/* 
 * Napocut Odoo Product Catalog - Styling System
 * Themes: Dark Mode (Default) & Light Mode
 */

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

:root {
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', sans-serif;

  /* Dark Palette (Default) — Apple dark mode: hitam pekat, bukan abu kebiruan */
  --bg-main: #000000;
  --bg-surface: #1d1d1f;
  --bg-surface-hover: #2a2a2c;
  --bg-card: rgba(29, 29, 31, 0.75);
  --bg-card-solid: #1d1d1f;
  --bg-glass: rgba(0, 0, 0, 0.65);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-strong: rgba(255, 255, 255, 0.18);
  --table-header-bg: #1d1d1f;
  --table-grid: rgba(255, 255, 255, 0.1);
  --bg-row-alt: rgba(255, 255, 255, 0.02);

  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-muted: #6e6e73;

  --primary: #2997ff;
  --primary-hover: #0071e3;
  --primary-light: rgba(41, 151, 255, 0.15);
  --accent: #2997ff;

  --success: #30d158;
  --success-bg: rgba(48, 209, 88, 0.15);
  --warning: #ff9f0a;
  --warning-bg: rgba(255, 159, 10, 0.15);
  --danger: #ff453a;
  --danger-bg: rgba(255, 69, 58, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 980px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;

  /* Motion */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-theme: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;

  --focus-ring: 0 0 0 3px var(--primary-light);
}

[data-theme="light"] {
  /* Apple light mode: off-white #f5f5f7, near-black teks, biru #0071e3 */
  --bg-main: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-surface-hover: #ececec;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-strong: rgba(0, 0, 0, 0.14);
  --table-header-bg: #f5f5f7;
  --table-grid: rgba(0, 0, 0, 0.08);
  --bg-row-alt: rgba(0, 0, 0, 0.015);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;

  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-light: rgba(0, 113, 227, 0.1);
  --accent: #0071e3;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  transition: var(--transition-theme);
  overflow-x: hidden;
}

/* Smooth theme switch across all surfaces */
.navbar,
.sidebar,
.sidebar-menu-item,
.settings-section,
.settings-checkbox,
.kpi-card,
.toolbar-card,
.table-container,
.data-table th,
.data-table td,
.spreadsheet-table th,
.spreadsheet-table td,
.form-control,
.select-control,
.modal-card,
.modal-footer,
.toast,
.user-pill,
.icon-btn,
.str-formula-note,
.spec-item {
  transition: var(--transition-theme);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Accessible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-tab-btn:focus-visible,
.sidebar-menu-item:focus-visible,
.icon-btn:focus-visible,
.btn-primary:focus-visible,
.export-btn:focus-visible,
.production-preview-btn:focus-visible,
.settings-checkbox:focus-within {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Decorative background is disabled to keep the theme fully solid. */
.bg-glow-container {
  display: none;
}
.glow-orb-1 {
  position: absolute;
  top: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: var(--primary-light);
}
.glow-orb-2 {
  position: absolute;
  bottom: -150px;
  right: -150px;
  width: 550px;
  height: 550px;
  background: var(--primary-light);
}

/* ================= AUTH / LOGIN VIEW ================= */
.auth-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.brand-header {
  text-align: center;
  margin-bottom: 32px;
}

.brand-logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}
.brand-logo-badge svg {
  width: 28px;
  height: 28px;
  color: #ffffff;
}

.brand-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.brand-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.odoo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(113, 75, 103, 0.2);
  border: 1px solid rgba(113, 75, 103, 0.4);
  color: #b779a5;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  margin-top: 10px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
  width: 100%;
  padding: 14px 22px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Secondary / ghost button variants */
.btn-secondary,
.btn-ghost {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-base);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color-strong);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.btn-secondary:disabled,
.btn-ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.nav-tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.nav-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}
.nav-tab-btn {
  border-radius: var(--radius-pill);
}
.nav-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ================= MAIN DASHBOARD LAYOUT ================= */
.app-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 67px;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.nav-logo svg {
  width: 20px;
  height: 20px;
}
.nav-title h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-title span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 30px;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}
.user-db {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color-strong);
}

/* Dashboard shell */
.dashboard-layout {
  display: block;
  flex: 1;
  min-width: 0;
}

.sidebar {
  position: fixed;
  top: 67px;
  bottom: 0;
  left: 0;
  z-index: 90;
  width: 240px;
  height: calc(100vh - 67px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  overflow-y: auto;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-menu-item {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-menu-item svg {
  flex-shrink: 0;
}

.sidebar-menu-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sidebar-menu-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Settings */
.settings-page {
  width: 100%;
}

.settings-header {
  margin-bottom: 24px;
}

.settings-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.settings-header p,
.settings-section-heading p,
.settings-loading {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.settings-section {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.settings-section-heading {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.test-connection-result {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.test-connection-result.success { color: var(--success); }
.test-connection-result.danger { color: var(--danger); }

.settings-section-heading h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.settings-checkbox {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-checkbox:hover {
  border-color: var(--primary);
}

.settings-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

/* Dashboard Content */
.dashboard-body {
  min-width: 0;
  padding: 28px;
  width: calc(100% - 240px);
  margin-left: 240px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon svg { width: 24px; height: 24px; }

.kpi-icon.blue { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.kpi-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.kpi-data h3 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-data p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Toolbar & Filters */
.toolbar-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-box {
  flex: 1;
  min-width: 260px;
}
.search-box .form-control {
  padding-left: 42px;
}

.filters-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.select-control {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.select-control:focus {
  border-color: var(--primary);
}

.date-control {
  width: auto;
  min-width: 150px;
}

.str-formula-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  background: var(--success);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.export-btn:hover {
  opacity: 0.9;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.stock-badge.in-stock {
  background: var(--success-bg);
  color: var(--success);
}
.stock-badge.out-of-stock {
  background: var(--danger-bg);
  color: var(--danger);
}
.stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Product List Table View */
.table-container {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  background: var(--bg-surface);
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  vertical-align: middle;
}
.data-table tr {
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.data-table tbody tr:nth-child(even) td {
  background-color: var(--bg-row-alt);
}
.data-table tr:hover {
  background-color: var(--bg-surface-hover);
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* Spreadsheet-style product list */
.spreadsheet-table {
  min-width: 920px;
  table-layout: auto;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.spreadsheet-table th {
  padding: 9px 10px;
  background: var(--table-header-bg);
  border: 1px solid var(--table-grid);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.sheet-sort-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sheet-sort-btn span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.sheet-sort-btn.active,
.sheet-sort-btn.active span {
  color: var(--primary);
}

.spreadsheet-table td {
  height: 38px;
  padding: 7px 10px;
  background: var(--bg-card-solid);
  border: 1px solid var(--table-grid);
  font-size: 0.8125rem;
  line-height: 1.25;
}

.spreadsheet-table tbody tr:hover td {
  background: var(--primary-light);
}

.spreadsheet-table .sheet-row-number {
  width: 54px;
  min-width: 54px;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
  background: var(--table-header-bg);
  color: var(--text-secondary);
  font-weight: 700;
}

.spreadsheet-table .sheet-number {
  text-align: right;
  white-space: nowrap;
}

.production-preview-btn {
  min-width: 76px;
  padding: 4px 7px;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.production-preview-btn:hover {
  background: var(--primary-light);
}

.production-preview-btn:disabled {
  color: var(--text-muted);
  cursor: wait;
}

.production-summary-row.expanded td {
  background: var(--primary-light);
  border-bottom-color: var(--primary);
}

.spreadsheet-table .production-preview-cell {
  height: auto;
  padding: 0;
  background: var(--bg-surface);
  border-top: 0;
}

.production-breakdown {
  padding: 9px 10px 12px 34px;
  animation: production-breakdown-open 140ms ease-out;
  transform-origin: top;
}

.production-breakdown-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--primary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.production-breakdown-scroll {
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--table-grid);
}

.production-breakdown-table {
  min-width: 760px;
}

.production-breakdown-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  font-size: 0.6875rem;
}

.production-breakdown-table td {
  height: 30px;
  padding: 5px 8px;
  font-size: 0.75rem;
}

@keyframes production-breakdown-open {
  from {
    opacity: 0;
    transform: scaleY(0.97);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* Modal / Drawer */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 800;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.spec-item {
  background: var(--bg-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.spec-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.spec-item span {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color-strong);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading bar indeterminate untuk proses panjang (mis. export Trace Makloon) */
.progress-bar {
  position: relative;
  height: 6px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: var(--primary, #3b82f6);
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { left: -35%; }
  100% { left: 100%; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-container {
    padding-top: 63px;
  }
  .sidebar {
    top: 63px;
    width: 72px;
    height: calc(100vh - 63px);
    padding: 16px 10px;
  }
  .sidebar-menu-item {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-menu-item span {
    display: none;
  }
  .dashboard-body {
    width: calc(100% - 72px);
    margin-left: 72px;
    padding: 16px;
  }
  .navbar { padding: 12px 16px; }
  .user-name, .user-db { display: none; }
  .user-pill { padding: 4px; }
  .toolbar-card { flex-direction: column; align-items: stretch; }
  .filters-group { justify-content: space-between; }
  .spec-grid { grid-template-columns: 1fr; }
}
