/* ================= App shell ================= */
.layout { min-height: 100vh; }
.layout::before {
  content: ""; position: fixed; top: -140px; right: -160px; width: 520px; height: 470px; z-index: 0; pointer-events: none;
  background: url("/img/blob-peach.svg") no-repeat center / contain;
}

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-w);
  display: flex; flex-direction: column; padding: 22px 14px 20px; overflow: hidden;
  background: linear-gradient(180deg, #5B3526 0%, #42261B 100%); color: #F6E4D7;
}
.sidebar::after {
  content: ""; position: absolute; left: -90px; bottom: -110px; width: 300px; height: 260px; pointer-events: none;
  background: url("/img/blob-orange.svg") no-repeat center / contain; opacity: .5;
}
.sidebar-brand { display: block; padding: 2px 8px 24px; border-radius: 14px; }
.sidebar .brand-eat { color: #FFF4EA; }
.sidebar .brand-tag { color: #E7C3AC; white-space: nowrap; letter-spacing: .08em; }
.side-nav { display: grid; gap: 4px; position: relative; z-index: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 14px;
  color: #F1DCCD; font-weight: 700; transition: background-color .2s, color .2s;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(255, 111, 97, .35); }
.sidebar-foot { position: relative; z-index: 1; margin-top: auto; padding: 0 10px; font-size: 12.5px; font-weight: 700; color: #DDBBA6; }
.demo-tag { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: var(--pill); background: rgba(255, 201, 167, .18); color: var(--peach); }

.main { position: relative; z-index: 1; margin-left: var(--sidebar-w); min-height: 100vh; padding: 30px clamp(20px, 3vw, 40px) 56px; }
.main:focus { outline: none; }
.view { max-width: 1320px; margin: 0 auto; animation: rise .3s var(--ease); }

.topbar, .tabbar { display: none; }
.chip-status {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 800; background: var(--tint); color: var(--ink-soft);
}
.chip-status.is-live { background: var(--green-bg); color: var(--green); }
.chip-status.is-live .dot { animation: pulse 2.4s ease-out infinite; }
.chip-status.is-warn { background: var(--warn-bg); color: var(--warn); }

/* Bottom sheet (Master on phone) */
.sheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: 0; border: 0; background: transparent; color: inherit; }
.sheet::backdrop { background: rgba(78, 44, 31, .38); }
.sheet[open] .sheet-panel { animation: sheet-up .28s var(--ease); }
.sheet-panel { background: #fff; border-radius: 26px 26px 0 0; padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); }
.sheet-grip { width: 44px; height: 5px; margin: 4px auto 8px; border-radius: var(--pill); background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px 8px; }
.sheet-head h2 { font-size: 18px; }
.sheet-list { display: grid; gap: 2px; }
.sheet-link { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 6px 8px; border-radius: 16px; }
.sheet-link:hover, .sheet-link:focus-visible { background: var(--tint-2); }
.sheet-link > .icon { color: var(--ink-mute); }
.ico-bubble { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--tint); color: var(--jeruk); flex: none; }
.sheet-text { display: grid; flex: 1; min-width: 0; }
.sheet-text span { font-size: 13px; color: var(--ink-soft); }

/* ================= Login ================= */
.auth {
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 40px;
  padding: 40px clamp(20px, 6vw, 88px);
  background: linear-gradient(155deg, #FFE1CB 0%, var(--krem) 48%, #FFD7BC 100%);
}
.auth::before, .auth::after { content: ""; position: absolute; pointer-events: none; background-repeat: no-repeat; background-size: contain; background-position: center; }
.auth::before { top: -160px; left: -170px; width: 560px; height: 500px; background-image: url("/img/blob-orange.svg"); opacity: .55; }
.auth::after { right: -180px; bottom: -200px; width: 620px; height: 560px; background-image: url("/img/blob-peach.svg"); }
.auth > * { position: relative; z-index: 1; }
.brand-xl .brand-mark { width: 112px; height: 112px; }
.brand-xl .brand-name { font-size: 72px; }
.brand-xl .brand-tag { font-size: 22px; font-weight: 700; font-style: italic; letter-spacing: 0; text-transform: none; color: var(--espresso); margin-top: 10px; }
.brand-xl { gap: 18px; }
.auth-headline { margin: 34px 0 26px; max-width: 460px; font-family: var(--font-display); font-size: 30px; font-weight: 700; font-style: italic; line-height: 1.25; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 580px; }
.feature {
  display: grid; justify-items: center; gap: 8px; padding: 16px 10px; border-radius: 20px;
  background: #fff; box-shadow: var(--shadow); text-align: center; font-weight: 800; font-size: 13px; line-height: 1.3;
}
.feature .icon { width: 30px; height: 30px; color: var(--jeruk); }
.auth-main { display: grid; justify-items: center; }
.auth-card { width: 100%; max-width: 420px; padding: 30px 30px 22px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.brand-card { display: flex; justify-content: center; }
.brand-card .brand-mark { width: 38px; height: 38px; }
.brand-card .brand-tag { display: none; }
.auth-title { margin-top: 16px; font-size: 25px; text-align: center; }
.auth-sub { margin: 6px 0 22px; text-align: center; color: var(--ink-soft); }
.form { display: grid; gap: 14px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.form-error { padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 700; }
.code-input { text-align: center; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: .35em; }
.link-center { justify-self: center; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-mute); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* ================= Dashboard ================= */
.status-block { margin-bottom: 18px; }
.strip { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: var(--green-bg); color: var(--green); font-weight: 800; }
.strip-warn { background: var(--warn-bg); color: var(--warn); }
.strip-sub { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-ico { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--tint); color: var(--jeruk); flex: none; }
.stat-ico .icon { width: 26px; height: 26px; }
.stat-text { display: grid; min-width: 0; }
.stat-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat:first-child { background: var(--grad); color: #fff; box-shadow: 0 14px 30px rgba(255, 111, 97, .3); }
.stat:first-child .stat-ico { background: rgba(255, 255, 255, .22); color: #fff; }
.stat:first-child .stat-label { color: rgba(255, 255, 255, .88); }

.dash-grid { display: grid; gap: 20px; align-items: start; }
.bars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bar-card { padding: 16px 18px; border-radius: 18px; background: var(--tint-2); border: 1px solid var(--line); }
.bar-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 15.5px; }
.bar-card h3 .icon { color: var(--jeruk); }
.tone-2 h3 .icon { color: var(--coral); }
.latest .section-head { align-items: center; }

@media (min-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 380px; }
  .latest { position: sticky; top: 24px; }
}

/* ================= Riwayat ================= */
.filters { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; margin-bottom: 20px; }
.date-range {
  display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 12px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; color: var(--ink-mute);
}
.date-range:focus-within { border-color: var(--jeruk); box-shadow: var(--ring); }
.date-input { min-height: 42px; width: 9.2em; padding: 0 2px; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.date-input:focus { outline: none; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--peach) 0 6px, transparent 6px 12px);
}
.day { position: relative; margin-bottom: 18px; }
.day-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 6px; font-size: 15px; color: var(--coral-ink); }
.day-head::before {
  content: ""; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 4px #FFE3DD;
}
.day-count { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; color: var(--ink-mute); }
.day-empty { padding: 6px 10px 4px; font-size: 14px; color: var(--ink-mute); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager-info { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.detail-photo { position: relative; padding: 10px; }
.detail-photo::before {
  content: ""; position: absolute; inset: -14px -18px -26px -14px; z-index: 0;
  background: url("/img/blob-peach.svg") no-repeat center / 100% 100%;
}
.photo {
  position: relative; z-index: 1; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 34px 56px 40px 62px; background: var(--tint); box-shadow: var(--shadow-lg);
}
.photo.thumb-empty { display: grid; place-items: center; }
.photo.thumb-empty .icon { width: 56px; height: 56px; }
.detail-title { margin: 6px 0 12px; font-size: 32px; }
.detail .badges { margin-bottom: 20px; }
.info { padding: 6px 20px; }
.info-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line-strong); }
.info-row:last-child { border-bottom: 0; }
.info-row dt { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.info-row dt .icon { width: 18px; height: 18px; color: var(--jeruk); }
.info-row dd { font-weight: 700; overflow-wrap: anywhere; }

/* ================= Master ================= */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.toolbar .search { flex: 0 1 380px; }
.count { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.master-detail { display: grid; gap: 20px; }
.master-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.master-hero h1 { font-size: 28px; margin: 4px 0 10px; }
.master-hero .muted { margin-top: 10px; }
.master-hero-text { flex: 1; min-width: 200px; }
.hero-thumb { width: 104px; height: 104px; border-radius: 28px 36px 30px 40px; object-fit: cover; }
.hero-ico { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 26px; background: var(--tint); color: var(--jeruk); flex: none; }
.hero-ico .icon { width: 42px; height: 42px; }
.usage-big { display: grid; justify-items: center; padding: 14px 22px; border-radius: 20px; background: var(--grad); color: #fff; }
.usage-big strong { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.usage-big span { font-size: 13px; font-weight: 700; }

/* ================= Pengaturan ================= */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
.subnav { display: grid; gap: 4px; padding: 10px; }
.subnav a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 14px; font-weight: 700; color: var(--ink-soft); }
.subnav a:hover { background: var(--tint-2); color: var(--espresso); }
.subnav a.active { background: var(--tint); color: var(--jeruk-ink); }
.settings-content { padding: 24px; }
.settings-content > h2 { font-size: 20px; }
.settings-content > .muted { margin: 4px 0 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting-label { font-weight: 800; }
.note { margin-top: 14px; }
.row-actions { display: flex; gap: 10px; margin-top: 18px; }
.status-panel { display: grid; gap: 16px; }
.panel-title { font-size: 16px; }
.kv { display: grid; justify-items: start; gap: 6px; }
.kv-label { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.kv .badge { white-space: normal; }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .settings { grid-template-columns: 200px minmax(0, 1fr); }
  .status-panel { grid-column: 2; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .status-panel .panel-title { grid-column: 1 / -1; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters .date-range, .filters .search { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); }
  .auth-hero { display: none; }
  .auth-card { padding: 28px 22px 20px; }
  .brand-card { flex-direction: column; text-align: center; gap: 8px; }
  .brand-card .brand-mark { width: 72px; height: 72px; }
  .brand-card .brand-name { font-size: 36px; }
  .brand-card .brand-tag { display: block; font-size: 14px; font-weight: 700; font-style: italic; letter-spacing: 0; text-transform: none; color: var(--jeruk-ink); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .layout::before { width: 340px; height: 300px; top: -120px; right: -150px; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 15;
    padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: var(--krem); border-bottom: 1px solid var(--line);
  }
  .topbar > a { display: flex; min-height: 44px; align-items: center; }
  .main {
    margin-left: 0;
    padding: 18px max(16px, env(safe-area-inset-right)) calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(150, 80, 40, .14);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: calc(var(--tab-h) - 12px); padding: 0; border: 0; background: none; cursor: pointer;
    font-size: 11.5px; font-weight: 800; color: var(--ink-mute);
  }
  .tab-ico { display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--pill); transition: background-color .2s; }
  .tab.active { color: var(--coral-ink); }
  .tab.active .tab-ico { background: #FFE6DC; }
  .toasts { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }

  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head h1 { font-size: 25px; }
  .card { padding: 16px; border-radius: 20px; }

  .stats { gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat-ico { width: 42px; height: 42px; border-radius: 14px; }
  .stat-value { font-size: 26px; }
  .bars-grid { grid-template-columns: 1fr; }
  .bar-card { padding: 14px; }
  .analysis .section-head .input-sm { width: 100%; }

  .date-range { flex-wrap: wrap; }
  .date-input { flex: 1; width: auto; min-width: 0; }
  .timeline { padding-left: 22px; }
  .day-head::before { left: -22px; }
  .timeline .meal-list { gap: 10px; }
  .timeline .meal-row {
    grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "thumb info" "thumb time";
    align-items: start; row-gap: 4px; padding: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .timeline .meal-row > .thumb { width: 84px; height: 84px; border-radius: 18px; }
  .timeline .meal-time { align-self: end; font-size: 12.5px; color: var(--jeruk-ink); }
  .timeline .meal-chev { display: none; }
  .timeline .meal-name { white-space: normal; }
  .pref-nophoto .timeline .meal-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "time"; }
  .pref-compact .timeline .meal-row > .thumb { width: 56px; height: 56px; }
  .pref-compact .timeline .meal-row { grid-template-columns: 56px minmax(0, 1fr); }
  .hide-sm { display: none; }
  .pager .btn { padding: 0 14px; }

  .detail-photo { margin: 0 -4px; }
  .detail-title { font-size: 26px; }
  .info { padding: 4px 16px; }
  .info-row { grid-template-columns: 1fr; gap: 2px; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar .search { flex: none; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; }
  .data-table tbody { display: grid; gap: 10px; }
  .data-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
  }
  .data-table td { display: block; padding: 0; border: 0; }
  .data-table .cell-name { display: flex; }
  .data-table .num { grid-row: 1; grid-column: 2; }
  .data-table .cell-cat, .data-table .cell-note { grid-column: 1 / -1; font-size: 13.5px; }
  .data-table .cell-note::before, .data-table .cell-cat::before { content: attr(data-label) ": "; font-weight: 800; color: var(--ink-mute); }
  .data-table .cell-cat .badge { vertical-align: middle; }
  .pref-compact .data-table tr { padding: 8px 12px; }

  .master-hero { flex-direction: column; align-items: flex-start; }
  .usage-big { justify-items: start; }

  .settings { grid-template-columns: 1fr; }
  .subnav { display: flex; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .subnav a { flex: none; }
  .status-panel { grid-column: auto; }
  .setting-row { align-items: flex-start; }
  .row-actions .btn { flex: 1; }
}

@media (max-width: 380px) {
  .stat-value { font-size: 23px; }
  .bar-row { grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) 40px; }
}

/* ================= Setup, MFA, akun ================= */
.stack { display: grid; gap: 14px; }
.center { text-align: center; }
.steps { list-style: none; display: flex; justify-content: space-between; gap: 4px; margin: 0 0 6px; padding: 0; }
.step { flex: 1; display: grid; justify-items: center; gap: 4px; min-width: 0; font-size: 11px; font-weight: 800; color: var(--ink-mute); text-align: center; }
.step-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--ink-soft); font-size: 12px; }
.step-dot .icon { width: 14px; height: 14px; }
.step.is-current { color: var(--jeruk-ink); }
.step.is-current .step-dot { background: var(--grad); color: #fff; }
.step.is-done .step-dot { background: var(--green-bg); color: var(--green); }
.step-label { overflow-wrap: anywhere; }
.qr-box { justify-self: center; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: #fff; }
.qr-img { display: block; width: 200px; height: 200px; }
.secret { justify-self: center; padding: 8px 14px; border-radius: 12px; background: var(--tint-2); font-weight: 800; letter-spacing: .08em; overflow-wrap: anywhere; text-align: center; user-select: all; }
.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.code-chip { display: block; padding: 9px 10px; border-radius: 12px; background: var(--tint-2); border: 1px solid var(--line); font-weight: 800; letter-spacing: .06em; text-align: center; user-select: all; }
.table-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.table-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.table-row .icon { width: 18px; height: 18px; flex: none; }
.table-row.is-ok { background: var(--green-bg); color: var(--green); }
.table-row.is-bad { background: var(--danger-bg); color: var(--danger); }
.table-err { flex-basis: 100%; font-size: 13px; font-weight: 600; }
.sub-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.sub-block > h3 { font-size: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form .input { flex: 1 1 200px; width: auto; }
.inline-form .form-error { flex-basis: 100%; }
.row-actions.wrap { flex-wrap: wrap; }
.session-row .setting-label { overflow-wrap: anywhere; }
.loading + .muted { margin: 0; }
@media (max-width: 380px) { .step-label { display: none; } .step.is-current .step-label { display: block; } }

/* Email dan Google (pengaturan) */
.stack-field { display: grid; gap: 6px; }
.sub-block code { overflow-wrap: anywhere; padding: 6px 10px; border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.05)); font-size: 13px; }

/* ================= Admin: pengguna, penyimpanan, keamanan, dialog ================= */
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 15px; object-fit: cover; overflow: hidden; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.avatar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.btn-danger { background: #fff; border-color: #F2B8B1; color: var(--danger); }
.btn-danger:hover:not([disabled]) { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.panel-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel-tools .input { flex: 1 1 200px; width: auto; }
.panel-tools select.input { flex: 0 1 160px; }
.link-box { display: grid; gap: 8px; padding: 14px; border-radius: var(--r); background: var(--tint-2); border: 1.5px dashed var(--line-strong); }
.link-box code { display: block; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; user-select: all; }

.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.admin-table th { padding: 11px 14px; text-align: left; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); background: var(--tint); white-space: nowrap; }
.admin-table th:first-child { border-radius: 12px 0 0 12px; }
.admin-table th:last-child { border-radius: 0 12px 12px 0; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-table .who > div { min-width: 0; }
.admin-table .who > div strong, .admin-table .who > div span { display: block; overflow-wrap: anywhere; }
.admin-table .who > div .muted { font-size: 13px; }
.admin-table .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-table .detail-cell { max-width: 320px; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 13px; }
.admin-table .when { white-space: nowrap; }
.is-off { opacity: .6; }

.meter { display: grid; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.meter-track { height: 12px; border-radius: var(--pill); background: var(--tint); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: var(--w, 0%); min-width: 4px; border-radius: var(--pill); background: var(--grad); transition: width .5s var(--ease); }
.meter.is-warn .meter-fill { background: linear-gradient(120deg, #FFC24A, #FF9D2E); }
.meter.is-full .meter-fill { background: linear-gradient(120deg, #E8604F, #B23A2E); }
.meter-lg .meter-track { height: 18px; }
.callout { padding: 12px 14px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; background: var(--warn-bg); color: var(--warn); }
.callout-danger { background: var(--danger-bg); color: var(--danger); }

.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--ink); background: #fff; }
.modal::backdrop { background: rgba(78, 44, 31, .45); }
.modal-body { display: grid; gap: 14px; padding: 24px; }
.modal-body h2 { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.secret-box { display: block; padding: 12px; border-radius: 12px; background: var(--tint-2); border: 1px solid var(--line); font-weight: 800; letter-spacing: .04em; text-align: center; overflow-wrap: anywhere; user-select: all; }

@media (max-width: 860px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody { display: block; }
  .admin-table tbody { display: grid; gap: 10px; }
  .admin-table tr { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
  .admin-table td { display: block; padding: 0; border: 0; }
  .admin-table td[data-label]:not(.cell-main)::before { content: attr(data-label) ": "; font-weight: 800; color: var(--ink-mute); }
  .admin-table .detail-cell { max-width: none; }
  .modal-actions .btn { flex: 1; }
}
