

:root{--bg:#f4f7fc;--surface:#fff;--surface-2:#f8faff;--ink:#18243a;--muted:#71809a;--line:#e6ebf3;--brand:#315ee8;--brand2:#6c7ff5;--teal:#14a89a;--shadow:0 16px 45px rgba(29,49,91,.075);--radius:18px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse at 12% 0%,#e9efff 0,transparent 34%),var(--bg);color:var(--ink);font-family:Vazirmatn,'Segoe UI',Tahoma,sans-serif;line-height:1.85;min-height:100vh}
a{color:var(--brand)}.sidebar{position:fixed;z-index:20;right:0;top:0;bottom:0;width:270px;padding:25px 18px;background:linear-gradient(165deg,#172b50,#101d36 72%);display:flex;flex-direction:column;box-shadow:-12px 0 35px #14264a12}
.brand{display:flex;align-items:center;gap:13px;color:white;text-decoration:none;font-weight:900;font-size:20px;padding:3px 9px 29px}.brand small{display:block;color:#9eb2d2;font-size:10px;font-weight:500;letter-spacing:.2px}.brand-accent{color:#81e2d4}.brand-mark{width:47px;height:47px;border-radius:16px;background:linear-gradient(140deg,#6889ff,#315ee8);display:grid;place-items:center;font-size:24px;color:white;box-shadow:0 8px 20px #315ee855}
.side-label,.eyebrow{font-size:10px;letter-spacing:.6px;color:#92a9ca;font-weight:800}.side-label{padding:0 13px 12px}.side-nav{display:grid;gap:5px}.side-nav a{display:flex;gap:13px;align-items:center;padding:11px 13px;border-radius:12px;text-decoration:none;color:#c1cee2;font-size:12px;transition:.2s;border:1px solid transparent}.side-nav a span{font-size:17px;width:21px;text-align:center}.side-nav a:hover,.side-nav a.active{color:#fff;background:linear-gradient(90deg,#ffffff12,#ffffff08);border-color:#ffffff10}.side-nav a.active{box-shadow:inset -3px 0 #75dfd2}
.sidebar-bottom{margin-top:auto}.secure-note{font-size:11px;color:#c0d0e3;padding:12px 13px;border:1px solid #ffffff20;border-radius:12px;margin-bottom:12px;background:#ffffff08}.pulse,.status-dot{display:inline-block;width:7px;height:7px;background:#34d399;border-radius:50%;margin-left:8px;box-shadow:0 0 0 4px #34d39920}.logout{width:100%;background:#ffffff0b;border:1px solid #ffffff25;color:#e2eaf6;border-radius:11px;padding:10px;font:inherit;cursor:pointer}
.main-shell{margin-right:270px;min-height:100vh}.main-shell.no-sidebar{margin:0}.topbar{height:72px;border-bottom:1px solid #e9edf4;display:flex;align-items:center;justify-content:space-between;padding:0 40px;background:#ffffffd9;backdrop-filter:blur(16px);position:sticky;top:0;z-index:10}.crumb{font-size:12px;color:#8390a5}.crumb span{color:#c0cad6;padding:0 9px}.top-user{display:flex;align-items:center;gap:10px;font-size:12px;color:#43536a}.avatar{width:35px;height:35px;border-radius:12px;background:#eaf0ff;color:#315ee8;display:grid;place-items:center;font-weight:900}
.wrap{max-width:1600px;margin:0 auto;padding:34px 40px 55px;min-height:calc(100vh - 120px)}.page-head,.section-head{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap}.page-head{margin-bottom:25px}.page-head h1{font-size:27px;margin:4px 0 3px;font-weight:900;color:#17243b;letter-spacing:-.5px}.muted{color:var(--muted);font-size:12px;margin:0}
.card,.glass,.panel{background:var(--surface);border:1px solid #e9edf4;border-radius:var(--radius);box-shadow:var(--shadow)}.panel{padding:24px;margin-bottom:20px}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:22px}.stat{padding:20px 22px;min-height:124px;position:relative;overflow:hidden}.stat:after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;left:-30px;bottom:-45px;background:#edf2ff}.stat-top{display:flex;justify-content:space-between;align-items:center;color:#6c7b92;font-size:12px}.stat-icon{font-style:normal;width:37px;height:37px;display:grid;place-items:center;border-radius:12px;background:#edf2ff;color:#315ee8}.stat b{display:block;font-size:31px;line-height:1.5;margin-top:6px;color:#172b49}.stat small{font-size:10px;color:#8190a3}.section-head{margin-bottom:17px}.section-head h2{font-size:16px;margin:2px 0 0;font-weight:800}.result-count{font-size:11px;color:#41628f;background:#edf4ff;border:1px solid #dce8fa;padding:5px 12px;border-radius:20px}
.filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.searchbox{display:flex;align-items:center;gap:8px;flex:1;min-width:220px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:0 13px;color:#6084b4}.searchbox input{border:0!important;background:transparent!important;padding-right:0!important;box-shadow:none!important}
.filters input,.filters select,input,select,textarea{font:inherit;color:#26364d;background:#fff;border:1px solid #dfe6f0;border-radius:11px;padding:10px 12px;outline:none;max-width:100%;transition:.18s}.filters select{min-width:145px}.filters input::placeholder{color:#a0aabd}.filters input:focus,.filters select:focus,input:focus,textarea:focus{border-color:#83a2f4;box-shadow:0 0 0 4px #456df018}
.button,button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border:1px solid #dce4ef;border-radius:11px;padding:10px 16px;font:inherit;font-size:12px;font-weight:800;cursor:pointer;white-space:nowrap;transition:transform .16s,box-shadow .16s,background .16s}.button:hover,button:hover{transform:translateY(-1px)}.primary{background:linear-gradient(135deg,#426df0,#3156d8);border-color:#315ee8;color:#fff;box-shadow:0 7px 17px #315ee82b}.primary:hover{background:#294fc9}.secondary,.ghost{background:#fff;color:#34506f}.tablewrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}table{width:100%;border-collapse:collapse;min-width:850px}th,td{text-align:right;padding:14px 15px;border-bottom:1px solid #edf1f6;white-space:nowrap;font-size:11px}th{color:#62738a;font-weight:800;background:#f7f9fd}td{color:#40516a}tbody tr{transition:background .15s}tbody tr:hover{background:#f7faff}tbody tr:last-child td{border-bottom:0}.tracking{font-family:Consolas,monospace;color:#2865b8;font-size:11px}.name-cell{font-weight:800;color:#1c2d45}.pill{display:inline-block;border-radius:20px;background:#edf4ff;border:1px solid #dce9fc;color:#285eaa;padding:4px 11px;font-size:10px}.table-link{color:#315ee8;text-decoration:none;font-weight:700}.empty{text-align:center!important;padding:45px!important;color:#718198}.empty b,.empty small{display:block}.empty small{font-size:10px;color:#8795a8}.empty-icon{font-size:28px;color:#7c9cc7;display:block}.pagination{display:flex;justify-content:space-between;align-items:center;margin-top:17px;color:#8190a3;font-size:11px}footer{text-align:center;color:#94a0b0;font-size:10px;padding:23px}footer span{color:#4f82c8;margin:0 5px}
.stack{display:grid;gap:12px}.details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.details>div{background:#f8faff;border:1px solid #e9eef6;border-radius:13px;padding:14px}.details small{display:block;color:#7b899b;font-size:10px}.details b{display:block;color:#24364e;font-size:12px;overflow-wrap:anywhere}.heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.doc-review{padding:14px 0;border-bottom:1px solid #edf1f6}.narrow{max-width:650px;margin:25px auto;padding:25px}.back{display:inline-block;margin-bottom:15px;color:#3569ae;text-decoration:none}.resend-card{margin-top:12px;padding:15px;background:#f4f8ff;border:1px solid #dce8fb;border-radius:13px}
label{display:block;font-size:12px;font-weight:700;color:#53647c;margin:8px 0 5px}input,select,textarea{width:100%;margin-bottom:10px}textarea{min-height:95px;resize:vertical}form button{margin-top:8px}.alert,.error{padding:11px 14px;border-radius:11px;background:#fff1f1;color:#b42336;border:1px solid #ffd6da;font-size:12px;margin:12px 0}
.login{max-width:1050px;min-height:590px;margin:38px auto;display:grid;grid-template-columns:1fr 1fr;overflow:hidden;border:1px solid #e4eaf5;box-shadow:0 25px 80px #1d32601c;border-radius:28px;background:#fff}.login-art{position:relative;display:flex;flex-direction:column;justify-content:space-between;padding:48px;color:#fff;background:radial-gradient(circle at 15% 10%,#91a9ff66,transparent 30%),linear-gradient(145deg,#182e58,#284fc0 58%,#4778ee);overflow:hidden}.login-art:before,.login-art:after{content:"";position:absolute;border:1px solid #ffffff24;border-radius:50%;width:390px;height:390px;left:-120px;bottom:-180px}.login-art:after{width:280px;height:280px;left:-60px;bottom:-125px}.login-art>*{position:relative;z-index:1}.login-brand{font-size:23px;font-weight:900;display:flex;align-items:center;gap:12px}.login-brand .brand-mark{background:#ffffff20;box-shadow:none}.login-art h2{font-size:31px;line-height:1.55;margin:0 0 12px;font-weight:900}.login-art p{color:#dbe5ff;font-size:13px;max-width:390px}.login-feature{display:flex;align-items:center;gap:10px;color:#e5ecff;font-size:11px;margin-top:22px}.login-feature span{width:27px;height:27px;display:grid;place-items:center;background:#ffffff1c;border-radius:9px}.login-content{padding:58px 54px;display:flex;flex-direction:column;justify-content:center}.login-content .eyebrow{color:#5475df}.login-content h1{font-size:26px;font-weight:900;margin:9px 0 4px}.login-content .muted{margin-bottom:24px}.login-content input{height:48px;margin-bottom:15px}.login-content button{width:100%;height:48px;margin-top:10px}.login-security{font-size:10px;color:#8995a8;text-align:center;margin-top:23px}
@media(max-width:1100px){.sidebar{width:235px}.main-shell{margin-right:235px}.stats{grid-template-columns:repeat(2,1fr)}.wrap{padding:25px 22px}.login{max-width:850px}.login-content{padding:42px 35px}}
@media(max-width:760px){.sidebar{position:relative;width:auto;height:auto;bottom:auto;padding:12px 14px}.brand{padding:2px 5px 12px}.side-label,.sidebar-bottom{display:none}.side-nav{display:flex;overflow:auto}.side-nav a{white-space:nowrap;padding:8px 10px;font-size:11px}.main-shell{margin:0}.topbar{padding:0 15px;height:57px}.wrap{padding:20px 13px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat{padding:13px;min-height:105px}.stat b{font-size:24px}.page-head h1{font-size:21px}.panel{padding:15px}.filters>*{width:100%}.searchbox{min-width:100%}.details{grid-template-columns:repeat(2,minmax(0,1fr))}.login{margin:12px auto;grid-template-columns:1fr;min-height:0;border-radius:20px}.login-art{padding:25px;min-height:230px}.login-art h2{font-size:23px}.login-content{padding:32px 23px}.login-feature{margin-top:10px}}



/* =========================================================
   LIBRARYBOT UI REFRESH ? Glass workspace
   Existing component styles are retained for compatibility.
   ========================================================= */
:root {
    color-scheme: dark;
    --bg: #0a1020;
    --surface: rgba(20, 30, 51, .78);
    --surface-2: rgba(26, 39, 64, .72);
    --ink: #edf3ff;
    --muted: #9aaac5;
    --line: rgba(173, 194, 230, .13);
    --brand: #7798ff;
    --brand2: #a18bff;
    --teal: #54dbc4;
    --shadow: 0 22px 65px rgba(0, 0, 0, .24);
    --radius: 20px;
    --sidebar-width: 278px;
}
html { background: var(--bg); }
body.app-body {
    color: var(--ink);
    background:
      radial-gradient(ellipse at 78% 0%, rgba(63, 91, 173, .19), transparent 38%),
      radial-gradient(ellipse at 5% 75%, rgba(35, 157, 153, .10), transparent 35%),
      linear-gradient(145deg, #0a1020, #0e1729 55%, #0a1322);
    font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
    overflow-x: hidden;
}
.ambient {
    position: fixed; pointer-events: none; z-index: 0;
    border-radius: 50%; filter: blur(85px); opacity: .17;
}
.ambient-one { width: 300px; height: 300px; top: 5%; right: 22%; background: #536ff5; }
.ambient-two { width: 260px; height: 260px; bottom: 4%; left: 8%; background: #18b7a5; }
.ambient-three { width: 220px; height: 220px; top: 48%; right: 55%; background: #845de7; opacity: .10; }

.sidebar {
    position: fixed; z-index: 50; top: 14px; right: 14px; bottom: 14px;
    width: var(--sidebar-width); padding: 19px 15px;
    display: flex; flex-direction: column;
    background: linear-gradient(160deg, rgba(25, 39, 66, .91), rgba(13, 23, 41, .88));
    border: 1px solid rgba(190, 208, 244, .15);
    border-radius: 24px;
    box-shadow: 0 25px 75px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.05);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    transition: width .25s ease, transform .25s ease;
}
.sidebar-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:27px; }
.brand { display:flex; align-items:center; gap:11px; min-width:0; padding:3px; color:#fff; text-decoration:none; }
.brand-mark {
    flex:0 0 43px; width:43px; height:43px; border-radius:14px;
    display:grid; place-items:center; color:#fff; font-size:23px; font-weight:900;
    background:linear-gradient(140deg,#7b9cff,#655de0);
    box-shadow:0 8px 26px rgba(91,111,235,.35);
}
.brand-copy { display:flex; flex-direction:column; min-width:0; }
.brand-copy strong { font-size:19px; letter-spacing:-.5px; line-height:1.4; }
.brand-copy strong span { color:#75dfd0; }
.brand-copy small { color:#9aaccb; font-size:9px; white-space:nowrap; }
.sidebar-collapse {
    width:29px; height:29px; padding:0; flex:0 0 29px;
    color:#aebddd; background:rgba(255,255,255,.06);
    border:1px solid var(--line); border-radius:9px; font-size:20px;
}
.sidebar-caption { color:#7186aa; font-size:10px; font-weight:800; padding:0 12px 10px; letter-spacing:.5px; }
.side-nav { display:grid; gap:5px; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:#52658a transparent; }
.side-nav a {
    display:flex; align-items:center; gap:12px; min-height:44px;
    padding:9px 12px; color:#b8c6df; text-decoration:none;
    border:1px solid transparent; border-radius:13px;
    font-size:11px; transition:background .18s ease, color .18s ease, border-color .18s ease;
}
.side-nav a:hover { color:#fff; background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.07); }
.side-nav a.active {
    color:#fff; background:linear-gradient(100deg,rgba(91,121,231,.25),rgba(66,193,180,.10));
    border-color:rgba(132,159,255,.22); box-shadow:inset -3px 0 #6fe0d0;
}
.nav-icon {
    flex:0 0 23px; width:23px; height:23px; display:grid; place-items:center;
    color:#8faaff; background:rgba(127,154,255,.10); border-radius:8px; font-size:15px;
}
.side-nav a.active .nav-icon { color:#78e2d4; background:rgba(92,221,203,.12); }
.sidebar-bottom { margin-top:auto; padding-top:15px; }
.system-status {
    display:flex; align-items:center; gap:9px; padding:12px 11px;
    color:#aebfda; background:rgba(255,255,255,.045);
    border:1px solid var(--line); border-radius:13px; font-size:10px; margin-bottom:10px;
}
.status-pulse,.top-user-status {
    width:7px; height:7px; flex:0 0 7px; border-radius:50%;
    background:#42d6a4; box-shadow:0 0 0 4px rgba(66,214,164,.12);
}
.status-label { margin-right:auto; color:#5ddbb0; font-size:8px; letter-spacing:.6px; }
.logout-button {
    display:flex; align-items:center; justify-content:flex-start; gap:11px;
    width:100%; padding:11px 12px; color:#d5deef;
    background:rgba(255,255,255,.045); border:1px solid var(--line);
    border-radius:12px; font-size:11px;
}
.logout-button:hover { background:rgba(239,91,111,.12); border-color:rgba(239,91,111,.25); }

.main-shell { position:relative; z-index:1; margin-right:calc(var(--sidebar-width) + 28px); min-height:100vh; transition:margin-right .25s ease; }
.main-shell.no-sidebar { margin:0; }
.topbar {
    position:sticky; top:0; z-index:30; height:76px; padding:0 34px;
    display:flex; align-items:center; justify-content:space-between; gap:15px;
    background:rgba(11,18,32,.70); border-bottom:1px solid rgba(190,208,244,.10);
    backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
}
.topbar-start,.topbar-actions { display:flex; align-items:center; gap:15px; min-width:0; }
.breadcrumb { color:#a5b4ce; font-size:11px; white-space:nowrap; }
.breadcrumb-home { color:#e1eaff; font-weight:800; }
.breadcrumb-separator { color:#5d7195; padding:0 9px; }
.topbar-icon-link {
    display:grid; place-items:center; width:37px; height:37px;
    color:#b8c9e8; text-decoration:none; background:rgba(255,255,255,.055);
    border:1px solid var(--line); border-radius:12px; font-size:17px;
}
.topbar-icon-link:hover { color:#fff; background:rgba(117,146,255,.15); }
.top-user { display:flex; align-items:center; gap:10px; color:#c5d2e8; font-size:11px; }
.top-user-status { width:6px; height:6px; }
.avatar {
    display:grid; place-items:center; width:36px; height:36px; border-radius:12px;
    color:#e9edff; background:linear-gradient(140deg,#536fe1,#7966ca);
    border:1px solid rgba(255,255,255,.16); font-weight:900;
}
.menu-toggle { display:none; }
.wrap { position:relative; max-width:1660px; margin:0 auto; padding:32px 34px 55px; min-height:calc(100vh - 130px); }
.app-footer { position:relative; padding:22px 15px 26px; text-align:center; color:#70819e; font-size:10px; }
.footer-brand { color:#a9bbdc; font-weight:900; }
.footer-separator { color:#5dd8c3; padding:0 7px; }
.login-top-label { color:#aebdd7; font-size:11px; }

body.sidebar-collapsed { --sidebar-width:86px; }
body.sidebar-collapsed .sidebar { padding-left:11px; padding-right:11px; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-caption,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .status-label { display:none; }
body.sidebar-collapsed .brand { justify-content:center; }
body.sidebar-collapsed .sidebar-head { flex-direction:column; }
body.sidebar-collapsed .side-nav a { justify-content:center; padding:9px 5px; }
body.sidebar-collapsed .nav-icon { flex-basis:32px; width:32px; height:32px; font-size:17px; }
body.sidebar-collapsed .system-status { justify-content:center; }
body.sidebar-collapsed .logout-button { justify-content:center; }
body.sidebar-collapsed .sidebar-collapse { transform:rotate(180deg); }

body.app-body .page-head h1, body.app-body .section-head h2 { color:#edf3ff; }
body.app-body .muted, body.app-body .page-head .muted { color:#9aabc5; }
body.app-body .card, body.app-body .glass, body.app-body .panel {
    color:#e8efff; background:rgba(22,33,55,.76);
    border:1px solid rgba(173,194,230,.13);
    box-shadow:0 18px 50px rgba(0,0,0,.17);
    backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
}
body.app-body input, body.app-body select, body.app-body textarea,
body.app-body .filters input, body.app-body .filters select {
    color:#e8efff; background:rgba(9,17,32,.72);
    border-color:rgba(173,194,230,.19);
}
body.app-body input::placeholder, body.app-body textarea::placeholder { color:#7587a5; }
body.app-body .tablewrap { background:rgba(13,23,41,.72); border-color:var(--line); }
body.app-body table { color:#e8efff; }
body.app-body th { color:#b6c6e1; background:rgba(39,55,83,.75); border-color:var(--line); }
body.app-body td { color:#c4d0e5; border-color:rgba(173,194,230,.09); }
body.app-body tbody tr:hover { background:rgba(108,139,225,.08); }
body.app-body .details>div { background:rgba(255,255,255,.035); border-color:var(--line); }
body.app-body .details b { color:#e4edff; }
body.app-body .details small { color:#92a4c1; }
body.app-body .secondary, body.app-body .ghost { color:#d7e3f8; background:rgba(255,255,255,.06); border-color:var(--line); }
body.app-body .result-count, body.app-body .pill { color:#a9c6ff; background:rgba(94,133,225,.13); border-color:rgba(117,153,238,.2); }
body.app-body .stat b { color:#f0f5ff; }
body.app-body .stat-top, body.app-body .stat small { color:#9bacc7; }
body.app-body .stat:after { background:rgba(115,143,240,.09); }
body.app-body .searchbox { background:rgba(9,17,32,.72); border-color:var(--line); }
body.app-body .table-link { color:#8eacff; }
body.app-body .empty { color:#a3b2ca; }
body.app-body footer { color:#7789a7; }

.sidebar-overlay { display:none; }

@media (max-width: 1100px) {
    .sidebar { width:250px; }
    .main-shell { margin-right:278px; }
    .wrap { padding:26px 22px 45px; }
    body.sidebar-collapsed .main-shell { margin-right:114px; }
}
@media (max-width: 760px) {
    .sidebar {
        top:0; right:0; bottom:0; width:min(300px,86vw); max-width:300px;
        border-radius:0 0 0 22px; transform:translateX(110%);
        padding:20px 16px; z-index:60;
    }
    body.mobile-menu-open .sidebar { transform:translateX(0); }
    .sidebar-overlay {
        display:block; position:fixed; inset:0; z-index:55;
        background:rgba(2,7,17,.66); opacity:0; visibility:hidden;
        backdrop-filter:blur(4px); transition:opacity .22s,visibility .22s;
    }
    body.mobile-menu-open .sidebar-overlay { opacity:1; visibility:visible; }
    .sidebar-collapse { display:none; }
    .main-shell, body.sidebar-collapsed .main-shell { margin:0; }
    .topbar { height:64px; padding:0 14px; }
    .menu-toggle {
        display:flex; width:39px; height:39px; padding:9px;
        flex-direction:column; justify-content:center; gap:5px;
        background:rgba(255,255,255,.06); border:1px solid var(--line); border-radius:12px;
    }
    .menu-toggle span { display:block; height:2px; width:19px; border-radius:3px; background:#dce7fb; }
    .breadcrumb { font-size:10px; }
    .topbar-start,.topbar-actions { gap:9px; }
    .top-user-name { display:none; }
    .topbar-icon-link { width:34px; height:34px; }
    .wrap { padding:21px 13px 38px; }
    .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
    .stat { min-width:0; padding:13px; }
    .page-head h1 { font-size:21px; }
    .panel { padding:15px; }
    .filters>* { width:100%; }
    .searchbox { min-width:100%; }
    .details { grid-template-columns:repeat(2,minmax(0,1fr)); }
    body.sidebar-collapsed .sidebar { width:min(300px,86vw); }
    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .sidebar-caption,
    body.sidebar-collapsed .nav-text,
    body.sidebar-collapsed .status-label { display:initial; }
    body.sidebar-collapsed .brand { justify-content:flex-start; }
    body.sidebar-collapsed .sidebar-head { flex-direction:row; }
    body.sidebar-collapsed .side-nav a { justify-content:flex-start; padding:9px 12px; }
    body.sidebar-collapsed .nav-icon { flex-basis:23px; width:23px; height:23px; }
}
@media (max-width: 420px) {
    .stats { grid-template-columns:1fr 1fr; }
    .stat b { font-size:22px; }
    .details { grid-template-columns:1fr; }
    .breadcrumb-separator { padding:0 4px; }
}




/* =========================================================
   OPERATOR EVENT CENTER ? GLASS UI
   ========================================================= */

.event-page {
    direction: rtl;
    color: var(--text-primary, #edf2ff);
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding-bottom: 32px;
}

.event-page * { box-sizing: border-box; }

.event-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 24px;
    background:
        radial-gradient(ellipse at 8% 0%, rgba(91,110,225,.19), transparent 48%),
        linear-gradient(135deg, rgba(30,41,68,.88), rgba(18,27,46,.72));
    box-shadow: 0 18px 50px rgba(0,0,0,.16);
    backdrop-filter: blur(18px);
}

.event-hero h1 {
    margin: 8px 0 9px;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 800;
    letter-spacing: -.7px;
}

.event-hero p,
.event-section-heading p,
.event-filter-heading p,
.event-table-heading p {
    margin: 0;
    color: #9eabc4;
    font-size: 13px;
    line-height: 1.9;
}

.eyebrow {
    color: #8da5ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .7px;
}

.event-action,
.event-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(139,160,255,.28);
    border-radius: 13px;
    background: linear-gradient(135deg, #536fe0, #765bd4);
    color: #fff !important;
    text-decoration: none !important;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.event-action:hover,
.event-primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(91,110,225,.28);
    filter: brightness(1.08);
}

.event-action-icon { font-size: 18px; }

.event-back-link {
    display: inline-block;
    margin-bottom: 13px;
    color: #a8b8ff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 700;
}

.event-back-link:hover { color: #fff !important; }

.event-total-chip {
    flex: 0 0 auto;
    padding: 12px 18px;
    border: 1px solid rgba(139,160,255,.2);
    border-radius: 14px;
    background: rgba(102,122,210,.12);
    color: #c5d0ff;
    font-size: 13px;
    font-weight: 800;
}

.event-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 34px;
}

.event-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 158px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(35,47,73,.8), rgba(20,29,48,.76));
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    backdrop-filter: blur(14px);
}

.event-stat::after {
    content: "";
    position: absolute;
    left: -28px;
    bottom: -50px;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: rgba(104,126,230,.08);
    filter: blur(2px);
}

.event-stat-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border: 1px solid rgba(140,159,255,.2);
    border-radius: 11px;
    background: rgba(112,132,230,.13);
    color: #aabaff;
    font-size: 19px;
}

.event-stat-label {
    color: #aab6cc;
    font-size: 12px;
}

.event-stat strong {
    margin-top: 5px;
    color: #fff;
    font-size: 29px;
    font-weight: 850;
    line-height: 1.3;
}

.event-stat small {
    margin-top: 5px;
    color: #7787a3;
    font-size: 11px;
}

.event-section-heading,
.event-filter-heading,
.event-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
}

.event-section-heading h2,
.event-filter-heading h2,
.event-table-heading h2 {
    margin: 0 0 5px;
    color: #edf2ff;
    font-size: 17px;
    font-weight: 800;
}

.event-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.event-category-card {
    display: flex;
    flex-direction: column;
    min-height: 158px;
    padding: 19px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(34,47,74,.78), rgba(20,29,48,.78));
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.1);
    backdrop-filter: blur(14px);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.event-category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(135,157,255,.38);
    background: linear-gradient(145deg, rgba(43,58,91,.9), rgba(24,35,59,.9));
}

.event-category-top,
.event-category-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.event-category-symbol {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid rgba(135,157,255,.2);
    border-radius: 12px;
    background: rgba(112,132,230,.14);
    color: #b5c3ff;
    font-size: 21px;
}

.event-category-count {
    color: #9eacd0;
    font-size: 11px;
    font-weight: 700;
}

.event-category-card h3 {
    margin: 16px 0;
    color: #f0f3ff;
    font-size: 14px;
    font-weight: 750;
}

.event-category-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.065);
    color: #8e9fbd;
    font-size: 11px;
}

.event-arrow { color: #a8b8ff; font-size: 17px; }

.event-filter-panel,
.event-table-panel {
    margin-bottom: 20px;
    padding: 23px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(30,42,67,.84), rgba(18,27,45,.84));
    box-shadow: 0 14px 36px rgba(0,0,0,.13);
    backdrop-filter: blur(16px);
}

.event-filter-heading { margin-bottom: 20px; }

.event-reset-link {
    color: #aabaff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 700;
}

.event-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.event-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.event-field > span {
    color: #b7c2d8;
    font-size: 12px;
    font-weight: 700;
}

.event-field input,
.event-field select {
    width: 100%;
    min-width: 0;
    height: 43px;
    padding: 0 12px;
    border: 1px solid rgba(174,190,224,.15);
    border-radius: 11px;
    outline: none;
    background: rgba(9,16,30,.48);
    color: #edf2ff;
    font: inherit;
    font-size: 12px;
    color-scheme: dark;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.event-field input:focus,
.event-field select:focus {
    border-color: rgba(135,157,255,.65);
    box-shadow: 0 0 0 3px rgba(112,132,230,.12);
}

.event-field input::placeholder { color: #65738c; }

.event-filter-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 19px;
}

.event-filter-actions > span {
    color: #8291aa;
    font-size: 11px;
}

.event-primary-button { min-width: 130px; }

.event-table-heading { margin-bottom: 18px; }

.event-page-indicator {
    color: #9eacd0;
    font-size: 12px;
    white-space: nowrap;
}

.event-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
}

.event-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
}

.event-table th {
    padding: 14px 13px;
    background: rgba(94,113,177,.13);
    color: #aebce0;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.event-table td {
    padding: 14px 13px;
    border-top: 1px solid rgba(255,255,255,.055);
    color: #d4dced;
    font-size: 12px;
    vertical-align: middle;
}

.event-table tbody tr { transition: background .15s ease; }
.event-table tbody tr:hover { background: rgba(120,143,220,.07); }

.event-date-cell strong,
.event-date-cell small,
.event-description-cell strong,
.event-description-cell small {
    display: block;
}

.event-date-cell strong { color: #e1e8fa; font-size: 12px; }
.event-date-cell small { margin-top: 4px; color: #8493ad; font-size: 10px; }

.event-description-cell { min-width: 220px; max-width: 340px; }
.event-description-cell strong { color: #e7edfc; font-size: 12px; }
.event-description-cell small {
    margin-top: 5px;
    color: #8f9db5;
    font-size: 11px;
    line-height: 1.8;
}

.event-tracking {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid rgba(134,157,255,.14);
    border-radius: 7px;
    background: rgba(112,132,230,.08);
    color: #b8c6ff;
    font-size: 11px;
    direction: ltr;
}

.event-status {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid rgba(120,190,160,.18);
    border-radius: 20px;
    background: rgba(65,160,125,.1);
    color: #91d5b6;
    font-size: 10px;
    white-space: nowrap;
}

.event-row-link {
    color: #aebeff !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.event-row-link:hover { color: #fff !important; }

.event-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    color: #aab8d1;
    font-size: 12px;
}

.event-pagination a,
.event-pagination span {
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 9px;
    text-decoration: none;
}

.event-pagination a {
    color: #bdc9ff !important;
    background: rgba(112,132,230,.1);
}

.event-pagination .disabled { color: #64718a; }
.event-pagination strong { color: #e6ecff; }

.event-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    padding: 30px;
    border: 1px dashed rgba(155,174,218,.18);
    border-radius: 18px;
    background: rgba(24,35,57,.4);
    text-align: center;
}

.event-empty-compact { min-height: 190px; }

.event-empty-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 13px;
    border-radius: 16px;
    background: rgba(112,132,230,.12);
    color: #aebeff;
    font-size: 25px;
}

.event-empty h3 {
    margin: 0 0 8px;
    color: #e8edfb;
    font-size: 15px;
}

.event-empty p {
    margin: 0;
    color: #8795ae;
    font-size: 12px;
    line-height: 1.9;
}

.event-notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-notification-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(30,42,67,.8), rgba(18,27,45,.8));
    box-shadow: 0 10px 28px rgba(0,0,0,.1);
}

.event-notification-card.is-unread {
    border-color: rgba(126,150,255,.25);
    background: linear-gradient(120deg, rgba(49,62,105,.48), rgba(20,30,51,.86));
}

.event-notification-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(112,132,230,.14);
    color: #b5c3ff;
    font-size: 19px;
}

.event-notification-content { flex: 1; min-width: 0; }

.event-notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.event-notification-meta time {
    color: #8492ab;
    font-size: 10px;
}

.event-notification-state {
    color: #8d9bb3;
    font-size: 10px;
    font-weight: 800;
}

.event-notification-state.unread { color: #aebeff; }

.event-notification-content h3 {
    margin: 0 0 7px;
    color: #edf2ff;
    font-size: 14px;
}

.event-notification-content p {
    margin: 0;
    color: #a0aec5;
    font-size: 12px;
    line-height: 1.9;
}

.event-mark-read {
    margin-top: 12px;
    padding: 7px 12px;
    border: 1px solid rgba(135,157,255,.22);
    border-radius: 9px;
    background: rgba(112,132,230,.12);
    color: #bdc9ff;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.event-mark-read:hover { background: rgba(112,132,230,.22); }

/* Tablet */
@media (max-width: 1050px) {
    .event-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .event-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile */
@media (max-width: 700px) {
    .event-page { padding-bottom: 20px; }

    .event-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 21px;
        border-radius: 18px;
        gap: 17px;
    }

    .event-hero h1 { font-size: 23px; }
    .event-hero p { font-size: 12px; }
    .event-action { width: 100%; }

    .event-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 27px;
    }

    .event-stat {
        display: grid;
        grid-template-columns: 40px 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        min-height: 86px;
        padding: 14px;
        column-gap: 12px;
    }

    .event-stat-icon {
        grid-row: 1 / 3;
        margin: 0;
    }

    .event-stat-label { align-self: end; }
    .event-stat strong {
        grid-column: 3;
        grid-row: 1 / 3;
        font-size: 25px;
    }

    .event-stat small { align-self: start; margin-top: 2px; }

    .event-category-grid { grid-template-columns: 1fr; gap: 10px; }
    .event-category-card { min-height: 140px; }

    .event-filter-panel,
    .event-table-panel { padding: 16px; border-radius: 16px; }

    .event-filter-grid { grid-template-columns: 1fr; gap: 13px; }
    .event-filter-actions { align-items: stretch; flex-direction: column; }
    .event-primary-button { width: 100%; }

    .event-section-heading h2,
    .event-filter-heading h2,
    .event-table-heading h2 { font-size: 15px; }

    .event-table-heading { align-items: flex-start; }
    .event-page-indicator { font-size: 10px; }

    .event-notification-card { padding: 15px; gap: 11px; }
    .event-notification-icon { flex-basis: 36px; width: 36px; height: 36px; }
    .event-notification-meta { align-items: flex-start; flex-direction: column; gap: 5px; }

    .event-pagination { gap: 9px; }
    .event-pagination a,
    .event-pagination span { padding: 7px 9px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .event-page *,
    .event-page *::before,
    .event-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}


/* FINAL SIDEBAR AND RESPONSIVE OVERRIDES */
body.app-body,
body.app-body button,
body.app-body input,
body.app-body select,
body.app-body textarea {
    font-family: "Vazirmatn", Tahoma, sans-serif;
}

.menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 13px;
    background: rgba(255,255,255,.07);
    color: inherit;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.menu-toggle:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.25);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

body.sidebar-collapsed .sidebar {
    width: 86px;
}

body.sidebar-collapsed .main-shell {
    margin-right: 114px;
}

body.sidebar-collapsed .sidebar .brand-copy,
body.sidebar-collapsed .sidebar .sidebar-caption,
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .status-label {
    display: none;
}

body.sidebar-collapsed .sidebar .side-nav a {
    justify-content: center;
}

body.sidebar-collapsed .sidebar .nav-icon {
    margin: 0;
}

body.sidebar-collapsed .sidebar .sidebar-bottom {
    align-items: center;
}

@media (max-width: 1100px) and (min-width: 761px) {
    body.sidebar-collapsed .sidebar {
        width: 86px;
    }

    body.sidebar-collapsed .main-shell {
        margin-right: 114px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: min(300px, 86vw) !important;
        max-width: 86vw;
        height: 100dvh;
        overflow-y: auto;
        z-index: 1001;
        transform: translateX(110%);
        transition: transform .25s ease;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(2, 6, 23, .62);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .25s ease, visibility .25s ease;
    }

    body.mobile-menu-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .main-shell,
    body.sidebar-collapsed .main-shell {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100%;
    }

    body.sidebar-collapsed .sidebar {
        width: min(300px, 86vw) !important;
    }

    body.sidebar-collapsed .sidebar .brand-copy,
    body.sidebar-collapsed .sidebar .sidebar-caption,
    body.sidebar-collapsed .sidebar .nav-text,
    body.sidebar-collapsed .sidebar .status-label {
        display: initial;
    }

    body.sidebar-collapsed .sidebar .side-nav a {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar .nav-icon {
        margin: initial;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-overlay,
    .menu-toggle {
        transition: none !important;
    }
}


/* SIDEBAR REPAIR: desktop collapse button, mobile topbar opener */
@media (min-width: 761px) {
    .menu-toggle { display: none !important; }
    .sidebar-collapse {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    body.sidebar-collapsed .side-label,
    body.sidebar-collapsed .secure-note { display: none; }
    body.sidebar-collapsed .brand-copy { display: none; }
    body.sidebar-collapsed .sidebar-head { justify-content: center; }
}
@media (max-width: 760px) {
    .menu-toggle { display: inline-flex !important; }
    .sidebar-collapse { display: none !important; }
}


/* LIBRARYBOT LIGHT THEME + VAZIRMATN REPAIR */
@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/Vazirmatn-Variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --ink: #17243a;
    --muted: #52627a;
    --line: #dce4ef;
    --brand: #315ee8;
    --brand2: #6556cf;
    --sidebar-width: 278px;
}

html {
    background: #f3f6fb !important;
}

body.app-body,
body.app-body button,
body.app-body input,
body.app-body select,
body.app-body textarea,
body.app-body table {
    font-family: "Vazirmatn", Tahoma, sans-serif !important;
}

body.app-body {
    color: #17243a !important;
    background: #f3f6fb !important;
}

body.app-body .main-shell {
    background: transparent !important;
}

body.app-body .topbar {
    color: #17243a !important;
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid #dce4ef !important;
    box-shadow: 0 3px 16px rgba(30,50,80,.05);
}

body.app-body .crumb,
body.app-body .top-user,
body.app-body .breadcrumb,
body.app-body .breadcrumb-home {
    color: #34445c !important;
}

body.app-body .page-head h1,
body.app-body .section-head h2,
body.app-body h1,
body.app-body h2,
body.app-body h3,
body.app-body h4 {
    color: #17243a !important;
}

body.app-body .muted,
body.app-body .page-head .muted,
body.app-body .stat-top,
body.app-body .stat small,
body.app-body .details small {
    color: #52627a !important;
}

body.app-body .card,
body.app-body .glass,
body.app-body .panel,
body.app-body .stat,
body.app-body .event-filter-panel,
body.app-body .event-table-panel,
body.app-body .event-notification-card {
    color: #17243a !important;
    background: #ffffff !important;
    border: 1px solid #dce4ef !important;
    box-shadow: 0 8px 26px rgba(30,50,80,.07) !important;
    backdrop-filter: none !important;
}

body.app-body .stat b,
body.app-body .stat strong,
body.app-body .details b,
body.app-body .details strong,
body.app-body .result-count {
    color: #14233b !important;
    font-weight: 800;
}

body.app-body input,
body.app-body select,
body.app-body textarea,
body.app-body .filters input,
body.app-body .filters select,
body.app-body .searchbox {
    color: #17243a !important;
    background: #ffffff !important;
    border: 1px solid #cbd6e5 !important;
}

body.app-body input::placeholder,
body.app-body textarea::placeholder {
    color: #78869a !important;
    opacity: 1;
}

body.app-body label {
    color: #34445c !important;
}

body.app-body .tablewrap {
    color: #17243a !important;
    background: #ffffff !important;
    border: 1px solid #dce4ef !important;
}

body.app-body table {
    color: #17243a !important;
}

body.app-body th {
    color: #263750 !important;
    background: #edf2f8 !important;
    border-color: #dce4ef !important;
}

body.app-body td {
    color: #263750 !important;
    border-color: #e5ebf3 !important;
}

body.app-body tbody tr:hover {
    background: #f3f7fd !important;
}

body.app-body .details > div {
    color: #17243a !important;
    background: #f7f9fc !important;
    border-color: #dce4ef !important;
}

body.app-body .secondary,
body.app-body .ghost {
    color: #34445c !important;
    background: #f2f5fa !important;
    border-color: #d5deea !important;
}

body.app-body .pill,
body.app-body .result-count {
    color: #244da8 !important;
    background: #eaf1ff !important;
    border-color: #d2e0ff !important;
}

body.app-body .table-link {
    color: #2458c6 !important;
}

body.app-body .empty,
body.app-body footer {
    color: #64748b !important;
}

/* Keep the navigation sidebar dark and visually distinct. */
body.app-body .sidebar {
    color: #e8efff;
}

/* Desktop collapse control; mobile keeps its separate menu button. */
@media (min-width: 761px) {
    body.app-body .menu-toggle {
        display: none !important;
    }

    body.app-body .sidebar-collapse {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    body.app-body.sidebar-collapsed .main-shell {
        margin-right: 114px !important;
    }
}

@media (max-width: 760px) {
    body.app-body .menu-toggle {
        display: inline-flex !important;
    }

    body.app-body .sidebar-collapse {
        display: none !important;
    }
}


/* SIDEBAR NAV TEXT WIDTH FIX */
body.app-body .sidebar .side-nav a {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0;
    min-height: 48px;
    padding: 7px 10px !important;
}

body.app-body .sidebar .side-nav a .nav-icon {
    display: grid !important;
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    place-items: center;
}

body.app-body .sidebar .side-nav a .nav-text {
    display: block;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    font-size: 12px !important;
    line-height: 1.8 !important;
    text-align: right;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

body.app-body.sidebar-collapsed .sidebar .side-nav a .nav-text {
    display: none !important;
}

@media (max-width: 760px) {
    body.app-body .sidebar .side-nav a .nav-text {
        display: block !important;
    }
}

/* Stable dashboard filter layout: prevent search controls from overlapping. */
body.app-body .filters.filters-grid{display:grid;grid-template-columns:minmax(280px,2fr) repeat(2,minmax(150px,1fr)) repeat(2,minmax(110px,auto));gap:12px;align-items:stretch;width:100%;}
body.app-body .filters.filters-grid>*{min-width:0;width:100%;}
body.app-body .filters.filters-grid .searchbox{min-width:0;overflow:hidden;}
body.app-body .filters.filters-grid .searchbox input{min-width:0;width:100%;}
@media(max-width:900px){body.app-body .filters.filters-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){body.app-body .filters.filters-grid{grid-template-columns:minmax(0,1fr);}}

/* Document review and preview gallery */
.document-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0 22px}
.document-card{min-width:0;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--surface,rgba(255,255,255,.72))}
.document-card h3{margin:0 0 12px;font-size:15px}
.document-preview{display:block;width:100%;height:230px;object-fit:contain;background:#f1f4f8;border:1px solid var(--line);border-radius:10px;margin-bottom:12px}
.document-pdf{display:block;width:100%;height:300px;border:1px solid var(--line);border-radius:10px;margin-bottom:12px;background:#f1f4f8}
.review-all-form{gap:12px}
.review-all-form .doc-review{border:1px solid var(--line);border-radius:12px;padding:14px;display:grid;grid-template-columns:minmax(130px,.6fr) minmax(150px,.7fr) minmax(220px,1.7fr);gap:12px;align-items:center}
.review-all-form .doc-review label{margin:0;min-width:0}
.review-all-form .doc-review input,.review-all-form .doc-review select{width:100%;min-width:0}
@media(max-width:760px){.document-gallery{grid-template-columns:minmax(0,1fr)}.review-all-form .doc-review{grid-template-columns:minmax(0,1fr)}}

/* Dashboard search layout - stable RTL grid */
body.app-body .filters.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    direction: rtl;
}

body.app-body .filters.filters-grid > * {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

body.app-body .filters.filters-grid .searchbox {
    grid-column: 1 / -1;
    min-width: 0;
    display: flex;
}

body.app-body .filters.filters-grid .searchbox input {
    min-width: 0;
    width: 100%;
}

body.app-body .filters.filters-grid > button,
body.app-body .filters.filters-grid > a {
    min-height: 44px;
    margin: 0;
}

@media (max-width: 900px) {
    body.app-body .filters.filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.app-body .filters.filters-grid .searchbox {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    body.app-body .filters.filters-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.app-body .filters.filters-grid .searchbox {
        grid-column: 1;
    }
}


/* Final fix: prevent nested borders in dashboard search controls */
body.app-body .filters.filters-grid .searchbox {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 13px !important;
    min-height: 46px !important;
    box-sizing: border-box !important;
}

body.app-body .filters.filters-grid .searchbox input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

body.app-body .filters.filters-grid select {
    min-width: 0 !important;
    height: 46px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}



/* Dashboard: dedicated responsive layout for nine independent search fields. */
body.app-body .dashboard-search-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    width: 100%;
}
body.app-body .dashboard-search-grid > * {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
}
body.app-body .dashboard-search-grid .searchbox {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0 !important;
    padding: 9px 11px;
    overflow: hidden;
}
body.app-body .dashboard-search-grid .searchbox span {
    color: #71819a;
    font-size: 11px;
    font-weight: 700;
}
body.app-body .dashboard-search-grid .searchbox input {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    height: 38px;
    padding: 7px 9px !important;
}
body.app-body .dashboard-search-grid select,
body.app-body .dashboard-search-grid button,
body.app-body .dashboard-search-grid > a {
    box-sizing: border-box;
    min-width: 0 !important;
    min-height: 46px;
    margin: 0;
}
@media (max-width: 900px) {
    body.app-body .dashboard-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    body.app-body .dashboard-search-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* LibraryBot dashboard search - final compact UI override */
body.app-body form.filters.filters-grid.dashboard-search-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 13px !important;
    align-items: end !important;
    direction: rtl !important;
    width: 100% !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > label.searchbox {
    grid-column: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 76px !important;
    padding: 8px 11px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--line) !important;
    border-radius: 11px !important;
    background: var(--surface) !important;
    overflow: hidden !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > label.searchbox > span {
    display: block !important;
    width: 100% !important;
    color: var(--muted, #71819a) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-align: right !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > label.searchbox > input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 6px 9px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--line) !important;
    border-radius: 7px !important;
    background: var(--surface, #fff) !important;
    color: var(--text, #26364d) !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    outline: none !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > label.searchbox > input:focus {
    border-color: #6689ed !important;
    box-shadow: 0 0 0 2px rgba(75, 110, 220, .12) !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > select {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 7px 10px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    box-sizing: border-box !important;
}

body.app-body form.filters.filters-grid.dashboard-search-grid > button,
body.app-body form.filters.filters-grid.dashboard-search-grid > a {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 8px 12px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    box-sizing: border-box !important;
}

@media (max-width: 900px) {
    body.app-body form.filters.filters-grid.dashboard-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    body.app-body form.filters.filters-grid.dashboard-search-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }
}
