/* =====================================================
   NetsaCare - Hospital Dashboard Styles
   Premium Medical Dashboard Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #6366f1;
    --info-bg: #eef2ff;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #1e40af;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-sidebar: #cbd5e1;

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* ─── Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ─── Auth Layout ──────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    border-radius: 50%;
}
.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    border-radius: 50%;
}
.auth-card {
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}
.auth-logo .subtitle {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.auth-logo .logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}

/* ─── Sidebar ──────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}
.sidebar-brand .brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.3px;
}
.sidebar-brand .brand-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nav-section {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 13.5px;
    font-weight: 500;
    gap: 12px;
    margin: 1px 8px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}
.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-white);
}
.nav-item i { width: 20px; text-align: center; font-size: 16px; opacity: 0.8; }
.nav-item.active i { opacity: 1; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-role {
    color: var(--text-muted);
    font-size: 11px;
}

/* ─── Main Content ─────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-left .page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.header-left .breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.btn-sidebar-toggle:hover { background: var(--bg-body); }
.main-content {
    padding: 24px;
    max-width: 1600px;
}

/* ─── Cards ────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}
.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
}
.card-body { padding: 20px; }

/* ─── Stat Cards ───────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-card .stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card .stat-icon.purple { background: var(--info-bg); color: var(--info); }
.stat-card .stat-icon.cyan { background: #ecfeff; color: var(--accent); }
.stat-info { flex: 1; }
.stat-info .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.stat-info .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-info .stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ─── Forms ────────────────────────────────── */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--bg-card);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-section {
    background: var(--bg-body);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}
.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* ─── Buttons ──────────────────────────────── */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
    color: white;
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}
.btn-light {
    background: var(--bg-body);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-light:hover { background: var(--border); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ─── Tables ───────────────────────────────── */
.table-responsive { border-radius: var(--radius); overflow: hidden; }
.table {
    margin-bottom: 0;
    font-size: 13.5px;
}
.table thead th {
    background: var(--bg-body);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.table tbody tr:hover { background: rgba(37,99,235,0.03); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ───────────────────────────────── */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}
.badge-emergency { background: var(--danger); color: white; animation: pulse-badge 2s infinite; }
.badge-urgent { background: var(--warning); color: white; }
.badge-routine { background: var(--success-bg); color: var(--success); }
.badge-critical { background: #7f1d1d; color: white; animation: pulse-badge 1.5s infinite; }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-completed { background: var(--primary-bg); color: var(--primary); }
.badge-missed { background: var(--danger-bg); color: var(--danger); }
.badge-scheduled { background: var(--info-bg); color: var(--info); }
.badge-locked {
    background: var(--text-muted);
    color: white;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── Alerts ───────────────────────────────── */
.alert {
    border-radius: var(--radius);
    border: none;
    padding: 14px 20px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-bg); color: #3730a3; border-left: 4px solid var(--info); }

/* ─── Lock Indicator ───────────────────────── */
.edit-lock-bar {
    background: linear-gradient(90deg, var(--warning-bg), #fff7ed);
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}
.edit-lock-bar.locked {
    background: linear-gradient(90deg, var(--danger-bg), #fff1f2);
    border-color: #fecaca;
}
.edit-lock-bar i { font-size: 18px; }
.edit-countdown {
    font-weight: 700;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
}
.edit-lock-bar.locked .edit-countdown { color: var(--danger); }

/* ─── Patient Status Pills ─────────────────── */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.active { background: var(--success); }
.status-dot.discharged { background: var(--text-muted); }
.status-dot.emergency { background: var(--danger); animation: pulse-badge 1.5s infinite; }

/* ─── Quick Action FAB ─────────────────────── */
.fab-container { position: fixed; bottom: 24px; right: 24px; z-index: 1050; }
.fab-btn {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(37,99,235,0.4);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fab-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 35px rgba(37,99,235,0.5);
}

/* ─── Pagination ───────────────────────────── */
.pagination .page-link {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ─── Responsive ───────────────────────────── */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.3); }
    .main-wrapper { margin-left: 0; }
    .btn-sidebar-toggle { display: block; }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 576px) {
    .main-content { padding: 16px; }
    .auth-card { padding: 32px 24px; }
    .stat-info .stat-value { font-size: 22px; }
}

/* ─── Utilities ────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cursor-pointer { cursor: pointer; }

/* ─── Chart container ──────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 280px;
}

/* ─── Empty State ──────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h5 { color: var(--text-secondary); font-weight: 600; }
.empty-state p { font-size: 13px; max-width: 320px; margin: 8px auto 0; }

