/* Delta AI demo dashboard */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --sb: #1a2b1e;          /* sidebar, brand dark green */
  --sb-ink: rgba(255,255,255,.66);
  --sb-line: rgba(255,255,255,.08);
  --lime: #5cb800;        /* brand accent */
  --lime-hi: #9ae740;     /* accent on dark */
  --lime-soft: #eef7e3;
  --blue: #00afef;
  --bg: #f4f7f4;
  --card: #ffffff;
  --ink: #1a2b1e;
  --mut: #5d7062;
  --faint: #8a9a8e;
  --line: #e1e8e2;
  --line-soft: #eef2ef;
  --amber: #b45309;  --amber-soft: #fdf3dc;
  --red: #b91c1c;    --red-soft: #fde8e8;
  --sky: #0072a0;    --sky-soft: #e2f4fc;
  --r: 10px;
  --sbw: 232px;
  --topbar: 64px;
  --shadow: 0 1px 2px rgba(26,43,30,.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  padding-left: var(--sbw);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
.show-xs { display: none; }
h1, h2, h3 { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Sidebar ---------- */
#ea-sb {
  position: fixed; inset: 0 auto 0 0; width: var(--sbw); z-index: 900;
  background: var(--sb); display: flex; flex-direction: column;
}
#ea-sb .sb-logo { height: var(--topbar); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--sb-line); flex-shrink: 0; }
#ea-sb .sb-logo img { height: 34px; width: auto; filter: brightness(0) invert(1); display: block; }
#ea-sb nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
#ea-sb .sb-group { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.34); padding: 14px 12px 6px; }
#ea-sb .sb-group:first-child { padding-top: 4px; }
#ea-sb nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0;
  border-radius: 8px; color: var(--sb-ink); text-decoration: none; font-weight: 500;
  transition: background .12s, color .12s;
}
#ea-sb nav a svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#ea-sb nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
#ea-sb nav a.on { color: var(--lime-hi); background: rgba(154,231,64,.10); font-weight: 600; }
#ea-sb nav a .sb-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--sb); background: var(--lime-hi); border-radius: 10px; padding: 1px 7px; }
#ea-sb .sb-foot { border-top: 1px solid var(--sb-line); padding: 14px 20px 16px; flex-shrink: 0; }
#ea-sb .sb-src { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
#ea-sb .sb-src span { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,.5); }
#ea-sb .sb-src i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); flex-shrink: 0; }
#ea-sb .sb-src i.ok { background: var(--lime-hi); }
#ea-sb .sb-src i.bad { background: #f87171; }
#ea-sb .sb-user { display: flex; align-items: center; gap: 10px; }
#ea-sb .sb-av { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; flex-shrink: 0; }
#ea-sb .sb-user b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
#ea-sb .sb-user small { display: block; color: rgba(255,255,255,.45); font-size: 11.5px; }
#ea-scrim { display: none; }

/* ---------- Top bar ---------- */
.ea-topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.ea-title { min-width: 0; }
.ea-title h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.ea-sub { font-size: 12px; color: var(--mut); line-height: 1.2; margin-bottom: 2px; }
.ea-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ea-menu { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--ink); }
.ea-menu svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ---------- Content ---------- */
.ea-content { padding: 24px 28px 40px; max-width: 1440px; }
.ea-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.ea-toolbar .grow { flex: 1; }
.ea-grid { display: grid; gap: 16px; }
.ea-content > * + * { margin-top: 16px; }
.ea-content > .ea-toolbar + * { margin-top: 0; }
.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c21 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* ---------- Cards ---------- */
.ea-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.ea-card.pad { padding: 18px 20px; }
.ea-ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.ea-ch h2 { font-size: 14px; font-weight: 700; }
.ea-ch .ea-link { font-size: 12.5px; font-weight: 600; color: var(--lime); text-decoration: none; white-space: nowrap; }
.ea-ch .ea-link:hover { text-decoration: underline; }
.ea-ch .meta { font-size: 12.5px; color: var(--mut); }

/* KPI tiles */
a.ea-kpi { text-decoration: none; display: block; padding: 18px 20px; transition: border-color .12s, transform .12s; }
a.ea-kpi:hover { border-color: #c6d6c9; }
.ea-kpi .lbl { font-size: 12.5px; font-weight: 600; color: var(--mut); display: flex; align-items: center; gap: 8px; }
.ea-kpi .lbl i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.ea-kpi .val { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.ea-kpi .val.sm { font-size: 24px; padding-top: 6px; }
.ea-kpi .foot { font-size: 12.5px; color: var(--mut); margin-top: 6px; }
.ea-kpi.warn .lbl i { background: #e0a800; }
.ea-kpi.alert .lbl i { background: #ef4444; }
.ea-kpi.info .lbl i { background: var(--blue); }

/* ---------- Lists ---------- */
.ea-list { list-style: none; margin: 0; padding: 0; }
.ea-list > li { border-bottom: 1px solid var(--line-soft); }
.ea-list > li:last-child { border-bottom: 0; }
.ea-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; text-decoration: none; min-width: 0; }
a.ea-row:hover { background: #f8faf8; }
.ea-row .grow { flex: 1; min-width: 0; }
.ea-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ea-row .s { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ea-row .r { font-size: 12.5px; color: var(--mut); white-space: nowrap; text-align: right; flex-shrink: 0; }
.ea-date { width: 46px; flex-shrink: 0; text-align: center; border-radius: 8px; background: var(--lime-soft); padding: 5px 0 6px; line-height: 1.05; }
.ea-date b { display: block; font-size: 17px; font-weight: 800; color: #3a7a00; }
.ea-date small { font-size: 10.5px; font-weight: 700; color: #3a7a00; text-transform: uppercase; letter-spacing: .05em; }
.ea-date.today { background: var(--lime); }
.ea-date.today b, .ea-date.today small { color: #fff; }
.dot-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }
.dot-read { width: 8px; height: 8px; flex-shrink: 0; }
.unread .t { font-weight: 700; }

/* ---------- Table ---------- */
.ea-tw { overflow-x: auto; }
.ea-tbl { width: 100%; border-collapse: collapse; }
.ea-tbl th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafcfa; white-space: nowrap; position: sticky; top: 0;
}
.ea-tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ea-tbl tr:last-child td { border-bottom: 0; }
.ea-tbl tbody tr:hover td { background: #f8faf8; }
.ea-tbl .r { text-align: right; }
.ea-tbl .nw { white-space: nowrap; }
.ea-tbl .mut { color: var(--mut); }
.ea-tbl .strong { font-weight: 600; }
.ea-tbl .jobno { font-weight: 700; color: #3a7a00; white-space: nowrap; }
.ea-tbl .clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea-tbl .sub { display: block; font-size: 12px; color: var(--mut); margin-top: 1px; }
.ea-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line-soft); }

/* ---------- Badges ---------- */
.ea-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ea-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ea-badge.g { background: var(--lime-soft); color: #3a7a00; }
.ea-badge.b { background: var(--sky-soft); color: var(--sky); }
.ea-badge.y { background: var(--amber-soft); color: var(--amber); }
.ea-badge.r { background: var(--red-soft); color: var(--red); }
.ea-badge.m { background: var(--line-soft); color: var(--mut); }

/* ---------- Controls ---------- */
.ea-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: background .12s, border-color .12s;
}
.ea-btn:hover { background: #f6f8f6; }
.ea-btn.prim { background: var(--lime); border-color: var(--lime); color: #fff; }
.ea-btn.prim:hover { background: #4fa300; }
.ea-inp {
  height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--ink); background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a9a8e' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; outline: none; min-width: 0; width: 260px;
}
.ea-inp:focus, .ea-sel:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(92,184,0,.14); }
.ea-sel {
  height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background-color: #fff; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235d7062' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.ea-seg { display: inline-flex; background: #e9efea; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.ea-seg button {
  border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--mut); padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.ea-seg button:hover { color: var(--ink); }
.ea-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(26,43,30,.12); }
.ea-seg button .n { font-weight: 700; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.ea-seg button.on .n { color: #3a7a00; }
.ea-count { font-size: 13px; color: var(--mut); white-space: nowrap; }

/* ---------- States ---------- */
.ea-empty { padding: 36px 20px; text-align: center; color: var(--mut); }
.ea-empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }
.ea-err { padding: 16px 20px; color: var(--red); background: var(--red-soft); border-radius: 8px; margin: 12px 20px; font-size: 13px; }
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef2ef 0, #f6f8f6 50%, #eef2ef 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
.sk.w60 { width: 60%; } .sk.w40 { width: 40%; } .sk.w80 { width: 80%; }
.sk-row { padding: 14px 20px; display: grid; gap: 8px; border-bottom: 1px solid var(--line-soft); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c21 { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  body { padding-left: 0; }
  #ea-sb { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.sb-open #ea-sb { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.sb-open #ea-scrim { display: block; position: fixed; inset: 0; background: rgba(15,25,18,.4); z-index: 850; }
  .ea-menu { display: inline-flex; }
  .ea-topbar { padding: 0 16px; gap: 12px; }
  .ea-topbar .ea-actions .ea-count { display: none; }
  .ea-content { padding: 16px 16px 32px; }
  .c3, .c2 { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .ea-inp { width: 100%; }
  .ea-toolbar .grow { display: none; }
  .ea-toolbar > .ea-inp { flex: 1 1 100%; order: -1; }
}
@media (max-width: 520px) {
  .c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  a.ea-kpi { padding: 14px; }
  .ea-kpi .val { font-size: 26px; }
  .ea-kpi .val.sm { font-size: 19px; }
  .ea-row { padding: 11px 16px; }
  .ea-ch { padding: 12px 16px; flex-wrap: wrap; row-gap: 8px; }
  .ea-ch h2 { flex: 1 1 100%; }
  .ea-ch h2:has(+ .ea-link) { flex: 1 1 auto; }
  .ea-tbl th, .ea-tbl td { padding: 10px 12px; }
  .hide-xs { display: none; }
  .show-xs { display: inline; }
}
