/* ============================================================
   efodia — UI stylesheet
   ============================================================ */
:root{
  --navy:#0f1f3d; --navy-2:#16294d; --ink:#1d2433; --muted:#6b7689;
  --line:#e6e9f0; --bg:#f4f6fb; --card:#ffffff;
  --brand:#1f6feb; --brand-dk:#1559c0; --accent:#0fae8e; --gold:#c79a2a;
  --green:#15a05a; --amber:#c98a00; --red:#d4453a; --blue:#1f6feb; --slate:#64748b;
  --radius:14px; --shadow:0 1px 2px rgba(16,28,55,.06),0 8px 24px rgba(16,28,55,.06);
  --shadow-lg:0 12px 40px rgba(16,28,55,.16);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);background:var(--bg);font-size:14.5px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{margin:0;font-weight:650;letter-spacing:-.01em}

/* Layout shell */
.app{display:flex;min-height:100vh}
.sidebar{width:256px;flex:0 0 256px;background:linear-gradient(180deg,var(--navy),var(--navy-2));
  color:#cdd6e8;position:sticky;top:0;height:100vh;overflow-y:auto;padding:18px 14px}
.main{flex:1;min-width:0;display:flex;flex-direction:column}

/* Brand */
.brand{display:flex;align-items:center;gap:11px;padding:8px 8px 18px}
.brand-mark{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,var(--brand),var(--accent));
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:20px;box-shadow:0 6px 16px rgba(31,111,235,.4)}
.brand-text{display:flex;flex-direction:column;line-height:1.15}
.brand-text strong{color:#fff;font-size:18px;letter-spacing:.2px}
.brand-text span{font-size:11px;color:#8da0c4}

/* Nav */
.nav{display:flex;flex-direction:column;gap:2px}
.nav-group{font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:#7184ab;margin:16px 10px 6px;font-weight:600}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:9px;color:#c3cde2;font-weight:500;transition:.15s}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff;text-decoration:none}
.nav-item.active{background:rgba(31,111,235,.20);color:#fff;box-shadow:inset 3px 0 0 var(--brand)}
.ni-icon{width:18px;height:18px;display:grid;place-items:center;opacity:.9}
.ni-icon svg{width:18px;height:18px}

/* Topbar */
.topbar{display:flex;align-items:center;gap:14px;padding:14px 26px;background:var(--card);
  border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.page-title{font-size:19px;font-weight:650;flex:1}
.topbar-right{display:flex;align-items:center;gap:14px}
.user-chip{display:flex;align-items:center;gap:9px}
.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--brand),var(--accent));
  color:#fff;display:grid;place-items:center;font-weight:700}
.user-meta{display:flex;flex-direction:column;line-height:1.2}
.user-meta strong{font-size:13px}
.user-meta span{font-size:11px;color:var(--muted)}
.hamburger{display:none;background:none;border:none;cursor:pointer;color:var(--ink);width:26px;height:26px}
.hamburger svg{width:24px;height:24px}

.content{padding:26px;max-width:1240px;width:100%}
.appfoot{padding:16px 26px;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}

/* Page header row */
.page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.page-head .sub{color:var(--muted);font-size:13px;margin-top:3px}

/* Cards */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-pad{padding:20px}
.card h2,.card h3{margin-bottom:4px}
.card-head{padding:16px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}
.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}

/* Stat cards */
.stat{padding:18px 20px;border-radius:var(--radius);background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow)}
.stat .label{color:var(--muted);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.stat .value{font-size:30px;font-weight:730;margin-top:6px;letter-spacing:-.02em}
.stat .foot{font-size:12px;color:var(--muted);margin-top:4px}
.stat.brand{background:linear-gradient(135deg,var(--navy),var(--navy-2));color:#fff;border:none}
.stat.brand .label{color:#9fb0d4}.stat.brand .foot{color:#9fb0d4}

/* Tables */
.table-wrap{overflow-x:auto}
table.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
table.tbl th{text-align:left;padding:11px 14px;color:var(--muted);font-weight:600;font-size:11.5px;
  text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--line);white-space:nowrap}
table.tbl td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
table.tbl tr:last-child td{border-bottom:none}
table.tbl tbody tr:hover{background:#f8faff}
.tbl-actions{display:flex;gap:8px}

/* Pills */
.pill{display:inline-block;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:600;line-height:1.4}
.pill-green{background:#e3f6ec;color:#0c7a42}
.pill-amber{background:#fbf0d6;color:#946100}
.pill-red{background:#fbe3e1;color:#a3271e}
.pill-blue{background:#e2edfd;color:#1456b8}
.pill-slate{background:#eef1f6;color:#475467}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:9px;font-weight:600;
  font-size:13.5px;cursor:pointer;border:1px solid transparent;transition:.15s;white-space:nowrap}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-dk)}
.btn-ghost{background:#fff;color:var(--ink);border-color:var(--line)}
.btn-ghost:hover{background:#f5f7fb}
.btn-danger{background:#fff;color:var(--red);border-color:#f3c9c5}
.btn-danger:hover{background:#fdeceb}
.btn-sm{padding:6px 12px;font-size:12.5px}
.btn svg{width:16px;height:16px}

/* Forms */
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px 20px}
.form-grid .full{grid-column:1/-1}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12.5px;font-weight:600;color:#3b4453}
.field .hint{font-size:11.5px;color:var(--muted)}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=number],select,textarea{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:9px;font:inherit;color:var(--ink);background:#fff;transition:.15s}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(31,111,235,.14)}
textarea{resize:vertical;min-height:90px}
.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.checkline{display:flex;align-items:center;gap:8px;font-size:13px}
.checkline input{width:auto}

/* Alerts */
.alert{padding:12px 16px;border-radius:10px;margin-bottom:16px;font-size:13.5px;font-weight:500}
.alert-success{background:#e6f7ee;color:#0c7a42;border:1px solid #b8e6cd}
.alert-amber{background:#fcf3da;color:#8a5b00;border:1px solid #f0dca6}
.alert-red,.alert-error{background:#fdeceb;color:#a3271e;border:1px solid #f3c9c5}
.alert-info{background:#e9f1fd;color:#1456b8;border:1px solid #c5dbfa}

/* Empty state */
.empty{text-align:center;padding:48px 20px;color:var(--muted)}
.empty svg{width:42px;height:42px;opacity:.4;margin-bottom:10px}

/* Misc */
.muted{color:var(--muted)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.right{text-align:right}.center{text-align:center}
.row-gap{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.badge-soft{background:#eef2fb;color:#33507f;padding:2px 8px;border-radius:6px;font-size:12px;font-weight:600}
.divider{height:1px;background:var(--line);margin:18px 0}
.kvs{display:grid;grid-template-columns:160px 1fr;gap:10px 16px;font-size:13.5px}
.kvs dt{color:var(--muted);font-weight:600}
.kvs dd{margin:0}
.tabbar{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:20px;flex-wrap:wrap}
.tab{padding:10px 16px;font-weight:600;color:var(--muted);border-bottom:2px solid transparent;cursor:pointer}
.tab.active{color:var(--brand);border-bottom-color:var(--brand)}
.doc-preview{background:#fff;border:1px solid var(--line);border-radius:10px;padding:34px 40px;font-size:14px;line-height:1.7;white-space:pre-wrap}
.search-box{position:relative;min-width:240px}
.search-box input{padding-left:36px}
.search-box svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--muted)}

/* Login */
.auth-wrap{min-height:100vh;display:grid;place-items:center;
  background:radial-gradient(1200px 500px at 50% -10%,#1b3460,transparent),linear-gradient(135deg,#0f1f3d,#16294d)}
.auth-card{width:380px;max-width:92vw;background:#fff;border-radius:18px;box-shadow:var(--shadow-lg);padding:34px 32px}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.auth-brand .brand-mark{width:44px;height:44px;font-size:23px}
.auth-card h2{font-size:21px;margin-bottom:4px}
.auth-card .sub{color:var(--muted);font-size:13px;margin-bottom:22px}
.auth-card .btn-primary{width:100%;justify-content:center;margin-top:6px;padding:11px}
.auth-foot{margin-top:18px;text-align:center;font-size:12px;color:var(--muted)}

/* Responsive */
@media(max-width:1080px){.grid-4{grid-template-columns:repeat(2,1fr)}.grid-3{grid-template-columns:1fr 1fr}}
@media(max-width:860px){
  .sidebar{position:fixed;left:-280px;z-index:60;transition:.25s;box-shadow:var(--shadow-lg)}
  .sidebar.open{left:0}
  .hamburger{display:block}
  .grid-2,.grid-3,.grid-4,.form-grid{grid-template-columns:1fr}
  .content{padding:18px}
}
