/* ============================================
    HUB - Klinikplanering
   ============================================ */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1f1f1f;
    --primary-hover: #4a4a4a;
    --primary-light: rgba(31, 31, 31, 0.1);
    --accent: #4a4a4a;
    --danger: #dc3545;
    --danger-hover: #c82333;
    --success: #4CAF50;
    --success-hover: #45a049;
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #777;
    --text-muted: #999;
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-gray: #f5f5f5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.5;
}

/* === Login === */
.login-container {
    max-width: 380px;
    margin: 120px auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-container h1 {
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}

.login-logo {
    display: block;
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
}

.login-container input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.login-container button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-container button:hover {
    background: var(--primary-hover);
}

.login-container .register-link {
    margin-top: 10px;
    padding: 8px;
    background: transparent;
    color: var(--text-medium);
    font-weight: 500;
}

.login-container .register-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* === Main Layout === */
.app-container {
    display: none;
    min-height: 100vh;
}

/* === Top Navigation === */
.top-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-icon {
    font-size: 15px;
    line-height: 1;
    width: 18px;
    text-align: center;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

.nav-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.staff-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 16px 18px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); }
.staff-toolbar-description { color: var(--text-light); font-size: 14px; margin: 0; }

.workspace-context {
    min-height: 48px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
}

.viewer-banner { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: #fff8e1; color: #7a5b00; border-bottom: 1px solid #f0d47b; font-size: 13px; font-weight: 500; }
.viewer-banner[hidden] { display: none !important; }
.viewer-banner i { font-size: 14px; }

.workspace-context > div { display: flex; align-items: baseline; gap: 10px; }
.workspace-clinic-switcher { display: inline-flex; align-items: center; }
.workspace-clinic-switcher select { min-width: 220px; min-height: 38px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: var(--radius-md); background: #fff; color: var(--text-dark); font-size: 13px; font-weight: 600; }
.workspace-context span, .platform-dashboard-header > span { color: #6b7280; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.platform-dashboard-header { padding: 8px 0 20px; }
.platform-dashboard-header p { color: var(--text-light); margin-top: 6px; }
.platform-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.platform-summary { display: grid; grid-template-columns: repeat(4, max-content); align-items: baseline; gap: 4px 12px; }
.platform-summary strong { font-size: 24px; color: #1f1f1f; }
.platform-summary span { color: var(--text-light); font-size: 13px; }
.platform-section-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
.platform-section-note { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }
.platform-info-band { background: #fff8e1; border-left: 3px solid #f9a825; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; color: #7a5b00; margin-bottom: 16px; }
.platform-user-group { margin-bottom: 20px; }
.platform-user-group h3 { font-size: 14px; font-weight: 600; color: var(--text-medium); margin-bottom: 8px; }
.platform-user-table { width: 100%; border-collapse: collapse; }
.platform-user-table th, .platform-user-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.platform-user-table th { color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.access-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.platform-loading, .platform-load-error { color: var(--text-light); padding: 18px 0; }
.platform-load-error { color: var(--danger); }
.organization-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 24px; }
.organization-card { border: 1px solid #d1d5db; border-radius: var(--radius-md); background: #fff; padding: 18px; }
.organization-card-header { display: flex; justify-content: space-between; gap: 12px; }
.organization-card h2 { font-size: 17px; margin-top: 8px; }
.organization-card p { color: var(--text-light); font-size: 12px; margin-top: 3px; }
.organization-card-count { text-align: right; }
.organization-card-count strong { display: block; font-size: 22px; }
.organization-card-count span, .organization-card-footer { color: var(--text-light); font-size: 12px; }
.organization-card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.organization-clinics { margin-top: 16px; }
.organization-clinics-title { color: #6b7280; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.organization-clinics ul { list-style: none; margin: 8px 0 0; padding: 0; }
.organization-clinics li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.organization-clinics li.clinic-list-item { display: block; padding: 12px 0; }
.clinic-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.clinic-managers { margin-top: 10px; padding: 8px 10px; background: #f9fafb; border-left: 3px solid #d1d5db; }
.clinic-managers > span { display: block; color: #6b7280; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.clinic-manager-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.clinic-manager-add { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }
.organization-clinics li strong, .organization-clinics li small { display: block; }
.organization-clinics li small { color: var(--text-light); font-size: 11px; margin-top: 2px; }
.clinic-card-status { color: #6b7280; font-size: 11px; text-align: right; white-space: nowrap; }
.empty-clinic { color: var(--text-light); font-size: 12px; }
.organization-status { display: inline-block; color: #374151; background: #e5e7eb; border-radius: 3px; padding: 3px 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.status-active { background: #d1d5db; color: #111827; }
.status-pending { background: #f3f4f6; }

.user-info {
    font-size: 13px;
    color: var(--text-light);
}

.clinic-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.clinic-switcher { display: inline-flex; align-items: center; }
.clinic-switcher select { min-width: 190px; max-width: 260px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-white); color: var(--text-medium); font-size: 13px; }

.clinic-space-admin { border-top: 0; margin: 0; padding-top: 0; }
.profile-section { border-top: 1px solid var(--border); padding: 22px 0; }
.clinic-profile-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.clinic-profile-columns .profile-section { border-top: 0; padding: 0; }
.clinic-profile-columns > .profile-access-section { grid-column: 1 / -1; }
.profile-access-section { max-width: 560px; display: grid; gap: 16px; }
.profile-access-section .form-group { display: grid; gap: 6px; }
.profile-access-section input[type="email"], .profile-access-section input[type="password"], .profile-access-section input[type="text"] { min-height: 42px; padding: 10px 12px; font-size: 14px; }
.profile-access-section .access-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.clinic-profile-panel { width: 100%; }
.clinic-profile-body { width: 100%; max-width: none; }
.clinic-profile-body > .profile-section { max-width: 1080px; }
.profile-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.profile-tab { appearance: none; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-light); padding: 10px 16px; font-size: 14px; font-weight: 700; cursor: pointer; }
.profile-tab:hover { color: var(--text-dark); background: var(--bg-light); }
.profile-tab.active { color: var(--text-dark); border-bottom-color: var(--accent); }
.profile-tab-panel[hidden] { display: none; }
.profile-tab-panel.active { display: block; }
.profile-section:first-child { border-top: 0; padding-top: 0; }
.profile-section-heading { margin-bottom: 16px; }
.profile-section-heading h2 { font-size: 18px; margin: 3px 0 4px; }
.profile-section-heading p { color: var(--text-light); font-size: 13px; margin: 0; }
.section-kicker { color: #6b7280; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.clinic-space-admin h2 { font-size: 16px; margin-bottom: 12px; }
.space-admin-grid { display: grid; grid-template-columns: 1fr 1.45fr; gap: 12px; }
.space-add-card { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fafafa; }
.space-add-card { display: grid; gap: 10px; margin-bottom: 12px; max-width: 420px; }
.space-add-card > label { margin: 0; }
.space-add-card input[type="text"], .space-add-card select { width: 100%; max-width: 360px; min-height: 40px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-white); color: var(--text-dark); font-size: 14px; }
.space-add-card .btn { justify-self: start; }
.checkbox-inline input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.space-add-card > label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form input, .inline-form select { flex: 1 1 150px; min-width: 120px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.space-floor { padding: 10px 0; border-top: 1px solid var(--border); }
.space-floor > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.space-room { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-medium); font-size: 12px; }
.space-floor { background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-top: 10px; }
.space-floor:first-child { margin-top: 16px; }
.space-floor > div { min-height: 28px; align-items: center; }
.space-floor-heading { display: flex; justify-content: space-between; align-items: center; }
.space-floor-actions { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; }
.space-floor-heading small, .space-room-row small { color: var(--text-light); font-size: 11px; }
.space-room-list { display: grid; gap: 5px; margin-top: 10px; }
.space-room-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.space-room-row > span:first-child { display: grid; gap: 2px; }
.space-room-actions { display: flex; align-items: center; gap: 8px; padding-left: 16px; }
.icon-action { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; color: var(--text-medium); }
.icon-action:hover:not(:disabled) { background: var(--bg-gray); }
.icon-action:disabled { opacity: .35; cursor: default; }
.clinic-space-admin .inline-form { align-items: center; }
.clinic-space-admin .inline-form input,
.clinic-space-admin .inline-form select { min-height: 38px; }
.clinic-space-admin .inline-form .btn { white-space: nowrap; }
.floor-toolbar { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.floor-toolbar label { color: var(--text-medium); font-weight: 600; font-size: 13px; }

@media (max-width: 720px) {
    .clinic-profile-columns { grid-template-columns: 1fr; }
    .space-admin-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1100px) {
    .clinic-profile-body > .profile-section { max-width: none; }
    .clinic-profile-body > .profile-section:first-child { max-width: 720px; }
    .clinic-profile-body > .profile-section:last-of-type { max-width: 920px; }
}

.clinic-color-control { display: grid; grid-template-columns: 48px 150px 54px; align-items: center; gap: 10px; max-width: 282px; }
.clinic-color-control input[type="color"] { width: 48px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.clinic-hex-input { width: 150px; height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--text-medium); text-transform: uppercase; background: var(--bg-white); }
.clinic-hex-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.clinic-hex-input.invalid { border-color: var(--danger); background: #fff5f5; }
.password-field { display: flex; align-items: stretch; gap: 8px; }
.password-field input { flex: 1; min-width: 0; }
.password-generate-btn { flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-light); color: var(--text-medium); padding: 0 12px; cursor: pointer; font-weight: 600; }
.password-generate-btn:hover { background: var(--bg-gray); color: var(--text-dark); }
.clinic-color-swatch { width: 54px; height: 32px; border: 1px solid #d1d5db; border-radius: 4px; }
.clinic-theme-preview { --preview-primary: #1f1f1f; --preview-accent: #4a4a4a; display: flex; align-items: center; justify-content: space-between; min-height: 58px; margin: 4px 0 22px; padding: 10px 12px; border: 1px solid #d1d5db; border-left: 8px solid var(--preview-primary); background: #fff; }
.clinic-theme-preview span { color: #1f1f1f; font-weight: 700; }
.clinic-theme-preview button { border: 0; background: var(--preview-primary); color: #fff; padding: 8px 12px; border-radius: 4px; }
.logo-editor { display: flex; align-items: center; gap: 16px; }
#clinicLogoCanvas { width: 80px; height: 80px; flex: 0 0 80px; border: 1px solid #9ca3af; border-radius: 4px; cursor: move; image-rendering: auto; }
.logo-editor-controls { display: grid; flex: 1; gap: 8px; }
.logo-editor-controls input[type="file"] { max-width: 100%; }
.form-hint { color: var(--text-light); font-size: 12px; margin-top: 8px; }
.clinic-profile-save { margin-top: 20px; }

.logout-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-medium);
    font-size: 18px;
}

.logout-btn:hover {
    background: var(--bg-gray);
    border-color: var(--border);
}

/* === Page Content === */
.page-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

/* === Cards & Panels === */
.panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.panel-body {
    padding: 20px;
}

/* === Forms === */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* === Schedule Warning === */
.schedule-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-gray);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* === Staff Cards === */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.staff-card {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.staff-login-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.staff-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.staff-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    border: 3px solid var(--border-light);
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.staff-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.staff-role {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.staff-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* === Vacation List === */
.vacation-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.vacation-filters .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.vacation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vacation-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid;
    transition: var(--transition);
}

.vacation-item:hover {
    box-shadow: var(--shadow-sm);
}

.vacation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 600;
    margin-right: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.vacation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vacation-info {
    flex: 1;
    min-width: 0;
}

.vacation-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.vacation-dates {
    font-size: 13px;
    color: var(--text-light);
}

.vacation-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

/* === Calendar === */
.calendar-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 0 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.calendar-top-bar .filter-container {
    border-bottom: none;
    flex: 1;
}

.add-absence-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-container {
    padding: 12px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    margin-right: 4px;
}

/* Checkbox filter styling */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-medium);
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.filter-checkbox:hover {
    color: var(--text-dark);
}

.filter-btn {
    padding: 6px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-medium);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
}

.calendar-day-header {
    background: var(--bg-gray);
    color: var(--text-medium);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--bg-white);
    min-height: 90px;
    padding: 8px;
    position: relative;
}

.calendar-day.other-month {
    background: var(--bg-light);
}

.calendar-day.calendar-day-today {
    background: #fffde7;
    box-shadow: inset 0 0 0 2px #1E88E5;
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-muted);
}

.calendar-day-number {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.week-number {
    font-weight: 400;
    font-size: 10px;
    color: var(--text-light);
    margin-left: 4px;
}

.calendar-vacation {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 2px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: block;
    font-weight: 500;
}

.calendar-vacation:hover {
    filter: brightness(1.1);
}

/* === Room Booking Grid === */
.room-date-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.room-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.room-nav-row-top {
    gap: 16px;
}

.room-nav-row-buttons {
    gap: 6px;
}

.room-date-nav .current-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    text-transform: capitalize;
}

.btn-nav {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border);
    padding: 8px 14px;
    min-width: 90px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
}

.btn-nav:hover {
    background: var(--bg-medium);
    border-color: var(--primary);
    color: var(--text-dark);
}

.btn-today {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 8px 14px;
    min-width: 90px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
}

.btn-today:hover {
    background: #333;
    color: white;
}

.btn-compact {
    display: none;
}

.room-date-picker {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-medium);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
}

.room-date-picker:hover {
    border-color: var(--primary);
}

.room-date-picker:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Week Overview */
.week-overview {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 10px 10px 20px 10px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: visible;
}

.week-day {
    flex: 1;
    min-width: 120px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

/* Weekend days (Saturday & Sunday) - half width */
.week-day.weekend {
    flex: 0.5;
    min-width: 70px;
    padding: 6px;
}

.week-day.weekend .week-day-header {
    flex-direction: column;
    gap: 2px;
}

.week-day.weekend .week-day-name {
    font-size: 10px;
}

.week-day.weekend .week-day-date {
    font-size: 10px;
}

.week-day.weekend .week-booking-indicator {
    font-size: 8px;
    padding: 1px 4px;
}

.week-day.weekend .week-day-empty {
    font-size: 9px;
}

.week-day:hover {
    background: #e8f4fc;
    border-color: var(--primary-light);
}

.week-day.active {
    background: #e3f2fd;
    border-color: var(--primary);
    position: relative;
}

.week-day.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--primary);
    z-index: 1;
}

.week-day.today.active::after {
    border-top-color: #1E88E5;
}

.week-day.today {
    border-color: #1E88E5;
    background: var(--bg-light);
}

.week-day.today.active {
    background: #e3f2fd;
    border-color: #1E88E5;
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
}

.week-day-name {
    text-transform: uppercase;
}

.week-day-date {
    font-weight: 500;
}

.week-day-bookings {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.week-booking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-booking-indicator.vacant {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 4px,
        #f5f5f5 4px,
        #f5f5f5 8px
    );
    color: #666;
    min-height: 16px;
}

.week-booking-indicator.conflict {
    animation: blink-conflict 1.2s ease-in-out infinite;
}

.week-day-empty {
    font-size: 10px;
    color: var(--text-light);
    font-style: italic;
}

/* Unassigned tandsköterskor bar */
.unassigned-staff-bar {
    display: none;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid #FF9800;
}

.unassigned-staff-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unassigned-staff-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.unassigned-staff-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-light);
    border-radius: 20px;
    border: 2px solid #ccc;
    font-size: 13px;
    white-space: nowrap;
}

.unassigned-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.unassigned-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.unassigned-initials {
    font-size: 10px;
}

.unassigned-name {
    font-weight: 500;
    color: var(--text-dark);
}

.room-grid-container {
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.room-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    table-layout: fixed;
}

/* Force consistent 5-minute row heights */
.room-table tbody tr {
    height: 4px;
}

.room-table th:first-child,
.room-table td:first-child {
    width: 70px;
}

.room-table-header {
    background: var(--bg-gray);
    padding: 14px 10px;
    font-weight: 600;
    text-align: center;
    color: var(--text-medium);
    font-size: 13px;
    border: 1px solid var(--border);
}

.room-table-time {
    background: var(--bg-light);
    padding: 8px;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    border: 1px solid var(--border);
}

.room-table-cell {
    background: var(--bg-white);
    height: 4px;
    max-height: 4px;
    position: relative;
    padding: 0;
    border: 1px solid var(--border);
    vertical-align: top;
    overflow: hidden;
}

/* Empty clickable cells show tooltip above other content */
.room-table-cell.clickable {
    overflow: visible;
}

.room-table-cell.clickable:hover {
    z-index: 100;
}

/* Thicker border at each full hour across whole grid */
.room-table tbody tr.hour-start > td {
    border-top: 2px solid var(--border) !important;
}

/* === Overlap / Rec Room visual distinction === */
.room-table-header-rec {
    background: #e5e7eb !important;
    color: #374151 !important;
    border-left: 1px solid var(--border) !important;
}

.rec-name-full {
    display: inline;
}

.rec-name-short {
    display: none;
}

.room-table-cell-rec {
    background: #f3f4f6 !important;
}

.room-table-cell-rec-first {
    border-left: 1px solid var(--border) !important;
}

/* === Overlap Room (Rec) === */
.room-table-cell-overlap.room-table-cell-booked,
.room-table tbody tr.hour-start > td.room-table-cell-overlap.room-table-cell-booked {
    cursor: pointer;
    padding: 0 !important;
    border-top-style: hidden !important;
    border-bottom-style: hidden !important;
}

/* Td that contains a booking label needs overflow visible so label text shows */
.room-table-cell-overlap.overlap-has-label {
    overflow: visible !important;
    z-index: 5;
}

/* Label shown in the first slot of an overlap booking — floats above subsequent rows */
.overlap-label {
    position: absolute;
    top: 0;
    box-sizing: border-box;
    color: white;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    padding: 3px 4px;
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    white-space: nowrap;
    overflow: visible;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.overlap-label-name {
    display: block;
}

.overlap-label-time {
    display: block;
    font-size: 10px;
    opacity: 0.9;
}

.overlap-label:hover {
    filter: brightness(1.1);
}

.overlap-label.conflict {
    animation: blink-conflict 1.2s ease-in-out infinite;
}

.overlap-label.conflict::after {
    content: "\26A0\FE0F";
    font-size: 10px;
    margin-left: 4px;
}

.room-booking {
    border-radius: 0;
    padding: 4px 6px;
    cursor: pointer;
    color: white;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    transition: var(--transition);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

/* Short bookings (under 90 min) - no text visible */
.room-booking.short-booking {
    padding: 0;
}

.room-booking.short-booking .room-booking-name,
.room-booking.short-booking .room-booking-time {
    display: none;
}

.room-booking:hover {
    filter: brightness(1.1);
}

.room-booking-name {
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-booking-time {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
    white-space: nowrap;
}

/* Room booking hover tooltip for short bookings */
.room-booking-tooltip {
    display: none;
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 140px;
    pointer-events: none;
}

.room-booking-tooltip.show {
    display: block;
}

.room-booking-tooltip-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.room-booking-tooltip-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    display: inline;
    vertical-align: middle;
}

.room-booking-tooltip-role {
    font-size: 11px;
    color: var(--text-light);
    margin-left: 4px;
}

.room-booking-tooltip-time {
    font-size: 12px;
    color: var(--text-medium);
    margin-top: 4px;
}

.room-booking-tooltip-staff2 {
    font-size: 12px;
    color: var(--text-medium);
    margin-top: 2px;
}

.room-booking-vacant {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 10px,
        #f0f0f0 10px,
        #f0f0f0 20px
    ) !important;
    color: var(--text-medium) !important;
    border: 2px dashed #bbb;
}

.repeat-indicator {
    font-size: 10px;
    margin-left: 4px;
}

/* Series dialog buttons */
.series-options {
    margin-top: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* === Modals === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow-y: auto;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-white);
    margin: 24px auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.2s;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
    flex: 0 0 auto;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* === Image Upload === */
.image-upload-container {
    text-align: center;
    margin-bottom: 20px;
}

.image-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    font-weight: 600;
    border: 3px solid var(--border-light);
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-medium);
    transition: var(--transition);
    font-weight: 500;
}

.file-input-label:hover {
    background: var(--bg-gray);
}

.remove-image-btn {
    margin-left: 8px;
    padding: 8px 14px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.remove-image-btn:hover {
    background: var(--danger-hover);
}

/* === Color Picker === */
.color-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, 28px);
    gap: 6px;
    align-items: center;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid var(--border-light);
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.06);
}

.color-option.selected {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

/* Custom color picker container */
.custom-color-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
    grid-column: 1 / -1;
}

.custom-color-input {
    width: 40px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.custom-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.custom-color-input::-webkit-color-swatch {
    border-radius: 3px;
    border: none;
}

.hex-color-input {
    width: 80px;
    padding: 6px 8px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.hex-color-input::placeholder {
    color: var(--text-muted);
    text-transform: none;
}

/* === Time Input === */
.time-input-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.time-input-group input {
    width: 60px;
    text-align: center;
}

.time-input-group span {
    font-weight: 600;
    color: var(--text-light);
}

/* Time Select Dropdowns */
.time-select-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.time-select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
    min-width: 70px;
}

.time-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.time-separator {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-medium);
    padding: 0 2px;
}

/* Add booking button */
.add-booking-btn {
    margin-left: 12px;
}

/* Room grid hint */
.room-grid-hint {
    text-align: center;
    padding: 12px;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 12px;
}

/* Clickable empty cells */
.room-table-cell.clickable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.room-table-cell.clickable:hover {
    background-color: var(--primary-light);
}

/* Time tooltip on hover */
.room-table-cell.clickable:hover::after {
    content: attr(data-time);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

/* === Repeat Options === */
.repeat-options {
    background: var(--bg-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.repeat-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repeat-option:last-child {
    margin-bottom: 0;
}

.repeat-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.repeat-option label {
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.repeat-option input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    margin: 0;
}

/* === Tooltip === */
.vacation-tooltip {
    display: none;
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 120px;
    text-align: center;
}

.vacation-tooltip.show {
    display: block;
}

.tooltip-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid var(--border-light);
}

.tooltip-initials {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 600;
    margin: 0 auto 8px;
}

.tooltip-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.tooltip-dates {
    font-size: 12px;
    color: var(--text-light);
}

/* === Staff Vacations Modal === */
.staff-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.staff-modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.staff-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-modal-info {
    flex: 1;
}

.staff-modal-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.staff-modal-role {
    font-size: 13px;
    color: var(--text-light);
}

.staff-vacations-list {
    max-height: 400px;
    overflow-y: auto;
}

.staff-vacation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.staff-vacation-item:last-child {
    margin-bottom: 0;
}

.staff-vacation-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-vacation-type {
    font-size: 18px;
}

.staff-vacation-dates {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.staff-vacation-actions {
    display: flex;
    gap: 6px;
}

.staff-no-vacations {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* === Notifications === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    animation: slideInRight 0.3s;
    max-width: min(420px, calc(100vw - 32px));
    line-height: 1.45;
    white-space: normal;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.hiding {
    animation: slideOutRight 0.3s forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--danger);
    color: white;
}

.confirm-modal-content { max-width: 460px; }
.confirm-modal-content .modal-body p { margin: 0; color: var(--text-medium); line-height: 1.5; }
.clinic-login-options { display: grid; gap: 10px; margin-top: 18px; }
.clinic-login-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; cursor: pointer; }
.clinic-login-option:hover { border-color: var(--primary); background: var(--bg-light); }
.clinic-login-option strong { color: var(--text-dark); }
.clinic-login-option span { color: var(--text-medium); }
.clinic-login-option small { grid-column: 1 / -1; color: var(--text-light); }

.clinic-choice-container { position: fixed; inset: 0; background: var(--bg-light); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 2000; overflow-y: auto; }
.clinic-choice-container[hidden] { display: none !important; }
.clinic-choice-card { width: 100%; max-width: 480px; background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; text-align: center; }
.clinic-choice-logo { display: block; width: 62px; height: 62px; margin: 0 auto 14px; }
.clinic-choice-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); }
.clinic-choice-lead { color: var(--text-light); font-size: 14px; margin-bottom: 12px; }
.clinic-choice-card .clinic-login-options { text-align: left; }
.clinic-choice-logout { margin-top: 18px; background: transparent; border: none; color: var(--text-light); font-size: 13px; cursor: pointer; text-decoration: underline; }
.clinic-choice-logout:hover { color: var(--text-dark); }

@media (max-width: 600px) {
    .notification {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* === Error/Empty States === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Mobile Rotation Notice === */
.rotation-prompt {
    display: none;
}

.rotation-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.rotation-prompt h2 {
    color: white;
    font-size: 22px;
    margin-bottom: 12px;
}

.rotation-prompt p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    .rotation-prompt {
        display: none;
    }
}

/* === Responsive === */

/* Nav: icons-only on tablets and phones (landscape + portrait) */
@media (max-width: 1500px) {
    .top-nav {
        padding: 0 8px;
        height: 50px;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 16px;
    }

    .nav-icon {
        font-size: 18px;
    }

    .nav-label {
        display: none;
    }

    @media (hover: hover) and (pointer: fine) {
        .nav-link[data-tooltip]::after {
            content: attr(data-tooltip);
            position: absolute;
            top: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%) translateY(-3px);
            z-index: 200;
            padding: 6px 9px;
            border-radius: 4px;
            background: #1f1f1f;
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease, transform 0.15s ease;
        }

        .nav-link[data-tooltip]:hover::after,
        .nav-link[data-tooltip]:focus-visible::after {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

    .user-info {
        display: none;
    }

    .nav-right {
        gap: 8px;
    }

    .logout-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .workspace-context {
        padding: 10px 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-context > div {
        flex-wrap: wrap;
    }

    .workspace-context .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .workspace-clinic-switcher,
    .workspace-clinic-switcher select { width: 100%; }
}

@media (max-width: 768px) {
    .rec-name-full { display: none; }
    .rec-name-short { display: inline; }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 10px;
    }

    .page-title {
        font-size: 18px;
    }

    .panel-header {
        padding: 12px 14px;
    }

    .panel-body {
        padding: 14px;
    }
    
    .vacation-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vacation-filters .search-input {
        max-width: none;
    }

    .btn-full {
        display: none;
    }

    .btn-compact {
        display: inline;
    }

    .btn-nav {
        min-width: auto;
        padding: 8px 12px;
        font-size: 14px;
    }

    .btn-today {
        min-width: auto;
        padding: 8px 14px;
        font-size: 14px;
    }

    .room-nav-row-buttons {
        gap: 4px;
    }

    .room-date-nav {
        padding: 10px 10px;
        gap: 8px;
    }

    .room-date-nav .current-date {
        font-size: 15px;
    }
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* === Absence Conflict Animation === */
@keyframes blink-conflict {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.room-booking.conflict {
    animation: blink-conflict 1.2s ease-in-out infinite;
}

.room-booking.conflict::after {
    content: "⚠️";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

/* === Grundschema Styles === */
.base-schedule-container {
    width: 100%;
}

.base-schedule-sort-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.base-schedule-order-cell {
    text-align: center;
    padding: 4px !important;
}

.base-schedule-order-select {
    width: 50px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
}

.base-schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.base-schedule-table th,
.base-schedule-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.base-schedule-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text-medium);
}

.base-schedule-table th:first-child {
    text-align: left;
    min-width: 100px;
}

.base-schedule-name-cell {
    text-align: left !important;
    font-weight: 600;
    color: white;
    padding: 8px 12px !important;
}

/* Clickable row for admin */
.base-schedule-row-clickable {
    cursor: pointer;
    transition: var(--transition);
}

.base-schedule-row-clickable:hover {
    background: var(--primary-light);
}

.base-schedule-time-cell-readonly {
    font-size: 12px;
    text-align: center;
    padding: 8px 4px !important;
}

.base-schedule-time-range {
    font-size: 11px;
    color: var(--text-dark);
}

.base-schedule-day-total {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 2px;
}

.base-schedule-time-empty {
    color: var(--text-muted);
}

.base-schedule-time-cell {
    font-size: 12px;
    min-width: 120px;
}

.base-schedule-time-cell input {
    width: 65px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.base-schedule-hours {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.base-schedule-day-hours {
    font-weight: 500;
    color: var(--text-medium);
}

.base-schedule-total {
    font-weight: 700;
    font-size: 14px;
}

.base-schedule-note {
    font-size: 10px;
    color: var(--text-light);
    font-style: italic;
}

.base-schedule-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Actions cell - no box styling */
.base-schedule-actions-cell {
    padding: 4px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
}

/* Delete icon button - minimal style */
.btn-icon-delete {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    color: var(--danger);
}

.btn-icon-delete:hover {
    background: #fee;
    border-color: var(--danger);
}

/* Order number display when not editable */
.base-schedule-order-number {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Order cell with drag handle */
.base-schedule-order-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 14px;
    padding: 8px 4px;
    user-select: none;
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: var(--text-medium);
}

/* Dragging state */
.base-schedule-table tr.dragging {
    opacity: 0.5;
    background: var(--primary-light);
}

.base-schedule-table tr.drag-over {
    border-top: 2px solid var(--primary);
}

.base-schedule-table tr[draggable="true"] {
    cursor: grab;
}

.base-schedule-table tr[draggable="true"]:active {
    cursor: grabbing;
}

/* Touch dragging state (mobile) */
.base-schedule-table tr.touch-dragging {
    background: var(--primary-light);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.base-schedule-table tr.touch-dragging td {
    background: var(--primary-light);
}

.drag-placeholder {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
}

.drag-placeholder td {
    background: var(--primary-light) !important;
    border: none;
}

/* Make drag handle bigger on touch devices */
@media (pointer: coarse) {
    .drag-handle {
        font-size: 18px;
        padding: 12px 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.base-schedule-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Add staff to base schedule form */
.add-base-schedule-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-base-schedule-form select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* Base Schedule Modal Day Inputs */
.base-schedule-modal-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.base-schedule-modal-day:last-child {
    border-bottom: none;
}

.base-schedule-modal-day label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
}

.base-schedule-modal-day .time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.base-schedule-modal-day .time-inputs input {
    width: 70px;
    padding: 8px 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.base-schedule-modal-day .time-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.base-schedule-modal-day .time-inputs span {
    color: var(--text-light);
    font-weight: 500;
}

/* === Contacts (Kontaktlista) === */
.contacts-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.contacts-search-bar {
    margin-bottom: 16px;
}

.contacts-search-bar .search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-white);
    transition: var(--transition);
}

.contacts-search-bar .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.contacts-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
}

.contacts-table th,
.contacts-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.contacts-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text-medium);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contacts-table tbody tr:hover {
    background: var(--bg-light);
}

.contacts-table tbody tr:last-child td {
    border-bottom: none;
}

.contacts-col-company {
    font-weight: normal;
    color: var(--text-dark);
}

.contacts-col-phone a,
.contacts-col-email a {
    color: #1E88E5;
    text-decoration: none;
}

.contacts-col-phone a:hover,
.contacts-col-email a:hover {
    text-decoration: underline;
}

.contacts-col-notes {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contacts-col-actions {
    width: 50px;
    text-align: center;
    padding: 6px !important;
    background: transparent;
}

.contacts-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.contacts-sortable:hover {
    color: var(--primary-hover);
}

.contacts-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

#contactGroupToggle {
    transition: var(--transition);
}

#contactGroupToggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.contacts-group-header td {
    background: #e3f2fd !important;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    padding: 10px 16px !important;
    border-bottom: 2px solid var(--primary) !important;
}

.contacts-group-count {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-light);
}

.contacts-table-grouped tbody tr:not(.contacts-group-header):hover {
    background: var(--bg-light);
}

.contacts-table th:last-child:empty {
    width: 50px;
    padding: 6px !important;
}

@media (max-width: 768px) {
    .contacts-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .contacts-table thead {
        display: none;
    }

    .contacts-table,
    .contacts-table tbody {
        display: block;
    }

    .contacts-table tbody tr {
        display: block;
        background: var(--bg-white);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .contacts-table tbody tr:hover {
        background: var(--bg-light);
    }

    .contacts-table tbody tr td {
        display: flex;
        align-items: center;
        padding: 4px 0;
        border-bottom: none;
        font-size: 13px;
    }

    .contacts-table tbody tr td:empty {
        display: none;
    }

    .contacts-table tbody tr td::before {
        display: none;
    }

    .contacts-table tbody tr td:first-child {
        font-size: 14px;
        font-weight: 700;
        padding-bottom: 6px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }

    .contacts-col-notes {
        max-width: none;
        white-space: normal;
    }

    .contacts-col-actions {
        width: auto !important;
        justify-content: flex-end !important;
        padding-top: 8px !important;
    }

    .contacts-col-actions::before {
        display: none !important;
    }

    /* Grouped view mobile */
    .contacts-table-grouped tbody {
        display: block;
    }

    .contacts-group-header td {
        display: block !important;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        margin-bottom: 0;
    }

    .contacts-group-header td::before {
        display: none;
    }

    .contacts-group-header + tr {
        border-top: none;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
}