/* style.css - Clean Corporate Theme */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ── Fonts ── */
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

/* ── CSS Custom Properties - Corporate Light ── */
:root {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #f8fafc;
  --border-color: #e2e8f0;
  --border-accent: #2563eb;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-amber: #2563eb;
  --accent-amber-hover: #1d4ed8;
  --accent-orange: #ea580c;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --gradient-steel: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  --gradient-header: linear-gradient(90deg, #1e3a5f 0%, #1e40af 50%, #1e3a5f 100%);
  --gradient-amber: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 12px rgba(37, 99, 235, 0.08);
  --icon-bg-blue: #eff6ff;
  --icon-bg-green: #dcfce7;
  --icon-bg-red: #fee2e2;
  --icon-bg-yellow: #fef3c7;
  --table-row-hover: #f8fafc;
  --scrollbar-thumb: #cbd5e1;
  --sidebar-active-bg: #eff6ff;
  --modal-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay-bg: rgba(15, 23, 42, 0.4);
  --skeleton-from: #e2e8f0;
  --skeleton-mid: #f1f5f9;
  --qr-bg: #ffffff;
  --progress-track: #333;
  --progress-bar: #4caf50;
}

/* ── CSS Custom Properties - Corporate Dark ── */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-surface: #334155;
  --border-color: #334155;
  --border-accent: #3b82f6;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent-amber: #3b82f6;
  --accent-amber-hover: #2563eb;
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --gradient-steel: linear-gradient(135deg, #1e293b 0%, #334155 50%, #0f172a 100%);
  --gradient-header: linear-gradient(90deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  --gradient-amber: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 4px 12px rgba(59, 130, 246, 0.15);
  --icon-bg-blue: #1e3a5f;
  --icon-bg-green: #14532d;
  --icon-bg-red: #450a0a;
  --icon-bg-yellow: #451a03;
  --table-row-hover: #334155;
  --scrollbar-thumb: #475569;
  --sidebar-active-bg: #1e3a5f;
  --modal-bg: #1e293b;
  --input-bg: #0f172a;
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --skeleton-from: #334155;
  --skeleton-mid: #475569;
  --qr-bg: #ffffff;
  --progress-track: #475569;
  --progress-bar: #22c55e;
}

/* ── Base ── */
body {
  font-family: "Roboto", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-amber); }

/* ── Card ── */
.ind-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}
.ind-card:hover {
  box-shadow: var(--shadow-glow);
}

/* ── Card with accent top bar ── */
.ind-card-accent {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--accent-amber);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}

/* ── Table styling ── */
.ind-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}
.ind-table thead th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}
.ind-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.ind-table tbody tr {
  transition: background 0.15s ease;
}
.ind-table tbody tr:hover {
  background: var(--table-row-hover);
}

/* ── Buttons ── */
.ind-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.ind-btn-primary {
  background: var(--accent-amber);
  color: #ffffff;
}
.ind-btn-primary:hover { background: var(--accent-amber-hover); }
.ind-btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.ind-btn-secondary:hover { border-color: var(--text-muted); color: var(--text-primary); background: var(--bg-card-hover); }
.ind-btn-danger { background: var(--accent-red); color: white; }
.ind-btn-danger:hover { background: #b91c1c; }
.ind-btn-success { background: var(--accent-green); color: white; }
.ind-btn-success:hover { background: #15803d; }

/* ── Form inputs ── */
.ind-input {
  width: 100%;
  padding: 9px 13px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ind-input:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ind-input::placeholder { color: var(--text-muted); }

.ind-select {
  width: 100%;
  padding: 9px 13px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.ind-select:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ind-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ── Badges ── */
.ind-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
}
.ind-badge-success { background: var(--icon-bg-green); color: #15803d; }
.ind-badge-warning { background: var(--icon-bg-yellow); color: #92400e; }
.ind-badge-danger { background: var(--icon-bg-red); color: #b91c1c; }
.ind-badge-info { background: var(--icon-bg-blue); color: var(--accent-blue); }
.ind-badge-neutral { background: var(--bg-surface); color: var(--text-muted); }

/* ── Modal ── */
.ind-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.ind-modal {
  background: var(--modal-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.ind-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ind-modal-header h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}
.ind-modal-body { padding: 20px; }

/* ── Sidebar ── */
.ind-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}
.ind-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.ind-sidebar-item:hover {
  color: var(--accent-amber);
  background: var(--sidebar-active-bg);
}
.ind-sidebar-item.active {
  color: var(--accent-amber);
  background: var(--sidebar-active-bg);
  font-weight: 600;
}
.ind-sidebar-sub {
  display: block;
  padding: 6px 14px 6px 40px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.ind-sidebar-sub:hover {
  color: var(--accent-amber);
}

/* ── Pagination ── */
.ind-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ind-pagination button {
  padding: 6px 11px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ind-pagination button:hover { border-color: var(--accent-amber); color: var(--accent-amber); }
.ind-pagination button.active {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #ffffff;
  font-weight: 600;
}

/* ── Metric Card ── */
.ind-metric {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.ind-metric::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-amber);
}
.ind-metric-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ind-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 4px 0;
}
.ind-metric-trend {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Section Header ── */
.ind-section-header {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

/* ── Toast Notification ── */
.ind-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  z-index: 100;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.ind-toast-success { background: var(--icon-bg-green); color: #15803d; border: 1px solid var(--border-color); }
.ind-toast-error { background: var(--icon-bg-red); color: #b91c1c; border: 1px solid var(--border-color); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Loading skeleton ── */
.ind-skeleton {
  background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--skeleton-mid) 50%, var(--skeleton-from) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Status indicator pulse ── */
.ind-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}
.ind-pulse-green { background: var(--accent-green); }
.ind-pulse-red { background: var(--accent-red); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Responsive Helpers ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .ind-table thead th { font-size: 0.625rem; padding: 8px 10px; }
  .ind-table tbody td { padding: 8px 10px; font-size: 0.8rem; }
  .ind-modal { width: 95vw !important; max-width: 95vw !important; margin: 16px auto; }
  .ind-metric { padding: 14px; }
  .ind-metric-value { font-size: 1.25rem; }
}
@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--border-color);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
[data-theme="dark"] .theme-toggle {
  background: var(--accent-amber);
}
[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
}
.theme-toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  z-index: 1;
  transition: opacity 0.3s ease;
}
.theme-toggle-icon.sun {
  left: 6px;
  color: #f59e0b;
  opacity: 1;
}
.theme-toggle-icon.moon {
  right: 6px;
  color: #94a3b8;
  opacity: 1;
}
[data-theme="dark"] .theme-toggle-icon.sun {
  opacity: 0.3;
}
[data-theme="light"] .theme-toggle-icon.moon,
:root:not([data-theme="dark"]) .theme-toggle-icon.moon {
  opacity: 0.3;
}

/* ── Theme transition ── */
body, .ind-card, .ind-sidebar, .ind-modal, .ind-input, .ind-select,
.ind-metric, .ind-table, .ind-btn-secondary, .ind-pagination button,
header, footer, main {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ── Print styles ── */
@media print {
  #filter-bulan, #filter-triwulan, #filter-start, #filter-end,
  #apply-filter, #cetak-laporan, label {
    display: none !important;
  }
  body { margin: 0; font-size: 12px; background: white; color: black; }
  table { width: 100%; border-collapse: collapse; }
  th, td { border: 1px solid #000; padding: 4px; }
}
