/* ============================================
   REPORT COD - Main CSS
   Light Mode | Professional | Clean
   ============================================ */

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

:root {
  --white:        #ffffff;
  --bg:           #f5f6fa;
  --bg-card:      #ffffff;
  --sidebar-bg:   #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover:#1e293b;
  --sidebar-active:#3b82f6;
  --border:       #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary:#64748b;
  --text-muted:   #94a3b8;
  --blue:         #3b82f6;
  --blue-dark:    #2563eb;
  --blue-light:   #eff6ff;
  --green:        #10b981;
  --green-light:  #ecfdf5;
  --red:          #ef4444;
  --red-light:    #fef2f2;
  --yellow:       #f59e0b;
  --yellow-light: #fffbeb;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --sidebar-w:    240px;
  --topbar-h:     64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   LAYOUT
   ============================================ */
.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand h1 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.sidebar-brand span {
  font-size: 0.72rem;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  color: #fff;
  background: var(--sidebar-hover);
}

.nav-item.active {
  color: #fff;
  background: rgba(59,130,246,0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sidebar-active);
  border-radius: 0 2px 2px 0;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info p {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.sidebar-user-info span {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}

/* MAIN CONTENT */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* PAGE CONTENT */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 22px; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-icon.blue   { background: var(--blue-light);   color: var(--blue); }
.stat-icon.green  { background: var(--green-light);  color: var(--green); }
.stat-icon.red    { background: var(--red-light);    color: var(--red); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow); }

/* ============================================
   TABLE
   ============================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

thead th {
  background: var(--bg);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--bg); }

.td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-aktif  { background: var(--green-light); color: var(--green); }
.badge-batal  { background: var(--red-light);   color: var(--red); }
.badge-bot    { background: var(--blue-light);  color: var(--blue); }
.badge-web    { background: var(--yellow-light);color: var(--yellow); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 11px 22px; font-size: 0.9rem; }

.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-success:hover { background: #059669; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 200px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
}

.form-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: var(--green-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--red-light);   color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--blue-light);  color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--yellow-light);color: #92400e; border: 1px solid #fde68a; }

/* ============================================
   PREVIEW AREA
   ============================================ */
.preview-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.preview-batch {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.preview-batch-header {
  background: var(--bg);
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.preview-batch-body {
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  transform: translateY(10px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.filter-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

.filter-select:focus { border-color: var(--blue); }

input[type="date"].filter-select { color: var(--text-primary); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.85rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px 0;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--white);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   UTILITIES
   ============================================ */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-blue     { color: var(--blue); }
.text-green    { color: var(--green); }
.text-red      { color: var(--red); }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fs-sm         { font-size: 0.78rem; }
.mono          { font-family: 'JetBrains Mono', monospace; }
.mb-0          { margin-bottom: 0; }
.mb-1          { margin-bottom: 8px; }
.mb-2          { margin-bottom: 16px; }
.mb-3          { margin-bottom: 24px; }
.mt-1          { margin-top: 8px; }
.mt-2          { margin-top: 16px; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1         { gap: 8px; }
.gap-2         { gap: 16px; }
.flex-1        { flex: 1; }
.w-100         { width: 100%; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}
.alert svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.stat-icon svg { width: 18px !important; height: 18px !important; }
.nav-item svg { width: 16px !important; height: 16px !important; }
.btn svg { width: 14px !important; height: 14px !important; }
.empty-state svg { width: 40px !important; height: 40px !important; }
thead th svg, tbody td svg { width: 14px !important; height: 14px !important; }
.topbar svg { width: 16px !important; height: 16px !important; }
