:root {
    --nadi-primary: #087f73;
    --nadi-primary-dark: #075f59;
    --nadi-primary-soft: #e7f5f2;
    --nadi-ink: #173531;
    --nadi-muted: #6b7e7b;
    --nadi-bg: #f3f7f6;
    --nadi-border: #dfe9e7;
    --nadi-sidebar: #123f3b;
}

* { box-sizing: border-box; }
body { background: var(--nadi-bg); color: var(--nadi-ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--nadi-primary); }
.btn-primary { --bs-btn-bg: var(--nadi-primary); --bs-btn-border-color: var(--nadi-primary); --bs-btn-hover-bg: var(--nadi-primary-dark); --bs-btn-hover-border-color: var(--nadi-primary-dark); --bs-btn-active-bg: var(--nadi-primary-dark); --bs-btn-active-border-color: var(--nadi-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--nadi-primary); --bs-btn-border-color: var(--nadi-primary); --bs-btn-hover-bg: var(--nadi-primary); --bs-btn-hover-border-color: var(--nadi-primary); }
.form-control:focus, .form-select:focus { border-color: #58afa7; box-shadow: 0 0 0 .22rem rgba(8,127,115,.13); }
.form-label { font-weight: 650; font-size: .9rem; }
.app-mobile-nav { background: var(--nadi-sidebar); min-height: 64px; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #6bd4c8; color: #073d38; font-weight: 850; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 16px; font-size: 1.35rem; }
.app-sidebar { --bs-offcanvas-width: 278px; background: var(--nadi-sidebar); color: #fff; }
.sidebar-desktop { position: fixed; inset: 0 auto 0 0; z-index: 1035; width: 260px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 26px 24px 22px; text-decoration: none; }
.sidebar-brand strong, .brand-lockup strong { display: block; font-size: 1.05rem; }
.sidebar-brand small, .brand-lockup small { display: block; opacity: .64; font-size: .72rem; letter-spacing: .03em; }
.sidebar-nav { padding: 8px 12px; }
.nav-label { padding: 18px 12px 7px; color: rgba(255,255,255,.45); text-transform: uppercase; font-size: .67rem; font-weight: 800; letter-spacing: .12em; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.73); border-radius: 12px; padding: 10px 12px; margin: 2px 0; font-weight: 650; }
.sidebar-nav .nav-link span { display: inline-grid; place-items: center; width: 24px; min-width: 24px; font-weight: 850; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active { color: #fff; background: rgba(107,212,200,.18); box-shadow: inset 3px 0 #6bd4c8; }
.sidebar-user { margin-top: auto; padding: 18px 24px 24px; border-top: 1px solid rgba(255,255,255,.09); }
.app-main { min-height: 100vh; }
.app-header { height: 88px; padding: 0 32px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--nadi-border); backdrop-filter: blur(12px); }
.app-content { padding: 20px 14px 40px; max-width: 1550px; }
.user-chip { display: flex; align-items: center; gap: 11px; }
.user-chip strong, .user-chip small { display: block; line-height: 1.25; }
.user-chip small { color: var(--nadi-muted); text-align: right; font-size: .75rem; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--nadi-primary-soft); color: var(--nadi-primary); font-weight: 800; }
.app-card { border: 1px solid var(--nadi-border); border-radius: 18px; box-shadow: 0 8px 28px rgba(20,64,59,.055); }
.app-card .card-header { background: transparent; border-color: var(--nadi-border); padding: 18px 20px; }
.stat-card { height: 100%; overflow: hidden; position: relative; }
.stat-card::after { content: ""; width: 70px; height: 70px; border-radius: 50%; background: var(--nadi-primary-soft); position: absolute; right: -18px; top: -18px; }
.stat-label { color: var(--nadi-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.65rem; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; }
.section-kicker, .eyebrow { color: var(--nadi-primary); text-transform: uppercase; font-size: .7rem; font-weight: 850; letter-spacing: .1em; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-actions h2 { margin: 0; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .82rem .8rem; border-bottom-color: var(--nadi-border); vertical-align: middle; }
.table thead th { color: var(--nadi-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.badge-soft-success { background: #dff6eb; color: #116944; }
.badge-soft-warning { background: #fff2ce; color: #865b00; }
.badge-soft-danger { background: #ffe4e3; color: #9e2c27; }
.badge-soft-info { background: #e3f2fb; color: #27617d; }
.badge-soft-secondary { background: #e9eeed; color: #53615f; }
.patient-name { color: var(--nadi-ink); font-weight: 750; text-decoration: none; }
.patient-name:hover { color: var(--nadi-primary); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--nadi-muted); }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 18px; background: var(--nadi-primary-soft); color: var(--nadi-primary); font-size: 1.4rem; font-weight: 900; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.detail-item small { display: block; color: var(--nadi-muted); margin-bottom: 3px; }
.detail-item strong { font-weight: 700; }
.form-section { padding: 20px; border: 1px solid var(--nadi-border); border-radius: 16px; background: #fff; }
.form-section + .form-section { margin-top: 16px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: 14px; background: rgba(243,247,246,.94); border-top: 1px solid var(--nadi-border); backdrop-filter: blur(10px); margin: 20px -14px -40px; }
.queue-number { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--nadi-primary-soft); color: var(--nadi-primary); font-weight: 850; }
.queue-number.urgent { background: #ffe4e3; color: #a62d27; }
.login-body { min-height: 100vh; background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-intro { position: relative; overflow: hidden; align-items: center; padding: clamp(48px, 8vw, 110px); background: radial-gradient(circle at 22% 18%, #2e9c91 0, transparent 30%), linear-gradient(145deg, #0e4d47, #07332f); color: #fff; }
.login-intro::after { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; right: -170px; bottom: -160px; box-shadow: 0 0 0 65px rgba(255,255,255,.035), 0 0 0 130px rgba(255,255,255,.025); }
.login-intro-content { max-width: 650px; position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.login-intro h1 { max-width: 600px; margin: 80px 0 20px; font-size: clamp(2.2rem, 4vw, 4.4rem); line-height: 1.04; letter-spacing: -.055em; }
.login-intro p { max-width: 600px; color: rgba(255,255,255,.72); font-size: 1.05rem; line-height: 1.8; }
.login-points { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 32px; font-weight: 650; font-size: .9rem; color: #bcebe5; }
.login-panel { display: grid; place-items: center; padding: 28px; }
.login-card { width: min(100%, 440px); }
.login-card h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -.035em; }
.security-note { margin: 26px auto 0; max-width: 340px; text-align: center; color: var(--nadi-muted); font-size: .75rem; line-height: 1.6; }
.clinical-note { white-space: pre-wrap; line-height: 1.65; }

@media (min-width: 992px) {
    .app-main { margin-left: 260px; }
    .app-content { padding: 28px 32px 56px; }
    .sticky-actions { margin: 24px -32px -56px; padding: 16px 32px; }
}

@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-panel { padding: 32px 20px; }
    .table-responsive-mobile thead { display: none; }
    .table-responsive-mobile tbody, .table-responsive-mobile tr, .table-responsive-mobile td { display: block; width: 100%; }
    .table-responsive-mobile tr { padding: 10px 0; border-bottom: 1px solid var(--nadi-border); }
    .table-responsive-mobile td { border: 0; padding: 4px 14px; }
    .table-responsive-mobile td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 105px; color: var(--nadi-muted); font-size: .75rem; }
}

@media (max-width: 575.98px) {
    .detail-list { grid-template-columns: 1fr; }
    .page-actions .btn { width: 100%; }
    .form-section { padding: 16px; }
}

@media print {
    .app-sidebar, .app-mobile-nav, .app-header, .no-print, .sticky-actions { display: none !important; }
    .app-main { margin: 0; }
    .app-content { padding: 0; }
    body { background: #fff; }
    .app-card { box-shadow: none; }
}

