/* ─── HimalayaClinic Management System ─────────────────────── */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 60px;
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #99f6e4;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #0d9488;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --radius: 8px;
    --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 rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* ─── App Layout ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand i { font-size: 24px; color: var(--primary); }
.sidebar-toggle { background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 20px; }

.sidebar-nav { padding: 12px 0; }

.nav-section-title {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sidebar-text);
    opacity: 0.5;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 450;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.sidebar-nav .nav-link.active {
    background: rgba(13, 148, 136, 0.12);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i { font-size: 18px; width: 20px; flex-shrink: 0; }

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }

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

.clinic-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-primary);
}

/* ─── Content Area ───────────────────────────────────────── */
.content-messages { padding: 16px 24px 0; }
.content-area { padding: 24px; flex: 1; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

/* ─── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 8px; }
.stat-card .stat-icon.primary { background: rgba(13,148,136,0.1); color: var(--primary); }
.stat-card .stat-icon.danger { background: rgba(244,63,94,0.1); color: var(--danger); }
.stat-card .stat-icon.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card .stat-icon.info { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-card .stat-icon.success { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ─── Tables ─────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(13,148,136,0.03); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-paid { background: rgba(16,185,129,0.12); color: #059669; }
.badge-partial { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-draft { background: rgba(100,116,139,0.12); color: #475569; }
.badge-cancelled { background: rgba(244,63,94,0.12); color: #e11d48; }
.badge-scheduled { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-in_progress { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-completed { background: rgba(16,185,129,0.12); color: #059669; }
.badge-pending { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-missed { background: rgba(244,63,94,0.12); color: #e11d48; }
.badge-service { background: rgba(13,148,136,0.12); color: var(--primary); }
.badge-product { background: rgba(59,130,246,0.12); color: var(--info); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-control, .form-select {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.form-label { font-weight: 500; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 3px; }
textarea.form-control { padding: 8px 10px; }

/* ─── Compact Buttons ────────────────────────────────────── */
.btn { font-size: 13px; padding: 6px 14px; border-radius: 6px; }
.btn-sm { font-size: 12px; padding: 3px 10px; }
.btn-lg { font-size: 14px; padding: 8px 18px; }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }

/* ─── Page Header ────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 600; }

/* ─── Search Bar ─────────────────────────────────────────── */
.search-box { position: relative; max-width: 360px; }
.search-box input { padding-left: 36px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-size: 16px; }

/* ─── Print Styles ───────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .content-messages, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: #fff; }
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ─── Login Page ─────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-card .brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.login-card .brand i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}
