:root {
  --bg: #f3f6f3;
  --paper: #ffffff;
  --ink: #182c28;
  --muted: #6f817c;
  --line: #e1e9e3;
  --line-strong: #c9d6cc;
  --green: #1f5745;
  --green-deep: #163f33;
  --green-ink: #0f2c23;
  --mint: #e8f3ea;
  --mint-strong: #d7ead9;
  --lime: #cdef9a;
  --lime-soft: #eaf7d8;
  --amber: #a97a1f;
  --amber-soft: #fbf2dc;
  --red: #b84949;
  --red-soft: #fbeaea;
  --blue: #3c6e91;
  --blue-soft: #e8f1f7;
  --purple: #6b5aa6;
  --purple-soft: #efecf8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(21, 45, 36, .04), 0 10px 30px rgba(21, 45, 36, .05);
  --sidebar: 272px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -1.1px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 19px; letter-spacing: -.35px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; }
small, .small { font-size: 13px; line-height: 1.6; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
strong { font-weight: 700; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #83b06c; outline-offset: 2px;
}
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.workspace { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1420px; margin: 0 auto; padding: 30px 34px 70px; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; padding: 0 34px;
  background: rgba(243, 246, 243, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.breadcrumb strong { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb svg { width: 17px; height: 17px; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.top-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.version-chip {
  font-size: 10.5px; letter-spacing: 1.4px; font-weight: 700; padding: 6px 9px;
  border-radius: 7px; background: var(--mint); color: var(--green); border: 1px solid var(--mint-strong);
  white-space: nowrap;
}
/* Ukuran bawaan ikon SVG: tanpa aturan ini, ikon di konteks yang belum
   diberi ukuran khusus (mis. judul Pengaturan Global) tampil sebesar
   bawaan SVG (300x150). Aturan konteks yang lebih spesifik tetap menang. */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
  transition: .15s;
}
.icon-btn:hover { background: var(--mint); border-color: var(--line-strong); }
.mobile-menu { display: none; }
.owner-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #2c6b55, #173c31); color: #eaf5e6; font-size: 12px; font-weight: 700;
  letter-spacing: .5px; flex-shrink: 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 50;
  background: linear-gradient(180deg, #173c31 0%, #122e26 55%, #10271f 100%);
  color: #e9f1ea; display: flex; flex-direction: column; padding: 22px 18px 16px;
  overflow: hidden;
}
.sidebar::after {
  content: ""; position: absolute; right: -70px; top: -80px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(205, 239, 154, .16), transparent 68%); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; position: relative; z-index: 1; }
.brand-mark { width: 36px; height: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.brand-mark i { border-radius: 3px; background: var(--lime); }
.brand-mark i:nth-child(2) { background: #8fbf86; }
.brand-mark i:nth-child(3) { background: #6e9e79; }
.brand-mark i:nth-child(4) { background: #eaf7d8; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.3px; }
.brand small { display: block; font-size: 9.5px; letter-spacing: 1.7px; color: #8fb39a; text-transform: uppercase; margin-top: 2px; }
.page-switch { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); margin-bottom: 16px; }
.page-switch label { display: block; font-size: 9.5px; letter-spacing: 1.6px; color: #8fb39a; font-weight: 700; margin-bottom: 7px; }
.page-switch select {
  width: 100%; padding: 9px 10px; border-radius: 9px; background: #f5f8f2; color: #173c31;
  border: 0; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.nav-scroll { overflow-y: auto; flex: 1; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #3d5c50 transparent; }
.nav-label { font-size: 9.5px; letter-spacing: 1.55px; color: #7c9f88; font-weight: 700; padding: 17px 10px 7px; text-transform: uppercase; }
.nav-btn {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px;
  color: #c9dccd; font-size: 13.5px; font-weight: 550; text-align: left; border: 0; background: transparent;
  transition: .14s; position: relative;
}
.nav-btn svg { width: 18px; height: 18px; color: #8fb39a; flex-shrink: 0; }
.nav-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-btn.active { background: rgba(205, 239, 154, .15); color: #f4fbec; }
.nav-btn.active svg { color: var(--lime); }
.nav-btn.active::before {
  content: ""; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 4px;
  background: var(--lime); border-radius: 0 4px 4px 0;
}
.nav-count {
  margin-left: auto; min-width: 22px; height: 21px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 6px; background: rgba(255, 255, 255, .09); color: #cfe3d3; font-size: 10.5px; font-weight: 700;
}
.kill-chip {
  margin: 12px 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .4px; display: flex; align-items: center; gap: 7px;
  background: rgba(184, 73, 73, .18); color: #ffc9c9; border: 1px solid rgba(255, 150, 150, .2);
}
.sidebar-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; margin-top: 10px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-bottom .avatar { width: 34px; height: 34px; background: #2d5e4d; }
.sidebar-bottom strong { display: block; font-size: 12.5px; color: #eef6eb; font-weight: 600; }
.sidebar-bottom small { font-size: 10.5px; color: #86a893; }
.mobile-shade { display: none; }

/* ---------- Cards & primitives ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 24px; }
.stack { display: grid; gap: 20px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.heading h1 { margin-bottom: 7px; }
.heading p { color: var(--muted); font-size: 14.5px; max-width: 760px; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-head h2 { display: flex; align-items: center; gap: 9px; }
.scope-banner {
  display: flex; align-items: center; gap: 9px; padding: 10px 14px; margin-bottom: 20px;
  background: var(--mint); border: 1px solid var(--mint-strong); border-radius: 10px;
  font-size: 12.5px; color: #3e6453;
}
.scope-banner svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }
.scope-banner b { color: var(--green-deep); }
.note {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: #f7faf7; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.65;
}
.note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--green); }
.banner {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: 12px; margin-bottom: 22px;
  background: var(--red-soft); border: 1px solid #efd3d3; color: #8f3030; font-size: 13px; font-weight: 600;
}
.banner svg { width: 18px; height: 18px; }
.banner.info { background: var(--blue-soft); border-color: #d2e2ee; color: #315c7b; }
.banner.ok { background: var(--mint); border-color: var(--mint-strong); color: #2f624c; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 13px; font-weight: 650; white-space: nowrap; transition: .15s; color: var(--ink);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: #f1f6f1; border-color: var(--line-strong); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn.lime { background: var(--lime); border-color: var(--lime); color: #1d3b28; }
.btn.lime:hover { background: #c2ea85; border-color: #c2ea85; }
.btn.danger { background: var(--red-soft); border-color: #efd3d3; color: var(--red); }
.btn.danger:hover { background: #f7dede; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--mint); color: var(--green); }
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 9px; }
.btn.link { background: transparent; border: 0; color: var(--green); padding: 0; font-size: 12.5px; }
.btn.link:hover { text-decoration: underline; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px;
  background: #eef2ee; color: #5b6c65; font-size: 10.5px; font-weight: 750; letter-spacing: .25px;
  white-space: nowrap; line-height: 1.45;
}
.badge.green { background: var(--mint); color: #24614a; }
.badge.lime { background: var(--lime-soft); color: #3f611a; }
.badge.amber { background: var(--amber-soft); color: #8d6412; }
.badge.red { background: var(--red-soft); color: #9d3737; }
.badge.blue { background: var(--blue-soft); color: #2e607f; }
.badge.purple { background: var(--purple-soft); color: #55448f; }
.badge.white { background: rgba(255, 255, 255, .14); color: #f0f8ec; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.tag {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px;
  background: #f1f5f1; color: #5f7169; font-size: 11px; font-weight: 600;
}

/* inputs */
.field { display: grid; gap: 7px; }
.field > label { font-size: 12px; font-weight: 700; color: #40534a; display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; font-size: 13.5px; transition: .15s; color: var(--ink);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: #6b9b72; box-shadow: 0 0 0 3px rgba(107, 155, 114, .14); }
.input::placeholder, .textarea::placeholder { color: #a9b6af; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236f817c' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.form-error { background: var(--red-soft); border: 1px solid #efd3d3; color: #973a3a; padding: 10px 13px; border-radius: 8px; font-size: 12.5px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: #d6dfd8; transition: .2s; position: relative; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat { padding: 18px 19px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .55px; }
.stat-label svg { width: 16px; height: 16px; color: #97aa9e; }
.stat-value { font-size: 36px; font-weight: 750; letter-spacing: -1.6px; line-height: 1.25; margin-top: 7px; }
.stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* dashboard */
.dashboard-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.hero {
  background: linear-gradient(135deg, #1d5141 0%, #163c31 60%, #123128 100%);
  border: 0; color: #ecf5e9; padding: 26px; position: relative; overflow: hidden; margin-bottom: 22px;
}
.hero::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  right: -100px; top: -140px; background: radial-gradient(circle, rgba(205,239,154,.22), transparent 65%);
}
.hero-title { display: flex; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.hero h2 { font-size: 25px; letter-spacing: -.7px; margin: 15px 0 9px; color: #f4fbef; }
.hero p { color: #bcd4c2; font-size: 14px; line-height: 1.7; max-width: 520px; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); position: relative; z-index: 1; }
.hero-bottom .small { color: #a9c7b1; }
.orbit { width: 86px; height: 86px; border-radius: 50%; border: 1px solid rgba(205,239,154,.35); display: grid; place-items: center; color: var(--lime); position: relative; flex-shrink: 0; }
.orbit::before, .orbit::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(205,239,154,.18); }
.orbit::before { inset: 11px; } .orbit::after { inset: 25px; }
.orbit svg { width: 26px; height: 26px; }
.pipeline { padding: 21px; }
.pipeline-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pipeline-steps { display: grid; gap: 10px; }
.pipeline-step { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.pipeline-step:last-child { border-bottom: 0; }
.pipeline-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--mint); display: grid; place-items: center; color: var(--green); flex-shrink: 0; }
.pipeline-icon svg { width: 17px; height: 17px; }
.pipeline-step strong { font-size: 12.5px; display: block; }
.pipeline-step small { color: var(--muted); font-size: 11px; }
.pipeline-step .time { margin-left: auto; font-size: 10.5px; color: var(--muted); font-weight: 700; white-space: nowrap; padding-top: 2px; }
.health-card { padding: 21px; }
.health-list { display: grid; gap: 2px; }
.health-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.health-row:last-child { border-bottom: 0; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #c4cfc8; margin-top: 7px; flex-shrink: 0; }
.health-dot.ok { background: #4c9b68; box-shadow: 0 0 0 3px rgba(76,155,104,.14); }
.health-dot.bad { background: #c06464; box-shadow: 0 0 0 3px rgba(192,100,100,.12); }
.health-row .service-name { font-size: 13px; font-weight: 650; flex: 1; }
.health-row small { color: var(--muted); font-size: 11px; display: block; margin-top: 1px; }
.health-row .btn { flex-shrink: 0; }
.today-card { padding: 21px; margin-top: 22px; }
.today-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.today-row:last-child { border-bottom: 0; }
.today-row .page-mini { flex: 1; min-width: 0; }
.today-row .page-mini strong { display: block; font-size: 13.5px; }
.today-row .page-mini small { color: var(--muted); font-size: 11.5px; }
.today-ep { display: flex; align-items: center; gap: 10px; }
.activity-feed { display: grid; gap: 0; }
.activity-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--mint); display: grid; place-items: center; color: var(--green); flex-shrink: 0; }
.activity-icon svg { width: 15px; height: 15px; }
.activity-icon.warn { background: var(--amber-soft); color: var(--amber); }
.activity-icon.err { background: var(--red-soft); color: var(--red); }
.activity-text { font-size: 12.5px; line-height: 1.55; }
.activity-text b { font-weight: 650; }
.activity-text small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* pages */
.page-card { overflow: hidden; display: flex; flex-direction: column; }
.page-cover {
  height: 116px; background: linear-gradient(135deg, #234f41, #153a2f); position: relative;
  display: flex; align-items: center; padding: 20px;
}
.page-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 10%, rgba(205,239,154,.24), transparent 55%);
}
.page-cover .badge { position: absolute; top: 15px; right: 15px; z-index: 2; }
.page-avatar {
  width: 66px; height: 66px; border-radius: 17px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15); display: grid; place-items: center; color: #dcefd8; z-index: 1;
}
.page-avatar svg { width: 30px; height: 30px; }
.page-card-body { padding: 19px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.page-card-body h2 { font-size: 18px; }
.page-card-body p { color: var(--muted); font-size: 12.5px; line-height: 1.65; margin-top: 7px; min-height: 42px; }
.page-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 14px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-metrics div { text-align: center; font-size: 10px; color: var(--muted); line-height: 1.5; }
.page-metrics b { display: block; font-size: 17px; color: var(--ink); letter-spacing: -.5px; }
.page-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11.5px; margin-bottom: 15px; }
.page-actions { display: flex; gap: 8px; margin-top: auto; }
.page-actions .btn:first-child { flex: 1; }

/* entity cards */
.entity-card { overflow: hidden; display: flex; flex-direction: column; }
.entity-art { height: 192px; background: linear-gradient(145deg, #e7eee5, #f2f5ef); position: relative; overflow: hidden; display: grid; place-items: center; }
.entity-art img { width: 100%; height: 100%; object-fit: cover; }
.entity-art .placeholder { display: grid; place-items: center; gap: 9px; color: #94a89a; font-size: 11.5px; text-align: center; padding: 20px; }
.entity-art .placeholder svg { width: 30px; height: 30px; }
.entity-art .badge { position: absolute; top: 12px; right: 12px; }
.entity-info { padding: 16px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.entity-info h2 { font-size: 17px; }
.entity-info p { color: var(--muted); font-size: 12.5px; line-height: 1.6; margin-top: 6px; min-height: 40px; }
.entity-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.locks { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; color: var(--green); }
.locks svg { width: 13px; height: 13px; }
.toolbar { display: flex; gap: 11px; align-items: center; margin-bottom: 19px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #94a69d; }
.search .input { padding-left: 36px; }
.toolbar .select { width: auto; min-width: 150px; }

/* reference */
.reference-layout { display: grid; grid-template-columns: 1.45fr .8fr; gap: 22px; align-items: start; }
.reference-frame { background: #e9eee8; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.reference-frame img { width: 100%; height: auto; }
.reference-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 9.5px; letter-spacing: 1.25px; text-transform: uppercase; color: #83958b;
  font-weight: 750; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click-row { cursor: pointer; transition: .12s; }
.table tbody tr.click-row:hover { background: #f7faf7; }
.table td strong { font-size: 13px; display: block; }
.table td .muted { font-size: 11.5px; display: block; margin-top: 2px; }
.table td .chev { color: #a5b5ab; width: 16px; height: 16px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state { padding: 58px 26px; text-align: center; display: grid; justify-items: center; gap: 9px; }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--mint); display: grid; place-items: center; color: var(--green); margin-bottom: 5px; }
.empty-state .empty-icon svg { width: 25px; height: 25px; }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 520px; }
.empty-state .btn { margin-top: 8px; }

/* memory & logs */
.memory-item { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.memory-item:last-child { border-bottom: 0; }
.memory-item h3 { font-size: 15px; }
.memory-item p { color: var(--muted); font-size: 13px; line-height: 1.65; margin-top: 6px; }
.memory-item .flex { margin-top: 12px; flex-wrap: wrap; }
.log-row { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-actor { flex-shrink: 0; width: 110px; }
.log-actor .badge { font-size: 9.5px; }
.log-body { flex: 1; min-width: 0; }
.log-body strong { font-size: 12.5px; display: block; }
.log-body p { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.55; }
.log-time { flex-shrink: 0; font-size: 10.5px; color: #93a59b; white-space: nowrap; }

/* settings */
.settings-tabs { display: flex; gap: 5px; padding: 5px; background: #e9efea; border-radius: 11px; margin-bottom: 22px; overflow-x: auto; }
.settings-tab { padding: 9px 15px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: #61736a; background: transparent; border: 0; white-space: nowrap; }
.settings-tab.active { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.settings-section { padding: 23px; margin-bottom: 18px; }
.settings-section > h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.settings-section > h2 svg { width: 21px; height: 21px; color: var(--green); }
.health-inline svg { width: 16px; height: 16px; }
.kill-chip svg { width: 14px; height: 14px; }
.mcp-endpoint { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; background: #f7faf7; border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; margin-top: 14px; }
.mcp-endpoint code { font-size: 12.5px; word-break: break-all; }
.mcp-tools { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px 16px; }
.mcp-tools li { font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: baseline; }
.mcp-tools code { color: var(--ink); font-size: 12px; white-space: nowrap; }
.mcp-token-reveal { margin-top: 13px; padding: 12px 13px; border-radius: 9px; background: var(--amber-soft); border: 1px solid #eadcb9; color: #6d5212; font-size: 12px; line-height: 1.55; }
.mcp-token-reveal code { display: block; margin-top: 6px; font-size: 12.5px; word-break: break-all; color: var(--ink); background: #fff; border: 1px solid #eadcb9; border-radius: 7px; padding: 8px 10px; }
.settings-section > p { color: var(--muted); font-size: 12.5px; margin-bottom: 19px; max-width: 720px; line-height: 1.65; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 17px; border-top: 1px dashed var(--line); }
.settings-actions .right { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.health-inline { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 9px; background: #f7faf7; border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); margin-top: 14px; line-height: 1.55; }
.health-inline.ok { background: var(--mint); border-color: var(--mint-strong); color: #2f624c; }
.health-inline.bad { background: var(--red-soft); border-color: #efd3d3; color: #8f3d3d; }
.account-list { display: grid; gap: 8px; margin-top: 13px; }
.account-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.account-row .avatar { width: 28px; height: 28px; font-size: 10px; }
.account-row .platform { margin-left: auto; font-size: 10px; }
.kill-card { border-color: #efd3d3; }
.kill-card h2 { color: var(--red); }
.secret-note { font-size: 11px; color: var(--muted); }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(14, 33, 26, .55);
  backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 18px 30px; overflow-y: auto; animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 720px; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  animation: rise .2s ease; overflow: hidden; margin: auto 0;
}
.modal:focus { outline: none; }
.modal.wide { max-width: 1080px; }
.modal.narrow { max-width: 520px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; }
.modal-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fafcf9; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 9px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: #f0f4f0; color: var(--ink); }
.modal-close svg { width: 19px; height: 19px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 12.5px; font-weight: 650; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green); border-color: var(--green); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upload-tile { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px; background: #fafcf9; }
.upload-tile .preview { height: 180px; border-radius: 9px; overflow: hidden; background: #e9eee8; display: grid; place-items: center; margin-bottom: 9px; }
.upload-tile .preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-tile .preview .placeholder { color: #94a89a; font-size: 11px; text-align: center; display: grid; place-items: center; gap: 8px; }
.upload-tile .preview svg { width: 26px; height: 26px; }
.upload-tile label.file-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.upload-tile label.file-btn:hover { background: var(--mint); }
.upload-tile input[type=file] { display: none; }
.upload-tile small { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; line-height: 1.45; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.panel-card .art { background: #eef2ec; }
.panel-card .art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.panel-card .body { padding: 13px; }
.panel-card .body h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-card .body p { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 6px; }
.qc-violations { margin-top: 8px; padding: 8px 9px; border-radius: 7px; background: var(--red-soft); color: #8a3636; font-size: 10.5px; line-height: 1.5; }
.dialog-list { display: grid; gap: 5px; margin-top: 8px; }
.dialog-item { background: #f5f8f4; border-radius: 7px; padding: 7px 9px; font-size: 11.5px; }
.dialog-item b { color: var(--green); font-size: 10.5px; display: block; }
.script-panel { border: 1px solid var(--line); border-radius: 11px; padding: 15px; }
.script-panel h4 { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.script-panel .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.function-badge { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; font-weight: 750; color: var(--purple); background: var(--purple-soft); border-radius: 5px; padding: 3px 6px; }
.strip-preview { border-radius: 11px; overflow: hidden; border: 1px solid var(--line); background: #12211c; }
.strip-preview img { width: 100%; height: auto; }
.art-zoom { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.art-zoom img { display: block; }
.art-zoom:hover img { filter: brightness(1.04); }
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: rgba(9, 18, 14, .94); animation: fade .15s ease;
}
.lightbox img {
  max-width: 96vw; max-height: 92vh; width: auto; height: auto; border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45); background: #fff;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25); background: rgba(23,60,49,.85); color: #f4f8f1;
  display: grid; place-items: center; cursor: pointer;
}
.lightbox-close:hover { background: #205746; }
.lightbox-close svg { width: 19px; height: 19px; }
.caption-box { background: #f7faf7; border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.7; color: #33473d; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.progress-banner { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 10px; background: var(--purple-soft); color: #57468f; font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(107,90,166,.25); border-top-color: #6b5aa6; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.loading-panel { padding: 60px; display: grid; justify-items: center; gap: 13px; color: var(--muted); font-size: 12.5px; }
.loading-panel .spinner { width: 24px; height: 24px; border-width: 3px; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 9px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  background: #173c31; color: #edf6e9; padding: 12px 15px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2); animation: rise .2s ease; line-height: 1.5;
}
.toast.error { background: #8f3535; }
.toast.success { background: #205b43; }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-visual {
  background: linear-gradient(150deg, #173c31 0%, #102d24 55%, #0d241d 100%);
  color: #edf6e9; padding: 54px 58px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-visual::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%; right: -160px; bottom: -170px;
  background: radial-gradient(circle, rgba(205,239,154,.18), transparent 65%);
}
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand .brand-mark { width: 40px; height: 40px; }
.login-brand strong { font-size: 17px; display: block; }
.login-brand small { font-size: 9.5px; letter-spacing: 1.8px; color: #8fb39a; text-transform: uppercase; }
.login-hero { position: relative; z-index: 1; max-width: 470px; }
.login-hero h1 { font-size: 44px; line-height: 1.12; letter-spacing: -1.8px; color: #f4fbef; margin-bottom: 17px; }
.login-hero p { color: #b9d3c0; font-size: 15px; line-height: 1.75; }
.login-features { display: grid; gap: 11px; margin-top: 30px; }
.login-feature { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; color: #b9d3c0; }
.login-feature .tick { width: 20px; height: 20px; border-radius: 50%; background: rgba(205,239,154,.16); color: var(--lime); display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.login-feature .tick svg { width: 11px; height: 11px; }
.login-feature b { color: #eaf5e5; }
.login-foot { position: relative; z-index: 1; font-size: 10.5px; color: #6f937d; letter-spacing: .2px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 390px; }
.login-card h2 { font-size: 27px; letter-spacing: -.8px; margin-bottom: 7px; }
.login-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { margin-top: 8px; }
.login-hint { margin-top: 20px; padding: 12px 13px; border-radius: 9px; background: #f7faf7; border: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.6; }
.login-hint code { color: var(--green); font-weight: 700; }

/* boot */
.boot-screen { min-height: 100vh; display: grid; place-items: center; gap: 14px; color: var(--muted); font-size: 13px; align-content: center; }
.boot-mark { width: 44px; height: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; animation: pulse 1.4s ease infinite; }
.boot-mark i { background: var(--green); border-radius: 4px; }
.boot-mark i:nth-child(2) { background: #7aa478; }
.boot-mark i:nth-child(3) { background: #a4c39a; }
.boot-mark i:nth-child(4) { background: var(--lime); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.94); opacity: .7; } }

/* responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .dashboard-main, .reference-layout { grid-template-columns: 1fr; }
  .today-card { margin-top: 0; }
}
@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 272px; box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .workspace { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .mobile-shade { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(11, 28, 22, .45); opacity: 0; pointer-events: none; transition: .2s; }
  .mobile-shade.show { opacity: 1; pointer-events: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { padding: 36px 30px; min-height: 330px; }
  .login-hero h1 { font-size: 34px; }
  .login-features, .login-foot { display: none; }
  .login-form-wrap { padding: 32px 22px 50px; }
}
@media (max-width: 760px) {
  .content { padding: 22px 17px 60px; }
  .topbar { padding: 0 17px; height: 60px; }
  .top-date { display: none; }
  .owner-chip span { display: none; }
  .version-chip { display: none; }
  h1 { font-size: 25px; }
  .heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .grid2, .grid3, .grid4, .form-grid, .panel-grid, .upload-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 29px; }
  .hero { padding: 21px; }
  .hero h2 { font-size: 21px; }
  .hero-bottom { align-items: flex-start; flex-direction: column; }
  .orbit { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .select { width: 100%; }
  .table th, .table td { padding: 11px 10px; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; max-width: none; }
  .modal.wide, .modal.narrow { max-width: none; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .kv { grid-template-columns: 1fr; gap: 3px; }
  .kv dd { margin-bottom: 8px; }
  .log-actor { width: 82px; }
  .today-row { flex-wrap: wrap; }
  .toasts { left: 16px; right: 16px; }
}
