:root {
  --navy: #061a33;
  --navy-2: #0b2b4c;
  --teal: #16b8ad;
  --teal-dark: #078d88;
  --bg: #f4f7fb;
  --line: #d8e1ea;
  --text: #132235;
  --muted: #617085;
  --danger: #b42318;
  --warn: #b76e00;
  --ok: #067647;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.brand-panel { background: var(--navy); color: white; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark { display: flex; gap: 18px; align-items: center; }
.eezi-symbol { width: 82px; height: 48px; border-radius: 50%; border: 9px solid var(--teal); border-left-color: white; border-right-color: white; transform: skewX(-12deg); }
.brand-panel h1 { font-size: 42px; max-width: 680px; line-height: 1.06; margin: 46px 0 16px; letter-spacing: 0; }
.brand-panel p { color: #c8d6e5; font-size: 18px; max-width: 680px; line-height: 1.55; }
.login-card { display: grid; align-content: center; justify-items: center; gap: 16px; padding: 32px; overflow: auto; }
.panel { width: min(480px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 45px rgba(6,26,51,.08); }
.auth-panel { width: min(540px, 100%); }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e8eef5; border-radius: 8px; padding: 5px; margin-bottom: 18px; }
.auth-switch button { min-height: 40px; border-radius: 6px; background: transparent; color: var(--navy); font-weight: 900; }
.auth-switch button.active { background: var(--teal-dark); color: white; box-shadow: 0 6px 18px rgba(7,141,136,.22); }
.panel h2, .section h2 { margin: 0 0 8px; color: var(--navy); letter-spacing: 0; }
.muted { color: var(--muted); }
.field { display: grid; gap: 7px; margin: 13px 0; }
.field label { font-weight: 700; font-size: 13px; color: #263d57; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; background: #fff; color: var(--text); }
textarea { min-height: 76px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border-radius: 7px; padding: 9px 13px; font-weight: 800; background: var(--navy); color: white; }
.btn.secondary { background: #e8eef5; color: var(--navy); }
.btn.teal { background: var(--teal-dark); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.error { color: var(--danger); font-weight: 700; }
.success { color: var(--ok); font-weight: 700; }
.app { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
.sidebar { background: var(--navy); color: white; padding: 18px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .logo { display: flex; align-items: center; gap: 12px; padding: 9px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .logo strong { font-size: 20px; letter-spacing: 3px; }
.nav { display: grid; gap: 7px; margin-top: 18px; }
.nav button { color: #d8e6f6; background: transparent; text-align: left; padding: 11px 12px; border-radius: 7px; font-weight: 700; }
.nav button.active, .nav button:hover { background: rgba(22,184,173,.18); color: white; }
.main { min-width: 0; }
.topbar { height: 68px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 22px; color: var(--navy); letter-spacing: 0; }
.content { padding: 22px; display: grid; gap: 18px; }
.section { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; overflow: hidden; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 8px; padding: 15px; min-height: 92px; }
.kpi span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.kpi strong { display: block; font-size: 28px; color: var(--navy); margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .field { min-width: 160px; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #263d57; background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #e8eef5; color: var(--navy); }
.status.ok { background: #dcfae6; color: var(--ok); }
.status.warn { background: #fff4d6; color: var(--warn); }
.status.bad { background: #fee4e2; color: var(--danger); }
.chart { min-height: 250px; display: flex; align-items: end; gap: 10px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px; }
.bar { flex: 1; min-width: 34px; background: linear-gradient(180deg, var(--teal), var(--navy-2)); border-radius: 6px 6px 0 0; position: relative; }
.bar small { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--muted); font-size: 11px; }
.stack { flex: 1; min-width: 42px; display: flex; flex-direction: column; justify-content: end; height: 220px; }
.seg { min-height: 4px; }
.seg.pv { background: #16b8ad; }
.seg.pf { background: #0b2b4c; }
.seg.mix { background: #f59e0b; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.heat div { border-radius: 7px; padding: 11px; color: white; font-weight: 800; background: var(--teal-dark); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hidden { display: none !important; }
.eezi-chat { position: fixed; right: 18px; bottom: 18px; z-index: 20; }
.chat-toggle { background: var(--teal-dark); color: white; border-radius: 999px; padding: 12px 16px; font-weight: 900; box-shadow: 0 12px 28px rgba(6,26,51,.22); }
.chat-panel { width: min(360px, calc(100vw - 36px)); background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 45px rgba(6,26,51,.18); overflow: hidden; margin-bottom: 10px; }
.chat-head { background: var(--navy); color: white; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.chat-head span { color: #c8d6e5; font-size: 12px; }
.chat-body { height: 240px; overflow: auto; padding: 12px; background: #f8fafc; display: grid; gap: 8px; align-content: start; }
.chat-msg { padding: 9px 11px; border-radius: 8px; max-width: 92%; line-height: 1.35; font-size: 14px; }
.chat-msg.bot { background: white; border: 1px solid var(--line); }
.chat-msg.user { background: var(--teal-dark); color: white; justify-self: end; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
@media (max-width: 980px) {
  .login-shell, .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid.two, .grid.three, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 14px; gap: 12px; align-items: start; flex-direction: column; }
}
