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

/* === CSS VARIABLES & THEME SYSTEM === */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Default Light Theme Colors */
  --bg-dark: #f1f5f9;          /* Slate 100 */
  --bg-panel: rgba(255, 255, 255, 0.85); /* Clean Translucent White Panel */
  --bg-panel-solid: #ffffff;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.25);

  --bg-card-primary: linear-gradient(135deg, #ffffff 0%, rgba(99, 102, 241, 0.06) 100%);
  --bg-card-danger: linear-gradient(135deg, #ffffff 0%, rgba(244, 63, 94, 0.05) 100%);
  --bg-card-info: linear-gradient(135deg, #ffffff 0%, rgba(99, 102, 241, 0.05) 100%);
  --bg-card-success: linear-gradient(135deg, #ffffff 0%, rgba(16, 185, 129, 0.05) 100%);
  --bg-card-warning: linear-gradient(135deg, #ffffff 0%, rgba(245, 158, 11, 0.05) 100%);
  --bg-card-summary: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, #ffffff 100%);
  --bg-subtle-box: rgba(15, 23, 42, 0.03);

  --primary: #4f46e5;          /* Slightly deeper indigo for contrast */
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --success: #059669;          /* Deeper emerald for readability */
  --success-hover: #047857;
  --success-glow: rgba(5, 150, 105, 0.12);

  --danger: #e11d48;           /* Deeper rose */
  --danger-hover: #be123c;
  --danger-glow: rgba(225, 29, 72, 0.12);

  --warning: #d97706;          /* Deeper amber */
  --warning-hover: #b45309;
  --warning-glow: rgba(217, 119, 6, 0.12);

  --info: #2563eb;             /* Deeper sky blue */
  --info-glow: rgba(37, 99, 235, 0.12);

  /* Typography Colors */
  --text-primary: #0f172a;     /* Slate 900 */
  --text-secondary: #475569;   /* Slate 600 */
  --text-muted: #64748b;       /* Slate 500 */
  --text-link: #4f46e5;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 4px 20px rgba(79, 70, 229, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Decorative Blobs */
  --blob-primary: rgba(79, 70, 229, 0.06);
  --blob-secondary: rgba(5, 150, 105, 0.04);
}

/* === DARK THEME VARIABLES === */
[data-theme="dark"] {
  --bg-dark: #090d16;
  --bg-panel: rgba(22, 28, 45, 0.45);
  --bg-panel-solid: #131929;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-glow: rgba(99, 102, 241, 0.15);

  --bg-card-primary: linear-gradient(135deg, rgba(22, 28, 45, 0.45) 0%, rgba(99, 102, 241, 0.05) 100%);
  --bg-card-danger: linear-gradient(135deg, rgba(22, 28, 45, 0.45) 0%, rgba(244, 63, 94, 0.03) 100%);
  --bg-card-info: linear-gradient(135deg, rgba(22, 28, 45, 0.45) 0%, rgba(99, 102, 241, 0.03) 100%);
  --bg-card-success: linear-gradient(135deg, rgba(22, 28, 45, 0.45) 0%, rgba(16, 185, 129, 0.04) 100%);
  --bg-card-warning: linear-gradient(135deg, rgba(22, 28, 45, 0.45) 0%, rgba(245, 158, 11, 0.04) 100%);
  --bg-card-summary: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(22, 28, 45, 0.7));
  --bg-subtle-box: rgba(255, 255, 255, 0.02);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.25);

  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --danger-glow: rgba(244, 63, 94, 0.25);

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-glow: rgba(245, 158, 11, 0.25);

  --info: #3b82f6;
  --info-glow: rgba(59, 130, 246, 0.25);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #818cf8;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.2);

  /* Decorative Blobs */
  --blob-primary: rgba(99, 102, 241, 0.15);
  --blob-secondary: rgba(16, 185, 129, 0.08);
}

/* === GENERAL RESET === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Stunning gradient blob background decoration */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--blob-primary) 0%, transparent 70%);
  z-index: -2;
  pointer-events: none;
  transition: background 0.3s ease;
}

body::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--blob-secondary) 0%, transparent 70%);
  z-index: -2;
  pointer-events: none;
  transition: background 0.3s ease;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  filter: brightness(1.2);
}

/* === GLASSMORPHISM STYLES === */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === NAVIGATION BAR === */
nav.glass {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand span.accent {
  background: linear-gradient(135deg, var(--primary), var(--info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: nowrap;
}

.links a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.links a i {
  font-size: 13px;
  margin-right: 0 !important;
}

.links a:hover, .links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    background: var(--bg-panel-solid);
    border-bottom: 1px solid var(--border-color);
  }
  .links.open {
    display: flex;
  }
  .links a {
    width: 100%;
    text-align: center;
    padding: 12px;
  }
}

/* === MAIN CONTAINER === */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem 1.5rem;
}

/* === GRID SYSTEM === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.laporan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .laporan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .laporan-grid {
    grid-template-columns: 1fr;
  }
}

/* === STAT CARDS === */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }

.stat-card.primary { background: var(--bg-card-primary); }
.stat-card.danger { background: var(--bg-card-danger); }
.stat-card.info { background: var(--bg-card-info); }
.stat-card.success { background: var(--bg-card-success); }
.stat-card.warning { background: var(--bg-card-warning); }

.stat-card h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-card .val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-card .text-caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Glow effects for values */
.val-blue { color: #60a5fa; text-shadow: 0 0 10px rgba(96, 165, 250, 0.2); }
.val-green { color: #34d399; text-shadow: 0 0 10px rgba(52, 211, 153, 0.2); }
.val-orange { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.2); }
.val-rose { color: #f43f5e; text-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }

/* === TABLES === */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 15, 30, 0.3);
  margin-bottom: 1.5rem;
}

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

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.positive {
  color: #34d399;
  font-weight: 500;
}

.negative {
  color: #fb7185;
  font-weight: 500;
}

.tfoot-bold {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.tfoot-bold td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.15);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  filter: brightness(1.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #fb7185);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
  filter: brightness(1.15);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

/* === FILTERS === */
.filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-row select, .filter-row input {
  background-color: var(--bg-panel-solid);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  height: 38px;
}

.filter-row select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

.filter-row select:focus, .filter-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* === FORMS & MODALS === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

select.form-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-dialog {
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 460px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.modal-dialog h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.modal-dialog p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
}

/* === TAB SYSTEM === */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* === GENERAL UTILITIES === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue { background: rgba(59, 130, 246, 0.12); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-green { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-orange { background: rgba(245, 158, 11, 0.12); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-purple { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-gray { background: rgba(100, 116, 139, 0.12); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.2); }

.row-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.row-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.row-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 50;
}

.row-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}

.row-menu button:hover {
  background: rgba(255, 255, 255, 0.03);
}

.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.2s ease;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}

.drop-zone img {
  max-width: 100%;
  max-height: 250px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

.part-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.part-chip.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-link);
  border-color: var(--primary);
}

.part-chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.sb-portion-input {
  width: 36px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 11px;
  text-align: center;
  margin-left: 6px;
  font-weight: 700;
  outline: none;
  transition: all 0.15s ease;
}

.sb-portion-input:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
}

.sb-portion-input:focus {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.bg-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
  opacity: 0.05;
}

/* === THEME TOGGLE BUTTON STYLE === */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  height: 38px;
  width: 38px;
  margin-right: 0.5rem;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-glow);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

/* === LIGHT THEME OVERRIDES === */
[data-theme="light"] select,
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] .form-input,
[data-theme="light"] .filter-row select,
[data-theme="light"] .filter-row input {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary) !important;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

[data-theme="light"] select:focus,
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] .form-input:focus,
[data-theme="light"] .filter-row select:focus,
[data-theme="light"] .filter-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .table-wrap {
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] th {
  background: rgba(15, 23, 42, 0.02);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
}

[data-theme="light"] td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  color: var(--text-primary);
}

[data-theme="light"] tr:hover td {
  background: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .tfoot-bold {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .tfoot-bold td {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .val-blue { color: #1d4ed8; text-shadow: none; }
[data-theme="light"] .val-green { color: #047857; text-shadow: none; }
[data-theme="light"] .val-orange { color: #b45309; text-shadow: none; }
[data-theme="light"] .val-rose { color: #be123c; text-shadow: none; }

[data-theme="light"] .positive {
  color: #047857;
}

[data-theme="light"] .negative {
  color: #be123c;
}

[data-theme="light"] .btn-outline {
  border: 1px solid rgba(15, 23, 42, 0.15);
  color: var(--text-secondary);
}

[data-theme="light"] .btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .badge-blue { background: rgba(37, 99, 235, 0.08); color: #1d4ed8; border: 1px solid rgba(37, 99, 235, 0.15); }
[data-theme="light"] .badge-green { background: rgba(5, 150, 105, 0.08); color: #047857; border: 1px solid rgba(5, 150, 105, 0.15); }
[data-theme="light"] .badge-orange { background: rgba(217, 119, 6, 0.08); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.15); }
[data-theme="light"] .badge-purple { background: rgba(109, 40, 217, 0.08); color: #6d28d9; border: 1px solid rgba(109, 40, 217, 0.15); }
[data-theme="light"] .badge-gray { background: rgba(71, 85, 105, 0.08); color: #334155; border: 1px solid rgba(71, 85, 105, 0.15); }

[data-theme="light"] .tabs {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .row-menu {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .row-menu button {
  color: var(--text-primary);
}

[data-theme="light"] .row-menu button:hover {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .row-menu-btn:hover {
  background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .part-chip {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .part-chip.active {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
  border-color: #4f46e5;
}

[data-theme="light"] .part-chip.selected {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .drop-zone {
  border: 2px dashed rgba(15, 23, 42, 0.15);
  background: rgba(15, 23, 42, 0.01);
}

[data-theme="light"] .drop-zone:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

[data-theme="light"] .bg-scene {
  opacity: 0.03;
}

/* === MOBILE & RESPONSIVE GRID UTILITIES === */
.grid-responsive-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.grid-responsive-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .links {
    z-index: 1001 !important; /* Ensure navbar dropdown layers above charts, cards & overlays */
  }
}

@media (max-width: 768px) {
  .grid-responsive-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem 0.75rem 2rem 0.75rem !important; /* Maximize screen utilization */
  }
  .grid-responsive-2 {
    grid-template-columns: 1fr;
  }
  .filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  .filter-row select, .filter-row input, .filter-row div {
    width: 100% !important;
  }
  .tab-btn {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  .grid-responsive-4 {
    grid-template-columns: 1fr;
  }
  .modal-dialog {
    padding: 1.25rem !important;
    width: 95% !important;
  }
  .modal-actions {
    flex-direction: column;
    gap: 8px !important;
  }
  .modal-actions button {
    width: 100%;
  }
}

/* Momentum scrolling for tables and tabs */
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

.tabs {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  white-space: nowrap !important;
}

