/* =============================================
   INVENTORY SYSTEM - Main Stylesheet
   Font: Plus Jakarta Sans (by Indonesian designer)
   ============================================= */

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0d1117;
  --sidebar-border: #1e2631;
  --sidebar-text: #8b949e;
  --sidebar-text-active: #f0f6fc;
  --sidebar-active-bg: rgba(59,130,246,0.15);
  --sidebar-active-accent: #3b82f6;
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --sidebar-section: #444c56;

  --header-h: 60px;
  --header-bg: #ffffff;
  --header-border: #e5e7eb;
  --header-shadow: 0 1px 4px rgba(0,0,0,0.06);

  --bg-main: #f3f6fb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --blue:    #3b82f6;
  --blue-dk: #2563eb;
  --green:   #22c55e;
  --amber:   #f59e0b;
  --red:     #ef4444;
  --purple:  #8b5cf6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--sidebar-text-active);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.brand-author {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.brand-author b {
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  letter-spacing: 0.2px;
}

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

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #2d3848; }

.nav-section {
  margin-bottom: 4px;
  padding: 0 10px;
}

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-section);
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-accent);
}

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

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.12);
  color: #f87171;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(239,68,68,0.18);
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-logout i { font-size: 13px; }

.header-user-badge .badge {
  padding: 6px 12px;
  font-size: 12px;
  gap: 6px;
}

/* ---- HEADER USER DROPDOWN ---- */
.header-user-menu {
  position: relative;
}

.header-user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: var(--transition);
}

.header-user-toggle:hover { background: var(--bg-main); }

.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-user-toggle .badge {
  padding: 3px 9px;
  font-size: 10px;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.header-user-dropdown.open { display: block; }

.dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-header strong {
  font-size: 13px;
  color: var(--text-primary);
}

.dropdown-header span {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-main); }

.dropdown-item-danger { color: var(--red); }
.dropdown-item-danger:hover { background: rgba(239,68,68,0.08); }

@media (max-width: 640px) {
  .header-user-name { display: none; }
  .header-date { display: none; }
}

.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; }
.user-name { font-size: 12px; font-weight: 600; color: var(--sidebar-text-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--sidebar-section); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

/* ---- TOP HEADER ---- */
.top-header {
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--bg-main); color: var(--text-primary); }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.bc-home { color: var(--blue); }
.bc-sep { color: var(--border-color); }
.bc-current { color: var(--text-primary); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 16px; }

.header-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.notif-btn {
  position: relative;
  background: none; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.notif-btn:hover { background: var(--bg-main); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

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

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left { }
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-actions { display: flex; gap: 10px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary   { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dk); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-main); color: var(--text-primary); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-success   { background: var(--green); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(59,130,246,0.1); color: var(--blue); }
.stat-icon.green  { background: rgba(34,197,94,0.1);  color: var(--green); }
.stat-icon.amber  { background: rgba(245,158,11,0.1); color: var(--amber); }
.stat-icon.red    { background: rgba(239,68,68,0.1);  color: var(--red); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: var(--purple); }

.stat-body { flex: 1; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

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

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
}

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table thead tr {
  background: var(--bg-main);
}

table.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-primary);
  vertical-align: middle;
}

table.data-table tbody tr:hover { background: #fafbfc; }
table.data-table tbody tr:last-child td { border-bottom: none; }

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

.badge-blue   { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-green  { background: rgba(34,197,94,0.1);  color: #16a34a; }
.badge-amber  { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-red    { background: rgba(239,68,68,0.1);  color: #dc2626; }
.badge-gray   { background: #f3f4f6; color: var(--text-secondary); }
.badge-purple { background: rgba(139,92,246,0.1); color: #7c3aed; }

/* ---- FORMS ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.form-label .required { color: var(--red); margin-left: 3px; }

.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

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

.form-control::placeholder { color: var(--text-muted); }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.form-control.is-invalid { border-color: var(--red); }
.invalid-feedback { font-size: 11px; color: var(--red); }

/* ---- SEARCH & FILTER BAR ---- */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-box i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.search-box input {
  padding-left: 32px;
  height: 36px;
}

/* ---- ACTION BUTTONS IN TABLE ---- */
.action-btns { display: flex; gap: 6px; align-items: center; }

.btn-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-icon.edit   { background: rgba(59,130,246,0.1); color: var(--blue); }
.btn-icon.delete { background: rgba(239,68,68,0.1);  color: var(--red); }
.btn-icon.view   { background: rgba(34,197,94,0.1);  color: var(--green); }
.btn-icon.print  { background: rgba(107,114,128,0.1); color: var(--text-secondary); }
.btn-icon:hover  { transform: scale(1.1); }

/* ---- ALERTS ---- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

.alert-success { background: rgba(34,197,94,0.1); color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.alert-error   { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.3); }
.alert-info    { background: rgba(59,130,246,0.1); color: #2563eb; border: 1px solid rgba(59,130,246,0.3); }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

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

.pag-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  padding: 0 8px;
}

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

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 18px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--border-color);
  margin-bottom: 16px;
}

.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ---- GRID LAYOUT ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---- UTILITIES ---- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }

/* ---- BARCODE DISPLAY ---- */
.barcode-cell {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: var(--bg-main);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ---- PROGRESS BAR ---- */
.progress-bar {
  height: 6px;
  background: var(--bg-main);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.5s ease;
}

/* ---- RESPONSIVE ---- */
/* ---- SIDEBAR OVERLAY (mobile) ---- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ---- SIDEBAR CLOSE BUTTON (mobile) ---- */
.sidebar-close {
  display: none;
  margin-left: auto;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-close:hover {
  background: rgba(239,68,68,0.15);
  color: var(--red);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  }

  .sidebar-close { display: flex; }

  body.sidebar-open { overflow: hidden; }

  .main-wrapper { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }

  .top-header { padding: 0 12px; gap: 8px; }
  .header-date { display: none; }
  .breadcrumb { font-size: 11px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { flex-direction: column; width: 100%; }
  .page-actions .btn { width: 100%; justify-content: center; }

  /* Paksa 2 kolom di tablet/mobile meski ada inline style grid-template-columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Paksa 1 kolom untuk grid form/detail dengan inline style (2-3 kolom) */
  .form-grid { grid-template-columns: 1fr !important; }

  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
}
