/* ============================================================
   Webiko Deployer — web/app.css
   Tema gelap tenang: permukaan hangat, garis tipis, satu aksen
   kuning. Vanilla CSS, tanpa build step.

   1. Token
   2. Reset & dasar
   3. Kerangka halaman
   4. Tombol & kontrol
   5. Form deploy
   6. Pratinjau, ledger, panduan
   7. Admin & login
   8. Utilitas, gerak, aksesibilitas
   ============================================================ */

/* ============================================================
   1. TOKEN
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #121314;
  --surface: #1f1e1c;
  --surface-2: #242320;
  --surface-3: #2b2a26;
  --well: #141413;

  --line: #302e29;
  --line-strong: #423f37;

  --ink: #f2efe6;
  --ink-2: #cfcabf;
  --muted: #a39d90;
  --faint: #8d8779;

  --accent: #ffe14d;
  --accent-ink: #121314;
  --accent-soft: rgba(255, 225, 77, 0.1);
  --accent-line: rgba(255, 225, 77, 0.28);

  --ok: #8fe3b8;
  --ok-soft: rgba(143, 227, 184, 0.1);
  --err: #ff9dae;
  --err-soft: rgba(255, 157, 174, 0.09);
  --warn: #ffcf6b;
  --warn-soft: rgba(255, 207, 107, 0.1);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --pad: 24px;
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.24);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.3);

  --font-sans: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", ui-monospace, "SF Mono", "JetBrains Mono",
    Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 180ms;
}

/* ============================================================
   2. RESET & DASAR
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -160px, rgba(255, 225, 77, 0.055), transparent 70%),
    radial-gradient(700px 380px at 100% 0%, rgba(255, 255, 255, 0.03), transparent 65%);
}

[hidden] {
  display: none !important;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--ink-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--accent);
}

ul,
ol {
  list-style: none;
}

code {
  font-family: var(--font-mono);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Dekorasi lama tidak dipakai di tema ini. */
.bg-grid,
.side-icons {
  display: none !important;
}

/* ============================================================
   3. KERANGKA HALAMAN
   ============================================================ */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background-color: rgba(18, 19, 20, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.appbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 780px;
  min-height: 60px;
  margin-inline: auto;
  padding: 10px 24px;
}

.appbar-wide {
  max-width: 1120px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background-color: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.appbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.capacity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.capacity svg {
  color: var(--faint);
}

.capacity strong,
.capacity b {
  color: var(--ink-2);
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.appbar .btn-ghost {
  height: 32px;
  font-size: 12.5px;
}

.app-main {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px 96px;
}

.stack {
  width: 100%;
  max-width: 720px;
}

.stack-title,
h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.stack-title {
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.12;
  text-wrap: balance;
}

.lead {
  max-width: 54ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

.label {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.stack > header .label {
  margin-bottom: 10px;
}

.pane-main {
  margin-top: 32px;
}

/* ============================================================
   4. TOMBOL & KONTROL
   ============================================================ */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn-primary {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  background-color: var(--ink);
  color: var(--accent-ink);
  font-size: 13.5px;
}

.btn-primary:hover:not(:disabled) {
  background-color: #ffffff;
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  background-color: var(--ink-2);
}

.btn-primary:disabled {
  cursor: not-allowed;
  background-color: var(--surface-3);
  color: var(--faint);
}

.btn-primary:disabled:hover {
  transform: none;
}

.btn-ghost {
  height: 36px;
  padding: 0 13px;
  border-color: var(--line);
  border-radius: 9px;
  background-color: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background-color: var(--surface-2);
  color: var(--ink);
}

.btn-ghost:active {
  background-color: var(--surface-3);
}

.btn-ghost.text-muted {
  color: var(--muted);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: transparent;
  color: var(--muted);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background-color: var(--surface-3);
  color: var(--ink);
}

.icon-btn.is-danger {
  color: var(--err);
}

.icon-btn.is-danger:hover {
  border-color: rgba(255, 157, 174, 0.35);
  background-color: var(--err-soft);
  color: var(--err);
}

.input,
.code-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--well);
  color: var(--ink);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.input {
  height: 44px;
  padding: 0 13px;
  font-size: 14px;
}

.input::placeholder,
.code-input::placeholder {
  color: var(--faint);
}

.input:hover,
.code-input:hover {
  border-color: var(--line-strong);
}

.input:focus,
.code-input:focus {
  outline: none;
}

.input:focus-visible,
.code-input:focus-visible {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.input.font-mono,
.font-mono {
  font-family: var(--font-mono);
}

.input.font-mono {
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.input-icon {
  position: relative;
}

.input-icon > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.input-icon .input {
  padding-left: 38px;
}

.code-input {
  min-height: 190px;
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  resize: vertical;
}

/* ============================================================
   5. FORM DEPLOY
   ============================================================ */

#deploy-form {
  padding: var(--pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-soft);
}

.field + .field {
  margin-top: 26px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.field-hint {
  display: flex;
  min-height: 20px;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 157, 174, 0.28);
  border-radius: var(--radius-sm);
  background-color: var(--err-soft);
  color: var(--err);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

.field-error > svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.name-wrap {
  position: relative;
}

.name-wrap .input {
  padding-right: 112px;
}

.name-suffix {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
  pointer-events: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--faint);
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.status-dot.is-ready {
  background-color: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

/* Tab sumber */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--seg-count, 3), minmax(0, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--well);
}

.seg-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--seg-count, 3));
  height: calc(100% - 8px);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background-color: var(--surface-3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 260ms var(--ease);
}

.seg-tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  transition: color var(--dur) var(--ease);
}

.seg-tab:hover {
  color: var(--ink-2);
}

.seg-tab[aria-selected="true"] {
  color: var(--ink);
}

.seg-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.seg-panel {
  padding-top: 16px;
}

/* Dropzone */
.dz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.015);
  text-align: center;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.dz:hover {
  border-color: #565248;
  background-color: rgba(255, 255, 255, 0.03);
}

.dz:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.dz.is-over {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.dz-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 12px;
  background-color: var(--surface-3);
  color: var(--muted);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.dz.is-over .dz-icon {
  background-color: var(--accent);
  color: var(--accent-ink);
}

.dz-title {
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.dz-sub {
  color: var(--faint);
  font-size: 12px;
}

.dz-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.dz-note {
  margin-top: 10px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

/* Chip file terpilih */
.chip {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface-2);
}

.chip-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background-color: var(--accent-soft);
  color: var(--accent);
}

.chip-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.chip-name {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-size {
  color: var(--faint);
  font-size: 11.5px;
}

/* Bar aksi */
.actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.actionbar-status {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
}

.success-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

/* Rail progres */
.rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 390px;
}

.rail::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 8%;
  right: 8%;
  height: 1px;
  background-color: var(--line-strong);
}

.rail-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.rail-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background-color: var(--line-strong);
}

.rail-step[data-state="active"] .rail-dot {
  background-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: dot-pulse 1.6s ease-in-out infinite;
}

.rail-step[data-state="done"] .rail-dot {
  background-color: var(--ok);
}

.rail-label {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.35;
  transition: color var(--dur) var(--ease);
}

.rail-step[data-state="done"] .rail-label {
  color: var(--muted);
}

.rail-step[data-state="active"] .rail-label {
  color: var(--ink-2);
}

@keyframes dot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 225, 77, 0.05);
  }
}

/* Sukses */
.success-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.success-link {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.success-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.success-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.success-warn {
  flex-shrink: 0;
  color: var(--warn);
  font-size: 12px;
  font-weight: 500;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 640ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   6. PRATINJAU, LEDGER, PANDUAN
   ============================================================ */

.preview {
  position: relative;
  display: block;
  margin-top: 20px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--well);
  box-shadow: var(--shadow-soft);
}

.preview:hover {
  border-color: var(--line-strong);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}

.preview:hover .preview-img {
  transform: scale(1.01);
}

.preview-img.is-loaded {
  opacity: 1;
}

.preview-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.pane-side {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.pane-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.pane-side-head h2,
.guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.pane-side-head h2 svg,
.guide-title svg {
  color: var(--accent);
}

.pane-side-head span {
  color: var(--faint);
  font-size: 11.5px;
}

.pane-side-empty {
  padding: 14px 0;
  color: var(--faint);
  font-size: 12.5px;
}

.pane-side ul {
  padding-top: 2px;
}

.pane-side-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.65;
}

.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.ledger-row:last-child {
  border-bottom: 0;
}

.ledger-name {
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-name span {
  color: var(--faint);
}

.ledger-row time {
  flex-shrink: 0;
  color: var(--faint);
  font-size: 11.5px;
}

.guide {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.guide-title {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.guide-list {
  counter-reset: langkah;
  margin-top: 16px;
}

.guide-list > li {
  position: relative;
  padding: 8px 0 8px 34px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.guide-list > li::before {
  counter-increment: langkah;
  content: counter(langkah);
  position: absolute;
  left: 0;
  top: 9px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--surface-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.guide-list strong {
  color: var(--ink-2);
  font-weight: 600;
}

.guide-list em {
  color: var(--ink-2);
  font-style: normal;
  font-weight: 550;
}

.guide-list code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background-color: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
}

.guide-prompt {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--well);
}

.guide-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background-color: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.guide-prompt-head .btn-ghost {
  height: 29px;
  padding: 0 10px;
  font-size: 11.5px;
}

.guide-prompt-body {
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.guide-note {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.65;
}

/* ============================================================
   7. ADMIN & LOGIN
   ============================================================ */

.admin-main {
  display: flex;
  flex: 1;
  justify-content: center;
  padding: 48px 24px 88px;
}

.admin {
  width: 100%;
  max-width: 1120px;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.admin-head .stack-title {
  font-size: clamp(1.7rem, 4vw, 2.15rem);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-total {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  text-decoration: none;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.stat:hover {
  border-color: var(--line-strong);
  background-color: var(--surface-2);
  transform: translateY(-1px);
}

.stat[aria-current="true"] {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
}

.stat-count {
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  color: var(--muted);
  font-size: 11.5px;
}

.stat[aria-current="true"] .stat-label {
  color: var(--ink-2);
}

.admin-search {
  display: flex;
  gap: 8px;
  margin: 22px 0 16px;
}

.admin-search .input-icon {
  flex: 1;
  min-width: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.admin-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr {
  transition: background-color var(--dur) var(--ease);
}

.admin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.text-muted {
  color: var(--muted);
}

.text-faint {
  color: var(--faint);
}

.admin-link {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.admin-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.6;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--faint);
}

.badge[data-s="active"] {
  border-color: rgba(143, 227, 184, 0.24);
  background-color: var(--ok-soft);
  color: var(--ok);
}

.badge[data-s="active"]::before {
  background-color: var(--ok);
}

.badge[data-s="failed"] {
  border-color: rgba(255, 157, 174, 0.24);
  background-color: var(--err-soft);
  color: var(--err);
}

.badge[data-s="failed"]::before {
  background-color: var(--err);
}

.badge[data-s="deleting"] {
  border-color: rgba(255, 207, 107, 0.24);
  background-color: var(--warn-soft);
  color: var(--warn);
}

.badge[data-s="deleting"]::before {
  background-color: var(--warn);
}

.badge[data-s="pending"] {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
  color: var(--accent);
}

.badge[data-s="pending"]::before {
  background-color: var(--accent);
}

.badge[data-s="deleted"] {
  color: var(--faint);
}

.admin-cell-action {
  text-align: right;
  white-space: nowrap;
}

.del-confirm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.del-ask {
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 550;
}

.admin-empty {
  margin-top: 18px;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-note {
  margin-top: 12px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
}

.flash[data-tone="ok"] {
  border-color: rgba(143, 227, 184, 0.24);
  background-color: var(--ok-soft);
  color: var(--ok);
}

.flash[data-tone="err"] {
  border-color: rgba(255, 157, 174, 0.24);
  background-color: var(--err-soft);
  color: var(--err);
}

/* Login */
.admin-login {
  width: 100%;
  max-width: 400px;
  margin: 32px auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: var(--surface);
  box-shadow: var(--shadow-lift);
}

.admin-login .stack-title {
  font-size: 1.65rem;
}

.admin-login .lead {
  font-size: 13.5px;
}

.admin-login .field {
  margin-top: 22px;
}

.login-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 12px;
  background-color: var(--accent-soft);
  color: var(--accent);
}

.login-actions {
  margin-top: 16px;
}

.login-submit {
  width: 100%;
}

.login-foot {
  margin-top: 20px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.65;
}

/* ============================================================
   8. UTILITAS, GERAK, AKSESIBILITAS
   ============================================================ */

.reveal {
  animation: rise 520ms var(--ease) both;
  animation-delay: var(--d, 0ms);
}

.row-in {
  animation: rise 420ms var(--ease) both;
  animation-delay: var(--d, 0ms);
}

.pop {
  animation: pop 200ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.check-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.check-path {
  display: inline-flex;
}

.check-path path,
.check-draw path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 360ms var(--ease) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.shake {
  animation: shake 320ms var(--ease) both;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.text-ok {
  color: var(--ok);
}

.text-err {
  color: var(--err);
}

.text-warn {
  color: var(--warn);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   BREAKPOINT
   ============================================================ */

@media (max-width: 639px) {
  .app-main,
  .admin-main {
    padding: 32px 16px 64px;
  }

  .appbar-inner {
    padding-inline: 16px;
  }

  .appbar-side {
    width: auto;
    margin-left: auto;
  }

  .wordmark {
    font-size: 13px;
  }

  .stack-title {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
  }

  .lead {
    font-size: 14.5px;
  }

  #deploy-form,
  .pane-side,
  .guide {
    padding: 18px;
  }

  .seg-tab {
    flex-direction: column;
    gap: 3px;
    height: 52px;
    font-size: 10.5px;
  }

  .name-wrap .input {
    padding-right: 13px;
  }

  .name-suffix {
    display: none;
  }

  .actionbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actionbar-status {
    width: 100%;
  }

  .success-actions {
    width: 100%;
  }

  .success-actions > .btn-ghost {
    flex: 1;
  }

  .btn-primary {
    width: 100%;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-login {
    padding: 22px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .row-in,
  .pop,
  .shake {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .rail-step[data-state="active"] .rail-dot {
    animation: none;
  }

  .seg-thumb,
  .check-path path,
  .check-draw path,
  .btn-primary,
  .btn-ghost,
  .icon-btn,
  .input,
  .code-input,
  .stat,
  .preview,
  .preview-img,
  .dz,
  .dz-icon,
  .status-dot,
  .success-link {
    transition-duration: 1ms;
    animation-duration: 1ms;
  }

  .stat:hover,
  .preview:hover .preview-img,
  .btn-primary:hover:not(:disabled) {
    transform: none;
  }

  .spinner {
    animation-duration: 1.4s;
  }
}

@media (forced-colors: active) {
  .btn-primary,
  .btn-ghost,
  .input,
  .code-input,
  .stat,
  .badge,
  .admin-table-wrap,
  .pane-side,
  .guide,
  .preview {
    border: 2px solid ButtonText;
  }
}
