/* ==========================================================================
   ESSORIA PLATFORM — user + admin dashboards, auth
   Extends essoria.css (tokens, buttons, forms, .es-app-* shell, .es-kpi,
   .es-box, .es-tl, .es-mgr). Load after essoria.css.
   ========================================================================== */

:root {
  --blue: #2563A8;
  --blue-50: #EAF1FA;
  --danger: #B42318;
  --danger-50: #FDECEA;
  --info: #24507F;
  --info-50: #EAF1F8;
  --violet: #5B4BA8;
  --violet-50: #F0EEFA;
  --side-w: 256px;
}

/* neutralise template's global button styling (uppercase, orange) — zero specificity so component classes win */
:where(.es-app, .es-authp) button { text-transform: none; background-color: transparent; color: inherit; padding: 0; font-size: inherit; font-weight: inherit; font-family: inherit; letter-spacing: normal; }
:where(.es-app, .es-authp) input[type=search] { -webkit-appearance: none; appearance: none; margin: 0; }

body.es-app { background: var(--paper); min-height: 100vh; }
body.es-app.admin { --side-bg: #050F1D; }
.es-app [hidden] { display: none !important; }

/* ---------- shell ---------- */
.es-app-side { scrollbar-width: thin; scrollbar-color: #1E3A5C transparent; }
.es-app-side .brand { display: flex; align-items: center; gap: 10px; }
.es-app-side .brand a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.es-app-side .brand .nm { font-weight: 700; letter-spacing: .14em; font-size: 15px; color: #fff; line-height: 1.1; }
.es-app-side .brand .nm small { display: block; font-family: var(--mono); font-weight: 400; letter-spacing: .12em; font-size: 9.5px; color: #F3A774; margin-top: 3px; }
body.admin .es-app-side { background: var(--side-bg); }
.es-app-side nav a { text-decoration: none; font-size: 14px; padding: 9px 14px; }
.es-app-side nav a span.l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-app-side .foot a { color: #B9C7D8; display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; text-decoration: none; cursor: pointer; }
.es-app-side .foot a:hover { color: #fff; }
.es-app-side .foot .ver { font-family: var(--mono); font-size: 10.5px; color: #4F6886; margin-top: 6px; }
.es-side-scrim { display: none; }

.es-app-top { gap: 12px; padding: 0 24px; }
.es-app-top .l { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.es-search { position: relative; flex: 1; max-width: 440px; }
.es-search input { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 0 12px 0 36px; font-size: 14px; color: var(--ink); font-family: var(--sans); }
.es-search input:focus { outline: none; border-color: var(--navy-600); background: #fff; box-shadow: 0 0 0 3px rgba(36,80,127,.12); }
.es-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.es-search .res { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 50; max-height: 360px; overflow-y: auto; }
.es-search .res a { display: block; padding: 10px 14px; font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.es-search .res a:hover, .es-search .res a.on { background: var(--paper); }
.es-search .res a small { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.es-search .res .none { padding: 14px; font-size: 13px; color: var(--muted); }
.es-icon-btn { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; text-decoration: none; flex-shrink: 0; }
.es-icon-btn:hover { border-color: var(--navy-600); color: var(--navy-800); }
.es-icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 10.5px; line-height: 18px; text-align: center; }
.es-who { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--radius); cursor: pointer; border: 1px solid transparent; background: none; text-align: left; position: relative; }
.es-who:hover { border-color: var(--line); }
.es-who .av { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-800); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.es-who .t { line-height: 1.25; min-width: 0; }
.es-who .t b { display: block; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.es-who .t span { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.es-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; z-index: 60; padding: 6px 0; }
.es-menu a, .es-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 16px; font-size: 14px; color: var(--ink); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.es-menu a:hover, .es-menu button:hover { background: var(--paper); color: var(--ink); }
.es-menu .hd { padding: 10px 16px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; font-size: 13px; }
.es-menu .hd b { display: block; color: var(--ink); }
.es-menu hr { margin: 6px 0; border-color: var(--line-soft); }

.es-demo-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 24px; }
.es-demo-bar b { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.es-demo-bar button { background: none; border: 0; color: #5F4A1C; font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 12.5px; padding: 0; }
.es-app-content { padding: 24px 28px 64px; max-width: 1480px; }
.es-route-loading { padding: 60px 0; }

/* bottom nav (mobile) */
.es-bottom-nav { display: none; }

@media (max-width: 991px) {
  .es-app-side { width: 280px; }
  .es-side-scrim.open { display: block; position: fixed; inset: 0; background: rgba(6,21,40,.5); z-index: 99; }
  .es-app-top { padding: 0 14px; height: 62px; }
  .es-search { display: none; }
  .es-search.open { display: block; position: absolute; left: 10px; right: 10px; top: 11px; max-width: none; z-index: 30; }
  .es-search-toggle { display: inline-flex !important; }
  .es-who .t { display: none; }
  .es-app-content { padding: 18px 14px 96px; }
  .es-demo-bar { padding: 8px 14px; }
  .es-bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .es-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 0; font-weight: 500; position: relative; }
  .es-bottom-nav a i { font-size: 18px; }
  .es-bottom-nav a.active { color: var(--accent-600); }
  .es-bottom-nav a .dot { position: absolute; top: 0; left: 55%; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 9.5px; line-height: 16px; text-align: center; padding: 0 4px; }
}
.es-search-toggle { display: none !important; }
@media (max-width: 479px) { .es-app-top .hide-xs { display: none !important; } }

/* ---------- page header ---------- */
.es-ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.es-ph .crumbs { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.es-ph .crumbs a { color: var(--muted); text-decoration: none; }
.es-ph .crumbs a:hover { color: var(--accent); }
.es-ph h1 { font-size: 26px; margin: 0; line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.es-ph p { margin: 6px 0 0; color: var(--muted); max-width: 760px; font-size: 14.5px; line-height: 1.55; }
.es-ph .acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 575px) { .es-ph h1 { font-size: 21px; } .es-ph .acts { width: 100%; } .es-ph .acts .flat-button { flex: 1; } }

/* ---------- buttons (compact app variants) ---------- */
.es-app .flat-button.sm { padding: 9px 14px; font-size: 13px; }
.es-app .flat-button.xs { padding: 6px 10px; font-size: 12px; gap: 6px; }
.flat-button.light { background: #fff; color: var(--ink); border-color: var(--line); }
.flat-button.light:hover { border-color: var(--navy-700); color: var(--navy-800); background: #fff; }
.flat-button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.flat-button.danger:hover { background: #8F1C13; border-color: #8F1C13; }
.flat-button.ok { background: var(--ok); border-color: var(--ok); }
.flat-button.ok:hover { background: #155C40; border-color: #155C40; }
.flat-button[disabled], .flat-button.is-disabled { opacity: .5; pointer-events: none; }
.flat-button.loading { pointer-events: none; opacity: .8; }
.flat-button.loading:after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: es-spin .7s linear infinite; }
.es-link { background: none; border: 0; padding: 0; color: var(--navy-700); font-weight: 600; cursor: pointer; font-size: inherit; text-decoration: none; }
.es-link:hover { color: var(--accent); }
@keyframes es-spin { to { transform: rotate(360deg); } }

/* ---------- badges ---------- */
.es-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 20px; white-space: nowrap; background: var(--paper-2); color: var(--body); border: 1px solid transparent; }
.es-badge:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.es-badge.plain:before { display: none; }
.es-badge.ok { background: var(--ok-50); color: var(--ok); }
.es-badge.warn { background: var(--warn-50); color: var(--warn); }
.es-badge.danger { background: var(--danger-50); color: var(--danger); }
.es-badge.info { background: var(--info-50); color: var(--info); }
.es-badge.accent { background: var(--accent-50); color: var(--accent-600); }
.es-badge.violet { background: var(--violet-50); color: var(--violet); }
.es-badge.neutral { background: var(--paper-2); color: var(--muted); }
.es-badge.navy { background: var(--navy-800); color: #fff; }
.es-vbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 8px 4px 6px; border-radius: 3px; border: 1px solid var(--line); background: #fff; color: var(--muted); white-space: nowrap; line-height: 1; }
.es-vbadge i { font-size: 12px; }
.es-vbadge.v { border-color: #A6D8C1; color: var(--ok); background: var(--ok-50); }
.es-vbadge.r { border-color: #EBD49E; color: var(--warn); background: var(--warn-50); }
.es-vbadge.a { border-color: #F2B8B5; color: var(--danger); background: var(--danger-50); }
.es-vbadge .lv { font-family: var(--mono); font-size: 10.5px; background: rgba(0,0,0,.06); padding: 2px 4px; border-radius: 2px; }
.es-tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 3px; background: var(--paper-2); color: var(--navy-700); white-space: nowrap; }
.es-demo-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 3px; background: var(--warn-50); color: #7A5410; border: 1px dashed #E2C47F; white-space: nowrap; font-weight: 500; }

/* ---------- KPI ---------- */
.es-kpis { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
a.es-kpi, .es-kpi { display: block; text-decoration: none; transition: border-color .15s, box-shadow .15s; position: relative; }
a.es-kpi:hover { border-color: var(--navy-600); box-shadow: var(--shadow); }
.es-kpi .ic { width: 34px; height: 34px; border-radius: var(--radius); background: var(--paper); color: var(--navy-700); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.es-kpi .kh { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.es-kpi .kh small { font-size: 13px; color: var(--muted); font-weight: 500; display: block; }
.es-kpi.accent .ic { background: var(--accent-50); color: var(--accent-600); }
.es-kpi.warn .ic { background: var(--warn-50); color: var(--warn); }
.es-kpi.ok .ic { background: var(--ok-50); color: var(--ok); }
.es-kpi.danger .ic { background: var(--danger-50); color: var(--danger); }
.es-kpi b { font-size: 28px; }
.es-kpi b.sm { font-size: 22px; }
@media (max-width: 479px) { .es-kpis { grid-template-columns: 1fr 1fr; } .es-kpi .ic { display: none; } .es-kpi b { font-size: 22px; } }

/* ---------- layout helpers ---------- */
.es-grid { display: grid; gap: 20px; }
.es-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.es-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.es-cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.es-cols-side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1199px) { .es-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .es-cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .es-cols-2, .es-cols-3, .es-cols-side { grid-template-columns: minmax(0, 1fr); } }
.es-app-main, .es-view-root, .es-stack, .es-box { min-width: 0; }
.es-stack > * + * { margin-top: 20px; }
.es-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.es-row.between { justify-content: space-between; }
.es-muted { color: var(--muted); }
.es-small { font-size: 13px; }
.es-nowrap { white-space: nowrap; }
.es-right { text-align: right; }
.es-strong { color: var(--ink); font-weight: 600; }
.es-box { margin-bottom: 0; }
.es-stack > .es-box, .es-box + .es-box { margin-top: 20px; }
.es-box-h h2 { display: flex; align-items: center; gap: 8px; }
.es-box-h .r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.es-box-b.flush { padding: 0; }
.es-box.navy { background: var(--navy-900); border-color: var(--navy-900); color: #B9C7D8; }
.es-box.navy h2, .es-box.navy h3 { color: #fff; }
.es-box.navy .es-box-h { border-color: #1F3D61; }
.es-note { display: block; margin: 0; border: 0; line-height: 1.55; background: var(--paper); border-left: 3px solid var(--navy-600); padding: 12px 16px; font-size: 13.5px; color: var(--body); border-radius: 0 var(--radius) var(--radius) 0; line-height: 1.55; }
.es-note.warn { border-left-color: var(--warn); background: var(--warn-50); color: #5F4A1C; }
.es-note.accent { border-left-color: var(--accent); background: var(--accent-50); color: #6B3410; }
.es-note.danger { border-left-color: var(--danger); background: var(--danger-50); color: #7A1A12; }
.es-note b { color: inherit; }
.es-hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* definition grid */
.es-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line-soft); }
.es-dl > div { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.es-dl dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-bottom: 3px; }
.es-dl dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.es-dl.cols-2 { grid-template-columns: 1fr 1fr; }
.es-dl.cols-1 { grid-template-columns: 1fr; }
.es-dl.cols-1 > div { display: flex; justify-content: space-between; gap: 12px; padding-right: 0; }
.es-dl.cols-1 dd { text-align: right; }

/* ---------- tabs ---------- */
.es-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.es-tabs::-webkit-scrollbar { display: none; }
.es-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; margin-bottom: -1px; font-family: var(--sans); }
.es-tabs button:hover { color: var(--ink); }
.es-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.es-tabs button .ct { font-family: var(--mono); font-size: 11px; background: var(--paper-2); color: var(--muted); border-radius: 10px; padding: 1px 7px; font-weight: 500; }
.es-tabs button.on .ct { background: var(--accent-50); color: var(--accent-600); }
.es-box .es-tabs { padding: 0 12px; margin-bottom: 0; }
.es-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.es-pills button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 500; color: var(--body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.es-pills button.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.es-pills button .ct { font-family: var(--mono); font-size: 10.5px; opacity: .75; }

/* ---------- table toolbar / filters ---------- */
.es-tt { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.es-tt .es-search { max-width: 320px; display: block; position: relative; }
.es-tt .es-search input { background: #fff; }
.es-tt select, .es-filter-sel { height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236E7E93' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; padding: 0 28px 0 10px; font-size: 13.5px; color: var(--ink); -webkit-appearance: none; appearance: none; max-width: 190px; font-family: var(--sans); }
.es-tt select.set { border-color: var(--navy-600); background-color: var(--info-50); }
.es-tt .sp { flex: 1; }
.es-tt .clr { font-size: 13px; }
.es-tt .meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
@media (max-width: 767px) { .es-tt .es-search { max-width: none; flex: 1 1 100%; } .es-tt select { flex: 1 1 calc(50% - 5px); max-width: none; } }

/* ---------- data table ---------- */
.es-dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.es-dt th { background: var(--paper); text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.es-dt th.sort { cursor: pointer; user-select: none; }
.es-dt th.sort:hover { color: var(--ink); }
.es-dt th.sort:after { content: " \2195"; opacity: .35; }
.es-dt th.asc:after { content: " \2191"; opacity: 1; color: var(--accent); }
.es-dt th.desc:after { content: " \2193"; opacity: 1; color: var(--accent); }
.es-dt td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink); line-height: 1.45; }
.es-dt tbody tr:last-child td { border-bottom: 0; }
.es-dt tbody tr.click { cursor: pointer; }
.es-dt tbody tr.click:hover td { background: #FAFBFD; }
.es-dt tbody tr.sel td { background: var(--info-50); }
.es-dt td small { display: block; color: var(--muted); font-size: 12px; }
.es-dt td.mono, .es-dt .mono { font-family: var(--mono); font-size: 12.5px; }
.es-dt td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.es-dt th.num { text-align: right; }
.es-dt td.acts { text-align: right; white-space: nowrap; width: 1%; }
.es-dt .chk { width: 1%; }
.es-dt input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.es-dt-wrap { overflow-x: auto; position: relative; }
.es-row-acts { display: inline-flex; gap: 4px; align-items: center; }
.es-row-acts .es-icon-btn { width: 32px; height: 32px; font-size: 13px; }
.es-kebab { position: relative; display: inline-block; }
.es-kebab .es-menu { min-width: 190px; }
.es-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.es-pager .pg { display: flex; gap: 4px; }
.es-pager button { min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--ink); padding: 0 8px; }
.es-pager button.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.es-pager button:disabled { opacity: .4; cursor: default; }
.es-bulk { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--info-50); border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }

/* mobile: rows -> cards */
@media (max-width: 767px) {
  .es-dt.cards thead { display: none; }
  .es-dt.cards, .es-dt.cards tbody, .es-dt.cards tr, .es-dt.cards td { display: block; width: 100%; }
  .es-dt.cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .es-dt.cards tbody tr:last-child { border-bottom: 0; }
  .es-dt.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .es-dt.cards td:before { content: attr(data-label); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; flex-shrink: 0; padding-top: 2px; }
  .es-dt.cards td.m-title { font-size: 15px; font-weight: 600; text-align: left; padding: 0 0 6px; display: block; }
  .es-dt.cards td.m-title:before, .es-dt.cards td.acts:before, .es-dt.cards td.chk:before, .es-dt.cards td.m-nolabel:before { display: none; }
  .es-dt.cards td.m-hide { display: none; }
  .es-dt.cards td.acts { justify-content: flex-start; padding-top: 10px; width: auto; }
  .es-dt.cards td.chk { position: absolute; right: 14px; top: 14px; width: auto; padding: 0; }
  .es-dt.cards td.num { text-align: right; }
  .es-dt.cards td small { display: inline; margin-left: 6px; }
  .es-dt.cards td.m-title small { display: block; margin: 2px 0 0; font-weight: 400; }
}

/* ---------- states ---------- */
.es-empty { text-align: center; padding: 48px 20px; }
.es-empty .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--paper); color: var(--navy-600); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px; }
.es-empty h3 { font-size: 17px; margin: 0 0 6px; }
.es-empty p { color: var(--muted); font-size: 14px; max-width: 420px; margin: 0 auto 16px; }
.es-empty.sm { padding: 28px 16px; }
.es-empty.sm .ic { width: 44px; height: 44px; font-size: 18px; }
.es-empty.err .ic { background: var(--danger-50); color: var(--danger); }
.es-empty.lock .ic { background: var(--warn-50); color: var(--warn); }
.es-skel { background: linear-gradient(90deg, var(--paper-2) 25%, #F7F9FB 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: es-sh 1.3s infinite; border-radius: 3px; height: 14px; margin: 10px 0; }
.es-skel.h { height: 28px; width: 40%; }
.es-skel.w60 { width: 60%; } .es-skel.w80 { width: 80%; }
@keyframes es-sh { to { background-position: -200% 0; } }
.es-loading { padding: 20px; }

/* ---------- modal / drawer ---------- */
.es-modal { z-index: 10060; }
.es-modal .es-modal-box { max-width: 640px; animation: es-pop .16s ease-out; }
.es-modal.sm .es-modal-box { max-width: 460px; }
.es-modal.lg .es-modal-box { max-width: 920px; }
.es-modal.xl .es-modal-box { max-width: 1180px; }
.es-modal-head h2 { font-size: 20px; margin: 0; }
.es-modal-head .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-600); }
.es-modal-foot { justify-content: flex-end; }
.es-modal-foot .sp { flex: 1; }
@keyframes es-pop { from { transform: translateY(8px); opacity: 0; } }
.es-drawer { position: fixed; inset: 0; z-index: 10055; display: flex; justify-content: flex-end; background: rgba(6,21,40,.45); }
.es-drawer-box { background: #fff; width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; animation: es-slide .2s ease-out; box-shadow: -20px 0 60px rgba(0,0,0,.2); }
.es-drawer.lg .es-drawer-box { max-width: 760px; }
.es-drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.es-drawer-head h2 { font-size: 19px; margin: 2px 0 0; }
.es-drawer-head .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-600); }
.es-drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.es-drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--paper); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes es-slide { from { transform: translateX(30px); opacity: .4; } }
body.es-lock { overflow: hidden; }

/* toasts */
.es-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 10100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.es-toast { background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: var(--radius); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 420px; animation: es-pop .2s ease-out; border-left: 3px solid var(--accent); }
.es-toast.ok { border-left-color: #4CC08E; }
.es-toast.danger { border-left-color: #F06A5F; }
.es-toast i { margin-top: 3px; }
@media (max-width: 991px) { .es-toasts { bottom: 84px; right: 10px; left: 10px; } .es-toast { max-width: none; } }

/* ---------- forms (app) ---------- */
.es-app .es-field input, .es-app .es-field select, .es-app .es-field textarea { height: 44px; font-size: 14.5px; }
.es-app .es-field textarea { height: 104px; }
.es-form-sec { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.es-form-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.es-form-sec > h3 { font-size: 16px; margin: 0 0 4px; }
.es-form-sec > p { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.es-form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.es-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink); margin: 0; }
.es-switch input { position: absolute; opacity: 0; pointer-events: none; }
.es-switch .tr { width: 38px; height: 22px; border-radius: 11px; background: #CFD8E3; position: relative; transition: background .15s; flex-shrink: 0; }
.es-switch .tr:after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.es-switch input:checked + .tr { background: var(--ok); }
.es-switch input:checked + .tr:after { transform: translateX(16px); }
.es-switch input:focus-visible + .tr { outline: 2px solid var(--accent); outline-offset: 2px; }
.es-checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.es-field .es-chips label { padding: 7px 12px; font-size: 13px; }

/* upload */
.es-upload { border: 1.5px dashed #C3CEDB; border-radius: var(--radius); padding: 20px; text-align: center; background: #FAFBFD; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.es-upload:hover, .es-upload.drag { border-color: var(--navy-600); background: var(--info-50); }
.es-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100% !important; }
.es-upload i { font-size: 22px; color: var(--navy-600); display: block; margin-bottom: 6px; }
.es-upload b { color: var(--ink); font-size: 14px; display: block; }
.es-upload span { font-size: 12.5px; color: var(--muted); }
.es-files { list-style: none; margin: 10px 0 0; padding: 0; }
.es-files li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; font-size: 13px; background: #fff; text-align: left; }
.es-files li i { color: var(--navy-600); }
.es-files li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.es-files li .s { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.es-files li button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }

/* stepper */
.es-steps { display: flex; gap: 0; margin: 0 0 24px; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.es-steps::-webkit-scrollbar { display: none; }
.es-steps li { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 8px; padding-right: 10px; position: relative; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.es-steps li .bar { height: 4px; border-radius: 2px; background: var(--line); }
.es-steps li.done .bar { background: var(--ok); }
.es-steps li.on .bar { background: var(--accent); }
.es-steps li.on, .es-steps li.done { color: var(--ink); }
.es-steps li span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; display: block; color: var(--muted); }
.es-steps li button { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.es-step-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.es-review { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.es-review h4 { font-size: 13px; margin: 0; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.es-review .es-dl { border-top: 0; padding: 0 14px; }
.es-success-card { text-align: center; padding: 40px 20px; }
.es-success-card .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-50); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; }
.es-success-card .es-ref { display: inline-block; margin: 16px 0 22px; border: 1px dashed var(--line); padding: 12px 20px; border-radius: var(--radius); }
.es-success-card .es-ref small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.es-success-card .es-ref b { font-family: var(--mono); font-size: 20px; color: var(--ink); }

/* ---------- timeline (horizontal progress) ---------- */
.es-prog { display: flex; align-items: center; gap: 3px; min-width: 120px; }
.es-prog i { flex: 1; height: 5px; border-radius: 2px; background: var(--line); display: block; }
.es-prog i.d { background: var(--ok); }
.es-prog i.n { background: var(--accent); }
.es-prog-l { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }
.es-hstages { display: flex; overflow-x: auto; padding: 4px 0 8px; gap: 0; scrollbar-width: thin; }
.es-hstages .s { flex: 1 0 92px; text-align: center; position: relative; font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.es-hstages .s:before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.es-hstages .s:first-child:before { display: none; }
.es-hstages .s .d { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; font-size: 10px; font-family: var(--mono); margin-bottom: 6px; }
.es-hstages .s.done .d { background: var(--ok); border-color: var(--ok); color: #fff; }
.es-hstages .s.done:before, .es-hstages .s.now:before { background: #9FD3BB; }
.es-hstages .s.now .d { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.es-hstages .s.now { color: var(--ink); font-weight: 600; }
.es-hstages .s.done { color: var(--ink); }
.es-tl li { grid-template-columns: 26px minmax(0, 1fr) auto; }
.es-tl.compact li { padding-bottom: 12px; }
.es-tl.compact h4 { font-size: 13.5px; }

/* ---------- activity / feed ---------- */
.es-feed { list-style: none; margin: 0; padding: 0; }
.es-feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.es-feed li:last-child { border-bottom: 0; }
.es-feed .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--paper); color: var(--navy-700); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.es-feed .ic.ok { background: var(--ok-50); color: var(--ok); }
.es-feed .ic.warn { background: var(--warn-50); color: var(--warn); }
.es-feed .ic.accent { background: var(--accent-50); color: var(--accent-600); }
.es-feed .ic.danger { background: var(--danger-50); color: var(--danger); }
.es-feed p { margin: 0; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.es-feed small { font-size: 12px; color: var(--muted); }
.es-feed a.row { color: inherit; text-decoration: none; display: contents; }
.es-feed li.click { cursor: pointer; }
.es-feed li.click:hover p { color: var(--navy-700); }
.es-feed li.unread p { font-weight: 600; }
.es-feed li.unread .ic { box-shadow: 0 0 0 2px var(--accent); }

/* comments */
.es-comments { list-style: none; margin: 0 0 14px; padding: 0; }
.es-comments li { padding: 12px 14px; background: var(--paper); border-radius: var(--radius); margin-bottom: 8px; font-size: 13.5px; }
.es-comments li.internal { background: var(--warn-50); border: 1px dashed #E2C47F; }
.es-comments .h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.es-comments .h b { color: var(--ink); }
.es-comments p { margin: 0; color: var(--ink); }
.es-comment-form textarea { width: 100%; height: 80px; border: 1px solid #CFD8E3; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; resize: vertical; font-family: var(--sans); }
.es-comment-form .es-row { margin-top: 8px; }

/* ---------- chat ---------- */
.es-chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 230px); min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.es-chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.es-chat-list .h { padding: 12px; border-bottom: 1px solid var(--line); }
.es-chat-list .h .es-search { max-width: none; display: block; }
.es-chat-list ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.es-chat-list li { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
.es-chat-list li:hover { background: var(--paper); }
.es-chat-list li.on { background: var(--info-50); box-shadow: inset 3px 0 0 var(--accent); }
.es-chat-list .av { width: 38px; height: 38px; border-radius: 50%; background: var(--paper-2); color: var(--navy-800); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; }
.es-chat-list .av.mgr { background: var(--navy-800); color: #fff; }
.es-chat-list .t { display: flex; justify-content: space-between; gap: 6px; }
.es-chat-list .t b { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-chat-list .t small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.es-chat-list .p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-chat-list li.unread .p { color: var(--ink); font-weight: 600; }
.es-chat-list .ref { font-family: var(--mono); font-size: 10.5px; color: var(--navy-600); }
.es-chat-pane { display: flex; flex-direction: column; min-height: 0; }
.es-chat-pane .h { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.es-chat-pane .h b { color: var(--ink); display: block; font-size: 15px; }
.es-chat-pane .h small { color: var(--muted); font-size: 12px; }
.es-chat-msgs { flex: 1; overflow-y: auto; padding: 18px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.es-bubble { max-width: 72%; background: #fff; border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; padding: 9px 13px; font-size: 14px; color: var(--ink); align-self: flex-start; }
.es-bubble.me { align-self: flex-end; background: var(--navy-800); color: #fff; border-color: var(--navy-800); border-radius: 10px 10px 2px 10px; }
.es-bubble .who { font-size: 11.5px; font-weight: 600; color: var(--accent-600); margin-bottom: 2px; }
.es-bubble .meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; font-family: var(--mono); }
.es-bubble.me .meta { color: #9FB3CC; }
.es-bubble .att { display: flex; gap: 8px; align-items: center; margin-top: 6px; padding: 7px 9px; border-radius: 6px; background: var(--paper); font-size: 12.5px; color: var(--ink); }
.es-bubble.me .att { background: #16395F; color: #fff; }
.es-chat-day { align-self: center; font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: #fff; padding: 3px 10px; border-radius: 10px; border: 1px solid var(--line); }
.es-chat-input { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.es-chat-input textarea { flex: 1; border: 1px solid #CFD8E3; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; resize: none; height: 44px; max-height: 140px; font-family: var(--sans); }
.es-chat-back { display: none !important; }
@media (max-width: 991px) {
  .es-chat { grid-template-columns: 1fr; height: calc(100vh - 220px); }
  .es-chat.thread .es-chat-list { display: none; }
  .es-chat:not(.thread) .es-chat-pane { display: none; }
  .es-chat-back { display: inline-flex !important; }
  .es-bubble { max-width: 88%; }
}

/* ---------- document cards ---------- */
.es-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.es-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.es-doc .h { display: flex; gap: 12px; align-items: flex-start; }
.es-doc .fi { width: 38px; height: 46px; border-radius: 3px; background: var(--paper); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; font-family: var(--mono); font-size: 9px; color: var(--navy-700); padding-bottom: 5px; flex-shrink: 0; position: relative; }
.es-doc .fi:before { content: ""; position: absolute; top: -1px; right: -1px; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent var(--paper-2) transparent transparent; }
.es-doc b { color: var(--ink); font-size: 14px; display: block; line-height: 1.35; }
.es-doc small { color: var(--muted); font-size: 12px; }
.es-doc .f { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- quick actions ---------- */
.es-qa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.es-qa a, .es-qa button { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: left; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; line-height: 1.3; font-family: var(--sans); }
.es-qa a:hover, .es-qa button:hover { border-color: var(--accent); box-shadow: var(--shadow); color: var(--ink); }
.es-qa .ic { width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent-50); color: var(--accent-600); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.es-qa .ic.navy { background: var(--info-50); color: var(--navy-700); }
.es-qa small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 1199px) { .es-qa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .es-qa { grid-template-columns: 1fr; } .es-qa a, .es-qa button { padding: 12px; } }

/* ---------- welcome ---------- */
.es-welcome { background: var(--navy-900); color: #B9C7D8; border-radius: var(--radius); padding: 26px 28px; display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; position: relative; overflow: hidden; }
.es-welcome:after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border: 40px solid rgba(224,102,27,.08); border-radius: 50%; }
.es-welcome h1 { color: #fff; font-size: 26px; margin: 4px 0 6px; line-height: 1.25; }
.es-welcome p { margin: 0; font-size: 14.5px; max-width: 620px; }
.es-welcome .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #F3A774; }
.es-welcome .acts { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
@media (max-width: 575px) { .es-welcome { padding: 20px; } .es-welcome h1 { font-size: 21px; } }

/* ---------- checklist ---------- */
.es-checklist { list-style: none; margin: 0; padding: 0; }
.es-checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.es-checklist li:last-child { border-bottom: 0; }
.es-checklist .m { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 2px solid var(--line); color: var(--muted); }
.es-checklist .ok .m { background: var(--ok); border-color: var(--ok); color: #fff; }
.es-checklist .rev .m { border-color: var(--warn); color: var(--warn); background: var(--warn-50); }
.es-checklist .req .m { border-color: var(--danger); color: var(--danger); background: var(--danger-50); }
.es-checklist b { color: var(--ink); font-size: 14px; display: block; }
.es-checklist small { color: var(--muted); font-size: 12.5px; }
.es-checklist .r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 575px) { .es-checklist li { grid-template-columns: 28px minmax(0, 1fr); } .es-checklist .r { grid-column: 2; justify-content: flex-start; } }

/* ---------- comparison ---------- */
.es-compare { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.es-compare table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 13.5px; }
.es-compare th, .es-compare td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.es-compare th[scope=row] { background: var(--paper); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; width: 160px; position: sticky; left: 0; }
.es-compare thead th { background: #fff; vertical-align: bottom; }
.es-compare thead th b { display: block; color: var(--ink); font-size: 14.5px; }
.es-compare td.best { background: var(--ok-50); color: var(--ok); font-weight: 600; }
.es-compare tr:last-child td, .es-compare tr:last-child th { border-bottom: 0; }

/* ---------- charts ---------- */
.es-chart { width: 100%; }
.es-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.es-chart .ax { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.es-chart .gl { stroke: var(--line-soft); stroke-width: 1; }
.es-chart .bl { stroke: var(--line); stroke-width: 1; }
.es-chart .v { font-family: var(--mono); font-size: 10px; fill: var(--ink); }
.es-chart rect.b:hover, .es-chart circle.p:hover { opacity: .8; }
.es-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--body); margin-top: 10px; }
.es-legend span { display: inline-flex; gap: 6px; align-items: center; }
.es-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.es-donut { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.es-donut svg { width: 150px; height: 150px; flex-shrink: 0; }
.es-donut .es-legend { flex-direction: column; gap: 8px; margin: 0; }
.es-donut .es-legend b { font-family: var(--mono); font-weight: 500; margin-left: auto; padding-left: 12px; color: var(--ink); }
.es-donut .es-legend span { min-width: 170px; }
.es-bars-h { list-style: none; margin: 0; padding: 0; }
.es-bars-h li { display: grid; grid-template-columns: 130px minmax(0, 1fr) 60px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.es-bars-h .t { height: 10px; background: var(--paper-2); border-radius: 5px; overflow: hidden; }
.es-bars-h .t i { display: block; height: 100%; background: var(--navy-600); border-radius: 5px; }
.es-bars-h .n { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--ink); }
.es-bars-h .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }

/* ---------- permission matrix ---------- */
.es-matrix { overflow-x: auto; }
.es-matrix table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 820px; }
.es-matrix th, .es-matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.es-matrix th { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--paper); }
.es-matrix td:first-child, .es-matrix th:first-child { text-align: left; color: var(--ink); font-weight: 500; position: sticky; left: 0; background: #fff; }
.es-matrix th:first-child { background: var(--paper); }
.es-matrix input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- misc ---------- */
.es-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--paper-2); color: var(--navy-800); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; flex-shrink: 0; }
.es-avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.es-avatar.navy { background: var(--navy-800); color: #fff; }
.es-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.es-person b { display: block; color: var(--ink); font-size: 13.5px; line-height: 1.3; }
.es-person small { color: var(--muted); font-size: 12px; }
.es-meter { height: 8px; background: var(--paper-2); border-radius: 4px; overflow: hidden; min-width: 80px; }
.es-meter i { display: block; height: 100%; background: var(--navy-600); border-radius: 4px; }
.es-meter.ok i { background: var(--ok); } .es-meter.warn i { background: #C98A12; } .es-meter.danger i { background: var(--danger); }
.es-statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.es-statgrid button, .es-statgrid > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: left; cursor: pointer; font-family: var(--sans); }
.es-statgrid button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.es-statgrid small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.es-statgrid b { font-size: 22px; color: var(--ink); display: block; line-height: 1.2; margin-top: 2px; }
.es-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.es-kv:last-child { border-bottom: 0; }
.es-kv span { color: var(--muted); }
.es-kv b { color: var(--ink); font-weight: 600; text-align: right; }
.es-kv.total { border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 15px; }
.es-sidenav { list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 90px; }
.es-sidenav button, .es-sidenav a { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-size: 14px; color: var(--body); border-radius: var(--radius); cursor: pointer; text-decoration: none; font-family: var(--sans); }
.es-sidenav button:hover, .es-sidenav a:hover { background: var(--paper); color: var(--ink); }
.es-sidenav button.on, .es-sidenav a.on { background: var(--info-50); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.es-sidenav button.danger { color: var(--danger); }
@media (max-width: 767px) { .es-sidenav { position: static; display: flex; overflow-x: auto; gap: 4px; } .es-sidenav button, .es-sidenav a { white-space: nowrap; width: auto; } }
.es-lock-row { display: flex; gap: 10px; align-items: center; color: var(--warn); font-size: 13px; background: var(--warn-50); padding: 8px 12px; border-radius: var(--radius); }
.es-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.es-lcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.es-lcard:hover { border-color: var(--navy-600); box-shadow: var(--shadow); }
.es-lcard .h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.es-lcard h3 { font-size: 16px; margin: 0; line-height: 1.35; }
.es-lcard .f { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: auto; flex-wrap: wrap; }
.es-lcard .es-dl { grid-template-columns: 1fr 1fr; }
.es-lcard .es-dl > div { padding: 7px 8px 7px 0; }
.es-pre { white-space: pre-wrap; font-size: 13.5px; color: var(--ink); }

/* ==========================================================================
   AUTH (login / register / forgot)
   ========================================================================== */
body.es-authp { background: var(--paper); }
.es-auth2 { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.es-auth2-side { background: var(--navy-950) center/cover; color: #B9C7D8; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; overflow: hidden; }
.es-auth2-side:before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,21,40,.82) 0%, rgba(6,21,40,.93) 60%, rgba(6,21,40,.98) 100%); }
.es-auth2-side > * { position: relative; }
.es-auth2-side .es-logo { color: #fff; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.es-auth2-side .es-logo .es-name { color: #fff; font-weight: 700; letter-spacing: .14em; }
.es-auth2-side h2 { color: #fff; font-size: 34px; line-height: 1.2; margin: 0 0 14px; max-width: 480px; }
.es-auth2-side .lead { font-size: 15.5px; max-width: 470px; margin: 0 0 28px; }
.es-auth2-lane { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 460px; }
.es-auth2-lane li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 0 0 16px; position: relative; font-size: 14px; color: #DCE5F0; }
.es-auth2-lane li:not(:last-child):before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; border-left: 1px dashed #2E4F78; }
.es-auth2-lane .n { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #2E4F78; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: #F3A774; background: var(--navy-950); }
.es-auth2-lane b { color: #fff; display: block; font-size: 14.5px; }
.es-auth2-lane small { color: #8EA2BC; font-size: 12.5px; }
.es-auth2-side .ft { font-size: 12.5px; color: #6F86A3; display: flex; gap: 16px; flex-wrap: wrap; }
.es-auth2-side .ft a { color: #8EA2BC; }
.es-auth2-main { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
.es-auth2-top { display: flex; justify-content: space-between; align-items: center; padding: 22px 40px; font-size: 14px; gap: 10px; }
.es-auth2-top a { font-weight: 600; text-decoration: none; }
.es-auth2-top .back { color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.es-auth2-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 24px 48px; }
.es-auth2-card { width: 100%; max-width: 480px; }
.es-auth2-card.wide { max-width: 620px; }
.es-auth2-card h1 { font-size: 30px; margin: 0 0 6px; line-height: 1.2; }
.es-auth2-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.es-auth2-card .es-field { margin-bottom: 16px; }
.es-auth2-card .es-field input, .es-auth2-card .es-field select { height: 48px; }
.es-auth2-card .row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 20px; }
.es-auth2-card .switch { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14.5px; text-align: center; }
.es-auth2-card .switch a { font-weight: 600; }
.es-auth2-card .alt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.es-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-family: var(--mono); letter-spacing: .1em; margin: 20px 0; }
.es-or:before, .es-or:after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.es-portal { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.es-portal button { border: 0; background: none; padding: 10px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 3px; cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; font-family: var(--sans); }
.es-portal button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(10,31,58,.12); }
.es-alert { padding: 11px 14px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.es-alert.danger { background: var(--danger-50); color: #7A1A12; }
.es-alert.ok { background: var(--ok-50); color: #12513A; }
.es-alert.info { background: var(--info-50); color: var(--navy-800); }
.es-alert.warn { background: var(--warn-50); color: #5F4A1C; }
.es-alert i { margin-top: 3px; }
.es-pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.es-pw-meter i { height: 4px; border-radius: 2px; background: var(--line); }
.es-pw-meter.s1 i:nth-child(-n+1) { background: var(--danger); }
.es-pw-meter.s2 i:nth-child(-n+2) { background: #C98A12; }
.es-pw-meter.s3 i:nth-child(-n+3) { background: #5A9E3A; }
.es-pw-meter.s4 i { background: var(--ok); }
.es-pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.es-pw-rules li:before { content: "\25CB"; margin-right: 6px; }
.es-pw-rules li.ok { color: var(--ok); }
.es-pw-rules li.ok:before { content: "\2713"; }
.es-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; }
.es-otp input { height: 54px !important; text-align: center; font-family: var(--mono); font-size: 22px !important; padding: 0 !important; }
.es-acct2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.es-acct2 input { position: absolute; opacity: 0; pointer-events: none; }
.es-acct2 label { border: 1.5px solid #CFD8E3; border-radius: var(--radius); padding: 14px 12px; cursor: pointer; margin: 0; display: flex; flex-direction: column; gap: 6px; transition: all .15s; background: #fff; height: 100%; }
.es-acct2 label i { font-size: 19px; color: var(--muted); }
.es-acct2 label b { font-size: 14px; color: var(--ink); line-height: 1.2; }
.es-acct2 label span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.es-acct2 input:checked + label { border-color: var(--accent); background: var(--accent-50); box-shadow: inset 0 0 0 1px var(--accent); }
.es-acct2 input:checked + label i { color: var(--accent); }
.es-acct2 input:focus-visible + label { outline: 2px solid var(--navy-600); outline-offset: 2px; }
.es-auth-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.es-auth-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.es-auth-steps i.d { background: var(--ok); } .es-auth-steps i.n { background: var(--accent); }
.es-auth-stepl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.es-auth2 > * { min-width: 0; }
@media (max-height: 760px) { .es-auth2-lane small { display: none; } .es-auth2-lane li { padding-bottom: 10px; } .es-auth2-side h2 { font-size: 28px; } }
@media (max-width: 1099px) {
  .es-auth2 { grid-template-columns: minmax(0, 1fr); }
  .es-auth2-side { display: none; }
  .es-auth2-top { padding: 16px 18px; }
  .es-auth2-body { padding: 10px 18px 40px; align-items: flex-start; }
  .es-auth2-card h1 { font-size: 25px; }
}
@media (max-width: 575px) { .es-acct2 { grid-template-columns: 1fr 1fr; } .es-auth2-card .alt { grid-template-columns: 1fr; } .es-pw-rules { grid-template-columns: 1fr; } .es-otp input { height: 46px !important; font-size: 18px !important; } }
.es-auth2-top .es-logo-sm { display: none; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; letter-spacing: .12em; text-decoration: none; }
@media (max-width: 1099px) { .es-auth2-top .es-logo-sm { display: inline-flex; } .es-auth2-top .back { display: none; } }

@media print { .es-app-side, .es-app-top, .es-bottom-nav, .es-demo-bar { display: none !important; } .es-app-shell { display: block; } }

/* ==========================================================================
   DASHBOARD HOMES (user + admin) — Essoria mockup layout
   ========================================================================== */
body.es-app { --card-line: #E3E8EF; --soft: 0 1px 2px rgba(10,31,58,.04), 0 6px 18px rgba(10,31,58,.05); }
body.es-app .es-box { border-radius: 12px; border-color: var(--card-line); box-shadow: var(--soft); }
body.es-app .es-box-h { border-bottom-color: #EEF1F5; }
body.es-app .es-box-h h2 { font-size: 16.5px; }
body.es-app .es-box-h a { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }

/* sidebar: orange pill + promo */
.es-app-side nav { padding: 12px; }
.es-app-side nav a { border-radius: 8px; padding: 9px 12px; }
.es-app-side nav a.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(224,102,27,.3); }
.es-app-side nav a.active i { color: #fff; }
.es-app-side nav a.active .ct { background: #fff; color: var(--accent-600); }
.es-side-promo { margin: 4px 14px 14px; border-radius: 12px; padding: 18px 16px 16px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; color: #D6E1EE; background: var(--navy-800) url("../images/photos/port-ship.jpg") center/cover; position: relative; overflow: hidden; }
.es-side-promo:before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,21,40,.9) 0%, rgba(6,21,40,.55) 55%, rgba(6,21,40,.85) 100%); }
.es-side-promo > * { position: relative; }
.es-side-promo b { display: block; color: #fff; font-size: 17px; line-height: 1.25; }
.es-side-promo p { font-size: 12.5px; margin: 6px 0 14px; line-height: 1.45; }
.es-side-promo .flat-button { border-radius: 8px; width: 100%; }
.es-country { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); white-space: nowrap; }
.es-country span { font-family: var(--mono); font-size: 10.5px; background: var(--paper-2); border-radius: 3px; padding: 2px 5px; color: var(--navy-700); }
@media (max-width: 991px) { .es-country { display: none; } }

/* hero */
.es-hero3 { --hero-img: url("../images/photos/port-ship.jpg"); position: relative; border-radius: 14px; overflow: hidden; padding: 28px 30px; min-height: 170px; margin-bottom: 18px;
  background: linear-gradient(90deg, #FFFFFF 0%, rgba(255,255,255,.96) 38%, rgba(255,255,255,.55) 58%, rgba(255,255,255,0) 78%), var(--hero-img) right center/cover, #EAF1F8; border: 1px solid var(--card-line); box-shadow: var(--soft); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 20px; align-items: center; }
.es-hero3 .hi { font-size: 19px; color: var(--ink); margin: 0; }
.es-hero3 h1 { font-size: 34px; margin: 2px 0 8px; line-height: 1.15; color: var(--ink); }
.es-hero3 p { margin: 0; font-size: 14.5px; color: var(--body); max-width: 520px; }
.es-hero3 .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.es-hero3 blockquote { margin: 0; padding: 12px 16px; background: rgba(255,255,255,.82); border-radius: 10px; font-size: 14px; line-height: 1.5; color: var(--ink); font-style: italic; align-self: start; }
@media (max-width: 991px) { .es-hero3 { grid-template-columns: minmax(0, 1fr); background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.88)), var(--hero-img) center/cover; padding: 20px; } .es-hero3 blockquote { display: none; } .es-hero3 h1 { font-size: 25px; } }

/* KPI tiles */
.es-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1199px) { .es-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .es-tiles { grid-template-columns: minmax(0, 1fr); } }
.es-tile2 { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; background: #fff; border: 1px solid var(--card-line); border-radius: 12px; padding: 16px; box-shadow: var(--soft); text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
a.es-tile2:hover { transform: translateY(-1px); border-color: #C9D4E2; color: inherit; }
.es-tile2 .ic { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; background: linear-gradient(135deg, #4C8DF6, #2563EB); }
.es-tile2 .ic.green { background: linear-gradient(135deg, #34C38F, #16A34A); } .es-tile2 .ic.orange { background: linear-gradient(135deg, #F7954A, #E0661B); } .es-tile2 .ic.purple { background: linear-gradient(135deg, #B57BF0, #8B3FD9); }
.es-tile2 .ic.red { background: linear-gradient(135deg, #F47171, #DC2626); } .es-tile2 .ic.teal { background: linear-gradient(135deg, #3BC4C4, #0E9494); } .es-tile2 .ic.navy { background: linear-gradient(135deg, #3B5F8F, #16395F); } .es-tile2 .ic.amber { background: linear-gradient(135deg, #F5C451, #D99A06); }
.es-tile2 .n { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.es-tile2 b { font-size: 25px; line-height: 1.1; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-tile2 .l { display: block; font-size: 13.5px; color: var(--ink); margin: 2px 0 4px; }
.es-tile2 .s { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-tile2 .s.warn { color: var(--warn); } .es-tile2 .s.danger { color: var(--danger); } .es-tile2 .s.ok { color: var(--ok); }
.es-tile2 .v { font-size: 12.5px; font-weight: 600; color: var(--blue); }
.es-tile2 .v:after { content: " \2192"; }

/* quick action tiles */
.es-qa3 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1199px) { .es-qa3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .es-qa3 { grid-template-columns: minmax(0, 1fr); } }
.es-qa3 a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 14px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; background: var(--blue-50); border: 1px solid transparent; transition: border-color .15s; }
.es-qa3 a:hover { border-color: currentColor; color: var(--ink); }
.es-qa3 a .ic { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--blue); font-size: 15px; }
.es-qa3 a:after { content: "\203A"; font-size: 20px; color: var(--muted); line-height: 1; }
.es-qa3 a.orange { background: var(--accent-50); } .es-qa3 a.orange .ic { color: var(--accent-600); }
.es-qa3 a.green { background: var(--ok-50); } .es-qa3 a.green .ic { color: var(--ok); }
.es-qa3 a.purple { background: var(--violet-50); } .es-qa3 a.purple .ic { color: var(--violet); }
.es-qa3 a.red { background: var(--danger-50); } .es-qa3 a.red .ic { color: var(--danger); }
.es-qa3 a.navy { background: var(--info-50); } .es-qa3 a.navy .ic { color: var(--navy-700); }
.es-qa-list a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 14px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--card-line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; margin-bottom: 8px; }
.es-qa-list a:last-child { margin-bottom: 0; }
.es-qa-list a:hover { border-color: var(--accent); }
.es-qa-list a:after { content: "\203A"; font-size: 20px; color: var(--muted); line-height: 1; }
.es-qa-list .ic { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue); }
.es-qa-list a:nth-child(2) .ic { background: var(--ok-50); color: var(--ok); } .es-qa-list a:nth-child(3) .ic { background: var(--accent-50); color: var(--accent-600); } .es-qa-list a:nth-child(4) .ic { background: var(--danger-50); color: var(--danger); } .es-qa-list a:nth-child(5) .ic { background: var(--violet-50); color: var(--violet); } .es-qa-list a:nth-child(6) .ic { background: var(--warn-50); color: var(--warn); }

/* home grids */
.es-home-row { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; margin-top: 18px; }
.es-home-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
.es-home-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
.es-home-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: stretch; }
@media (max-width: 1279px) { .es-home-row { grid-template-columns: minmax(0, 1fr); } .es-home-3, .es-home-admin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 767px) { .es-home-3, .es-home-2, .es-home-admin { grid-template-columns: minmax(0, 1fr); } }
.es-home-row > *, .es-home-3 > *, .es-home-2 > *, .es-home-admin > * { margin: 0 !important; min-width: 0; }

/* compact tables in boxes */
.es-compact .es-dt { font-size: 12.5px; }
.es-compact .es-dt th { padding: 9px 12px; font-size: 10px; }
.es-compact .es-dt td { padding: 9px 12px; }
.es-compact .es-badge { font-size: 11px; padding: 4px 7px; }
.es-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; background: var(--blue-50); color: var(--blue); white-space: nowrap; }
.es-chip.export { background: var(--accent-50); color: var(--accent-600); }
.es-chip.stage { background: var(--violet-50); color: var(--violet); }

/* trade manager card (light) */
.es-mgr2 .p { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 14px; }
.es-mgr2 .p .es-avatar { width: 56px; height: 56px; font-size: 17px; background: var(--navy-800); color: #fff; }
.es-mgr2 .p b { display: block; color: var(--ink); font-size: 15px; }
.es-mgr2 .p small { display: block; color: var(--muted); font-size: 12.5px; }
.es-mgr2 .on { font-size: 11.5px; color: var(--ok); display: inline-flex; gap: 5px; align-items: center; }
.es-mgr2 .on:before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.es-mgr2 .on.off { color: var(--muted); } .es-mgr2 .on.off:before { background: var(--muted); }
.es-mgr2 .tx { border: 1px solid var(--card-line); border-radius: 10px; padding: 12px 14px; }
.es-mgr2 .tx .es-kv { font-size: 13px; padding: 7px 0; }

/* horizontal trade timeline with icons */
.es-ttl { display: flex; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; }
.es-ttl .s { flex: 1 0 70px; text-align: center; position: relative; font-size: 11.5px; color: var(--muted); }
.es-ttl .s:before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; border-top: 2px dotted #CBD5E1; }
.es-ttl .s:first-child:before { display: none; }
.es-ttl .s.done:before, .es-ttl .s.now:before { border-top: 2px solid var(--ok); }
.es-ttl .d { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1.5px solid #CBD5E1; color: var(--muted); font-size: 12px; position: relative; z-index: 1; }
.es-ttl .done .d { background: var(--ok); border-color: var(--ok); color: #fff; }
.es-ttl .now .d { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-50); }
.es-ttl .done, .es-ttl .now { color: var(--ink); }
.es-ttl .now { font-weight: 700; color: var(--blue); }
.es-stage-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.es-stage-card .cur { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; border: 1px solid var(--card-line); border-radius: 10px; padding: 12px; align-items: center; }
.es-stage-card .cur .im { height: 84px; border-radius: 8px; background: var(--paper) center/cover; }
.es-stage-card .cur b { display: block; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.es-stage-card .cur p { margin: 0; font-size: 13px; color: var(--body); line-height: 1.5; }
.es-stage-card .nx { border: 1px solid var(--card-line); border-radius: 10px; padding: 12px 14px; }
.es-stage-card .nx b { font-size: 13.5px; color: var(--ink); display: block; margin-bottom: 6px; }
.es-stage-card .nx ol { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.es-stage-card .nx li { counter-increment: n; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 4px 0; color: var(--body); }
.es-stage-card .nx li:before { content: counter(n); width: 20px; height: 20px; border-radius: 50%; background: var(--paper-2); color: var(--navy-700); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
@media (max-width: 767px) { .es-stage-card { grid-template-columns: minmax(0, 1fr); } .es-stage-card .cur { grid-template-columns: 90px minmax(0, 1fr); } }

/* mini message list */
.es-mini { list-style: none; margin: 0; padding: 0; }
.es-mini li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.es-mini li:last-child { border-bottom: 0; }
.es-mini .es-avatar { width: 36px; height: 36px; font-size: 12px; }
.es-mini .es-avatar.c1 { background: var(--blue-50); color: var(--blue); } .es-mini .es-avatar.c2 { background: var(--accent-50); color: var(--accent-600); } .es-mini .es-avatar.c3 { background: var(--ok-50); color: var(--ok); } .es-mini .es-avatar.c4 { background: var(--violet-50); color: var(--violet); }
.es-mini b { display: block; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-mini small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-mini .r { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.es-mini .r .dot { display: inline-flex; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; align-items: center; justify-content: center; margin-top: 3px; padding: 0 5px; }

/* admin header controls */
.es-admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.es-admin-head h1 { font-size: 26px; margin: 0; }
.es-admin-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.es-admin-head .r { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.es-admin-head .date { display: flex; gap: 10px; align-items: center; border: 1px solid var(--card-line); background: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13px; color: var(--ink); line-height: 1.3; }
.es-admin-head .date i { font-size: 18px; color: var(--navy-700); }
.es-admin-head .date small { display: block; color: var(--muted); font-size: 11.5px; }
.es-admin-head select { border: 1px solid var(--card-line); border-radius: 10px; padding: 0 30px 0 12px; height: auto; min-height: 44px; font-size: 13.5px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236E7E93' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; color: var(--ink); }
.es-admin-head .flat-button { border-radius: 10px; }
.es-flag { font-family: var(--mono); font-size: 10.5px; background: var(--paper-2); color: var(--navy-700); border-radius: 3px; padding: 2px 5px; margin-right: 8px; display: inline-block; min-width: 26px; text-align: center; }
.es-compact .es-dt td .mono, .es-compact .es-dt td a.mono, .es-compact .es-dt td .es-badge, .es-compact .es-dt td .es-chip { white-space: nowrap; }
.es-compact .es-dt td { vertical-align: middle; }
.es-mgr2 .tx .es-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.es-mgr2 .tx .es-kv b { text-align: left; }
.es-compact .es-dt td { white-space: nowrap; }
.es-compact .es-dt td.ell { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.es-home-3 .es-compact .es-dt td.ell { max-width: 130px; }
@media (max-width: 767px) { .es-compact .es-dt td, .es-compact .es-dt td.ell { white-space: normal; max-width: none; } }
.es-admin-head > div:first-child { flex: 1 1 420px; min-width: 0; }
.es-admin-head .r { align-items: center; }
.es-admin-head .r .flat-button { padding: 13px 18px; }
.es-chart-note { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.es-chart-note b { color: var(--ink); }
/* ---- compact, collapsible sidebar ---- */
.es-app-side .brand { padding: 16px 18px 14px; }
.es-app-side nav { padding: 8px 10px; }
.es-app-side nav a { font-size: 13px; padding: 7px 10px; margin-bottom: 1px; gap: 10px; line-height: 1.3; }
.es-app-side nav a i { font-size: 13px; width: 16px; }
.es-app-side nav a .ct { font-size: 10px; padding: 1px 6px; }
.es-ngrp { margin-top: 4px; }
.es-app-side nav .grp { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; cursor: pointer; padding: 10px 10px 5px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #5D7694; }
.es-app-side nav .grp:hover { color: #B9C7D8; }
.es-app-side nav .grp i { font-size: 9px; transition: transform .2s; }
.es-ngrp.closed .grp i { transform: rotate(-90deg); }
.es-ngrp.closed .es-nlinks { display: none; }
.es-app-side .foot { padding: 10px 18px; font-size: 12px; }
.es-app-side .foot a { font-size: 13px; padding: 5px 0; }
.es-side-promo { min-height: 0; padding: 14px; margin: 6px 10px 10px; }
.es-side-promo b { font-size: 15px; }
.es-side-promo p { margin: 4px 0 10px; font-size: 12px; }
@media (max-height: 820px) { .es-side-promo { display: none; } }
