/* =========================================================
   Pediatric Surgery Ward — Design System
   Palette:  ink #0F2545  ink-2 #17335C  teal #1D9A8D
             amber #F0A64C  rose #E8667A  paper #F7F9FC
   Type:     Display  -> 'Plus Jakarta Sans'
             Body/UI  -> 'Inter'
             Bengali  -> 'Noto Sans Bengali' (stacked in both)
   ========================================================= */

:root {
    --ink: #0f2545;
    --ink-2: #17335c;
    --ink-3: #1e4372;
    --teal: #1d9a8d;
    --teal-dark: #157468;
    --amber: #f0a64c;
    --rose: #e8667a;
    --violet: #6e56cf;
    --gold: #ffd166;
    --paper: #f7f9fc;
    --mist: #eaf1f3;
    --line: #e4e9f1;
    --ink-soft: #5b6b85;
    --white: #ffffff;
    --sidebar-width: 264px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-soft: 0 2px 10px rgba(15, 37, 69, 0.06);
    --shadow-card: 0 10px 30px rgba(15, 37, 69, 0.08);
    --shadow-pop: 0 18px 44px rgba(15, 37, 69, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Inter', 'Noto Sans Bengali', 'Segoe UI', sans-serif;
    font-size: 0.96rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand, .stat-card h3 {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Bengali', 'Segoe UI', sans-serif;
}

a { color: var(--teal-dark); }

::selection { background: var(--teal); color: #fff; }

/* Slim premium scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6d1e0; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #a9b8cd; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =========================================================
   Auth pages (Login / Register) — split panel
   ========================================================= */
.auth-shell {
    min-height: 100vh;
    display: flex;
}

.auth-aside {
    flex: 0 0 44%;
    max-width: 44%;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 55%, var(--ink-3) 100%);
    color: #fff;
    padding: 3rem 3rem 2.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
/* Animated mesh-gradient blobs — signature backdrop */
.auth-aside::before,
.auth-aside::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    z-index: 0;
    pointer-events: none;
}
.auth-aside::before {
    width: 480px; height: 480px;
    top: -160px; right: -160px;
    background: radial-gradient(circle, rgba(29,154,141,0.55), transparent 68%);
    animation: blob-float-a 11s ease-in-out infinite;
}
.auth-aside::after {
    width: 420px; height: 420px;
    bottom: -140px; left: -120px;
    background: radial-gradient(circle, rgba(240,166,76,0.4), transparent 70%);
    animation: blob-float-b 13s ease-in-out infinite;
}
@keyframes blob-float-a {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(-26px, 30px) scale(1.08); }
}
@keyframes blob-float-b {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(24px, -24px) scale(1.06); }
}
.auth-aside .mesh-extra {
    position: absolute;
    width: 300px; height: 300px;
    top: 38%; left: 52%;
    background: radial-gradient(circle, rgba(110,86,207,0.35), transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
    animation: blob-float-a 9s ease-in-out infinite reverse;
    pointer-events: none;
}
.auth-aside .aside-top,
.auth-aside .aside-mid,
.auth-aside .aside-bottom,
.auth-aside > div { position: relative; z-index: 2; }

/* Floating decorative care icons */
.float-icon {
    position: absolute;
    z-index: 1;
    color: rgba(255,255,255,0.16);
    font-size: 1.6rem;
    animation: float-drift 6s ease-in-out infinite;
    pointer-events: none;
}
.float-icon.fi-1 { top: 12%; right: 16%; font-size: 2rem; animation-delay: 0s; }
.float-icon.fi-2 { top: 46%; left: 8%; font-size: 1.3rem; animation-delay: 1.2s; color: rgba(240,166,76,0.22); }
.float-icon.fi-3 { bottom: 22%; right: 10%; font-size: 1.7rem; animation-delay: 2.1s; }
.float-icon.fi-4 { top: 68%; left: 40%; font-size: 1.1rem; animation-delay: 0.6s; color: rgba(110,86,207,0.3); }
@keyframes float-drift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(6deg); }
}

.auth-aside .aside-top .mark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
}
.auth-aside .aside-top .mark .icon-badge {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.22);
}
.auth-aside .aside-top p {
    margin-top: 0.6rem;
    color: rgba(255,255,255,0.68);
    font-size: 0.86rem;
    max-width: 320px;
}

.auth-aside .aside-mid h1 {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.22;
    max-width: 400px;
    margin-bottom: 0.7rem;
    letter-spacing: -0.5px;
}
.auth-aside .aside-mid h1 .grad-word {
    background: linear-gradient(100deg, var(--amber), #ffe1ae 55%, var(--amber));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-aside .aside-mid p {
    color: rgba(255,255,255,0.7);
    max-width: 360px;
    font-size: 0.92rem;
}

/* Signature element: animated vitals / ECG waveform with glow orb */
.vitals-wrap {
    margin: 1.6rem 0 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.16);
    border-bottom: 1px solid rgba(255,255,255,0.16);
    padding: 1rem 0;
    position: relative;
}
.vitals-wrap svg { width: 100%; height: 56px; display: block; overflow: visible; }
.vitals-line {
    fill: none;
    stroke: var(--amber);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 340;
    stroke-dashoffset: 340;
    animation: draw-pulse 3.2s ease-in-out infinite;
    filter: drop-shadow(0 0 7px rgba(240,166,76,0.65));
}
.vitals-dot {
    fill: var(--amber);
    filter: drop-shadow(0 0 6px rgba(240,166,76,0.9));
    animation: pulse-dot 3.2s ease-in-out infinite;
}
@keyframes draw-pulse {
    0% { stroke-dashoffset: 340; }
    45% { stroke-dashoffset: 0; }
    75% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: -340; opacity: 0.4; }
}
@keyframes pulse-dot {
    0%, 40% { opacity: 0; }
    46% { opacity: 1; r: 5; }
    55% { r: 3; opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}
.vitals-caption {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.72rem; letter-spacing: 0.6px; text-transform: uppercase;
    color: rgba(255,255,255,0.45); margin-top: 0.5rem;
}
.vitals-caption b { color: var(--amber); font-weight: 700; }
.live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80; margin-right: 5px;
    box-shadow: 0 0 0 rgba(74,222,128,0.6);
    animation: live-blink 1.6s ease-in-out infinite;
}
@keyframes live-blink {
    0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
    70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.auth-aside .aside-bottom {
    display: flex;
    gap: 1.6rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
}
.auth-aside .aside-bottom strong { color: #fff; display:block; font-size:1.15rem; font-family:'Plus Jakarta Sans',sans-serif; }

.auth-main {
    flex: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem 1.5rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 105% -5%, rgba(29,154,141,0.14), transparent 42%),
        radial-gradient(circle at -5% 105%, rgba(240,166,76,0.12), transparent 42%),
        var(--paper);
}
.auth-main::before {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(15,37,69,0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
    pointer-events: none;
}

.auth-card {
    max-width: 460px;
    width: 100%;
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: var(--shadow-pop);
    padding: 2.7rem 2.4rem;
    border: 1px solid rgba(255,255,255,0.6);
    position: relative;
    z-index: 2;
    animation: card-rise 0.55s cubic-bezier(.2,.8,.2,1);
}
.auth-card::before {
    content: "";
    position: absolute; inset: -1px;
    border-radius: 25px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(29,154,141,0.5), rgba(240,166,76,0.35), rgba(110,86,207,0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}
@keyframes card-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card .auth-eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--teal-dark);
    margin-bottom: 0.4rem;
}
.auth-card h3 {
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -0.3px;
}
.auth-card .text-muted { color: var(--ink-soft) !important; }

.input-icon-group { position: relative; }
.input-icon-group .field-icon {
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--ink-soft);
    font-size: 0.95rem;
    pointer-events: none;
}
.input-icon-group .form-control,
.input-icon-group .form-select { padding-left: 2.4rem; }

.auth-divider-note {
    text-align: center;
    font-size: 0.86rem;
    color: var(--ink-soft);
}
.auth-divider-note a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.auth-divider-note a:hover { text-decoration: underline; }

/* Login-mode toggle (Doctor / Admin) */
.role-toggle {
    display: flex;
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 1.6rem;
    position: relative;
}
.role-toggle .rt-slider {
    position: absolute;
    top: 4px; bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    box-shadow: 0 6px 14px rgba(29,154,141,0.32);
    transition: transform .28s cubic-bezier(.2,.8,.2,1), background .2s ease, box-shadow .2s ease;
    z-index: 0;
}
.role-toggle.mode-admin .rt-slider {
    transform: translateX(100%);
    background: linear-gradient(135deg, var(--rose), #b23252);
    box-shadow: 0 6px 14px rgba(232,102,122,0.32);
}
.role-toggle button {
    flex: 1;
    position: relative; z-index: 1;
    border: none;
    background: transparent;
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-soft);
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    transition: color .2s ease;
    cursor: pointer;
}
.role-toggle button.active { color: #fff; }
.role-toggle button:focus-visible { outline-offset: 2px; }

/* =========================================================
   Form controls — global premium touch
   ========================================================= */
.form-label { font-weight: 600; font-size: 0.83rem; color: var(--ink); margin-bottom: 0.35rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    padding: 0.62rem 0.9rem;
    font-size: 0.92rem;
    background: #fbfcfe;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(29,154,141,0.14);
    background: #fff;
}
.form-control:disabled { background: #f1f4f8; color: var(--ink-soft); }

/* =========================================================
   Buttons
   ========================================================= */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 0.88rem; }
.btn-brand {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    border: none;
    box-shadow: 0 8px 18px rgba(29,154,141,0.28);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-brand::before {
    content: "";
    position: absolute; top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
    z-index: 1;
}
.btn-brand:hover::before { left: 130%; }
.btn-brand:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(29,154,141,0.36);
    filter: brightness(1.03);
}
.btn-brand:active { transform: translateY(0); }
.btn-outline-primary { border-color: var(--teal); color: var(--teal-dark); }
.btn-outline-primary:hover { background: var(--teal); border-color: var(--teal); }
.btn-outline-secondary { border-color: var(--line); color: var(--ink-soft); }
.btn-outline-danger:hover, .btn-danger { box-shadow: 0 6px 14px rgba(232,102,122,0.28); }

/* =========================================================
   App shell — sidebar + topbar
   ========================================================= */
body.app-body {
    background:
        radial-gradient(circle at 100% 0%, rgba(29,154,141,0.05), transparent 32%),
        radial-gradient(circle at 0% 100%, rgba(110,86,207,0.04), transparent 30%),
        var(--paper);
}

.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(190deg, var(--ink) 0%, var(--ink-2) 100%);
    position: fixed;
    top: 0; left: 0;
    color: #fff;
    padding: 1.3rem 0.9rem;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .28s ease;
}
.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.5rem 1.3rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.app-sidebar .brand .icon-badge {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--teal), var(--violet));
    border: 1px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 0 16px rgba(29,154,141,0.55);
}
.app-sidebar .brand .txt { font-weight: 700; font-size: 0.98rem; line-height: 1.25; font-family: 'Plus Jakarta Sans', sans-serif; }
.app-sidebar .brand .txt small { font-weight: 400; opacity: 0.6; font-size: 0.72rem; display: block; }

.sidebar-close { display: none; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.app-sidebar a.nav-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.72);
    padding: 0.62rem 0.75rem;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    position: relative;
    transition: background .15s ease, color .15s ease;
}
.app-sidebar a.nav-link-item i { font-size: 1.02rem; width: 20px; text-align: center; opacity: 0.85; }
.app-sidebar a.nav-link-item:hover { background: rgba(255,255,255,0.07); color: #fff; transform: translateX(2px); }
.app-sidebar a.nav-link-item { transition: background .15s ease, color .15s ease, transform .15s ease; }
.app-sidebar a.nav-link-item.active {
    background: linear-gradient(90deg, rgba(29,154,141,0.28), rgba(29,154,141,0.08));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(29,154,141,0.35);
}
.app-sidebar a.nav-link-item.active i { opacity: 1; text-shadow: 0 0 10px rgba(29,154,141,0.9); }
.app-sidebar a.nav-link-item.active::before {
    content: "";
    position: absolute; left: -0.9rem; top: 8%; bottom: 8%;
    width: 3px; border-radius: 3px;
    background: var(--teal);
    box-shadow: 0 0 10px var(--teal);
}
.app-sidebar a.nav-link-item.logout-link { color: rgba(232,102,122,0.85); margin-top: 0.5rem; }
.app-sidebar a.nav-link-item.logout-link:hover { background: rgba(232,102,122,0.14); color: #fff; }

.sidebar-foot {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    padding: 0.9rem 0.75rem 0.2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.6rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,37,69,0.45);
    z-index: 1030;
}

.app-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 1.9rem 3rem;
    min-height: 100vh;
}

.topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 1.2rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    position: sticky;
    top: 0.7rem;
    z-index: 1010;
    overflow: hidden;
}
.topbar::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--violet), var(--amber));
}
.topbar h5 {
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.2px;
    display: flex; align-items: center; gap: 0.6rem;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    width: 38px; height: 38px;
    border-radius: 10px;
    align-items: center; justify-content: center;
    font-size: 1.05rem;
    color: var(--ink);
    flex: 0 0 38px;
}

.role-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 0.32rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
}
.role-pill.admin { background: rgba(232,102,122,0.14); color: #c23350; }
.role-pill.user { background: rgba(29,154,141,0.14); color: var(--teal-dark); }

.user-chip {
    display: flex; align-items: center; gap: 0.55rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--line);
}
.user-chip .avatar-sm {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--ink-3));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; flex: 0 0 32px;
}
.user-chip .meta { line-height: 1.15; }
.user-chip .meta .name { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.user-chip .meta .role { font-size: 0.7rem; color: var(--ink-soft); }

/* =========================================================
   Dashboard welcome hero banner
   ========================================================= */
.welcome-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 55%, var(--ink-3) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-card);
}
.welcome-banner::before {
    content: "";
    position: absolute; width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(29,154,141,0.5), transparent 70%);
    top: -110px; right: 8%;
    filter: blur(4px);
}
.welcome-banner::after {
    content: "";
    position: absolute; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(240,166,76,0.32), transparent 70%);
    bottom: -120px; left: 12%;
    filter: blur(4px);
}
.welcome-banner .wb-text { position: relative; z-index: 1; }
.welcome-banner .wb-eyebrow {
    display: inline-block;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--amber);
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
}
.welcome-banner h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.35rem; letter-spacing: -0.3px; }
.welcome-banner p { color: rgba(255,255,255,0.68); font-size: 0.88rem; max-width: 480px; margin: 0; }
.welcome-banner .wb-art {
    position: relative; z-index: 1;
    width: 74px; height: 74px; border-radius: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 74px;
}
.welcome-banner .wb-icon { font-size: 2rem; color: var(--amber); filter: drop-shadow(0 0 10px rgba(240,166,76,0.6)); animation: pulse-scale 2.2s ease-in-out infinite; }
@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
@media (max-width: 575.98px) {
    .welcome-banner { flex-direction: column; align-items: flex-start; padding: 1.4rem 1.3rem; }
    .welcome-banner .wb-art { display: none; }
}

/* =========================================================
   Stat cards — gradient bento tiles
   ========================================================= */
.stat-card {
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    background: linear-gradient(150deg, var(--accent, var(--teal)) 0%, var(--accent2, var(--teal-dark)) 130%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 12px 26px -8px var(--accent-shadow, rgba(29,154,141,0.45));
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
.stat-card::after {
    content: "";
    position: absolute; width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    top: -46px; right: -36px;
    pointer-events: none;
}
.stat-card:hover { transform: translateY(-5px) scale(1.015); box-shadow: 0 18px 34px -8px var(--accent-shadow, rgba(29,154,141,0.55)); }
.stat-card .stat-text { position: relative; z-index: 1; }
.stat-card .stat-text span { font-size: 0.75rem; color: rgba(255,255,255,0.85); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card h3 { font-size: 2rem; font-weight: 800; margin: 0.2rem 0 0; color: #fff; }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.22);
    color: #fff;
    flex: 0 0 44px;
    position: relative; z-index: 1;
    backdrop-filter: blur(4px);
}
.stat-card .stat-watermark {
    position: absolute;
    right: -10px; bottom: -18px;
    font-size: 5.2rem;
    color: rgba(255,255,255,0.12);
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

/* =========================================================
   Cards / tables / badges
   ========================================================= */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.card-header {
    background: var(--mist);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    padding: 0.85rem 1.15rem;
}

table.table thead { background: var(--mist); }
table.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--ink-soft);
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.table td { font-size: 0.87rem; vertical-align: middle; }
table.table tbody tr { transition: background .12s ease; }
table.table tbody tr:hover { background: #f5f9fb; }

.badge { font-weight: 600; font-size: 0.72rem; padding: 0.42em 0.7em; border-radius: 20px; }
.badge.bg-success { background-color: rgba(29,154,141,0.15) !important; color: var(--teal-dark) !important; }
.badge.bg-info { background-color: rgba(23,51,92,0.1) !important; color: var(--ink-2) !important; }
.badge.bg-warning { background-color: rgba(240,166,76,0.2) !important; color: #915c14 !important; }
.badge.bg-danger { background-color: rgba(232,102,122,0.16) !important; color: #c23350 !important; }
.badge.bg-secondary { background-color: #eef1f6 !important; color: var(--ink-soft) !important; }

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 0.88rem; }
.alert-danger { background: rgba(232,102,122,0.1); color: #b1233f; border-color: rgba(232,102,122,0.22); }
.alert-success { background: rgba(29,154,141,0.1); color: var(--teal-dark); border-color: rgba(29,154,141,0.22); }
.alert-warning { background: rgba(240,166,76,0.14); color: #8a5713; border-color: rgba(240,166,76,0.28); }

.profile-avatar {
    width: 92px; height: 92px; border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--ink-3));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; font-weight: 700; margin: 0 auto 1rem;
    box-shadow: 0 10px 24px rgba(29,154,141,0.3);
}

/* =========================================================
   Responsive — tablet & mobile
   ========================================================= */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,0.25); }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-close { display: inline-flex; margin-left: auto; }
    .app-content { margin-left: 0; padding: 1.1rem 1rem 2.5rem; }
    .menu-toggle { display: inline-flex; }
    .sidebar-backdrop.show { display: block; }
    .topbar { top: 0.5rem; }
    .user-chip .meta { display: none; }

    .auth-aside { display: none; }
    .auth-shell.compact-aside .auth-aside {
        display: flex;
        flex: 0 0 auto; max-width: 100%;
        min-height: auto;
        padding: 1.6rem 1.4rem;
    }
    .auth-shell.compact-aside { flex-direction: column; }
    .auth-shell.compact-aside .aside-mid,
    .auth-shell.compact-aside .aside-bottom,
    .auth-shell.compact-aside .vitals-wrap { display: none; }
    .auth-shell.compact-aside .auth-main { padding: 2rem 1.2rem; }
}

@media (max-width: 575.98px) {
    .auth-card { padding: 1.9rem 1.4rem; border-radius: 18px; }
    .stat-card h3 { font-size: 1.6rem; }
    .app-content { padding: 1rem 0.75rem 2.5rem; }
    .topbar { flex-wrap: wrap; padding: 0.7rem 0.9rem; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    :root { --sidebar-width: 232px; }
}
