/* ============================================================
   QOS Design System — app.css
   Dark/Light mode via CSS variables + Tailwind class strategy
   ============================================================ */

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

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
  --font: 'Inter', system-ui, sans-serif;

  /* Surface — light mode (warm neutral) */
  --bg:          #f9f9f7;
  --bg-elevated: #ffffff;
  --bg-sunken:   #f0f0ec;
  --surface:     #ffffff;
  --surface-2:   #f5f5f2;
  --surface-3:   #e5e7eb;

  /* Border */
  --border:      #e5e7eb;
  --border-2:    #d1d5db;

  /* Text */
  --text:        #0d1117;
  --text-2:      #374151;
  --text-3:      #6b7280;
  --text-4:      #9ca3af;

  /* Brand — Gold */
  --brand:       #9d7b2f;
  --brand-hover: #7a5f24;
  --brand-light: #fef9ec;
  --brand-text:  #7a5f24;

  /* Status — conventional (unchanged) */
  --success:     #10b981;
  --success-bg:  #ecfdf5;
  --warning:     #f59e0b;
  --warning-bg:  #fffbeb;
  --danger:      #ef4444;
  --danger-bg:   #fef2f2;
  --info:        #3b82f6;
  --info-bg:     #eff6ff;

  /* Shadow */
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
  --shadow-xl:   0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  /* Sidebar */
  --sidebar-w:      256px;
  --sidebar-strip:   52px;

  /* Layout heights */
  --header-h:    56px;
}

.dark {
  /* Surface — dark navy (brand palette) */
  --bg:          #0d1117;
  --bg-elevated: #161b22;
  --bg-sunken:   #090d12;
  --surface:     #161b22;
  --surface-2:   #1f2937;
  --surface-3:   #253041;

  --border:      #253041;
  --border-2:    #30404f;

  --text:        #f0ece3;
  --text-2:      #c9bfa8;
  --text-3:      #8b8068;
  --text-4:      #ecd2a9;

  /* Brand — Light Gold (on dark bg) */
  --brand:       #f4d58d;
  --brand-hover: #e6c070;
  --brand-light: rgba(244, 213, 141, 0.10);
  --brand-text:  #f4d58d;

  --success-bg:  #052e16;
  --warning-bg:  #1c1200;
  --danger-bg:   #1c0505;
  --info-bg:     #0c1a2e;

  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl:   0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
}

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

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

html { font-family: var(--font); background: var(--bg); color: var(--text); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────*/
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── Layout ─────────────────────────────────────────────────────────────────*/
.app-layout {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.2s ease;
}

/* Two-panel tab nav */
nav.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* Left strip — tab icon buttons */
.sidebar-tab-strip {
  width: var(--sidebar-strip);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 2px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-tab {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  cursor: pointer;
  background: transparent;
  border: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.sidebar-tab:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.sidebar-tab.active {
  background: var(--brand-light);
  color: var(--brand);
}

.sidebar-tab svg {
  width: 18px;
  height: 18px;
}

/* Right panel — sub-nav items */
.sidebar-panel-wrap {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.sidebar-panel {
  display: none;
  padding-bottom: 12px;
}

.sidebar-panel.active {
  display: block;
}

.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

/* ── Sidebar Items ──────────────────────────────────────────────────────────*/
.nav-section {
  padding: 14px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

/* Sub-group header di dalam panel (contoh: Transaksi / Akuntansi di bawah tab Keuangan) */
.nav-subgroup {
  padding: 12px 10px 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-4);
  opacity: 0.7;
}

.nav-subgroup:first-child {
  padding-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin: 1px 6px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
  overflow: visible;
}

/* Nav item label — truncates long text */
.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nav counter badge */
.nav-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  background: var(--brand);
  color: #fff;
  flex-shrink: 0;
  margin-left: auto;
}

/* Nav pulse dot (e.g. Meeting L10 active) */
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
}
.nav-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #ef4444;
  opacity: 0.35;
  animation: nav-pulse 1.6s ease-in-out infinite;
}
@keyframes nav-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.35; }
  50%       { transform: scale(1.8); opacity: 0; }
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-item.active {
  background: #fde9a0;
  color: var(--brand-text);
  font-weight: 600;
}

.dark .nav-item.active {
  background: rgba(244, 213, 141, 0.20);
}

.nav-item.active svg { color: var(--brand); }

.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg { opacity: 1; }

/* ── Page Header ────────────────────────────────────────────────────────────*/
.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.page-body { padding: 24px; }

/* ── Cards ──────────────────────────────────────────────────────────────────*/
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow 0.2s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  cursor: default;
}

.stat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
}

.stat-delta {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--brand);
  color: #fff !important;
}
.dark .btn-primary {
  color: #0d1117 !important;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-3);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }

.btn-lg { padding: 10px 18px; font-size: 14px; border-radius: 10px; }

/* ── Input ──────────────────────────────────────────────────────────────────*/
.input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}

.input::placeholder { color: var(--text-4); }

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

select.input { cursor: pointer; }

textarea.input { resize: vertical; min-height: 80px; }

/* ── Badge / Status Pill ────────────────────────────────────────────────────*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge svg { width: 10px; height: 10px; }

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--info-bg);    color: var(--info);    }
.badge-neutral { background: var(--surface-3);  color: var(--text-3);  }
.badge-brand   { background: var(--brand-light); color: var(--brand-text); }

/* ── Table ──────────────────────────────────────────────────────────────────*/
.data-table { width: 100%; border-collapse: collapse; }

.data-table thead th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table thead th:first-child { border-radius: 10px 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 10px 0 0; }

.data-table tbody td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 0.1s ease; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Progress ───────────────────────────────────────────────────────────────*/
.progress {
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

.progress-sm { height: 4px; }
.progress-lg { height: 8px; }

/* ── Tabs ───────────────────────────────────────────────────────────────────*/
.tab-list {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--brand-text);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ── Modal ──────────────────────────────────────────────────────────────────*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-box-lg { max-width: 680px; }
.modal-box-xl { max-width: 860px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ── Dark mode — FAB, nav counter & notification badge ──────────────────────*/
.dark .nav-counter {
  background: var(--surface-2);
  color: var(--text-4);
  border: 1px solid var(--border);
}
.dark .nav-dot {
  background: var(--text-4);
}
.dark .nav-dot::after {
  background: var(--text-4);
}
.dark .fixed.bottom-6.w-14.h-14.rounded-full {
  background: var(--surface-2) !important;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.dark .fixed.bottom-6.w-14.h-14.rounded-full svg {
  color: var(--text-4) !important;
}
.dark #qos-notif-badge {
  background: var(--surface-2) !important;
  color: var(--text-4) !important;
  border: 1px solid var(--border);
}

/* ── Drawer ─────────────────────────────────────────────────────────────────*/
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 50; display: flex; justify-content: flex-end;
}
.drawer {
  width: 100%; max-width: 620px; height: 100dvh;
  background: var(--surface); display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px; min-height: 57px;
}
.drawer-title { font-size: 15px; font-weight: 600; color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-shrink: 0; background: var(--surface);
}

/* ── Divider ────────────────────────────────────────────────────────────────*/
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Empty State ────────────────────────────────────────────────────────────*/
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-4);
}

.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-4);
  max-width: 280px;
  line-height: 1.5;
}

/* ── Skeleton ───────────────────────────────────────────────────────────────*/
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--surface-3) 25%,
    var(--surface-2) 50%,
    var(--surface-3) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 8px;
}

/* ── Toast ──────────────────────────────────────────────────────────────────*/
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.25s cubic-bezier(.4,0,.2,1);
  max-width: 320px;
}

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success { background: var(--success); color: #fff; }
.toast.error   { background: var(--danger);  color: #fff; }
.toast.warning { background: var(--warning); color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── NSN Ring (L1) ──────────────────────────────────────────────────────────*/
.nsn-score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Dropdown ───────────────────────────────────────────────────────────────*/
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s ease;
}

.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-item svg { width: 15px; height: 15px; opacity: 0.7; }

/* ── Rock Card ──────────────────────────────────────────────────────────────*/
.rock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.rock-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 14px 0 0 14px;
}

.rock-card.on-track::before  { background: var(--success); }
.rock-card.off-track::before { background: var(--danger); }
.rock-card.done::before      { background: var(--text-4); }

.rock-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ── Task Item ──────────────────────────────────────────────────────────────*/
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
  cursor: pointer;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--surface-2); }

/* ── Mobile (< lg = 1024px, sesuai Tailwind lg breakpoint) ──────────────────*/
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 39;
  }

  /* main-content fullwidth — sidebar sudah position:fixed, out of flex flow */
  .app-layout {
    width: 100vw;
  }

  .main-content {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .page-body    { padding: 16px; }
  .stat-value   { font-size: 22px; }
}

/* ── Pixel AI COA Suggestion ────────────────────────────────────────────────*/
.pixel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pixel-btn:hover { background: var(--brand-light); border-color: var(--brand); }
.pixel-btn svg   { width: 14px; height: 14px; }

.pixel-coa-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pixel-coa-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pixel-coa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pixel-coa-header svg { color: var(--brand); }

.pixel-coa-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pixel-coa-account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pixel-coa-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-brand { background: var(--brand-light); color: var(--brand-text); }
.badge-green { background: var(--success-bg);  color: var(--success);   }
.badge-blue  { background: var(--info-bg);     color: var(--info);      }
.badge-gray  { background: var(--surface-3);   color: var(--text-3);    }

/* ── Transitions ────────────────────────────────────────────────────────────*/
[x-cloak] { display: none !important; }

.fade-enter { animation: fadeIn 0.2s ease; }

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

/* ── Layout helpers ─────────────────────────────────────────────────────────*/
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Page toolbar — filters & action buttons di bawah topbar ────────────────*/
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .page-toolbar { padding: 8px 16px; }
  .page-toolbar-actions { margin-left: 0; width: 100%; }
}

/* ── Form aliases (form-label = input-label, form-input = input) ─────────── */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}

.form-input::placeholder { color: var(--text-4); }

.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

/* ── Icon button ─────────────────────────────────────────────────────────── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Badge extras ────────────────────────────────────────────────────────── */
.badge-default { background: var(--surface-3); color: var(--text-3); }

/* ── Modal backdrop (alias) ──────────────────────────────────────────────── */
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-body {
  padding: 4px 0 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ── Utility ────────────────────────────────────────────────────────────────*/
.text-muted    { color: var(--text-3); }
.text-faint    { color: var(--text-4); }
.text-brand    { color: var(--brand-text); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }

.bg-surface    { background: var(--surface); }
.bg-surface-2  { background: var(--surface-2); }
.border-base   { border-color: var(--border); }

.rounded-card  { border-radius: 14px; }
