/* WGN IPAM — tampilan mengikuti referensi ip-mgmt.jpg (sidebar oranye, kartu putih lembut). */
:root {
  --accent: #e9634a;
  --accent-strong: #d1432b;
  --accent-grad: linear-gradient(180deg, #f17c61 0%, #e45b41 45%, #c5361d 100%);
  --accent-grad-h: linear-gradient(90deg, #ee6e53 0%, #e0573d 100%);
  --page: #f9e3dd;
  --frame: rgba(255, 246, 243, .82);
  --surface: #ffffff;
  --surface-2: #fdf4f1;
  --beige: #f6ebe1;
  --text: #2c2a33;
  --text-2: #55535e;
  --muted: #a3a1ab;
  --line: #f0e3df;
  --shadow: 0 6px 22px rgba(201, 82, 55, .08);
  --shadow-strong: 0 14px 30px rgba(214, 79, 52, .32);
  --st-used: #5ea9df;
  --st-reserved: #7181b8;
  --st-inactive: #d9472f;
  --st-free: #6cbb86;
  --st-gw: #f2a541;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-w: 96px;
  --right-w: 320px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-strong); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: 'Poppins', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 16px; height: 16px; }

.blob { position: fixed; border-radius: 50%; filter: blur(70px); z-index: 0; pointer-events: none; }
.blob-a { width: 520px; height: 520px; left: -140px; top: -160px; background: #f7c6b9; }
.blob-b { width: 460px; height: 460px; right: -120px; bottom: -160px; background: #f5cfc4; }

/* ---------- Shell ---------- */
.shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--right-w);
  gap: 0;
  max-width: 1480px;
  margin: 28px auto;
  min-height: calc(100vh - 56px);
  background: var(--frame);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(197, 87, 62, .12);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; min-height: 100%; }
.brand { height: 92px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; letter-spacing: .5px; color: var(--accent-strong); }
.brand span, .login-brand span { color: var(--text); font-weight: 600; margin-left: 4px; }
.side-panel {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  background: var(--accent-grad);
  border-top-right-radius: 64px;
  padding: 44px 0 24px;
  position: relative;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--accent-strong); font-weight: 700; font-size: 15px;
  display: grid; place-items: center; border: 3px solid rgba(255, 255, 255, .55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.nav { display: flex; flex-direction: column; gap: 10px; margin-top: 42px; width: 100%; }
.nav-item {
  position: relative; height: 54px; width: 100%; border: 0; background: transparent; color: rgba(255, 255, 255, .78);
  display: grid; place-items: center;
}
.nav-item svg.i { width: 24px; height: 24px; stroke-width: 1.5; }
.nav-item:hover { color: #fff; }
.nav-item.active { color: #fff; }
.nav-item.active::after { content: ''; position: absolute; right: 0; top: 13px; width: 4px; height: 28px; border-radius: 4px 0 0 4px; background: #fff; }
.nav-item .nav-label {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--text); color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 30;
}
.nav-item:hover .nav-label { opacity: 1; }
.side-bottom {
  margin-top: auto; width: 42px; height: 42px; border-radius: 12px; border: 0;
  background: rgba(255, 255, 255, .22); color: #fff; display: grid; place-items: center; position: relative;
}
.side-bottom:hover { background: rgba(255, 255, 255, .34); }

/* ---------- Main ---------- */
.main { padding: 22px 26px 28px; min-width: 0; }
.topbar { display: flex; gap: 18px; align-items: center; height: 48px; margin-top: 2px; }
.search { flex: 1; display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; height: 46px; padding: 0 5px 0 16px; box-shadow: var(--shadow); max-width: 560px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; height: 100%; }
.search input::placeholder { color: var(--muted); }
.search-btn { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--accent-grad-h); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(226, 88, 63, .35); }
.search-btn svg.i { width: 16px; height: 16px; }
.clock { margin-left: auto; height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--surface-2); border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; color: var(--text-2); font-weight: 500; }
.clock b { font-weight: 500; color: var(--text); }

.view { margin-top: 24px; }
.view-title { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; flex-wrap: wrap; }
.view-title h2 { margin: 0; font-size: 20px; font-weight: 500; color: #4a4850; }
.view-title .spacer { flex: 1; }

/* Stats */
.stats-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
.stat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 8px; }
.stat { padding: 0 22px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-label { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 26px; font-weight: 500; margin: 2px 0 6px; letter-spacing: -.3px; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.delta i { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9px; color: #fff; }
.delta.good { color: #5fae78; } .delta.good i { background: #8fd1a4; }
.delta.warn { color: #e0664c; } .delta.warn i { background: #f19b86; }
.delta.info { color: #5d8fc4; } .delta.info i { background: #93bce4; }

.help-card {
  background: var(--accent-grad-h); color: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-strong);
  position: relative; border: 0; text-align: left; display: flex; flex-direction: column; gap: 8px;
}
.help-card .hc-brand { font-weight: 700; font-size: 10px; letter-spacing: .4px; line-height: 1.3; }
.help-card .hc-brand span { display: block; font-weight: 500; font-size: 10px; letter-spacing: 0; opacity: .95; }
.help-card .hc-text { font-size: 11.5px; opacity: .92; line-height: 1.5; }
.help-card .hc-dots { position: absolute; right: 12px; top: 12px; width: 24px; height: 16px; border-radius: 5px; background: rgba(255, 255, 255, .25); display: grid; place-items: center; font-size: 10px; letter-spacing: 1px; }
.help-card:hover { filter: brightness(1.04); }

/* Chips & controls */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font-size: 12px; white-space: nowrap; }
.chip:hover { border-color: #f1c2b6; }
.chip.on { background: var(--accent-grad-h); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(226, 88, 63, .25); }
.chip .n { opacity: .7; margin-left: 4px; }
select.input, input.input, textarea.input {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; outline: none; min-width: 0; width: 100%;
}
select.input:focus, input.input:focus, textarea.input:focus { border-color: #f0a693; box-shadow: 0 0 0 3px rgba(233, 99, 74, .12); }
select.input.compact { width: auto; padding: 5px 10px; border-radius: 999px; font-size: 12px; }

.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); white-space: nowrap; }
.btn:hover { filter: brightness(.98); }
.btn-primary { background: var(--accent-grad-h); color: #fff; box-shadow: 0 8px 18px rgba(226, 88, 63, .3); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-danger { background: #fff1ee; color: var(--accent-strong); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Table (gaya "Orders") ---------- */
.tbl { width: 100%; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 14px; padding: 0 18px 0 16px; }
.tbl-head { color: var(--text-2); font-size: 12px; font-weight: 500; height: 38px; }
.tbl-head button { border: 0; background: none; padding: 0; display: inline-flex; gap: 6px; align-items: center; color: inherit; font-weight: 500; text-align: left; }
.tbl-head button .arr { font-size: 12px; color: var(--text); opacity: .25; }
.tbl-head button.sorted .arr { opacity: 1; }
.tbl-body { display: flex; flex-direction: column; gap: 12px; }
.tbl-row {
  background: var(--surface); border-radius: 8px; min-height: 52px; box-shadow: 0 2px 10px rgba(200, 90, 64, .045);
  font-size: 12.5px; cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative;
}
.tbl-row:hover { box-shadow: 0 6px 16px rgba(200, 90, 64, .1); }
.tbl-row.selected {
  background: var(--accent-grad-h); color: #fff; transform: scale(1.022); box-shadow: var(--shadow-strong); z-index: 2;
}
.tbl-row.selected .muted, .tbl-row.selected .sub { color: rgba(255, 255, 255, .78); }
.cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 0; }
.cell .sub { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cell.c { text-align: center; }
.kebab { border: 0; background: none; width: 26px; height: 32px; display: grid; place-items: center; color: #c9c5cc; border-radius: 6px; justify-self: end; }
.kebab:hover { background: rgba(0, 0, 0, .04); }
.tbl-row.selected .kebab { color: #fff; }
.empty { background: var(--surface); border-radius: 12px; padding: 34px; text-align: center; color: var(--muted); }

.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 66px; height: 24px; padding: 0 10px; border-radius: 5px; font-size: 11px; color: #fff; font-weight: 500; white-space: nowrap; }
.pill.Aktif, .pill.used { background: var(--st-used); }
.pill.Reserved, .pill.reserved { background: var(--st-reserved); }
.pill.Nonaktif, .pill.inactive { background: var(--st-inactive); }
.pill.free { background: var(--st-free); }
.pill.soft { background: var(--surface-2); color: var(--text-2); }
.tbl-row.selected .pill { background: #fff; color: var(--accent-strong); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 11px; }

/* Menu kebab */
.menu { position: fixed; z-index: 60; background: var(--surface); border-radius: 12px; box-shadow: 0 16px 40px rgba(60, 30, 20, .18); padding: 6px; min-width: 180px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 12px; border-radius: 8px; text-align: left; color: var(--text); }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--accent-strong); }


/* Kolom tabel per halaman */
.t-alloc { --cols: minmax(130px, 1.1fr) minmax(0, 1.7fr) minmax(0, 1fr) 54px 44px 92px 26px; --cols-m: minmax(0, 1fr) auto 26px; }
.t-ref { --cols: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 70px 70px 26px; --cols-m: minmax(0, 1fr) auto 26px; }
.t-border { --cols: 150px 140px minmax(0, 1.5fr) minmax(0, 1fr) 54px 150px; --cols-m: minmax(0, 1fr) minmax(0, 1fr) auto; }
.t-users { --cols: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 90px minmax(0, 1fr) 26px; --cols-m: minmax(0, 1fr) minmax(0, 1fr) auto 26px; }
.t-audit { --cols: 160px 110px 140px minmax(0, 1fr); --cols-m: 110px 80px minmax(0, 1fr); }
.t-audit .tbl-row, .t-border .tbl-row { cursor: default; }
.t-audit .cell:last-child { white-space: normal; }
.t-border .cell:last-child { display: flex; gap: 6px; justify-content: flex-end; overflow: visible; }
.cell .sub.only-mobile { display: none; }
.shell.no-right { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ---------- Right bar ---------- */
.rightbar { background: var(--surface); padding: 30px 0 22px; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.rb-section { padding: 0 20px 22px; border-bottom: 8px solid var(--surface-2); margin-bottom: 18px; }
.rb-section:last-child { border-bottom: 0; margin-bottom: 0; }
.rb-title { font-size: 14px; font-weight: 500; margin: 0 0 16px; color: #3a3840; display: flex; align-items: center; gap: 8px; }
.rb-title .spacer { flex: 1; }
.rb-title .link { border: 0; background: none; color: var(--accent-strong); font-size: 12px; padding: 0; }

.blocks-scroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
.blocks-scroll::-webkit-scrollbar { display: none; }
.block-card { flex: 0 0 128px; scroll-snap-align: start; background: var(--surface-2); border-radius: 10px; padding: 12px 10px 12px; text-align: center; border: 2px solid transparent; }
.block-card.on { border-color: #f3b3a3; }
.block-card .mini { display: block; margin: 0 auto 10px; width: 92px; height: 92px; }
.block-card .bc-name { font-weight: 600; font-size: 12px; }
.block-card .bc-sub { font-size: 10.5px; color: var(--text-2); margin-top: 4px; }
.block-card .bc-sub b { font-weight: 500; color: var(--text); }
.dots { display: flex; gap: 5px; margin-top: 10px; }
.dots span { width: 6px; height: 4px; border-radius: 3px; background: #e6dcd9; }
.dots span.on { width: 14px; background: #cfc5c2; }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); row-gap: 14px; column-gap: 14px; font-size: 12px; }
.kv dt { color: var(--text); font-weight: 500; }
.kv dd { margin: 0; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.kv dd.strong { color: var(--text); }
.kv-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.reco-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.reco-tabs .chip { padding: 4px 10px; font-size: 11.5px; }
.reco-wrap { display: flex; gap: 12px; align-items: stretch; margin-right: -20px; overflow: hidden; }
.reco-card { flex: 0 0 calc(100% - 44px); background: var(--beige); border-radius: 12px; padding: 18px 14px 16px; text-align: center; position: relative; }
.reco-card svg.box { width: 128px; height: 112px; display: block; margin: -36px auto 6px; filter: drop-shadow(0 10px 12px rgba(120, 80, 40, .2)); }
.reco-card .rc-name { color: #8b6a47; font-weight: 600; font-size: 14px; margin-top: 4px; }
.reco-card .rc-sub { font-size: 10.5px; color: #7f7466; margin-top: 10px; }
.reco-card .rc-sub b { font-weight: 600; color: #5d5246; margin-right: 6px; }
.reco-peek { flex: 0 0 40px; background: #efeeee; border-radius: 12px 0 0 12px; }
.reco-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .8); display: grid; place-items: center; color: #8b6a47; }
.reco-nav.prev { left: 6px; } .reco-nav.next { right: 6px; }
.reco-empty { background: var(--surface-2); border-radius: 12px; padding: 24px 12px; text-align: center; color: var(--muted); }
.rb-cta { margin-top: 16px; height: 44px; font-size: 13px; }
.rb-placeholder { color: var(--muted); font-size: 12px; background: var(--surface-2); padding: 18px; border-radius: 10px; text-align: center; }

/* ---------- IP map ---------- */
.map-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .used { background: var(--st-used); } .legend .reserved { background: var(--st-reserved); }
.legend .inactive { background: var(--st-inactive); } .legend .free { background: #e7f4eb; border: 1px solid #bfe0c9; }
.legend .gw { background: transparent; border: 2px solid var(--st-gw); }
.legend .on { background: transparent; position: relative; }
.legend .on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #32c36c; }
.ipgrid { display: grid; grid-template-columns: repeat(16, minmax(0, 46px)); gap: 5px; margin-top: 16px; justify-content: center; }
.ipc {
  aspect-ratio: 1; min-width: 0; border-radius: 6px; border: 0; padding: 0; font-size: 11px; font-weight: 500;
  display: grid; place-items: center; position: relative; color: #fff; transition: transform .08s;
}
.ipc:hover { transform: scale(1.12); z-index: 3; }
.ipc.used { background: var(--st-used); }
.ipc.reserved { background: var(--st-reserved); }
.ipc.inactive { background: var(--st-inactive); opacity: .85; }
.ipc.free { background: #eef7f1; color: #6aa47e; }
.ipc.r-network, .ipc.r-broadcast { opacity: .55; }
.ipc.r-gateway { box-shadow: inset 0 0 0 2.5px var(--st-gw); }
.ipc.on::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #32c36c; box-shadow: 0 0 0 1.5px #fff; }
.ipc.sel { outline: 3px solid var(--text); outline-offset: 1px; z-index: 4; }
.ipc.hl { outline: 2px dashed var(--accent-strong); outline-offset: 1px; }
.map-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--text); color: #fff; padding: 8px 11px; border-radius: 9px; font-size: 11.5px; line-height: 1.5; max-width: 260px; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.tip b { font-weight: 600; }

/* ---------- Generic cards / forms ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 18px; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card p { margin: 6px 0; color: var(--text-2); line-height: 1.6; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); font-weight: 500; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 11px; }
.field .hint.ok { color: #4f9e69; }
.field .hint.err { color: var(--accent-strong); }
.form-error { color: var(--accent-strong); font-size: 12px; min-height: 18px; }
textarea.input { resize: vertical; min-height: 80px; }
textarea.code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 11.5px; min-height: 120px; }
code, .code-inline { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 11.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

.sum-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.sum-chip { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 14px; min-width: 120px; border: 2px solid transparent; text-align: left; }
.sum-chip b { display: block; font-size: 20px; font-weight: 500; }
.sum-chip span { font-size: 11.5px; color: var(--muted); }
.sum-chip.on { border-color: #f3b3a3; }
.type-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.type-missing { background: #fde6e1; color: #c33a20; }
.type-status { background: #fff1d9; color: #a86a00; }
.type-not_on_border { background: #ece9fb; color: #5a49b8; }
.type-detail { background: #e6f0fb; color: #2f6aa8; }
.type-missing_inactive { background: #f2f1f3; color: #77737d; }
.type-match { background: #e5f5ea; color: #3c8a56; }

details.paste { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
details.paste summary { cursor: pointer; font-weight: 500; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(60, 30, 22, .35); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 70px rgba(60, 20, 10, .3); }
.modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.modal-head .x { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; gap: 10px; padding: 0 22px 20px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.box-note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; z-index: 90; background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 12.5px; transition: all .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent-strong); }

/* ---------- Login ---------- */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--frame); border-radius: 22px; padding: 34px 30px; box-shadow: 0 30px 60px rgba(197, 87, 62, .15); display: flex; flex-direction: column; gap: 12px; backdrop-filter: blur(8px); }
.login-brand { font-weight: 700; color: var(--accent-strong); letter-spacing: .5px; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; font-weight: 600; }
.login-card p { margin: 0 0 8px; font-size: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.login-card input { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 13px; outline: none; }
.login-card input:focus { border-color: #f0a693; box-shadow: 0 0 0 3px rgba(233, 99, 74, .12); }
.login-card .btn { margin-top: 6px; height: 44px; }

.only-mobile { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); margin: 18px; }
  .rightbar { grid-column: 2; padding: 22px 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; background: transparent; }
  .rb-section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 0; margin: 0; }
}
@media (max-width: 1000px) {
  .stats-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  body { font-size: 13px; }
  .shell { display: block; margin: 0; border-radius: 0; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); box-shadow: none; backdrop-filter: none; overflow: visible; }
  .sidebar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; min-height: 0; }
  .brand { display: none; }
  .side-panel { flex-direction: row; justify-content: space-around; border-radius: 22px 22px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .avatar { display: none; }
  .nav { flex-direction: row; margin: 0; gap: 0; justify-content: space-around; }
  .nav-item { height: 52px; }
  .nav-item.active::after { right: auto; top: auto; bottom: 2px; left: 50%; transform: translateX(-50%); width: 22px; height: 3px; border-radius: 3px; }
  .nav-item .nav-label { display: none; }
  .side-bottom { margin: 0 4px 0 8px; align-self: center; flex: none; }
  .main { padding: 16px 16px 8px; }
  .topbar { flex-wrap: wrap; height: auto; gap: 10px; }
  .search { max-width: none; flex-basis: 100%; }
  .clock { display: none; }
  .view { margin-top: 16px; }
  .stat-card { grid-template-columns: 1fr; padding: 6px 0; }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding: 12px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
  .stat:first-child { border-top: 0; }
  .stat-value { grid-row: span 2; grid-column: 2; margin: 0; font-size: 22px; }
  .tbl-head { display: none; }
  .tbl-row { grid-template-columns: var(--cols-m, 1fr auto auto); padding: 4px 8px 4px 14px; }
  .tbl-row .hide-m { display: none; }
  .tbl-row.selected { transform: none; }
  .rightbar { display: flex; flex-direction: column; padding: 8px 16px 20px; }
  .ipgrid { gap: 3px; }
  .ipc { font-size: 9px; border-radius: 4px; }
  .ipc.on::after { width: 4px; height: 4px; top: 2px; right: 2px; }
  .form-grid, .grid-2 { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .only-mobile { display: initial; }
  .cell .sub.only-mobile { display: block; }
  .hide-mobile { display: none !important; }
}
@media (hover: none) { .ipc:hover { transform: none; } .nav-item .nav-label { display: none; } }
