:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --secondary: #0f172a;
    --surface: #ffffff;
    --bg-app: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --teal: #0d9488;
    --sidebar-width: 270px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Auth Login Modal Overlay */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.65)), 
                url('images (16).jpg') no-repeat center center / cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    z-index: 1000;
}

.login-card {
    background: white;
    width: 420px;
    max-width: 100%;
    padding: 35px 25px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.brand-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.brand-header h2 { font-size: 1.4rem; color: var(--secondary); font-weight: 800; }
.brand-header p { font-size: 0.8rem; color: var(--text-muted); }

.forgot-pass-wrapper {
    text-align: right;
    margin-top: -5px;
    margin-bottom: 15px;
}

.forgot-pass-wrapper a {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.forgot-pass-wrapper a:hover {
    text-decoration: underline;
}

.error-alert {
    background: #fee2e2;
    color: var(--danger);
    padding: 8px;
    font-size: 0.8rem;
    border-radius: 6px;
    display: none;
    margin-bottom: 15px;
    text-align: center;
}

.info-alert {
    padding: 10px;
    font-size: 0.82rem;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.4;
}

.info-alert.success { background: #d1fae5; color: #047857; }
.info-alert.error { background: #fee2e2; color: #b91c1c; }

.login-footer-hint {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Sidebar */
aside {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand i { font-size: 1.8rem; color: #38bdf8; }
.brand h3 { font-size: 1.1rem; font-weight: 700; color: white; }
.brand small { font-size: 0.7rem; color: #94a3b8; }

.active-role-box {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.active-role-box small { font-size: 0.7rem; color: #94a3b8; display: block; }

.role-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: #38bdf8;
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    padding: 15px 10px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-item:hover, .sidebar-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer { padding: 15px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.btn-logout { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-logout:hover { background: var(--danger); color: white; }

/* Main Workspace Layout */
main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header {
    background: white;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-main); }
.header-right { display: flex; align-items: center; gap: 20px; }

.notif-wrapper { position: relative; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; }
.notif-wrapper .badge {
    position: absolute; top: -6px; right: -8px;
    background: var(--danger); color: white;
    font-size: 0.65rem; font-weight: bold; padding: 2px 5px; border-radius: 10px;
}

.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.user-details { display: flex; flex-direction: column; }
.user-details .name { font-size: 0.85rem; font-weight: 700; }
.user-details .role { font-size: 0.72rem; color: var(--text-muted); }

.context-banner {
    background: #e0f2fe;
    color: #0369a1;
    padding: 10px 30px;
    font-size: 0.82rem;
    font-weight: 600;
    border-bottom: 1px solid #bae6fd;
}

/* Content Workstation (Compact Layout & Glassmorphism Background) */
.content-area {
    padding: 18px 22px;
    flex-grow: 1;
    background: linear-gradient(rgba(241, 245, 249, 0.45), rgba(241, 245, 249, 0.45)), 
                url('images (16).jpg') no-repeat center center / cover fixed;
}

.view-panel { display: none; }
.view-panel.active { display: block; }

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* Cards & Tables (Frosted Glass Effect for Visual Pop) */
.card, .table-card, .stat-card, .doctor-card, .cabin-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-data span { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 4px; }
.stat-data h2 { font-size: 1.35rem; font-weight: 800; color: var(--secondary); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.icon-blue { background: rgba(224, 242, 254, 0.9); color: #0284c7; }
.icon-green { background: rgba(209, 250, 229, 0.9); color: #10b981; }
.icon-orange { background: rgba(254, 243, 199, 0.9); color: #f59e0b; }
.icon-teal { background: rgba(204, 251, 241, 0.9); color: #0d9488; }

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

.table-header h4 { font-size: 0.95rem; color: var(--secondary); font-weight: 700; }

.table-responsive { width: 100%; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

table th {
    background: rgba(248, 250, 252, 0.85);
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

table tbody tr:hover { background: rgba(248, 250, 252, 0.6); }

/* Status Badges */
.badge-status {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.status-scheduled, .status-pending { background: #fef3c7; color: #b45309; }
.status-completed, .status-available, .status-paid { background: #d1fae5; color: #047857; }
.status-in-consultation, .status-occupied { background: #fee2e2; color: #b91c1c; }

/* Doctor & Cabin Card */
.doctor-card, .cabin-card {
    text-align: center;
}

.doctor-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid #e0f2fe;
}

.doctor-card h4 { font-size: 0.95rem; color: var(--secondary); margin-bottom: 3px; }
.doctor-card p { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }

.cabin-card h3 { font-size: 1.1rem; margin-bottom: 4px; color: var(--secondary); }
.cabin-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

/* Patient EMR Desk */
.card-header-flex { display: flex; justify-content: space-between; align-items: center; }
.patient-emr-box {
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    font-size: 0.82rem;
}

/* Forms & Buttons */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* Filter Tabs */
.filter-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.tab-btn {
    padding: 5px 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn.active { background: var(--primary); color: white; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
}
.modal-overlay.active { display: flex; }

.modal {
    background: white;
    width: 480px;
    max-width: 90%;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal h3 { font-size: 1.05rem; color: var(--secondary); margin-bottom: 5px; }
.modal-subtext { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }

/* Print Document Style */
#printableArea {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    background: #fff;
}

.doc-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

/* Utilities */
.mt-20 { margin-top: 15px; }
.mb-20 { margin-bottom: 15px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

.notif-list { list-style: none; }
.notif-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 95;
}

/* Responsive UI */
@media (max-width: 992px) {
    aside { transform: translateX(-100%); }
    aside.active { transform: translateX(0); }
    main { margin-left: 0; }
    .mobile-toggle { display: block; }
    .grid-2col { grid-template-columns: 1fr; }
    .sidebar-overlay.active { display: block; }
}
