:root {
  --primary: #111f3e;
  --secondary: #1a2e5a;
  --accent: #c9a84c;
  --accent-light: #e8c96e;
  --neutral: #f0f3f9;
  --ink: #18223a;
  --muted: #64708c;
  --line: #dde3ef;
  --card: #ffffff;
  --ok: #2e7d4f;
  --warn: #b7861f;
  --danger: #b4472f;
  --decline: #7a1f2b;
  --violet: #5a4a9e;
  --radius: clamp(10px, 1vw, 14px);
  --gap: clamp(10px, 1.4vw, 18px);
  --fs-xxs: clamp(0.62rem, 0.58rem + 0.12vw, 0.68rem);
  --fs-xs: clamp(0.68rem, 0.64rem + 0.14vw, 0.74rem);
  --fs-sm: clamp(0.74rem, 0.7rem + 0.15vw, 0.81rem);
  --fs-md: clamp(0.8rem, 0.76rem + 0.18vw, 0.88rem);
  --fs-lg: clamp(0.95rem, 0.86rem + 0.35vw, 1.12rem);
  --fs-xl: clamp(1.15rem, 0.98rem + 0.7vw, 1.55rem);
  --fs-hero: clamp(1.35rem, 0.95rem + 1.9vw, 2.6rem);
  --shadow: 0 10px 30px -14px rgba(17, 31, 62, .28);
  --shadow-lg: 0 24px 60px -24px rgba(17, 31, 62, .45);
  --nav-h: clamp(52px, 4.6vw, 62px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--neutral);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--accent); }
.min-w-0 { min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.text-muted-2 { color: var(--muted) !important; }
.fs-xxs { font-size: var(--fs-xxs) !important; }
.fs-xs { font-size: var(--fs-xs) !important; }
.fs-sm { font-size: var(--fs-sm) !important; }
.fs-md { font-size: var(--fs-md) !important; }
.fs-lg { font-size: var(--fs-lg) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
.text-gold { color: var(--accent) !important; }
.text-navy { color: var(--primary) !important; }
.bg-navy { background: var(--primary) !important; }
.eyebrow { font-size: var(--fs-xxs); letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--accent); }

.topbar {
  position: sticky; top: 0; z-index: 1040;
  height: var(--nav-h);
  background: linear-gradient(90deg, var(--primary), #14254a 60%, var(--secondary));
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 6px 22px -12px rgba(0,0,0,.6);
}
.topbar .inner { height: 100%; display: flex; align-items: center; gap: clamp(8px, 1.2vw, 18px); padding: 0 clamp(12px, 2vw, 28px); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; flex-shrink: 1; }
.brand:hover { color: #fff; }
.brand-mark {
  width: clamp(30px, 2.6vw, 36px); height: clamp(30px, 2.6vw, 36px); border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--primary);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
  font-size: clamp(.95rem, .8rem + .5vw, 1.15rem);
}
.brand-text { min-width: 0; line-height: 1.1; }
.brand-text b { display: block; font-size: var(--fs-md); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; color: var(--accent-light); font-size: var(--fs-xxs); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mainnav { display: none; align-items: center; gap: 2px; margin-left: auto; flex-wrap: nowrap; min-width: 0; }
.mainnav > .nav-item { position: relative; }
.mainnav .nav-link {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  color: #d8def0; font-size: var(--fs-sm); font-weight: 500; padding: 8px clamp(7px, .8vw, 12px); border-radius: 8px;
  transition: color .2s, background .2s;
}
.mainnav .nav-link:hover, .mainnav .nav-link.show { color: var(--accent-light); background: rgba(255,255,255,.06); }
.mainnav .nav-link.active { color: var(--primary); background: linear-gradient(135deg, var(--accent-light), var(--accent)); font-weight: 600; }
.mainnav .dropdown-menu, .tb-actions .dropdown-menu {
  border: 1px solid rgba(201,168,76,.35); border-radius: 12px; padding: 6px; background: var(--primary);
  box-shadow: var(--shadow-lg); min-width: 230px; margin-top: 10px !important;
}
.mainnav .dropdown-item, .tb-actions .dropdown-item { color: #dfe5f4; font-size: var(--fs-sm); border-radius: 8px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
.mainnav .dropdown-item i, .tb-actions .dropdown-item i { color: var(--accent); }
.mainnav .dropdown-item:hover, .mainnav .dropdown-item.active, .tb-actions .dropdown-item:hover { background: rgba(201,168,76,.16); color: #fff; }
.tb-actions { display: flex; align-items: center; gap: clamp(6px, .8vw, 12px); margin-left: auto; flex-shrink: 0; }
.mainnav + .tb-actions { margin-left: clamp(6px, 1vw, 14px); }
.tb-icon {
  position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: #e6ebf7; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: .2s;
}
.tb-icon:hover { color: var(--primary); background: var(--accent-light); }
.tb-icon .dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--primary); }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); background: var(--secondary); color: var(--accent-light); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: 0 0 auto; }
.avatar-lg { width: clamp(72px, 7vw, 96px); height: clamp(72px, 7vw, 96px); font-size: 1.6rem; border-width: 3px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: #fff; cursor: pointer; padding: 3px 6px 3px 3px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); max-width: 220px; min-width: 0; }
.user-chip .meta { line-height: 1.1; min-width: 0; display: none; }
.user-chip .meta b { display: block; font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta small { display: block; font-size: var(--fs-xxs); color: var(--accent-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: grid; }
.status-pill { display: none; align-items: center; gap: 6px; font-size: var(--fs-xxs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #bfe8cf; background: rgba(46,125,79,.18); border: 1px solid rgba(110,210,150,.35); padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #45d483; box-shadow: 0 0 0 0 rgba(69,212,131,.7); animation: pulse 1.8s infinite; flex: 0 0 auto; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(69,212,131,.7);} 70% { box-shadow: 0 0 0 8px rgba(69,212,131,0);} 100% { box-shadow: 0 0 0 0 rgba(69,212,131,0);} }

@media (min-width: 1200px) {
  .mainnav { display: flex; }
  .burger { display: none; }
  .user-chip .meta { display: block; }
}
@media (min-width: 1400px) { .status-pill { display: inline-flex; } }

.notif-menu { width: min(360px, 92vw); max-height: 70vh; overflow: auto; }
.notif-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #dfe5f4; font-size: var(--fs-xs); }
.notif-item:hover { background: rgba(201,168,76,.12); color: #fff; }
.notif-item .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(201,168,76,.15); color: var(--accent-light); }
.notif-item.unread { background: rgba(255,255,255,.04); }

.aside-backdrop { position: fixed; inset: 0; background: rgba(8,14,30,.55); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s; z-index: 1060; }
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 310px); z-index: 1070;
  background: linear-gradient(180deg, var(--primary), #0c1730);
  border-right: 2px solid var(--accent);
  transform: translateX(-105%); transition: transform .42s cubic-bezier(.77,0,.18,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
body.aside-open .side-menu { transform: translateX(0); }
body.aside-open .aside-backdrop { opacity: 1; visibility: visible; }
body.aside-open { overflow: hidden; }
.side-head { padding: 16px; border-bottom: 1px solid rgba(201,168,76,.25); display: flex; align-items: center; gap: 10px; }
.side-user { padding: 14px 16px; display: flex; gap: 10px; align-items: center; color: #fff; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.06); }
.side-body { flex: 1; overflow-y: auto; padding: 10px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #d8def0; font-size: var(--fs-sm); font-weight: 500;
  width: 100%; background: none; border: 0; text-align: left; transition: .2s; opacity: 0; transform: translateX(-14px);
}
body.aside-open .side-link { opacity: 1; transform: none; transition: opacity .35s ease, transform .35s ease, background .2s, color .2s; }
.side-link i.lead { color: var(--accent); font-size: 1rem; width: 18px; text-align: center; }
.side-link:hover { background: rgba(201,168,76,.12); color: #fff; }
.side-link.active { background: linear-gradient(135deg, var(--accent-light), var(--accent)); color: var(--primary); font-weight: 600; }
.side-link.active i.lead { color: var(--primary); }
.side-link .chev { margin-left: auto; transition: transform .3s; font-size: .75rem; }
.side-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.side-sub { margin: 2px 0 6px 22px; padding-left: 10px; border-left: 1px dashed rgba(201,168,76,.4); }
.side-sub .side-link { font-size: var(--fs-xs); padding: 8px 10px; }
.side-sub .side-link.active { background: rgba(201,168,76,.18); color: var(--accent-light); }
.side-sub .side-link.active i.lead { color: var(--accent-light); }
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(201,168,76,.25); font-size: var(--fs-xxs); color: #9aa6c4; }

.page { padding: clamp(12px, 2vw, 26px) clamp(12px, 2.2vw, 30px) clamp(20px, 3vw, 36px); max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); }
.page-head h1 { font-size: var(--fs-xl); font-weight: 700; color: var(--primary); margin: 2px 0 0; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.crumbs { font-size: var(--fs-xxs); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.cardx { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.cardx .hd { display: flex; align-items: center; gap: 10px; padding: clamp(10px, 1.1vw, 14px) clamp(12px, 1.3vw, 18px); border-bottom: 1px solid var(--line); min-width: 0; }
.cardx .hd h2, .cardx .hd h3 { font-size: var(--fs-md); font-weight: 700; margin: 0; color: var(--primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardx .hd .ic { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: rgba(201,168,76,.14); color: var(--accent); }
.cardx .bd { padding: clamp(10px, 1.2vw, 16px) clamp(12px, 1.3vw, 18px); min-width: 0; }
.cardx.navy { background: linear-gradient(150deg, var(--primary), var(--secondary)); color: #e6ebf7; border-color: rgba(201,168,76,.3); }
.cardx.navy .hd { border-color: rgba(201,168,76,.25); }
.cardx.navy .hd h2, .cardx.navy .hd h3 { color: #fff; }
.explain { font-size: var(--fs-xs); color: var(--muted); background: var(--neutral); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 8px 10px; margin-top: 10px; }

.kpi { position: relative; overflow: hidden; padding: clamp(10px, 1.1vw, 14px) clamp(12px, 1.2vw, 16px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; height: 100%; }
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--accent-light), var(--accent)); }
.kpi .lbl { font-size: var(--fs-xxs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: clamp(1.05rem, .9rem + .8vw, 1.55rem); font-weight: 700; color: var(--primary); line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: var(--fs-xxs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .ico { position: absolute; right: 10px; top: 10px; font-size: 1.15rem; color: rgba(201,168,76,.55); }

.btn { font-size: var(--fs-sm); border-radius: 9px; font-weight: 600; padding: .45rem .85rem; display: inline-flex; align-items: center; gap: 7px; justify-content: center; white-space: nowrap; }
.btn-sm { font-size: var(--fs-xs); padding: .32rem .6rem; border-radius: 8px; }
.btn-gold { background: linear-gradient(135deg, var(--accent-light), var(--accent)); color: var(--primary); border: 0; box-shadow: 0 6px 16px -8px rgba(201,168,76,.9); }
.btn-gold:hover, .btn-gold:focus { background: var(--accent-light); color: var(--primary); transform: translateY(-1px); }
.btn-navy { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn-navy:hover, .btn-navy:focus { background: var(--secondary); color: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--primary); background: rgba(201,168,76,.08); }
.btn-glass { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.btn-glass:hover { background: var(--accent-light); color: var(--primary); border-color: var(--accent-light); }
.btn-danger-soft { background: rgba(180,71,47,.1); color: var(--danger); border: 1px solid rgba(180,71,47,.3); }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }
.btn-ok-soft { background: rgba(46,125,79,.1); color: var(--ok); border: 1px solid rgba(46,125,79,.3); }
.btn-ok-soft:hover { background: var(--ok); color: #fff; }

.badge-x { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xxs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; white-space: nowrap; border: 1px solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.b-ok { background: rgba(46,125,79,.12); color: var(--ok); border-color: rgba(46,125,79,.3); }
.b-warn { background: rgba(183,134,31,.12); color: #8d6512; border-color: rgba(183,134,31,.35); }
.b-danger { background: rgba(180,71,47,.12); color: var(--danger); border-color: rgba(180,71,47,.3); }
.b-decline { background: rgba(122,31,43,.12); color: var(--decline); border-color: rgba(122,31,43,.3); }
.b-violet { background: rgba(90,74,158,.12); color: var(--violet); border-color: rgba(90,74,158,.3); }
.b-navy { background: rgba(17,31,62,.08); color: var(--primary); border-color: rgba(17,31,62,.2); }
.b-gold { background: rgba(201,168,76,.15); color: #8a6b1c; border-color: rgba(201,168,76,.45); }
.b-live { background: rgba(69,212,131,.14); color: #bff2d4; border-color: rgba(69,212,131,.4); }
.b-glass { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(4px); }

.tbl-wrap { overflow-x: auto; border-radius: 10px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-xs); table-layout: fixed; }
.tbl th { background: var(--primary); color: #fff; font-weight: 600; font-size: var(--fs-xxs); letter-spacing: .07em; text-transform: uppercase; padding: 9px 10px; border-bottom: 2px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; top: 0; z-index: 1; }
.tbl th:first-child { border-top-left-radius: 10px; }
.tbl th:last-child { border-top-right-radius: 10px; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:nth-child(even) td { background: #f8fafd; }
.tbl tbody tr:hover td { background: rgba(201,168,76,.09); }
.tbl.flash tbody tr.new td { animation: flashrow 2.2s ease; }
@keyframes flashrow { 0% { background: rgba(232,201,110,.55); } 100% { background: transparent; } }
.tbl-dark th { background: #0c1730; }
.tbl-dark td { color: #dfe5f4; border-color: rgba(255,255,255,.07); }
.tbl-dark tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.tbl-dark tbody tr:hover td { background: rgba(201,168,76,.1); }

.form-label { font-size: var(--fs-xs); font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.form-control, .form-select { font-size: var(--fs-sm); border-radius: 9px; border-color: var(--line); padding: .45rem .7rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(201,168,76,.2); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.input-group-text { font-size: var(--fs-sm); background: var(--neutral); border-color: var(--line); color: var(--secondary); }
.form-text { font-size: var(--fs-xxs); }

.modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { background: linear-gradient(120deg, var(--primary), var(--secondary)); color: #fff; border-bottom: 2px solid var(--accent); padding: 12px 18px; }
.modal-header .modal-title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal-header .modal-title i { color: var(--accent-light); }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .8; }
.modal-body { font-size: var(--fs-sm); }
.modal-footer { background: var(--neutral); border-top: 1px solid var(--line); padding: 10px 16px; }
.modal-backdrop.show { opacity: .62; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.98); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.modal.show .modal-dialog { transform: none; }
.sys-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; flex: 0 0 auto; }
.sys-icon.success { background: rgba(46,125,79,.12); color: var(--ok); }
.sys-icon.error { background: rgba(180,71,47,.12); color: var(--danger); }
.sys-icon.warning { background: rgba(183,134,31,.14); color: var(--warn); }
.sys-icon.info { background: rgba(26,46,90,.1); color: var(--secondary); }

.loader {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  background: rgba(10,18,38,.58); backdrop-filter: blur(7px) saturate(.8); -webkit-backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.loader.show { opacity: 1; visibility: visible; }
.loader-box { text-align: center; color: #fff; padding: 22px 26px; border-radius: 18px; background: rgba(17,31,62,.72); border: 1px solid rgba(201,168,76,.4); box-shadow: var(--shadow-lg); width: min(380px, 88vw); }
.spinner-gold { width: 64px; height: 64px; margin: 0 auto 14px; position: relative; }
.spinner-gold::before, .spinner-gold::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; }
.spinner-gold::before { border-top-color: var(--accent); border-right-color: var(--accent); animation: spin 1s linear infinite; }
.spinner-gold::after { inset: 10px; border-bottom-color: var(--accent-light); border-left-color: var(--accent-light); animation: spin 1.4s linear infinite reverse; }
.spinner-gold i { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-light); font-size: 1.15rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-msg { font-size: var(--fs-sm); font-weight: 600; }
.loader-sub { font-size: var(--fs-xxs); color: var(--accent-light); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; min-height: 1.2em; }
.loader-bar { height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.loader-bar span { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); animation: slidebar 1.3s ease-in-out infinite; }
@keyframes slidebar { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.fade-up { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.fade-up.in { opacity: 1; transform: none; }
.d1 { transition-delay: .06s; } .d2 { transition-delay: .12s; } .d3 { transition-delay: .18s; } .d4 { transition-delay: .24s; } .d5 { transition-delay: .3s; } .d6 { transition-delay: .36s; }

.hero {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); min-height: clamp(300px, 34vw, 430px);
  background: var(--primary); color: #fff; box-shadow: var(--shadow-lg); isolation: isolate; border: 1px solid rgba(201,168,76,.35);
}
.hero-slides { position: absolute; inset: 0; z-index: -2; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.12) translateX(3%); transition: opacity 1.6s ease, transform 10.5s linear; }
.hero-slide.on { opacity: 1; transform: scale(1.02) translateX(0); }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(10,18,38,.93) 0%, rgba(17,31,62,.82) 42%, rgba(17,31,62,.45) 100%), radial-gradient(circle at 85% 20%, rgba(201,168,76,.18), transparent 45%); }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-light), transparent); }
.hero-inner { position: relative; z-index: 2; padding: clamp(18px, 3vw, 40px); display: grid; gap: clamp(14px, 2vw, 26px); grid-template-columns: 1fr; height: 100%; }
@media (min-width: 992px) { .hero-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; } }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; line-height: 1.12; margin: 6px 0 10px; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.55), 0 1px 0 rgba(0,0,0,.4); }
.hero h1 .gold { color: var(--accent-light); }
.hero-rotator { min-height: 2.8em; font-size: clamp(.86rem, .76rem + .45vw, 1.08rem); color: #f4f6fb; font-weight: 500; text-shadow: 0 1px 10px rgba(0,0,0,.7); display: flex; align-items: flex-start; gap: 8px; }
.hero-rotator i { color: var(--accent-light); margin-top: 2px; }
.hero-rotator .ch { display: inline-block; opacity: 0; transform: translateY(8px) rotateX(70deg); animation: draw .45s forwards; white-space: pre; }
@keyframes draw { to { opacity: 1; transform: none; } }
.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-panel { background: rgba(10,18,38,.55); border: 1px solid rgba(201,168,76,.35); border-radius: 14px; padding: clamp(12px, 1.4vw, 18px); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-width: 0; }
.hero-panel .row-x { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.12); font-size: var(--fs-xs); min-width: 0; }
.hero-panel .row-x:last-child { border-bottom: 0; }
.hero-panel .row-x span:first-child { color: #b9c3dc; white-space: nowrap; }
.hero-panel .row-x b { color: #fff; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-clock { font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); font-weight: 800; color: var(--accent-light); letter-spacing: .03em; text-shadow: 0 2px 14px rgba(0,0,0,.5); line-height: 1; }
.hero-dots { position: absolute; right: clamp(14px, 2vw, 26px); bottom: 14px; display: flex; gap: 6px; z-index: 3; }
.hero-dots span { width: 22px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); transition: .4s; }
.hero-dots span.on { background: var(--accent-light); width: 36px; }
.spin-word { display: inline-block; animation: spinword .8s ease; }
@keyframes spinword { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.section-title { display: flex; align-items: center; gap: 10px; margin: clamp(18px, 2.4vw, 30px) 0 clamp(10px, 1.2vw, 14px); }
.section-title h2 { font-size: var(--fs-lg); font-weight: 700; color: var(--primary); margin: 0; white-space: nowrap; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.section-title .num { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--accent-light); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; flex: 0 0 auto; }

.chart-box { position: relative; height: clamp(200px, 22vw, 270px); }
.chart-box.sm { height: clamp(180px, 18vw, 230px); }

.terminal { background: #0a1226; border-radius: 10px; border: 1px solid rgba(201,168,76,.25); color: #cfd8ee; font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: var(--fs-xxs); padding: 10px; height: clamp(220px, 26vw, 300px); overflow-y: auto; line-height: 1.6; }
.terminal.tall { height: 58vh; }
.terminal .ln { display: flex; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: lnin .5s ease; }
.terminal .ln .t { color: #7c8bb0; flex: 0 0 auto; }
.terminal .ln .s { color: var(--accent-light); flex: 0 0 auto; text-transform: uppercase; }
.terminal .ln .m { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.terminal .ln.OK .m, .terminal .ln.SUCCESS .m { color: #a8e6c1; }
.terminal .ln.WARN .m { color: #f3d48a; }
.terminal .ln.ERROR .m { color: #f3a08f; }
@keyframes lnin { from { opacity: 0; transform: translateX(-8px); background: rgba(201,168,76,.18); } to { opacity: 1; transform: none; background: transparent; } }

.log-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); min-width: 0; animation: lnin .5s ease; }
.log-item:last-child { border-bottom: 0; }
.log-item .lv { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; font-size: .85rem; }
.lv.INFO { background: rgba(26,46,90,.1); color: var(--secondary); }
.lv.SUCCESS { background: rgba(46,125,79,.12); color: var(--ok); }
.lv.WARN { background: rgba(183,134,31,.14); color: var(--warn); }
.lv.ERROR { background: rgba(180,71,47,.12); color: var(--danger); }
.log-item .tx { min-width: 0; flex: 1; }
.log-item .tx b { display: block; font-size: var(--fs-xs); color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-item .tx small { display: block; font-size: var(--fs-xxs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.feature { height: 100%; padding: clamp(12px, 1.3vw, 16px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s, border-color .3s; min-width: 0; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.feature .fi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--accent-light); font-size: 1.05rem; margin-bottom: 9px; }
.feature h4 { font-size: var(--fs-md); font-weight: 700; color: var(--primary); margin: 0 0 4px; }
.feature p { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.step { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: 0; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--primary); font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; font-size: var(--fs-xs); }
.step b { font-size: var(--fs-sm); color: var(--primary); display: block; }
.step p { font-size: var(--fs-xs); color: var(--muted); margin: 0; }

.aim-quote { font-size: clamp(.9rem, .82rem + .35vw, 1.05rem); font-weight: 600; color: var(--primary); border-left: 4px solid var(--accent); background: var(--neutral); padding: 14px 16px; border-radius: 0 12px 12px 0; line-height: 1.55; }
.met-card { border: 1px solid rgba(46,125,79,.3); background: linear-gradient(180deg, rgba(46,125,79,.06), #fff); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.met-card h6 { font-size: var(--fs-sm); font-weight: 700; color: var(--ok); display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
.met-card ul { margin: 0; padding-left: 18px; font-size: var(--fs-xs); color: #2f3a52; }
.met-card li { margin-bottom: 3px; }
.obj { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: #fff; }
.obj .on { font-size: var(--fs-xxs); font-weight: 700; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.obj p.stmt { font-weight: 600; color: var(--primary); margin: 4px 0 0; font-size: var(--fs-md); }

.ai-card { border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 12px 14px; height: 100%; min-width: 0; }
.ai-card .k { font-size: var(--fs-xxs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.ai-card .v { font-size: clamp(1rem, .9rem + .5vw, 1.35rem); font-weight: 800; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-card .f { font-size: var(--fs-xxs); color: var(--secondary); font-family: 'JetBrains Mono', Consolas, monospace; background: var(--neutral); border-radius: 6px; padding: 3px 6px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); margin-bottom: 10px; animation: lnin .6s ease; }
.insight .av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--accent-light); }
.insight p { margin: 0; font-size: var(--fs-sm); color: #26324d; }
.insight .ts { font-size: var(--fs-xxs); color: var(--muted); margin-top: 3px; }
.insight.tone-warn { border-left: 3px solid var(--warn); }
.insight.tone-ok { border-left: 3px solid var(--ok); }
.insight.tone-danger { border-left: 3px solid var(--danger); }
.insight.tone-info { border-left: 3px solid var(--secondary); }
.formula { font-family: 'JetBrains Mono', Consolas, monospace; font-size: var(--fs-xxs); background: #0a1226; color: #e8c96e; border-radius: 10px; padding: 10px 12px; line-height: 1.7; overflow-x: auto; }
.formula .c { color: #8fa0c8; }
.ring { width: 46px; height: 46px; position: relative; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); color: #fff; }

.dropzone { border: 2px dashed rgba(201,168,76,.6); border-radius: 14px; background: linear-gradient(180deg, #fff, var(--neutral)); text-align: center; padding: clamp(16px, 2.4vw, 28px); cursor: pointer; transition: .25s; }
.dropzone:hover, .dropzone.drag { background: rgba(201,168,76,.08); border-color: var(--accent); }
.dropzone i { font-size: 2rem; color: var(--accent); }
.cam-box { position: relative; background: #070d1c; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid rgba(201,168,76,.35); }
.cam-box video, .cam-box img.preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-guide { position: absolute; inset: 12%; border: 2px dashed rgba(232,201,110,.7); border-radius: 18px; pointer-events: none; }
.cam-guide::after { content: 'Align the tobacco leaf inside the frame'; position: absolute; bottom: -26px; left: 0; right: 0; text-align: center; font-size: var(--fs-xxs); color: var(--accent-light); letter-spacing: .06em; }
.cam-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #9aa6c4; padding: 16px; font-size: var(--fs-xs); }
.preview-box { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #070d1c; aspect-ratio: 4 / 3; }
.preview-box img { width: 100%; height: 100%; object-fit: contain; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.meta-grid div { background: var(--neutral); border-radius: 8px; padding: 6px 8px; font-size: var(--fs-xxs); min-width: 0; }
.meta-grid div b { display: block; color: var(--primary); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps-bar { display: flex; gap: 6px; }
.steps-bar .s { flex: 1; padding: 7px 8px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: var(--fs-xxs); font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.steps-bar .s span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps-bar .s.on { border-color: var(--accent); color: var(--primary); background: rgba(201,168,76,.1); }
.steps-bar .s.done { border-color: rgba(46,125,79,.35); color: var(--ok); background: rgba(46,125,79,.06); }

.verdict { border-radius: 14px; padding: 14px 16px; color: #fff; position: relative; overflow: hidden; }
.verdict::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); }
.verdict h3 { font-size: var(--fs-lg); font-weight: 800; margin: 0; letter-spacing: -.01em; }
.verdict p { margin: 4px 0 0; font-size: var(--fs-xs); opacity: .92; }
.v-pest_detected { background: linear-gradient(120deg, #8e3522, var(--danger)); }
.v-healthy { background: linear-gradient(120deg, #1f5a38, var(--ok)); }
.v-low_confidence { background: linear-gradient(120deg, #8a6212, var(--warn)); }
.v-non_plant { background: linear-gradient(120deg, #4f121b, var(--decline)); }
.v-non_tobacco { background: linear-gradient(120deg, #3c3070, var(--violet)); }
.v-disease_suspected { background: linear-gradient(120deg, #7a420c, #a35a12); }
.gauge { position: relative; width: clamp(96px, 9vw, 120px); aspect-ratio: 1; flex: 0 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .gv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.gauge .gv b { font-size: clamp(1rem, .9rem + .5vw, 1.35rem); color: var(--primary); }
.gauge .gv small { display: block; font-size: var(--fs-xxs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pbar { height: 7px; border-radius: 6px; background: var(--neutral); overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--secondary), var(--primary)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.pbar.top span { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.img-tabs .nav-link { font-size: var(--fs-xxs); font-weight: 600; color: var(--muted); padding: 5px 9px; border-radius: 7px; }
.img-tabs .nav-link.active { background: var(--primary); color: var(--accent-light); }
.result-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #070d1c; aspect-ratio: 4 / 3; object-fit: contain; cursor: zoom-in; }
.placeholder-box { border: 2px dashed var(--line); border-radius: 14px; padding: clamp(24px, 4vw, 48px) 16px; text-align: center; color: var(--muted); }
.placeholder-box i { font-size: 2.4rem; color: var(--accent); }
.pdf-frame { width: 100%; height: 76vh; border: 0; border-radius: 10px; background: #525659; }

.pest-card { overflow: hidden; height: 100%; cursor: pointer; transition: transform .3s, box-shadow .3s; }
.pest-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pest-card img { width: 100%; height: clamp(120px, 12vw, 160px); object-fit: cover; display: block; }

.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-size: var(--fs-xs); border: 1px solid var(--line); background: #fff; color: var(--primary); }
.pager .on { background: var(--primary); color: var(--accent-light); border-color: var(--primary); }

.footer { background: var(--primary); color: #b9c3dc; border-top: 3px solid var(--accent); margin-top: clamp(24px, 3vw, 40px); }
.footer .inner { max-width: 1680px; margin: 0 auto; padding: clamp(18px, 2.4vw, 30px) clamp(12px, 2.2vw, 30px); display: grid; gap: 18px; grid-template-columns: 1fr; font-size: var(--fs-xs); }
@media (min-width: 768px) { .footer .inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h5 { color: var(--accent-light); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.footer a { color: #d8def0; }
.footer a:hover { color: var(--accent-light); }
.footer .base { border-top: 1px solid rgba(255,255,255,.08); padding: 10px clamp(12px, 2.2vw, 30px); font-size: var(--fs-xxs); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 1680px; margin: 0 auto; }

.auth-body { min-height: 100vh; background: radial-gradient(circle at 15% 10%, rgba(201,168,76,.18), transparent 35%), linear-gradient(160deg, #0a1226 0%, var(--primary) 45%, var(--secondary) 100%); display: flex; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 40px); }
.auth-card { width: min(1120px, 100%); background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); display: grid; grid-template-columns: 1fr; border: 1px solid rgba(201,168,76,.35); }
@media (min-width: 992px) { .auth-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.auth-side { position: relative; min-height: clamp(260px, 40vw, 640px); color: #fff; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(20px, 3vw, 38px); }
.auth-side::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,18,38,.35) 0%, rgba(10,18,38,.88) 70%, rgba(10,18,38,.96) 100%); }
.auth-side h1 { font-size: clamp(1.2rem, .95rem + 1.2vw, 1.9rem); font-weight: 800; line-height: 1.15; text-shadow: 0 2px 16px rgba(0,0,0,.6); margin: 8px 0 10px; }
.auth-side ul { list-style: none; padding: 0; margin: 14px 0 0; font-size: var(--fs-xs); color: #dfe5f4; }
.auth-side li { display: flex; gap: 8px; margin-bottom: 6px; }
.auth-side li i { color: var(--accent-light); }
.auth-form { padding: clamp(18px, 3vw, 40px); max-height: 100vh; overflow-y: auto; }
.auth-tabs { display: flex; background: var(--neutral); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); transition: .25s; }
.auth-tabs button.on { background: var(--primary); color: var(--accent-light); box-shadow: var(--shadow); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-pick label { border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: var(--fs-xs); transition: .2s; min-width: 0; }
.role-pick input { display: none; }
.role-pick label i { font-size: 1.2rem; color: var(--accent); }
.role-pick input:checked + label { border-color: var(--accent); background: rgba(201,168,76,.1); box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
.sub-title { font-size: var(--fs-xs); font-weight: 700; color: var(--primary); letter-spacing: .08em; text-transform: uppercase; border-left: 3px solid var(--accent); padding-left: 8px; margin: 16px 0 10px; }
.pic-prev { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); background: var(--neutral); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }

@media (max-width: 575.98px) {
  .tbl { table-layout: auto; }
  .tbl td, .tbl th { max-width: 180px; }
  .steps-bar .s span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
