@import url('../vendor/fonts/poppins/300.css');
@import url('../vendor/fonts/poppins/400.css');
@import url('../vendor/fonts/poppins/500.css');
@import url('../vendor/fonts/poppins/600.css');
@import url('../vendor/fonts/poppins/700.css');

:root {
  --sdp-primary: #ED1D24;
  --sdp-primary-dark: #C4151C;
  --sdp-secondary: #000000;
  --sdp-light: #F5F6FA;
  --sdp-gray: #6C757D;
  --sdp-border: #E9EAF0;
  --sdp-sidebar-w: 260px;
  --sdp-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --sdp-radius: 14px;

  --bg-body: var(--sdp-light);
  --bg-card: #ffffff;
  --bg-sidebar: #0d0d0d;
  --text-main: #1c1c1e;
  --text-muted: #7a7a85;
}

[data-theme="dark"] {
  --bg-body: #14151a;
  --bg-card: #1d1e25;
  --bg-sidebar: #0a0a0d;
  --text-main: #f1f1f3;
  --text-muted: #a0a0ab;
  --sdp-border: #2a2b34;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 14.5px;
  transition: background .25s ease, color .25s ease;
}

a { text-decoration: none; }

/* ============ LOGIN PAGE ============ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #1a1a1a, #000000 65%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: var(--sdp-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
}

.login-brand {
  background: linear-gradient(160deg, var(--sdp-primary), var(--sdp-primary-dark));
  color: #fff;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.login-brand .logo-circle {
  width: 72px; height: 72px;
  background: #fff;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 26px; color: var(--sdp-primary);
  margin-bottom: 20px;
}

.login-form-side { padding: 50px 40px; }

.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid var(--sdp-border);
  padding: 10px 14px;
  font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sdp-primary);
  box-shadow: 0 0 0 3px rgba(237,29,36,.12);
}

.btn-brand {
  background: var(--sdp-primary);
  border: none;
  color: #fff;
  font-weight: 500;
  border-radius: 10px;
  padding: 10px 18px;
  transition: background .2s ease, transform .15s ease;
}
.btn-brand:hover { background: var(--sdp-primary-dark); color: #fff; transform: translateY(-1px); }

/* ============ APP LAYOUT ============ */
.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sdp-sidebar-w);
  background: var(--bg-sidebar);
  color: #d7d7db;
  z-index: 1030;
  transition: width .2s ease, transform .2s ease;
  overflow-y: auto;
}
.app-sidebar.collapsed { width: 78px; }
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .brand-text,
.app-sidebar.collapsed .nav-section-title { display: none; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-badge {
  width: 38px; height: 38px; background: var(--sdp-primary);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-brand .brand-text { font-weight: 600; color: #fff; font-size: 15px; line-height: 1.2; }
.sidebar-brand .brand-text small { display:block; font-weight:400; color:#9a9aa2; font-size: 11px; }

.nav-section-title {
  text-transform: uppercase; font-size: 11px; letter-spacing: .06em;
  color: #6c6c76; padding: 16px 20px 6px;
}

.app-sidebar .nav-link {
  color: #c6c6cc;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  border-radius: 0;
}
.app-sidebar .nav-link i { font-size: 17px; width: 20px; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active {
  background: rgba(237,29,36,.14);
  color: #fff;
  border-left-color: var(--sdp-primary);
  font-weight: 500;
}

.app-main {
  margin-left: var(--sdp-sidebar-w);
  min-height: 100vh;
  transition: margin-left .2s ease;
}
.app-main.expanded { margin-left: 78px; }

.app-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--sdp-border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020;
}

.topbar-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--sdp-border);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--sdp-border); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--sdp-primary);
  border: 2px solid var(--bg-card);
}

.app-content { padding: 24px; }

.breadcrumb-bar { padding: 14px 24px 0; font-size: 13px; color: var(--text-muted); }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--sdp-border);
  border-radius: var(--sdp-radius);
  box-shadow: var(--sdp-shadow);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  height: 100%;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.bg-soft-red { background: rgba(237,29,36,.12); color: var(--sdp-primary); }
.bg-soft-black { background: rgba(0,0,0,.08); color: #1c1c1e; }
.bg-soft-green { background: rgba(25,135,84,.12); color: #198754; }
.bg-soft-yellow { background: rgba(255,193,7,.16); color: #b8860b; }
.bg-soft-blue { background: rgba(13,110,253,.12); color: #0d6efd; }

[data-theme="dark"] .bg-soft-black { background: rgba(255,255,255,.08); color: #f1f1f3; }

.section-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.section-sub { color: var(--text-muted); font-size: 12.5px; }

table.dataTable { font-size: 13.5px; }
.table > :not(caption) > * > * { border-color: var(--sdp-border); }

.badge-soft-success { background: rgba(25,135,84,.12); color: #198754; }
.badge-soft-danger { background: rgba(237,29,36,.12); color: var(--sdp-primary); }
.badge-soft-warning { background: rgba(255,193,7,.18); color: #b8860b; }
.badge-soft-secondary { background: rgba(108,117,125,.15); color: #6c757d; }

.thumb-barang {
  width: 42px; height: 42px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--sdp-border);
}

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.mobile-open { transform: translateX(0); }
  .app-main, .app-main.expanded { margin-left: 0; }
}

/* ============ Cetak / Export PDF ============ */
@media print {
  .no-print, .app-sidebar, .app-topbar, .breadcrumb-bar,
  .dropdown, #flashData, .swal2-container { display: none !important; }

  html, body { background: #fff !important; }
  * { color: #000 !important; box-shadow: none !important; text-shadow: none !important; }

  .app-main, .app-main.expanded { margin-left: 0 !important; }
  .app-content { padding: 0 !important; }

  .card-sdp {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .print-header { display: block !important; margin-bottom: 16px; }

  table.dataTable { width: 100% !important; font-size: 11.5px; }
  table.dataTable th, table.dataTable td {
    border: 1px solid #ccc !important;
    padding: 5px 8px !important;
  }
  table.dataTable thead th { background: #eee !important; }

  .dataTables_wrapper .dataTables_paginate,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info { display: none !important; }

  tr { page-break-inside: avoid; }
}

.print-header { display: none; }
