/* ============================================================
   SI-PM DIKARI — Design System
   Arah: panel kontrol operasional HVAC.
   Palet sejuk (cyan = pendinginan) di atas dasar slate.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Surfaces */
  --bg:          #EEF2F7;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --sidebar-1:   #0B1220;
  --sidebar-2:   #131D31;

  /* Brand — cooling */
  --primary:     #06B6D4;
  --primary-700: #0891B2;
  --primary-300: #67E8F9;
  --accent:      #38BDF8;

  /* Status */
  --good:        #10B981;
  --fair:        #14B8A6;
  --poor:        #F59E0B;
  --breakdown:   #EF4444;
  --replace:     #8B5CF6;

  /* Text */
  --ink:         #0F172A;
  --ink-soft:    #334155;
  --muted:       #64748B;
  --faint:       #94A3B8;

  /* Lines */
  --border:      #E2E8F0;
  --border-soft: #EEF2F7;

  --radius:      16px;
  --radius-sm:   11px;
  --shadow-sm:   0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow:      0 10px 30px -12px rgba(15,23,42,.16);
  --shadow-lg:   0 24px 60px -24px rgba(15,23,42,.28);

  --sidebar-w:   268px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--primary-300); color: var(--ink); }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--sidebar-1), var(--sidebar-2));
  color: #cbd5e1;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-right: 1px solid rgba(255,255,255,.04);
}

.brand {
  padding: 22px 18px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.05);
  margin-bottom: 4px;
}
.brand__logo {
  width: 152px; max-width: 82%; height: auto;
  display: block; margin: 0 auto 8px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.45));
}
.brand__cap {
  font-size: 10.5px; font-weight: 600; color: #64748b;
  letter-spacing: .1em; text-transform: uppercase;
}

.nav { flex: 1; overflow-y: auto; padding: 6px 14px 24px; }
.nav__group { margin-top: 18px; }
.nav__label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #475569;
  padding: 0 10px 8px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: #94a3b8;
  margin-bottom: 1px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav__item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav__item:hover { background: rgba(148,163,184,.08); color: #e2e8f0; }
.nav__item.active {
  background: linear-gradient(100deg, rgba(6,182,212,.20), rgba(6,182,212,.04));
  color: #fff;
}
.nav__item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--primary); box-shadow: 0 0 12px var(--primary);
}
.nav__item.active svg { opacity: 1; color: var(--primary-300); }
.nav__badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--breakdown); color: #fff;
  min-width: 19px; height: 19px; padding: 0 6px;
  border-radius: 99px; display: grid; place-items: center;
}
.nav__badge--amber { background: var(--poor); }

/* ---------- Dropdown nav (collapsible) ---------- */
.nav__parent { margin-bottom: 1px; }
.nav__toggle { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.nav__chev { width: 15px !important; height: 15px !important; margin-left: auto; opacity: .55; transition: transform .22s ease; }
.nav__parent.open .nav__chev { transform: rotate(180deg); opacity: .9; }
.nav__toggle.active-parent { background: rgba(148,163,184,.06); color: #e2e8f0; }
.nav__toggle.active-parent svg:first-child { opacity: 1; color: var(--primary-300); }

.nav__sub {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
  margin: 2px 0 2px 10px; padding-left: 14px;
  border-left: 1px solid rgba(148,163,184,.16);
}
.nav__parent.open .nav__sub { max-height: 720px; }
.nav__subitem {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; margin: 1px 0;
  font-size: 12.8px; font-weight: 500; color: #8da2bd;
  transition: background .15s, color .15s; position: relative;
}
.nav__subitem > span:not(.nav__code) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__subitem:hover { background: rgba(148,163,184,.08); color: #e2e8f0; }
.nav__subitem.active { background: linear-gradient(100deg, rgba(6,182,212,.18), rgba(6,182,212,.03)); color: #fff; }
.nav__code {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: .02em; color: var(--primary-300);
  background: rgba(6,182,212,.12); border: 1px solid rgba(6,182,212,.25);
  padding: 2px 5px; border-radius: 5px; flex-shrink: 0;
}
.nav__ext { margin-left: auto; font-size: 12px; opacity: .45; }
.nav__sub-empty { padding: 8px 10px; font-size: 12px; color: #64748b; font-style: italic; }

/* ---------- Main ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  height: 68px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
}
.topbar__menu { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar__title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 13px; width: 270px;
  color: var(--muted);
}
.search input { border: 0; background: none; outline: none; font: inherit; font-size: 13.5px; color: var(--ink); width: 100%; }
.search svg { width: 17px; height: 17px; flex-shrink: 0; }

.userchip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--primary), var(--primary-700));
  color: #04222a; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; font-family: 'Sora', sans-serif;
}
.userchip__name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.userchip__role { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* ---------- Content ---------- */
.content { padding: 28px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--_tone); opacity: .07;
}
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--_tone) 14%, white);
  color: var(--_tone);
}
.kpi__icon svg { width: 19px; height: 19px; }
.kpi__value { font-family: 'Sora', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; line-height: 1; }
.kpi__meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.kpi__pct { font-weight: 700; color: var(--_tone); }
.kpi__bar { margin-top: 14px; height: 6px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.kpi__bar > i { display: block; height: 100%; border-radius: 99px; background: var(--_tone); width: var(--_w, 0%); }

.kpi--total { --_tone: var(--primary); }
.kpi--good { --_tone: var(--good); }
.kpi--poor { --_tone: var(--poor); }
.kpi--breakdown { --_tone: var(--breakdown); }
.kpi--replace { --_tone: var(--replace); }

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.card__title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.card__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card__body { padding: 22px; }

.chart-wrap { position: relative; height: 280px; }

/* Donut SVG */
.donut { position: relative; width: 240px; max-width: 100%; margin: 4px auto 6px; }
.donut__svg { width: 100%; height: auto; display: block; }
.donut__svg circle { transition: stroke-dashoffset .6s ease; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut__center b { font-family: 'Sora', sans-serif; font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.donut__center span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.donut__legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 18px; }
.donut__chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.donut__chip i { width: 9px; height: 9px; border-radius: 3px; }
.donut__chip b { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--ink); }

/* Legend list (donut) */
.legend { display: flex; flex-direction: column; gap: 2px; }
.legend__row { display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-bottom: 1px dashed var(--border-soft); }
.legend__row:last-child { border-bottom: 0; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend__name { font-size: 13.5px; font-weight: 500; }
.legend__val { margin-left: auto; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14px; }
.legend__pct { font-size: 12px; color: var(--muted); width: 54px; text-align: right; }

/* ============================================================
   TABLE
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border-soft); }
.select, .input {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; outline: none;
}
.select:focus, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(6,182,212,.14); }
.toolbar .input--search { margin-left: auto; min-width: 200px; }

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  padding: 13px 18px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #f6fbfd; }
table.data tbody tr.row-link { cursor: pointer; }
table.data tbody tr.row-link:hover { background: #eef7fb; }
table.data tbody tr.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.data tbody tr:last-child td { border-bottom: 0; }

.hvac-id { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 13px; color: var(--ink); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.hvac-id .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.room-cell { color: var(--ink-soft); max-width: 260px; }
.type-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary-700); background: rgba(6,182,212,.10); padding: 4px 10px; border-radius: 7px; white-space: nowrap; }
.text-faint { color: var(--faint); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  padding: 5px 11px 5px 9px; border-radius: 99px;
  background: color-mix(in srgb, var(--_b) 12%, white);
  color: color-mix(in srgb, var(--_b) 60%, #0f172a);
  white-space: nowrap;
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--_b); }
.badge--good { --_b: var(--good); }
.badge--fair { --_b: var(--fair); }
.badge--poor { --_b: var(--poor); }
.badge--breakdown { --_b: var(--breakdown); }
.badge--replace { --_b: var(--replace); }
.badge--muted { --_b: var(--faint); }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; flex-wrap: wrap; }
.pager__info { font-size: 13px; color: var(--muted); }
.pager__nav { display: flex; gap: 6px; }
.pager__btn { min-width: 36px; height: 36px; padding: 0 11px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; transition: all .12s; }
.pager__btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-700); }
.pager__btn.active { background: var(--primary); border-color: var(--primary); color: #04222a; }
.pager__btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============================================================
   LOGIN
   ============================================================ */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.auth__aside {
  background: linear-gradient(165deg, var(--sidebar-1), #0d2030 60%, #06323d);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth__aside::before {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.35), transparent 70%);
  top: -120px; right: -120px;
}
.auth__aside::after {
  content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.20), transparent 70%);
  bottom: -100px; left: -80px;
}
.auth__brand { display: flex; align-items: center; gap: 12px; position: relative; }
.auth__brand-logo { width: 150px; height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.auth__logo { display: block; width: 168px; height: auto; margin: 0 auto 22px; }
.auth__hero { position: relative; }
.auth__hero h2 { font-family: 'Sora', sans-serif; font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 16px; }
.auth__hero p { color: #94a3b8; font-size: 15px; max-width: 420px; line-height: 1.6; }
.auth__stats { display: flex; gap: 30px; position: relative; margin-top: 36px; }
.auth__stat b { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 800; display: block; }
.auth__stat span { color: #64748b; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }

.auth__panel { display: grid; place-items: center; padding: 40px; }
.auth__form { width: 100%; max-width: 380px; }
.auth__form h1 { font-family: 'Sora', sans-serif; font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth__form > p { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field input {
  width: 100%; font: inherit; font-size: 14.5px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); outline: none; transition: border .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(6,182,212,.13); }
.btn {
  width: 100%; cursor: pointer; font: inherit; font-weight: 700; font-size: 14.5px;
  padding: 13px; border: 0; border-radius: 11px; color: #04222a;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  box-shadow: 0 10px 24px -10px rgba(6,182,212,.7);
  transition: transform .12s, box-shadow .12s; margin-top: 6px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(6,182,212,.8); }
.btn:active { transform: translateY(0); }
.alert { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13.5px; padding: 11px 14px; border-radius: 11px; margin-bottom: 18px; }
.hint { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; background: var(--surface-2); border: 1px dashed var(--border); padding: 11px; border-radius: 11px; }
.hint code { font-family: 'JetBrains Mono', monospace; color: var(--ink); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.backdrop { display: none; }

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 55; }
  .main { margin-left: 0; }
  .topbar__menu { display: grid; place-items: center; }
  .search { display: none; }
  .content { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   MASTER DATA — buttons, drawer, toast, forms
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer;
  color: #04222a; border: 0; border-radius: 10px; padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  box-shadow: 0 8px 18px -8px rgba(6,182,212,.7); transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(6,182,212,.8); }
.btn-primary svg { width: 16px; height: 16px; }

.btn-ghost {
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  color: var(--ink-soft); background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 14px; transition: all .12s; text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-700); }
.btn-ghost--sm { padding: 6px 11px; font-size: 12.5px; }

.row-actions { display: flex; align-items: center; gap: 7px; justify-content: flex-end; }
.inline-del { margin: 0; display: inline; }
.btn-edit, .btn-del {
  font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer;
  border-radius: 8px; padding: 6px 13px; border: 1px solid transparent; transition: all .12s;
}
.btn-edit { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.btn-edit:hover { background: #fef3c7; }
.btn-del { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.btn-del:hover { background: #fee2e2; }
.col-action { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

.toolbar__count { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.empty-row { text-align: center; padding: 46px 20px !important; color: var(--muted); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 7px; }
.chip + .chip { margin-left: 4px; }
.req { color: var(--breakdown); }

/* Form controls in drawer */
.field select, .field textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); outline: none; transition: border .15s, box-shadow .15s;
}
.field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(6,182,212,.13); }
.field textarea { resize: vertical; min-height: 76px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-static { font-size: 14px; font-weight: 600; color: var(--ink); padding: 10px 0; }

.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 220px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.check:hover { background: #fff; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.filebox { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1.5px dashed var(--border); border-radius: 12px; cursor: pointer; color: var(--muted); transition: border .15s, background .15s; }
.filebox:hover { border-color: var(--primary); background: var(--surface-2); }
.filebox svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.filebox__txt { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sitelist__rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sitelist__row { display: flex; gap: 8px; }
.sitelist__row input { flex: 1; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.sitelist__row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(6,182,212,.13); }
.sitelist__del { border: 1px solid var(--border); background: var(--surface); color: var(--breakdown); border-radius: 9px; width: 40px; cursor: pointer; font-size: 16px; flex-shrink: 0; }
.sitelist__del:hover { background: #fef2f2; border-color: #fecaca; }

/* Drawer / slide-over */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 80; }
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 456px; max-width: 92vw;
  background: var(--surface); box-shadow: -20px 0 60px -24px rgba(15,23,42,.4);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 90; display: flex;
}
.drawer.show { transform: translateX(0); }
.drawer form { display: flex; flex-direction: column; width: 100%; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer__head h3 { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; margin: 0; }
.drawer__x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.drawer__x:hover { color: var(--ink); }
.drawer__body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Toast */
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 18px; box-shadow: var(--shadow-sm); animation: toastIn .3s ease; }
.toast__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.toast__x { margin-left: auto; background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }
.toast__x:hover { opacity: 1; }
.toast--success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.toast--success .toast__dot { background: var(--good); }
.toast--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.toast--error .toast__dot { background: var(--breakdown); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .checklist { grid-template-columns: 1fr; }
  .row-actions { flex-wrap: wrap; }
}

/* ============================================================
   CHAT per site
   ============================================================ */
.chat { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 232px); min-height: 440px; overflow: hidden; }
.chat__stream { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; background:
  radial-gradient(1100px 380px at 80% -8%, rgba(6,182,212,.05), transparent 60%); }
.chat__empty { margin: auto; color: var(--muted); font-size: 14px; text-align: center; }

.msg { display: flex; gap: 11px; align-items: flex-start; max-width: 76%; }
.msg--me { flex-direction: row-reverse; align-self: flex-end; }
.msg__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #04222a;
  background: linear-gradient(135deg, var(--primary-300), var(--primary)); box-shadow: var(--shadow-sm);
}
.msg--me .msg__avatar { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1e293b; }
.msg__body { min-width: 0; }
.msg__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.msg--me .msg__meta { flex-direction: row-reverse; }
.msg__name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.msg__time { font-size: 11px; color: var(--muted); }
.msg__bubble {
  font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 14px; border-top-left-radius: 4px;
  word-break: break-word; white-space: normal;
}
.msg--me .msg__bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: #04222a; border: 0; border-radius: 14px; border-top-right-radius: 4px;
}
.msg--me .msg__bubble a { color: #033; }

.chat__composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.chat__composer textarea {
  flex: 1; resize: none; font: inherit; font-size: 14px; line-height: 1.4; color: var(--ink);
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; outline: none; max-height: 140px;
  transition: border .15s, box-shadow .15s;
}
.chat__composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(6,182,212,.13); }
.chat__send { padding: 11px 13px; flex-shrink: 0; }
.chat__send svg { width: 18px; height: 18px; }

@media (max-width: 600px) { .msg { max-width: 90%; } .chat { height: calc(100vh - 200px); } }

/* ============================================================
   EQUIPMENT — resume, form unit, profil, import
   ============================================================ */
.badge--cond { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); }

.btn-success {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: 13.5px;
  color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 8px 18px -8px rgba(16,185,129,.7);
}
.btn-success:hover { transform: translateY(-1px); }
.btn-success svg { width: 16px; height: 16px; }

/* Resume kondisi */
.resume { padding: 20px 22px; }
.resume__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.resume__title { font-family: 'Sora',sans-serif; font-weight: 700; font-size: 15px; }
.resume__title span { font-family: 'Inter',sans-serif; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.resume__total { background: var(--primary); color: #04222a; font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 8px; }
.resume__cards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.rcard { display: block; padding: 12px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--c); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.rcard--on { box-shadow: 0 0 0 2px var(--c) inset; }
.rcard__label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard__row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.rcard__num { font-family: 'Sora',sans-serif; font-size: 22px; font-weight: 800; color: var(--ink); }
.rcard__pct { font-size: 11.5px; font-weight: 700; color: var(--c); }
.resume__bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin-top: 14px; background: var(--surface-2); }
.resume__bar span { display: block; height: 100%; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; align-items: center; }
.filters .select { min-width: 150px; flex: 0 0 auto; }
.filters .input--search { flex: 1; min-width: 180px; margin: 0; }

/* Pager */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager__item { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border);
  color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 600; padding: 0 8px; }
.pager__item:hover { border-color: var(--primary); color: var(--primary-700); }
.pager__item.on { background: var(--primary); color: #04222a; border-color: var(--primary); }

/* Form unit */
.unit-form { padding: 24px; }
.unit-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.unit-form__full { grid-column: 1 / -1; }
.unit-form__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.unit-form input[type=text], .unit-form input[type=number] { width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); outline: none; }
.unit-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(6,182,212,.13); }
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Profil unit */
.unit-profile { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.spec { display: flex; flex-direction: column; gap: 3px; }
.spec span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.spec b { font-size: 14px; font-weight: 600; color: var(--ink); }
.spec--wide { grid-column: 1 / -1; }
.spec-sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.unit-qr .qr-box { display: inline-grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.unit-qr .qr-box img, .unit-qr .qr-box canvas { display: block; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.photo-item { margin: 0; }
.photo-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.photo-item figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }
.photo-empty { width: 100%; height: 160px; border-radius: 12px; border: 1px dashed var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--faint); }
.photo-empty svg { width: 30px; height: 30px; }
.photo-empty span { font-size: 12px; }

/* ===== Tombol aksi di header profil ===== */
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-actions .btn-primary svg { width: 15px; height: 15px; }

/* ===== Grid aksi pemeliharaan (PM/CIL/Predictive/TS) ===== */
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.action-btn { display: flex; flex-direction: column; gap: 3px; text-decoration: none; border-radius: 13px;
  padding: 16px 16px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  position: relative; transition: transform .12s, box-shadow .12s, border-color .12s; }
.action-btn b { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; }
.action-btn small { font-size: 12px; color: var(--muted); }
.action-btn__cue { margin-top: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.action-btn:not(.action-btn--off):hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(15,23,42,.5); }
.action-btn--pm   { border-color: #bae6fd; background: linear-gradient(160deg,#f0f9ff,#fff); }
.action-btn--pm   .action-btn__cue { color: #0284c7; }
.action-btn--cil  { border-color: #fde68a; background: linear-gradient(160deg,#fffbeb,#fff); }
.action-btn--cil  .action-btn__cue { color: #b45309; }
.action-btn--pred { border-color: #ddd6fe; background: linear-gradient(160deg,#f5f3ff,#fff); }
.action-btn--pred .action-btn__cue { color: #7c3aed; }
.action-btn--ts   { border-color: #fecaca; background: linear-gradient(160deg,#fef2f2,#fff); }
.action-btn--ts   .action-btn__cue { color: #dc2626; }
.action-btn--off  { background: var(--surface-2); cursor: not-allowed; opacity: .72; }
.action-btn--off b, .action-btn--off small { color: var(--faint); }
.action-btn--off .action-btn__cue { color: var(--faint); font-weight: 600; }

/* Import */
.import-steps { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 14px; color: var(--ink-soft); }
.import-steps code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.import-errs { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #b91c1c; }
.import-errs ul { margin: 8px 0 0; padding-left: 18px; }

@media (max-width: 900px) {
  .resume__cards { grid-template-columns: repeat(3, 1fr); }
  .unit-form__grid { grid-template-columns: 1fr; }
  .unit-profile { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-actions { width: 100%; }
}
/* ===== Menu aksi baris (popover) ===== */
.col-action { text-align: right; white-space: nowrap; position: relative; }
.rowmenu { display: inline-block; position: relative; }
.rowmenu > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: 20px; line-height: 1; color: var(--ink-soft);
  border: 1px solid var(--border); background: var(--surface); user-select: none; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu > summary::marker { content: ''; }
.rowmenu > summary:hover { border-color: var(--primary); color: var(--primary-700); }
.rowmenu[open] > summary { background: var(--primary); color: #04222a; border-color: var(--primary); }
.rowmenu__pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 240; width: 196px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(15,23,42,.4); padding: 8px; display: grid; gap: 6px; }
.rowmenu__pop form { margin: 0; }
.rmi { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 12px; border-radius: 8px; border: 0; cursor: