/* ============================================
   IHC COMMAND CENTER — Professional UI v2
   Dark theme + Violet accent
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2747; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a3660; }

html { scroll-behavior: smooth; }

/* === NAVIGATION === */
.nav-section-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: #3d3a5c; font-weight: 700; padding: 16px 20px 6px; margin-top: 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  color: #5c5a7a; font-weight: 450; font-size: 0.82rem;
  padding: 9px 20px; border-left: 2.5px solid transparent;
  transition: all 0.15s ease;
}
.nav-link:hover { background: rgba(139,92,246,0.04); color: #b0aed0; }
.nav-link.active {
  background: rgba(139,92,246,0.07); color: #c4b5fd;
  font-weight: 600; border-left-color: #8b5cf6;
}
.nav-link svg, .nav-link span.nav-icon { width: 18px; height: 18px; opacity: 0.6; flex-shrink: 0; }
.nav-link.active svg, .nav-link.active span.nav-icon { opacity: 1; }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-draft { background: rgba(100,116,139,0.1); color: #94a3b8; }
.badge-confirmed { background: rgba(251,191,36,0.12); color: #fbbf24; }
.badge-received { background: rgba(59,130,246,0.12); color: #60a5fa; }
.badge-done { background: rgba(16,185,129,0.12); color: #34d399; }
.badge-aktif { background: rgba(139,92,246,0.1); color: #a78bfa; }
.badge-selesai { background: rgba(16,185,129,0.1); color: #34d399; }
.badge-ready { background: rgba(16,185,129,0.1); color: #34d399; }
.badge-shipped { background: rgba(59,130,246,0.1); color: #60a5fa; }
.badge-reserved { background: rgba(251,191,36,0.1); color: #fbbf24; }
.badge-unpaid { background: rgba(239,68,68,0.1); color: #f87171; }
.badge-paid { background: rgba(16,185,129,0.1); color: #34d399; }

/* === CARDS === */
.card {
  background: #141225;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px; padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: rgba(255,255,255,0.07); }
.card-gold {
  border-color: rgba(139,92,246,0.12);
  background: linear-gradient(145deg, rgba(139,92,246,0.06) 0%, #141225 70%);
}
.card-gold:hover { border-color: rgba(139,92,246,0.25); }

/* === TABLES === */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.04);
  background: #141225;
}
.data-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #5c5a7a; font-weight: 700;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: sticky; top: 0; z-index: 1;
}
.data-table td {
  padding: 12px 16px; font-size: 0.84rem;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  vertical-align: middle; color: #b0aed0;
}
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover td { background: rgba(139,92,246,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 550; cursor: pointer;
  border: none; white-space: nowrap;
  transition: all 0.15s ease; font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: #8b5cf6; color: #fff; }
.btn-gold:hover { background: #9d7afa; box-shadow: 0 4px 24px rgba(139,92,246,0.25); }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.07); color: #7a78a0; }
.btn-outline:hover { border-color: rgba(139,92,246,0.35); color: #a78bfa; background: rgba(139,92,246,0.04); }
.btn-outline.active { border-color: rgba(139,92,246,0.4); color: #a78bfa; background: rgba(139,92,246,0.06); }
.btn-danger { background: rgba(239,68,68,0.06); color: #fb7185; border: 1px solid rgba(239,68,68,0.1); }
.btn-danger:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.2); }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: 8px; }

/* === FORMS === */
.form-input {
  width: 100%; background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
  padding: 10px 14px; font-size: 0.84rem; color: #d4d2f0;
  font-family: inherit; transition: all 0.15s ease;
}
.form-input:focus {
  outline: none; border-color: rgba(139,92,246,0.5);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
  background: rgba(0,0,0,0.3);
}
.form-input::placeholder { color: #3d3a5c; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235c5a7a' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

/* === TOAST === */
.toast-enter { animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1); }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === SPINNER === */
.spinner {
  border: 3px solid rgba(255,255,255,0.04); border-top-color: #8b5cf6;
  border-radius: 50%; width: 30px; height: 30px;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === PAGE HEADER === */
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: #eae8ff; letter-spacing: -0.01em; }
.page-header p { font-size: 0.82rem; color: #5c5a7a; margin-top: 3px; }

/* === KPI === */
.kpi-value {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.02em; margin-top: 6px; color: #eae8ff;
  line-height: 1.2;
}
.kpi-label {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #5c5a7a; font-weight: 700;
}

/* === PROGRESS BAR === */
.progress-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.04); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: #8b5cf6; transition: width 0.4s ease; }

/* === MODAL === */
#modal-content {
  box-shadow: 0 25px 80px -12px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04);
  border-radius: 16px;
}

/* === SIDEBAR ACTION BUTTONS === */
.sidebar-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 8px; border-radius: 10px;
  color: #5c5a7a; transition: all 0.15s;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
}
.sidebar-action-btn:hover {
  color: #a78bfa; background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.1);
}

/* === MISC === */
.text-gradient { background: linear-gradient(135deg, #a78bfa, #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .kpi-value { font-size: 1.2rem; }
  .card { padding: 16px; }
}
@media (max-width: 768px) {
  .kpi-value { font-size: 1.05rem; }
  .kpi-label { font-size: 0.6rem; }
  .card { padding: 14px; border-radius: 12px; }
  .data-table th { padding: 10px 12px; font-size: 0.6rem; }
  .data-table td { padding: 10px 12px; font-size: 0.78rem; }
  .btn { padding: 8px 14px; font-size: 0.8rem; }
  .btn-sm { padding: 4px 10px; font-size: 0.7rem; }
  .page-header h2 { font-size: 1.25rem; }
  .table-wrap { border-radius: 12px; }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(30,30,58,0.6); border: 1.5px solid rgba(139,92,246,0.25);
  cursor: pointer; transition: all 0.25s ease; text-align: left; width: 100%;
}
.login-card:hover {
  border-color: rgba(139,92,246,0.6);
  box-shadow: 0 0 20px rgba(139,92,246,0.12);
  transform: translateY(-1px);
}
.login-card .lc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.login-card .lc-title { font-size: 0.9rem; font-weight: 600; color: #e8e6ff; }
.login-card .lc-sub { font-size: 0.72rem; color: #6b6992; margin-top: 1px; }
.login-card .lc-arrow { color: #4a4870; transition: color 0.2s; }
.login-card:hover .lc-arrow { color: #8b5cf6; }
.login-group { border-radius: 14px; overflow: hidden; }
.login-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; width: 100%; cursor: pointer;
  background: rgba(139,92,246,0.04); border: 1px solid rgba(139,92,246,0.1);
  border-radius: 10px; transition: all 0.2s; color: #a5a3c2; text-align: left;
}
.login-group-header:hover { background: rgba(139,92,246,0.08); }
.login-group-header span:first-child { flex: 1; }
.login-group-items { padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.login-group-items .login-card { border-radius: 10px; padding: 10px 14px; }
.login-group-items .login-card .lc-icon { width: 36px; height: 36px; font-size: 1rem; }
.login-group-items .login-card .lc-title { font-size: 0.82rem; }

/* ============================================
   KEUANGAN — Professional Components
   ============================================ */
.keu-kpi {
  background: #141225; border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px; padding: 20px; transition: border-color 0.2s;
}
.keu-kpi:hover { border-color: rgba(139,92,246,0.12); }
.keu-kpi-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.keu-kpi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.keu-kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #5c5a7a; font-weight: 700; }
.keu-kpi-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }

.keu-section {
  background: #141225; border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px; padding: 24px; transition: border-color 0.2s;
}
.keu-section:hover { border-color: rgba(255,255,255,0.07); }
.keu-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.keu-section-header h3 { font-size: 0.85rem; font-weight: 600; color: #b0aed0; }
.keu-section-badge {
  font-size: 0.7rem; font-weight: 700; color: #7a78a0;
  background: rgba(255,255,255,0.04); padding: 4px 10px; border-radius: 8px;
}
.keu-form-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #5c5a7a; font-weight: 700; margin-bottom: 6px; }

.keu-wallet-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.keu-wallet-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: all 0.2s; flex: 1; min-width: 160px;
}
.keu-wallet-item:hover { border-color: rgba(139,92,246,0.25); background: rgba(139,92,246,0.04); }
.keu-wallet-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; flex-shrink: 0;
}
.keu-wallet-name { font-size: 0.75rem; color: #7a78a0; font-weight: 500; }
.keu-wallet-bal { font-size: 0.95rem; font-weight: 700; margin-top: 2px; }

.keu-breakdown-list { display: flex; flex-direction: column; gap: 14px; }
.keu-breakdown-row { display: flex; align-items: center; justify-content: space-between; }
.keu-breakdown-left { display: flex; align-items: center; gap: 10px; }
.keu-breakdown-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.keu-breakdown-label { font-size: 0.82rem; color: #b0aed0; font-weight: 500; }
.keu-breakdown-right { display: flex; align-items: center; gap: 10px; }
.keu-breakdown-amount { font-size: 0.82rem; font-weight: 700; color: #9896b8; }
.keu-breakdown-pct { font-size: 0.68rem; color: #5c5a7a; font-weight: 600; min-width: 30px; text-align: right; }
.keu-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.03); overflow: hidden; margin-top: 6px; }
.keu-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

.keu-hpp-avg {
  background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(139,92,246,0.02) 100%);
  border: 1px solid rgba(139,92,246,0.12); border-radius: 12px;
  padding: 16px; text-align: center; margin-bottom: 16px;
}
.keu-hpp-avg-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7a78a0; font-weight: 600; margin-bottom: 4px; }
.keu-hpp-avg-value { font-size: 1.3rem; font-weight: 800; color: #a78bfa; }
.keu-hpp-avg-unit { font-size: 0.75rem; font-weight: 600; color: #7a78a0; margin-left: 2px; }
.keu-hpp-list { display: flex; flex-direction: column; gap: 2px; }
.keu-hpp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.025);
}
.keu-hpp-row:last-child { border-bottom: none; }
.keu-hpp-kode { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; color: #a78bfa; font-weight: 600; }
.keu-hpp-val { font-size: 0.85rem; font-weight: 700; color: #d4d2f0; }
.keu-hpp-meta { font-size: 0.68rem; color: #5c5a7a; margin-top: 2px; }

.keu-payroll-list { display: flex; flex-direction: column; gap: 2px; }
.keu-payroll-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.025);
}
.keu-payroll-row:last-child { border-bottom: none; }
.keu-tipe-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ============================================
   LIGHT MODE
   ============================================ */
body.light { background: #f8f7ff !important; color: #1e1b4b !important; }
body.light .card { background: #fff; border-color: #ebe8ff; }
body.light .card:hover { border-color: #d4ceff; }
body.light .card-gold { background: linear-gradient(145deg, rgba(139,92,246,0.04) 0%, #fff 70%); border-color: #ddd6fe; }
body.light .nav-link { color: #6b7280; }
body.light .nav-link:hover { background: rgba(139,92,246,0.04); color: #4c1d95; }
body.light .nav-link.active { background: rgba(139,92,246,0.06); color: #7c3aed; border-left-color: #7c3aed; }
body.light .nav-section-label { color: #9ca3af; }
body.light aside { background: #fdfcff !important; border-color: #ebe8ff !important; }
body.light .lg\:hidden.fixed { background: rgba(253,252,255,0.95) !important; border-color: #ebe8ff !important; }
body.light .table-wrap { background: #fff; border-color: #ebe8ff; }
body.light .data-table th { background: #f8f7ff; color: #6d28d9; border-color: #ebe8ff; }
body.light .data-table td { color: #374151; border-color: #f3f0ff; }
body.light .data-table tbody tr:hover td { background: #faf9ff; }
body.light .form-input { background: #faf9ff; border-color: #e5e0ff; color: #1e1b4b; }
body.light .form-input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.1); background: #fff; }
body.light .form-input::placeholder { color: #b0aed0; }
body.light .btn-outline { border-color: #e5e0ff; color: #6b7280; }
body.light .btn-outline:hover { border-color: #8b5cf6; color: #7c3aed; }
body.light .btn-outline.active { background: rgba(139,92,246,0.06); border-color: #8b5cf6; color: #7c3aed; }
body.light .btn-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
body.light .kpi-value { color: #1e1b4b; }
body.light .kpi-label { color: #6b7280; }
body.light .page-header h2 { color: #1e1b4b; }
body.light .page-header p { color: #6b7280; }
body.light .badge-draft { background: #f3f4f6; color: #6b7280; }
body.light .badge-confirmed { background: #fef3c7; color: #d97706; }
body.light .badge-received { background: #dbeafe; color: #2563eb; }
body.light .badge-done { background: #ecfdf5; color: #059669; }
body.light .badge-aktif { background: #ede9fe; color: #7c3aed; }
body.light .badge-selesai { background: #ecfdf5; color: #059669; }
body.light .badge-ready { background: #ecfdf5; color: #059669; }
body.light .badge-shipped { background: #dbeafe; color: #2563eb; }
body.light .badge-unpaid { background: #fef2f2; color: #dc2626; }
body.light .badge-paid { background: #ecfdf5; color: #059669; }
body.light .progress-bar { background: #ebe8ff; }
body.light .text-gradient { background: linear-gradient(135deg, #7c3aed, #6d28d9); -webkit-background-clip: text; }
body.light #modal-backdrop { background: rgba(0,0,0,0.3); }
body.light #modal-content { background: #fff; border-color: #ebe8ff; box-shadow: 0 25px 60px -12px rgba(0,0,0,0.15); }
body.light .login-card { background: #fff; border-color: #e5e0ff; }
body.light .login-card:hover { border-color: #8b5cf6; box-shadow: 0 4px 20px rgba(139,92,246,0.1); }
body.light .login-card .lc-title { color: #1e1b4b; }
body.light .login-card .lc-sub { color: #6b7280; }
body.light .login-group-header { background: rgba(139,92,246,0.04); border-color: #e5e0ff; color: #4c1d95; }

body.light .text-slate-400, body.light .text-slate-500 { color: #6b7280 !important; }
body.light .text-slate-600 { color: #9ca3af !important; }
body.light .text-violet-400 { color: #7c3aed !important; }
body.light .text-violet-300 { color: #8b5cf6 !important; }

/* Light mode keuangan */
body.light .keu-kpi { background: #fff; border-color: #ebe8ff; }
body.light .keu-kpi:hover { border-color: #d4ceff; }
body.light .keu-kpi-label { color: #6b7280; }
body.light .keu-section { background: #fff; border-color: #ebe8ff; }
body.light .keu-section:hover { border-color: #d4ceff; }
body.light .keu-section-header { border-color: #f3f0ff; }
body.light .keu-section-header h3 { color: #374151; }
body.light .keu-section-badge { background: #f5f3ff; color: #6d28d9; }
body.light .keu-wallet-item { background: #faf9ff; border-color: #ebe8ff; }
body.light .keu-wallet-item:hover { border-color: #8b5cf6; background: #f5f3ff; }
body.light .keu-wallet-name { color: #6b7280; }
body.light .keu-wallet-bal { color: #1e1b4b; }
body.light .keu-breakdown-label { color: #374151; }
body.light .keu-breakdown-amount { color: #1e1b4b; }
body.light .keu-breakdown-pct { color: #9ca3af; }
body.light .keu-bar { background: #ebe8ff; }
body.light .keu-hpp-avg { background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(139,92,246,0.01) 100%); border-color: #ddd6fe; }
body.light .keu-hpp-avg-label { color: #6b7280; }
body.light .keu-hpp-avg-value { color: #7c3aed; }
body.light .keu-hpp-kode { color: #7c3aed; }
body.light .keu-hpp-val { color: #1e1b4b; }
body.light .keu-hpp-meta { color: #9ca3af; }
body.light .keu-hpp-row { border-color: #f3f0ff; }
body.light .keu-payroll-row { border-color: #f3f0ff; }
body.light .keu-form-label { color: #6b7280; }
