/* ============================================================
   assets/css/style.css — Modern Design System Lab Peminjaman
   Color Palette: Deep Violet + Indigo + Soft Neutral
   ============================================================ */

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

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --secondary:      #8b5cf6;
  --accent:         #06b6d4;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;
  --sidebar-w:      250px;
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  #1e293b;
  --sidebar-active: rgba(99,102,241,0.18);
  --sidebar-text:   #94a3b8;
  --sidebar-border: rgba(255,255,255,0.06);
  --bg:             #f8fafc;
  --surface:        #ffffff;
  --border:         #e2e8f0;
  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.12);
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 200;
  border-right: 1px solid var(--sidebar-border);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}
.sidebar-brand .brand-icon {
  width: 38px; height: 38px; background: var(--primary);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.sidebar-brand .brand-icon i { color: #fff; font-size: 18px; }
.sidebar-brand .brand-text { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand .brand-sub  { font-size: 11px; color: var(--sidebar-text); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 15px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; line-height: 1.3; }
.user-role { font-size: 11px; color: var(--sidebar-text); }
.sidebar-section {
  padding: 12px 20px 4px;
  font-size: 10px; font-weight: 700; color: var(--sidebar-text);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sidebar-divider { border-color: var(--sidebar-border); margin: 6px 0; }
.sidebar-nav { padding: 4px 0; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; text-decoration: none; position: relative;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar-nav .nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.sidebar-nav .nav-link i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer { padding: 8px 0 16px; border-top: 1px solid var(--sidebar-border); margin-top: auto; }
.logout-link { color: #f87171 !important; }
.logout-link:hover { background: rgba(239,68,68,0.12) !important; color: #fca5a5 !important; }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; padding: 28px 32px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.topbar-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.2; }
.topbar-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* STAT CARDS */
.stat-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 20px 22px; border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: transparent; }
.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon i { font-size: 22px; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 3px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-card.c-primary .stat-icon { background: var(--primary-light); }
.stat-card.c-primary .stat-icon i { color: var(--primary); }
.stat-card.c-warning .stat-icon { background: #fef3c7; }
.stat-card.c-warning .stat-icon i { color: var(--warning); }
.stat-card.c-success .stat-icon { background: #d1fae5; }
.stat-card.c-success .stat-icon i { color: var(--success); }
.stat-card.c-danger  .stat-icon { background: #fee2e2; }
.stat-card.c-danger  .stat-icon i { color: var(--danger); }
.stat-card.c-cyan    .stat-icon { background: #cffafe; }
.stat-card.c-cyan    .stat-icon i { color: var(--accent); }
.stat-card.c-violet  .stat-icon { background: #ede9fe; }
.stat-card.c-violet  .stat-icon i { color: var(--secondary); }

/* CARD SECTION */
.card-section { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-section-header { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-section-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px; }
.card-section-title i { color: var(--primary); font-size: 16px; }

/* TABLE */
.table { margin: 0; }
.table th { font-size: 11px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-top: none; background: #f8fafc; padding: 12px 14px; white-space: nowrap; }
.table td { font-size: 13px; vertical-align: middle; color: var(--text-primary); padding: 12px 14px; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }

/* BADGES */
.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.02em; }

/* BUTTONS */
.btn { font-weight: 500; border-radius: var(--radius-sm); transition: all 0.15s; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* FORMS */
.form-control, .form-select { border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 13.5px; padding: 9px 13px; transition: border-color 0.15s, box-shadow 0.15s; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); outline: none; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }

/* MODALS */
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header  { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body    { padding: 20px 22px; }
.modal-footer  { padding: 14px 22px; border-top: 1px solid var(--border); }
.modal-title   { font-size: 15px; font-weight: 700; }

/* ALERTS */
.alert { border-radius: var(--radius-sm); font-size: 13.5px; border: none; border-left: 4px solid; }
.alert-success { background: #f0fdf4; border-left-color: var(--success); color: #065f46; }
.alert-danger  { background: #fff1f2; border-left-color: var(--danger);  color: #991b1b; }
.alert-warning { background: #fffbeb; border-left-color: var(--warning); color: #92400e; }
.alert-info    { background: #eff6ff; border-left-color: var(--info);    color: #1e40af; }

/* FILTER PILLS */
.filter-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500; border: 1.5px solid var(--border); color: var(--text-secondary); background: var(--surface); text-decoration: none; transition: all 0.15s; }
.filter-pill:hover { border-color: var(--primary); color: var(--primary); }
.filter-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden;
}
.login-page::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%); top: -200px; right: -200px; }
.login-card { background: rgba(255,255,255,0.97); backdrop-filter: blur(20px); border-radius: var(--radius-xl); padding: 40px 36px; width: 100%; max-width: 430px; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }

/* CHART */
.chart-card { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.chart-card .chart-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.chart-card .chart-sub   { font-size: 12px; color: var(--text-secondary); margin-bottom: 18px; }

/* RESPONSIVE */
@media (max-width: 992px) {
  .main-content { margin-left: 0; padding: 20px 16px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
}

/* UTILS */
code { font-size: 11px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #6366f1; }
.fw-semibold { font-weight: 600; }

/* ── DATATABLES FIX ───────────────────────────────────────── */
/* Fix dropdown "Tampilkan entri" - prevent Bootstrap form-select override */
div.dt-length select,
div.dataTables_length select {
  width: auto !important;
  min-width: 70px !important;
  padding: 5px 32px 5px 10px !important;
  font-size: 13px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--surface) !important;
  /* Arrow chevron custom - pastikan tidak ketumpuk angka */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 14px 14px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer;
  color: var(--text-primary) !important;
  line-height: 1.5 !important;
  height: auto !important;
  display: inline-block !important;
  vertical-align: middle;
}

div.dt-length select:focus,
div.dataTables_length select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
  outline: none !important;
}

div.dt-length label,
div.dataTables_length label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  margin: 0 !important;
  white-space: nowrap;
}

/* Fix DataTables search input */
div.dt-search,
div.dataTables_filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
div.dt-search input,
div.dataTables_filter input {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
}
div.dt-search input:focus,
div.dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
  outline: none !important;
}

/* Fix info & pagination text */
div.dt-info,
div.dataTables_info {
  font-size: 12.5px !important;
  color: var(--text-secondary) !important;
  padding-top: 8px !important;
}

div.dt-paging .dt-paging-button,
.dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  font-size: 13px !important;
}
