/* assets/css/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a365d;
  --primary-light: #2b6cb0;
  --primary-xlight: #ebf4ff;
  --accent: #63b3ed;
  --green: #276749;
  --green-light: #f0fff4;
  --amber: #b7791f;
  --amber-light: #fffbeb;
  --red: #c53030;
  --red-light: #fff5f5;
  --gray-50: #f7fafc;
  --gray-100: #f0f4f8;
  --gray-200: #e2e8f0;
  --gray-400: #a0aec0;
  --gray-600: #718096;
  --gray-800: #2d3748;
  --gray-900: #1a202c;
  --sidebar-w: 240px;
  --topbar-h: 58px;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--gray-100); color: var(--gray-900); font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* ── LAYOUT ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--primary); color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
  transition: transform .25s;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo {
  width: 36px; height: 36px; background: var(--primary-light);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-logo i { font-size: 20px; }
.sidebar-header h2 { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-header p  { font-size: 11px; color: #90cdf4; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.user-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.user-info p    { font-size: 13px; font-weight: 600; color: #fff; }
.user-info span { font-size: 11px; color: #90cdf4; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.nav-label {
  font-size: 10px; font-weight: 700; color: #4a90d9; text-transform: uppercase;
  letter-spacing: .06em; padding: .6rem 1rem .25rem;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 1rem; color: #bee3f8; font-size: 13.5px; font-weight: 500;
  position: relative; transition: background .15s, color .15s; border-radius: 0;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.1); }
.logout-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 8px; color: #fc8181; font-size: 13.5px; cursor: pointer; transition: background .15s;
}
.logout-btn:hover { background: rgba(255,0,0,.12); }

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

/* ── TOPBAR ─────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--gray-600); font-size: 20px; display: none; padding: 4px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: 12.5px; color: var(--gray-600); display: flex; align-items: center; gap: 5px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--gray-800); }
.notif-bell {
  position: relative; color: var(--gray-600); font-size: 22px;
  display: flex; align-items: center; padding: 4px;
}
.notif-bell:hover { color: var(--primary-light); }
.notif-dot {
  position: absolute; top: 0; right: -2px;
  background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
  padding: 0 4px; border-radius: 10px; min-width: 16px; text-align: center; border: 1.5px solid #fff;
}

/* ── PAGE CONTENT ──────────────────────────────────── */
.page-content { padding: 1.5rem; flex: 1; }

/* ── CARDS ──────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.1rem; gap: 10px;
}
.card-title    { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.card-subtitle { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

/* ── STAT CARDS ────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 1.25rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.1rem 1.25rem; border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-icon i { font-size: 20px; }
.stat-label { font-size: 12px; color: var(--gray-600); font-weight: 500; margin-bottom: 3px; }
.stat-val   { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--gray-600); margin-top: 4px; }

.stat-card.blue .stat-icon { background: var(--primary-xlight); }
.stat-card.blue .stat-icon i, .stat-card.blue .stat-val { color: var(--primary-light); }
.stat-card.green .stat-icon { background: var(--green-light); }
.stat-card.green .stat-icon i, .stat-card.green .stat-val { color: var(--green); }
.stat-card.amber .stat-icon { background: var(--amber-light); }
.stat-card.amber .stat-icon i, .stat-card.amber .stat-val { color: var(--amber); }
.stat-card.red .stat-icon   { background: var(--red-light); }
.stat-card.red .stat-icon i, .stat-card.red .stat-val { color: var(--red); }

/* ── GRID ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 1.25rem; }

/* ── TABLE ──────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 9px 12px; font-size: 11.5px; font-weight: 700; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); text-transform: uppercase; letter-spacing: .04em; background: var(--gray-50); }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.tbl-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ── BADGES ─────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-blue   { background: var(--primary-xlight); color: var(--primary-light); }
.badge-gray   { background: var(--gray-50); color: var(--gray-600); border: 1px solid var(--gray-200); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; line-height: 1; }
.btn i { font-size: 16px; }
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: #2c5282; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #22543d; }
.btn-danger  { background: var(--red-light); color: var(--red); border: 1.5px solid #fed7d7; }
.btn-danger:hover { background: #fed7d7; }
.btn-outline { background: #fff; color: var(--gray-800); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-sm i { font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── FORMS ──────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-800); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 13.5px; color: var(--gray-900);
  background: #fff; outline: none; transition: border .2s;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(43,108,176,.12); }
.form-control.is-invalid { border-color: var(--red); }
.invalid-feedback { font-size: 12px; color: var(--red); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-text { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.input-prefix-wrap { position: relative; }
.input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-600); font-size: 13px; pointer-events: none; }
.input-prefix + .form-control { padding-left: 36px; }
.search-wrap { position: relative; margin-bottom: 1rem; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 17px; }
.search-wrap .form-control { padding-left: 36px; }

/* ── ALERTS ─────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 1rem; font-size: 13.5px; position: relative; }
.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-light); border: 1px solid #c6f6d5; color: var(--green); }
.alert-danger  { background: var(--red-light);   border: 1px solid #fed7d7; color: var(--red); }
.alert-warning { background: var(--amber-light); border: 1px solid #fbd38d; color: var(--amber); }
.alert-close { position: absolute; right: 10px; top: 10px; background: none; border: none; cursor: pointer; color: inherit; opacity: .6; font-size: 16px; }

/* ── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-box {
  background: #fff; border-radius: 14px; padding: 1.75rem;
  width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
  transform: translateY(-12px); transition: transform .2s;
  box-shadow: var(--shadow-md);
}
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-600); font-size: 20px; padding: 2px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.25rem; }

/* ── PROGRESS ───────────────────────────────────────── */
.progress { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .3s; }

/* ── MISC ───────────────────────────────────────────── */
code.kode { background: var(--gray-50); border: 1px solid var(--gray-200); padding: 2px 7px; border-radius: 5px; font-size: 12px; font-family: monospace; color: var(--gray-800); }
.empty-state { text-align: center; padding: 3rem; color: var(--gray-600); }
.empty-state i { font-size: 48px; color: var(--gray-200); display: block; margin-bottom: 10px; }
.stok-val.low { color: var(--red); font-weight: 700; }
.stok-val.ok  { color: var(--green); font-weight: 700; }
.stok-val.warn{ color: var(--amber); font-weight: 700; }

/* ── LOGIN PAGE ─────────────────────────────────────── */
body.login-body { background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border-radius: 16px; padding: 2.5rem; width: 400px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo .logo-icon { width: 60px; height: 60px; background: var(--primary-xlight); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.login-logo .logo-icon i { font-size: 30px; color: var(--primary-light); }
.login-logo h1 { font-size: 21px; font-weight: 800; color: var(--primary); }
.login-logo p  { font-size: 13px; color: var(--gray-600); margin-top: 3px; }
.login-btn { width: 100%; padding: 13px; background: var(--primary-light); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s; margin-top: 6px; }
.login-btn:hover { background: #2c5282; }
.login-hint { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 12px; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
