/* ==========================================================================
   VARIABLES & GENERAL RESET
   ========================================================================== */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;
  --bg-light: #f1f5f9;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --text-light: #cbd5e1;
  --accent: #38bdf8;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #ef4444;
  --border-color: #e2e8f0;
  --radius-md: 8px;
  --radius-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: #334155;
  min-height: 100vh;
}

code {
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  color: var(--bg-dark);
  font-size: 12px;
}

/* ==========================================================================
   INTERFACE 1: AUTH LAYER (LOGIN / REGISTER)
   ========================================================================== */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

.auth-sidebar {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.sidebar-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 35%;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.sidebar-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  max-width: 480px;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--bg-light);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.auth-header {
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-action-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-action-divider::before,
.auth-action-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-action-divider span {
  padding: 0 0.75rem;
}

/* ==========================================================================
   INTERFACE 2: LAYOUT & DASHBOARD UTAMA
   ========================================================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigasi */
.sidebar-panel {
  width: 280px;
  background: var(--bg-dark);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand-box {
  padding: 25px 20px;
  background: var(--bg-dark-card);
  border-bottom: 1px solid #334155;
}

.sidebar-brand-box h2 {
  margin: 0;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 1px;
}

.sidebar-brand-box p {
  margin: 5px 0 0 0;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
}

.sidebar-nav-menu {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}

.sidebar-nav-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-nav-menu li a:hover,
.sidebar-nav-menu li.active a {
  background: var(--bg-dark-card);
  color: var(--accent);
  font-weight: 600;
  border-left: 4px solid var(--accent);
}

.sidebar-panel-footer {
  border-top: 1px solid #334155;
}

.disabled-menu {
  opacity: 0.5;
  cursor: not-allowed;
}

.disabled-menu a {
  pointer-events: none;
}

/* Main Area Content */
.main-content-full {
  flex: 1;
  padding: 30px;
  box-sizing: border-box;
  overflow-y: auto;
}

.header-title-section {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 25px;
}

.header-title-section.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title-section h1 {
  margin: 0;
  font-size: 24px;
  color: var(--text-dark);
}

.header-title-section p {
  margin: 6px 0 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Metrics / Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 5px;
}

.stat-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Soft Color Badges */
.bg-green-soft  { background: #dcfce7; color: #16a34a; }
.bg-purple-soft { background: #f3e8ff; color: #9333ea; }
.bg-yellow-soft { background: #fef9c3; color: #ca8a04; }
.bg-blue-soft   { background: #e0f2fe; color: #0284c7; }

/* Pulse Animation for Live Monitoring */
@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.pulse-indicator {
  color: var(--success);
  font-size: 11px;
  animation: pulse-dot 1.5s infinite;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.card-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 15px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-excel-container {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
}

.import-action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.danger-zone-container {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fee2e2;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #fca5a5;
  flex-wrap: wrap;
}

/* Progress Bar Container */
.progress-container {
  display: none;
  margin-top: 10px;
}

.progress-track {
  background: #e2e8f0;
  border-radius: 4px;
  height: 10px;
  width: 100%;
  overflow: hidden;
}

.progress-fill {
  background: #15803d;
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}

/* ==========================================================================
   TABEL & DATA DISPLAY
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.classic-table, .custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.classic-table th, .custom-table th {
  background: #f8fafc;
  padding: 12px;
  color: #475569;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.classic-table td, .custom-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
  vertical-align: middle;
}

.classic-table tbody tr:hover, .custom-table tbody tr:hover {
  background-color: #f8fafc;
}

/* ==========================================================================
   BUTTONS & FORM INPUTS
   ========================================================================== */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-excel {
  background-color: #15803d;
  border-color: #15803d;
}

.btn-excel:hover {
  background-color: #166534;
  border-color: #166534;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  border: 1px solid var(--danger);
}

.btn-danger-dark {
  background-color: #b91c1c;
  color: #ffffff;
  border: 1px solid #b91c1c;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.form-input-select, .form-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  background: #ffffff;
  font-size: 13px;
}

textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  resize: vertical;
  font-size: 13px;
}

/* ==========================================================================
   MODAL OVERLAYS & PREVIEW
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex !important;
}

.modal-dialog {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.modal-header-box h3 {
  margin: 0;
  color: var(--text-dark);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-footer-box {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-top: 15px;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dashboard-wrapper { flex-direction: column; }
  .sidebar-panel { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .header-title-section.flex-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}