:root {
  --bg-canvas: #f6f4f0;
  --bg-surface: #fcfbf8;
  --bg-subtle: #ebe6dd;
  --bg-sand: #e2dbd0;
  --bg-espresso: #1e1d1a;
  --bg-espresso-hover: #2f2d28;
  --accent: #8c7a6b;
  --accent-hover: #736355;
  --accent-soft: #efece6;

  --text-main: #1e1d1a;
  --text-muted: #6e6a63;
  --border-thin: #dcd5c9;
  --border-strong: #c5bcae;

  --status-ok-bg: #e7f1ea;
  --status-ok-fg: #245536;
  --status-warn-bg: #f8efd8;
  --status-warn-fg: #724a06;
  --status-err-bg: #f9e9e7;
  --status-err-fg: #8c2626;
  --status-neutral-bg: #ebe6dd;
  --status-neutral-fg: #4e4942;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.is-hidden {
  display: none !important;
}

a[href],
button,
select,
summary,
label[for],
input[type="checkbox"],
input[type="radio"],
[role="button"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

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

.global-rail {
  width: 64px;
  flex-shrink: 0;
  background: var(--bg-espresso);
  color: #f6f4f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  width: 100%;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.rail-nav,
.rail-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.rail-footer {
  margin-top: auto;
}

.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: #e4ded5;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.rail-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

/* Secondary Project Sidebar */
.project-sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-thin);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 25;
}

.project-sidebar.is-collapsed {
  width: 64px;
  padding: 14px 8px;
}

.project-sidebar.is-collapsed .sidebar-title,
.project-sidebar.is-collapsed .group-label,
.project-sidebar.is-collapsed .side-btn span,
.project-sidebar.is-collapsed .sidebar-db-note {
  display: none;
}

.project-sidebar.is-collapsed .side-btn {
  justify-content: center;
  padding: 10px 4px;
}

.project-sidebar.is-collapsed .side-btn::before {
  content: attr(data-short);
  font-size: 11px;
  font-weight: 700;
}

.project-sidebar.is-collapsed #btn-toggle-sidebar svg {
  transform: rotate(180deg);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  padding: 0 8px 4px;
}

.side-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  margin-bottom: 2px;
}

.side-btn:hover {
  background: var(--bg-subtle);
}

.side-btn.is-active {
  background: var(--accent-soft);
  border-color: #dec9b7;
  color: var(--accent-hover);
  font-weight: 700;
}

.side-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.side-btn.is-active .side-count {
  background: var(--accent);
  color: #ffffff;
}

.sidebar-db-note {
  margin-top: auto;
  padding: 10px 8px 4px;
  border-top: 1px solid var(--border-thin);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Main Workspace */
.workspace-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-thin);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}

.page-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-content {
  padding: 20px 24px 40px;
  flex: 1;
  min-width: 0;
}

/* ------------------------------------------------------------------ BUTTONS & INPUTS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.btn:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-dark {
  background: var(--bg-espresso);
  border-color: var(--bg-espresso);
  color: #ffffff;
}

.btn-dark:hover {
  background: var(--bg-espresso-hover);
}

.btn-danger {
  background: var(--bg-surface);
  border-color: #dfada9;
  color: var(--status-err-fg);
}

.btn-danger:hover {
  background: var(--status-err-bg);
}

.btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0;
}

.icon-btn:hover {
  background: var(--bg-subtle);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input[type="text"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

.inline-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
}

.inline-input:hover,
.inline-input:focus {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.inline-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ CARDS, METRICS & BANNERS */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: hidden;
  margin-bottom: 18px;
}

.card-pad {
  padding: 18px 20px;
}

.card-head {
  padding: 13px 18px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-thin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toast-banner {
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 600;
}

.toast-banner.is-ok {
  background: var(--status-ok-bg);
  border-color: #b7d7bf;
  color: var(--status-ok-fg);
}

.toast-banner.is-err {
  background: var(--status-err-bg);
  border-color: #ebb7b2;
  color: var(--status-err-fg);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
}

.badge-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
}

.badge-err {
  background: var(--status-err-bg);
  color: var(--status-err-fg);
}

.badge-neutral {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-fg);
}

/* ------------------------------------------------------------------ TABLES & QTO DRAG-AND-DROP */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  background: var(--bg-canvas);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-thin);
  white-space: nowrap;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-thin);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #fdfcfa;
}

/* QTO Accordion Bab & Sub-Bab */
.bab-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.bab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-sand);
  border-bottom: 1px solid var(--border-thin);
  flex-wrap: wrap;
}

.bab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
}

.bab-toggle:hover {
  color: var(--accent-hover);
}

.bab-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.subbab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 8px 26px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-thin);
  border-top: 1px solid var(--border-thin);
  flex-wrap: wrap;
}

.subbab-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bg-espresso);
}

.subbab-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-hover);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  border-radius: 4px;
}

.drag-handle:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.qto-row.is-dragging {
  opacity: 0.45;
  background: var(--accent-soft) !important;
}

.subbab-row td {
  background: #f2ece1;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  padding: 7px 12px;
}

.subbab-row.is-dragging {
  opacity: 0.5;
}

.subbab-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subbab-empty-hint td {
  background: var(--bg-canvas);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 10px 14px;
}

.inline-input[readonly] {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-thin);
  cursor: default;
}

.price-hint {
  margin: 2px 4px 0 0;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: right;
}

.qto-parent-row td {
  background: #f5f1ea;
  font-weight: 600;
  border-top: 1px solid var(--border-strong);
}

.qto-subitem-row td {
  background: #fcfbf9;
}

.subitem-indent {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 18px;
}

.subitem-arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.parent-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-sand);
  color: var(--bg-espresso);
}

.drop-target-above {
  box-shadow: inset 0 3px 0 0 var(--accent);
}

.drop-target-inside {
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
  background: var(--accent-soft) !important;
}

.code-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  max-width: 150px;
}

.code-pick-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.code-pick-btn.is-empty {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent);
}

.move-btns {
  display: inline-flex;
  gap: 2px;
}

.move-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-thin);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11px;
  padding: 0;
}

.move-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

/* AHSP Rincian Expansion */
.ahsp-comp-box {
  background: var(--bg-canvas);
  padding: 12px 16px;
  border-top: 1px solid var(--border-thin);
}

.comp-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin: 10px 0 4px;
}

.comp-section-title:first-child {
  margin-top: 0;
}

/* Kurva-S & Schedule */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
}

.kurva-svg {
  width: 100%;
  min-width: 540px;
  height: auto;
  display: block;
}

/* States */
.empty-box,
.loading-box,
.error-box {
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.error-box {
  border-style: solid;
  border-color: #ebb7b2;
  background: var(--status-err-bg);
  color: var(--status-err-fg);
}

.empty-box h3 {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 15px;
}

/* ------------------------------------------------------------------ MODALS & CHIPS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 33, 29, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(38, 33, 29, 0.22);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-sm { max-width: 480px; }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-thin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-thin);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
}

.field input[type="checkbox"],
.field input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.check-list-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
}

.field label.check-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-main);
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0;
}

.context-strip {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
}

.chip-btn.is-active {
  background: var(--bg-espresso);
  border-color: var(--bg-espresso);
  color: #ffffff;
}

.modal-scroll-list {
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-sm);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 33, 29, 0.4);
  z-index: 22;
}

.mobile-only {
  display: none;
}

/* ------------------------------------------------------------------ RESPONSIVE MOBILE */
@media (max-width: 900px) {
  .mobile-only {
    display: inline-flex;
  }

  .app-shell {
    flex-direction: column;
  }

  .global-rail {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .rail-brand {
    width: auto;
    border-bottom: none;
    padding-bottom: 0;
  }

  .rail-nav,
  .rail-footer {
    flex-direction: row;
    width: auto;
    margin-top: 0;
  }

  .rail-btn {
    min-height: 44px;
    padding: 6px 10px;
  }

  .project-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .project-sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .topbar {
    padding: 10px 14px;
  }

  .main-content {
    padding: 14px;
  }

  .btn,
  .icon-btn {
    min-height: 40px;
  }
}

/* ------------------------------------------------------------------ STATUS KONTRAK & WEEKLY REPORT */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status-perencanaan {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-fg);
}

.status-kontrak {
  background: #e1eef9;
  color: #184e82;
}

.status-selesai {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
}

.weekly-week-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.weekly-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .weekly-notes-grid {
    grid-template-columns: 1fr;
  }
}

.weekly-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.weekly-photo-card {
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.weekly-photo-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.weekly-photo-meta {
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

details.weekly-daily-details {
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 12px 16px;
}

details.weekly-daily-details > summary {
  font-weight: 700;
  color: var(--text-main);
  font-size: 14px;
}

details.weekly-daily-details[open] > summary {
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ MENU TITIK TIGA (KEBAB) */
.kebab-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.kebab-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.kebab-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.kebab-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.kebab-menu {
  position: fixed;
  z-index: 60;
  min-width: 204px;
  padding: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(38, 33, 29, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.kebab-menu.is-open {
  display: flex;
}

.kebab-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.kebab-item:hover {
  background: var(--bg-subtle);
}

.kebab-item.is-primary-item {
  font-weight: 700;
  color: var(--accent);
}

.kebab-item.is-danger {
  color: var(--status-err-fg);
}

.kebab-item.is-danger:hover {
  background: var(--status-err-bg);
}

.kebab-sep {
  height: 1px;
  background: var(--border-thin);
  margin: 3px 4px;
}

/* ------------------------------------------------------------------ BACKUP VOLUME */
.vol-cell-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-cell-wrap .inline-num {
  flex: 1;
  min-width: 58px;
}

.vol-fx-btn {
  flex-shrink: 0;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.vol-fx-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.vol-fx-btn.has-bv {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

tr.bv-op-neg td {
  background: #fdf4f3;
}

.bv-summary-bar {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bv-net-box {
  font-size: 14px;
  color: var(--text-main);
}

.topbar-wilayah-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong, var(--border-thin));
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-surface, #fff);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  max-width: 220px;
  cursor: pointer;
}

.topbar-wilayah-select:focus {
  outline: none;
  border-color: var(--accent);
}

.topbar-oh-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-strong, var(--border-thin));
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-surface, #fff);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-oh-wrap input {
  width: 52px;
  border: none;
  background: transparent;
  text-align: right;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-main);
  padding: 0;
}

.topbar-oh-wrap input:focus {
  outline: none;
}

.topbar-pill-group {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.topbar-pill-group .topbar-wilayah-select {
  height: 34px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 10px;
}

.topbar-pill-divider {
  width: 1px;
  height: 20px;
  background: var(--border-thin);
  flex-shrink: 0;
}

.topbar-pill-group .topbar-oh-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
  height: 34px;
  padding: 0 10px;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.icon-action-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.icon-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.icon-action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ MODAL TEMA STUDIO */
.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 10px;
}

.theme-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  text-align: left;
  color: var(--text-main);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.theme-preset-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.theme-preset-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--bg-surface);
}

.theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.theme-preset-name {
  font-size: 13.5px;
  font-weight: 600;
}

.theme-preset-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.theme-custom-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.theme-color-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.theme-color-pick input[type="color"] {
  width: 38px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

/* ------------------------------------------------------------------ LAYAR AUTH / LOGIN BETA */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-canvas);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-thin);
  border-radius: var(--radius-lg, 14px);
  padding: 28px;
  box-shadow: 0 12px 32px rgba(30, 29, 26, 0.06);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-espresso);
  color: #FCFBF8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.auth-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

.auth-tagline {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(30, 29, 26, 0.08);
}

.auth-form .field {
  margin-bottom: 14px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  background: #FBE9E7;
  color: #9E2A2B;
  border: 1px solid rgba(158, 42, 43, 0.2);
}

.auth-msg.is-ok {
  background: #E8F2EA;
  color: #2D5A3D;
  border-color: rgba(45, 90, 61, 0.2);
}

.auth-note {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}
