/* HCEP Professional Dashboard */

.app-shell {
    overflow: hidden;
    background: #ffffff;
}

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.app-sidebar {
    width: 272px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo-text {
    display: block;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: #1a1a1a;
}

.sidebar-logo-sub {
    display: block;
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 16px 8px;
    padding: 14px;
    background: var(--bg-section);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.sidebar-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c41e3a, #a01830);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.avatar-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #c41e3a;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.sidebar-profile-info strong {
    display: block;
    font-size: 0.88rem;
    color: #1a1a1a;
}

.sidebar-token {
    font-size: 0.68rem;
    color: #9ca3af;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

.sidebar-nav-label {
    display: block;
    padding: 16px 10px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
}

.sidebar-nav-label:first-child { padding-top: 4px; }

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px 8px 8px;
    margin-bottom: 3px;
    background: none;
    border: none;
    border-radius: 12px;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s cubic-bezier(0.4,0,0.2,1), color 0.2s ease, transform 0.15s ease;
    text-align: left;
    font-family: inherit;
}

.sidebar-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    padding: 8px;
    border-radius: 9px;
    background: #f4f4f5;
    color: #6b7280;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.sidebar-link:hover {
    background: #f9fafb;
    color: #1a1a1a;
}

.sidebar-link:hover .sidebar-icon {
    background: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
    transform: scale(1.05);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.09), rgba(196, 30, 58, 0.03));
    color: #c41e3a;
    font-weight: 700;
}

.sidebar-link.active .sidebar-icon {
    background: linear-gradient(135deg, #c41e3a, #a01830);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.28);
}

.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.sidebar-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #c41e3a;
    color: #fff;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.3);
}

.sidebar-badge.show { display: flex; }

.sidebar-link:has(.sidebar-badge.show)::after { display: none; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
}

.kvkk-switch {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
}

.kvkk-switch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}

.kvkk-toggle-group {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
}

.kvkk-toggle-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.kvkk-toggle-btn.active {
    background: #c41e3a;
    color: #fff;
}

.kvkk-switch-desc {
    margin-top: 8px;
    font-size: 0.68rem;
    color: #9ca3af;
    line-height: 1.4;
}

.sidebar-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: #9ca3af;
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}

.sidebar-back:hover {
    background: rgba(196, 30, 58, 0.06);
    color: #6b7280;
    text-decoration: none;
}

/* ── Main Area ── */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 28px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.sidebar-toggle:hover { background: #f3f4f6; }

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.topbar-breadcrumb svg { color: #d1d5db; }

.breadcrumb-root { color: #9ca3af; font-weight: 500; }
.breadcrumb-current { color: #1a1a1a; font-weight: 700; letter-spacing: -0.01em; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(196, 30, 58, 0.08);
    border: 1px solid rgba(196, 30, 58, 0.15);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c41e3a;
}

.ai-pulse {
    width: 8px;
    height: 8px;
    background: #c41e3a;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(196,30,58,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(196,30,58,0); }
}

.topbar-clock {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
    text-align: right;
}

.topbar-icon-btn {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.topbar-icon-btn:hover {
    background: rgba(196,30,58,0.08);
    color: #c41e3a;
    border-color: rgba(196,30,58,0.2);
}

.topbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.topbar-badge.show { display: flex; }

/* ── Content ── */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 40px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(196,30,58,0.06), transparent),
        #ffffff;
}

.dash-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dash-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.panel-intro h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.panel-intro p {
    color: #9ca3af;
    font-size: 0.9rem;
    max-width: 520px;
}

.panel-intro .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.link-btn {
    background: none;
    border: none;
    color: #c41e3a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.link-btn:hover { text-decoration: underline; }

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.kpi-card {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.kpi-card:hover {
    border-color: rgba(196, 30, 58, 0.2);
    transform: translateY(-2px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--kpi-accent, #c41e3a);
    opacity: 0.6;
}

.kpi-card.kpi-blue { --kpi-accent: #c41e3a; }
.kpi-card.kpi-green { --kpi-accent: #c41e3a; }
.kpi-card.kpi-purple { --kpi-accent: #8b5cf6; }
.kpi-card.kpi-amber { --kpi-accent: #f59e0b; }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: var(--kpi-accent, #c41e3a);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.03em;
    line-height: 1;
}

.kpi-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
    margin-left: 4px;
}

.kpi-sub {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #9ca3af;
}

.kpi-skeleton {
    height: 80px;
    background: linear-gradient(90deg, #f5f5f5 25%, #e5e7eb 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Overview ── */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.overview-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 24px;
}

.overview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.overview-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.overview-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.overview-item:last-child { border-bottom: none; }

.overview-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.overview-item-icon.type-queue { background: rgba(196,30,58,0.12); color: #c41e3a; }
.overview-item-icon.type-lab { background: rgba(107,114,128,0.1); color: #6b7280; }
.overview-item-icon.type-pharmacy { background: rgba(196,30,58,0.08); color: #6b7280; }
.overview-item-icon.type-medication { background: rgba(107,114,128,0.1); color: #6b7280; }
.overview-item-icon.type-general { background: #e5e7eb; color: #6b7280; }
.overview-item-icon svg { display: block; }

.overview-item-body h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.overview-item-body p {
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.4;
}

.overview-empty {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.85rem;
}

/* ── Queue ── */
.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.queue-card-pro {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    transition: border-color 0.2s;
}

.queue-card-pro:hover { border-color: rgba(196,30,58,0.15); }

.queue-card-pro.has-user {
    border-color: rgba(196,30,58,0.25);
    box-shadow: 0 0 0 1px rgba(196,30,58,0.08);
}

.queue-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
}

.queue-dept {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.queue-doctor {
    font-size: 0.8rem;
    color: #9ca3af;
}

.queue-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #6b7280;
}

.queue-wait-ring {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.queue-wait-ring svg {
    transform: rotate(-90deg);
}

.queue-wait-num {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.queue-wait-num strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: #c41e3a;
    line-height: 1;
}

.queue-wait-num span {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.queue-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

.queue-stat {
    flex: 1;
    padding: 10px 14px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: center;
}

.queue-stat-val {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
}

.queue-stat-lbl {
    font-size: 0.68rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.queue-timeline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.queue-ticket {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    transition: all 0.15s;
}

.queue-ticket.called { background: rgba(196,30,58,0.15); border-color: #c41e3a; color: #c41e3a; }
.queue-ticket.user { background: rgba(196,30,58,0.12); border-color: #c41e3a; color: #6b7280; box-shadow: 0 0 12px rgba(16,185,129,0.2); }
.queue-ticket.in-exam { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #6b7280; }

.queue-ai-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(196,30,58,0.08), rgba(196,30,58,0.02));
    border: 1px solid rgba(196,30,58,0.12);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #6b7280;
}

.queue-ai-banner strong { color: #c41e3a; }

/* ── Notifications ── */
.notif-feed { max-width: 720px; }

.notif-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 12px;
    transition: all 0.15s;
    position: relative;
}

.notif-card:hover { border-color: #d1d5db; }
.notif-card.unread { border-left: 3px solid #c41e3a; background: rgba(196,30,58,0.03); }

.notif-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-type-icon.queue { background: rgba(196,30,58,0.12); color: #c41e3a; }
.notif-type-icon.lab { background: rgba(107,114,128,0.1); color: #6b7280; }
.notif-type-icon.pharmacy { background: rgba(196,30,58,0.08); color: #6b7280; }
.notif-type-icon.medication { background: rgba(107,114,128,0.1); color: #6b7280; }
.notif-type-icon.general { background: #e5e7eb; color: #6b7280; }
.notif-type-icon.appointment { background: rgba(196,30,58,0.08); color: #c41e3a; }
.notif-type-icon.prescription { background: rgba(236,72,153,0.12); color: #c41e3a; }
.notif-type-icon.health { background: rgba(196,30,58,0.12); color: #c41e3a; }
.notif-type-icon.vaccination { background: rgba(196,30,58,0.08); color: #6b7280; }

.notif-content { flex: 1; min-width: 0; }

.notif-content h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.notif-content p {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.5;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.notif-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notif-tag.queue { background: rgba(196,30,58,0.12); color: #c41e3a; }
.notif-tag.lab { background: rgba(107,114,128,0.1); color: #6b7280; }
.notif-tag.pharmacy { background: rgba(196,30,58,0.08); color: #6b7280; }
.notif-tag.medication { background: rgba(107,114,128,0.1); color: #6b7280; }
.notif-tag.appointment { background: rgba(196,30,58,0.08); color: #c41e3a; }
.notif-tag.prescription { background: rgba(236,72,153,0.12); color: #c41e3a; }
.notif-tag.health { background: rgba(196,30,58,0.12); color: #c41e3a; }
.notif-tag.vaccination { background: rgba(196,30,58,0.08); color: #6b7280; }

.notif-time {
    font-size: 0.72rem;
    color: #6b7280;
}

/* ── Lab ── */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.lab-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    transition: border-color 0.2s;
}

.lab-card:hover { border-color: #d1d5db; }
.lab-card.ready { border-top: 2px solid #c41e3a; }
.lab-card.pending { border-top: 2px solid #f59e0b; }

.lab-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.lab-card-header h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a1a;
}

.lab-pill {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.lab-pill.ready { background: rgba(196,30,58,0.08); color: #6b7280; }
.lab-pill.pending { background: rgba(107,114,128,0.1); color: #6b7280; }

.lab-result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
}

.lab-ref-range {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-bottom: 14px;
}

.lab-ai-box {
    padding: 14px;
    background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(196,30,58,0.04));
    border: 1px solid rgba(107,114,128,0.1);
    border-radius: 10px;
}

.lab-ai-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.lab-ai-box p {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
}

.lab-pending-bar {
    height: 4px;
    background: rgba(245,158,11,0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.lab-pending-fill {
    height: 100%;
    width: 60%;
    background: #f59e0b;
    border-radius: 2px;
    animation: pendingPulse 2s infinite;
}

@keyframes pendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Medications ── */
.med-timeline { max-width: 640px; }

.med-card {
    display: flex;
    gap: 20px;
    padding: 20px 24px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 12px;
    align-items: center;
    transition: border-color 0.15s;
}

.med-card:hover { border-color: rgba(245,158,11,0.2); }

.med-time-block {
    text-align: center;
    min-width: 64px;
    padding: 10px;
    background: rgba(245,158,11,0.08);
    border-radius: 12px;
}

.med-time-val {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #6b7280;
    line-height: 1;
}

.med-time-period {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-top: 2px;
}

.med-details { flex: 1; }
.med-details h4 { font-size: 0.95rem; font-weight: 600; color: #1a1a1a; margin-bottom: 4px; }
.med-details p { font-size: 0.82rem; color: #9ca3af; }

.med-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.med-tag {
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 500;
}

.med-check {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.med-check:hover { border-color: #c41e3a; color: #c41e3a; }
.med-check.taken { background: #c41e3a; border-color: #c41e3a; color: #fff; }

/* ── Pharmacy ── */
.pharmacy-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.pharmacy-grid { display: flex; flex-direction: column; gap: 12px; }

.pharmacy-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    transition: all 0.15s;
    flex-wrap: wrap;
}

.pharmacy-card.on-duty {
    border-color: rgba(16,185,129,0.2);
    background: rgba(16,185,129,0.03);
}

.pharmacy-card:hover { border-color: #d1d5db; }

.pharmacy-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a1a1a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.duty-pill {
    padding: 2px 8px;
    background: rgba(196,30,58,0.12);
    color: #6b7280;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.pharmacy-card-addr { font-size: 0.8rem; color: #9ca3af; }

.pharmacy-card-meta { text-align: right; }
.pharmacy-dist-val { font-size: 1.15rem; font-weight: 800; color: #c41e3a; }
.pharmacy-stock { font-size: 0.75rem; font-weight: 600; margin-top: 2px; }
.stock-high { color: #6b7280; }
.stock-medium { color: #6b7280; }
.stock-low { color: #f87171; }

.route-panel {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    min-height: 280px;
    position: sticky;
    top: 0;
}

.route-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 220px;
    color: #6b7280;
    font-size: 0.85rem;
    gap: 12px;
}

.route-panel.active .route-panel-empty { display: none; }

.route-result-content {
    animation: fadeIn 0.4s ease;
}

.route-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.route-result-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(196,30,58,0.08);
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.route-result-header p { font-size: 0.8rem; color: #9ca3af; }

.route-steps { list-style: none; }

.route-step {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.route-step:last-child { border-bottom: none; }

.route-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(196,30,58,0.12);
    color: #c41e3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.route-step-text { font-size: 0.85rem; color: #6b7280; line-height: 1.4; }
.route-step-text strong { color: #374151; }

/* ── Doctors ── */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.doctor-card {
    padding: 22px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    transition: all 0.2s;
    cursor: default;
}

.doctor-card:hover {
    border-color: rgba(196,30,58,0.15);
    transform: translateY(-2px);
}

.doctor-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.doctor-avatar-pro {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.doctor-card-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.doctor-card-info span {
    font-size: 0.8rem;
    color: #9ca3af;
}

.doctor-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.doctor-dept {
    font-size: 0.75rem;
    color: #6b7280;
}

.doctor-avail {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
}

.doctor-avail.yes { background: rgba(196,30,58,0.08); color: #6b7280; }
.doctor-avail.no { background: rgba(239,68,68,0.12); color: #f87171; }

.doctor-exam-time {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 10px;
}

/* ── States ── */
.state-loading, .state-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 0.9rem;
    gap: 12px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #c41e3a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    font-size: 0.85rem;
    color: #374151;
    animation: toastIn 0.3s ease;
    max-width: 380px;
}

.toast.success { border-left: 3px solid #c41e3a; }
.toast.info { border-left: 3px solid #c41e3a; }

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

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 150;
}

/* ── E-Nabız / MHRS Components ── */
.enabiz-badge {
    padding: 8px 16px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
}

.enabiz-mini {
    padding: 2px 8px;
    background: rgba(196,30,58,0.08);
    color: #6b7280;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.health-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.health-tab {
    padding: 10px 18px;
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.health-tab.active {
    background: rgba(196,30,58,0.12);
    border-color: rgba(196,30,58,0.3);
    color: #c41e3a;
}

.health-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.health-record-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.health-record-card.type-allergy { border-left: 3px solid #ef4444; }
.health-record-card.type-diagnosis { border-left: 3px solid #8b5cf6; }
.health-record-card.type-surgery { border-left: 3px solid #f59e0b; }

.health-record-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.health-type-pill {
    padding: 3px 10px;
    background: rgba(107,114,128,0.1);
    color: #6b7280;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.health-type-pill.vaccine { background: rgba(196,30,58,0.08); color: #6b7280; }
.health-type-pill.radiology { background: rgba(196,30,58,0.12); color: #c41e3a; }

.health-icd {
    font-size: 0.72rem;
    color: #9ca3af;
    font-family: monospace;
}

.health-record-card h4 { font-size: 0.95rem; margin-bottom: 6px; color: #1a1a1a; }
.health-record-card p { font-size: 0.85rem; color: #9ca3af; line-height: 1.5; margin-bottom: 12px; }

.health-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: #6b7280;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.health-next-dose {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 600;
}

.health-dose { font-size: 0.75rem; color: #9ca3af; }

/* Appointments */
.appt-list { display: flex; flex-direction: column; gap: 12px; max-width: 800px; }

.appt-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    flex-wrap: wrap;
}

.appt-date-block {
    text-align: center;
    min-width: 56px;
    padding: 10px;
    background: rgba(196,30,58,0.06);
    border-radius: 12px;
}

.appt-day { display: block; font-size: 1.5rem; font-weight: 800; color: #c41e3a; line-height: 1; }
.appt-month { font-size: 0.68rem; color: #9ca3af; text-transform: uppercase; }

.appt-body { flex: 1; min-width: 200px; }
.appt-body h4 { font-size: 0.95rem; margin-bottom: 4px; }
.appt-body p { font-size: 0.82rem; color: #9ca3af; }
.appt-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 0.75rem; color: #6b7280; flex-wrap: wrap; }
.appt-ref { font-family: monospace; color: #c41e3a; }

.appt-status {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.appt-status.confirmed { background: rgba(196,30,58,0.08); color: #6b7280; }
.appt-status.scheduled { background: rgba(196,30,58,0.08); color: #c41e3a; }
.appt-status.completed { background: #e5e7eb; color: #6b7280; }
.appt-status.cancelled { background: rgba(239,68,68,0.12); color: #f87171; }

/* Prescriptions */
.rx-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.rx-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.rx-card.status-active { border-top: 2px solid #c41e3a; }
.rx-card.status-expired { border-top: 2px solid #9ca3af; opacity: 0.75; }

.rx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.rx-no { font-family: monospace; font-size: 0.8rem; color: #c41e3a; font-weight: 600; }

.rx-status-pill {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
}

.rx-status-pill.active { background: rgba(196,30,58,0.08); color: #6b7280; }
.rx-status-pill.expired { background: #e5e7eb; color: #6b7280; }
.rx-status-pill.used { background: rgba(196,30,58,0.08); color: #c41e3a; }

.rx-card h4 { font-size: 0.92rem; margin-bottom: 6px; }
.rx-doctor { font-size: 0.8rem; color: #9ca3af; margin-bottom: 12px; }

.rx-items { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.rx-item-tag {
    padding: 4px 10px;
    background: rgba(196,30,58,0.06);
    border: 1px solid rgba(196,30,58,0.12);
    border-radius: 6px;
    font-size: 0.72rem;
    color: #c41e3a;
}

/* Hospitals */
.hospital-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.hospital-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    transition: border-color 0.2s;
}

.hospital-card:hover { border-color: rgba(196,30,58,0.2); }

.hospital-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.hospital-card h4 { font-size: 0.95rem; color: #1a1a1a; }

.hospital-type {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}

.hospital-type.devlet { background: rgba(196,30,58,0.12); color: #c41e3a; }
.hospital-type.universite { background: rgba(107,114,128,0.1); color: #6b7280; }
.hospital-type.ozel { background: rgba(107,114,128,0.1); color: #6b7280; }
.hospital-type.sehir { background: rgba(196,30,58,0.08); color: #6b7280; }

.hospital-addr { font-size: 0.82rem; color: #9ca3af; margin-bottom: 12px; }

.hospital-stats {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.hospital-rating { color: #6b7280; font-weight: 700; }

.hospital-badges { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.h-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.h-badge.emergency { background: rgba(239,68,68,0.12); color: #f87171; }
.h-badge.mhrs { background: rgba(196,30,58,0.08); color: #c41e3a; }

.hospital-contact { font-size: 0.75rem; color: #6b7280; }

/* ── Responsive ── */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .pharmacy-layout { grid-template-columns: 1fr; }
    .route-panel { position: static; }
}

@media (max-width: 900px) {
    .app-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
    }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: flex; }
    .ai-status { display: none; }
    .overview-grid { grid-template-columns: 1fr; }
    .app-content { padding: 20px 16px 32px; }
}

@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .queue-grid { grid-template-columns: 1fr; }
    .topbar-clock { display: none; }
}
