/* ============================================================
   StokBakeri v2.0 — Enterprise Clean Theme
   Font: Plus Jakarta Sans
   ============================================================ */

/* ── DESIGN TOKENS ── */
:root {
  /* Brand */
  --primary:        #1a56db;
  --primary-hover:  #1344b8;
  --primary-light:  #ebf0ff;
  --primary-xlight: #f5f7ff;

  /* Neutrals */
  --white:    #ffffff;
  --bg:       #f4f6fb;
  --surface:  #ffffff;
  --border:   #e3e8f0;
  --border-2: #c8d3e8;

  /* Text */
  --text-1:  #111827;
  --text-2:  #374151;
  --text-3:  #6b7280;
  --text-4:  #9ca3af;

  /* Status */
  --green:       #059669;
  --green-bg:    #ecfdf5;
  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --orange:      #d97706;
  --orange-bg:   #fffbeb;
  --blue:        #2563eb;
  --blue-bg:     #eff6ff;

  /* Sidebar */
  --sidebar-w:   240px;
  --sidebar-bg:  #0f172a;
  --sidebar-txt: rgba(255,255,255,0.7);
  --sidebar-act: #1a56db;

  /* Misc */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow:    0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.15);

  --topbar-h: 58px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font); background: var(--bg); color: var(--text-1); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ── APP SHELL ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.brand-icon { font-size: 26px; }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }

.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section {
  padding: 14px 18px 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,0.3);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px;
  color: var(--sidebar-txt);
  font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(26,86,219,0.2);
  color: #93b4ff;
  border-left-color: var(--sidebar-act);
  font-weight: 600;
}
.nav-icon { width: 20px; text-align: center; font-size: 16px; opacity: 0.85; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.su-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sidebar-act);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.su-info { flex: 1; min-width: 0; }
.su-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-role { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 1px; }
.su-logout {
  color: rgba(255,255,255,0.4); font-size: 18px;
  padding: 4px; border-radius: 6px; transition: all 0.15s; flex-shrink: 0;
}
.su-logout:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 199;
}

/* ── MAIN WRAP ── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-menu {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.topbar-menu span { display: block; width: 22px; height: 2px; background: var(--text-2); border-radius: 2px; transition: all 0.2s; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-1); flex: 1; }
.topbar-date  { font-size: 12.5px; color: var(--text-3); }

/* ── PAGE CONTENT ── */
.page-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* ── PAGE HEADER ── */
.page-hdr {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.page-hdr h1 { font-size: 20px; font-weight: 700; color: var(--text-1); }
.page-hdr p  { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.page-hdr-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-hdr {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-hdr h3 { font-size: 14px; font-weight: 700; color: var(--text-1); }
.card-hdr-right { display: flex; align-items: center; gap: 8px; }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: attr(data-icon);
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 44px; opacity: 0.07;
}
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-3); }
.stat-value { font-size: 30px; font-weight: 700; color: var(--text-1); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-3); }
.stat-card.c-blue   { border-left: 4px solid var(--blue);  }
.stat-card.c-green  { border-left: 4px solid var(--green); }
.stat-card.c-red    { border-left: 4px solid var(--red);   }
.stat-card.c-orange { border-left: 4px solid var(--orange); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-xlight); }
tbody td { padding: 11px 14px; color: var(--text-2); vertical-align: middle; }
tbody td strong { color: var(--text-1); font-weight: 600; }
.td-secondary { font-size: 12px; color: var(--text-4); margin-top: 2px; }
.empty-row td { text-align: center; padding: 48px; color: var(--text-4); font-size: 14px; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }
.badge-gray   { background: var(--bg);        color: var(--text-3); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(26,86,219,0.3); transform: translateY(-1px); }
.btn-outline { background: var(--white); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-bg); color: var(--green); border: 1.5px solid #6ee7b7; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 9px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); background: none; border: none; cursor: pointer; font-size: 15px; transition: background 0.15s; color: var(--text-3); }
.btn-icon:hover { background: var(--bg); color: var(--text-1); }
.btn-icon.edit:hover  { background: var(--blue-bg);  color: var(--blue); }
.btn-icon.del:hover   { background: var(--red-bg);   color: var(--red); }

/* ── FILTER BAR ── */
.filter-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--bg);
}
.filter-bar input,
.filter-bar select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px;
  background: var(--white); color: var(--text-1); outline: none;
  transition: border-color 0.15s;
}
.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--primary); }
.filter-bar input[type=text],
.filter-bar input[type=search] { min-width: 190px; }
.filter-sep { font-size: 13px; color: var(--text-4); }

/* ── FORMS ── */
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; color: var(--text-1);
  background: var(--white); outline: none; transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }
.form-control[readonly] { background: var(--bg); color: var(--text-3); cursor: default; }
textarea.form-control { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── SEARCHABLE SELECT ── */
.ss-wrap { position: relative; }
.ss-btn {
  width: 100%; padding: 9px 36px 9px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px;
  color: var(--text-1); background: var(--white);
  text-align: left; cursor: pointer; outline: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color 0.15s;
  appearance: none;
}
.ss-btn:focus, .ss-wrap.open .ss-btn { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }
.ss-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 11px; color: var(--text-3); transition: transform 0.2s; }
.ss-wrap.open .ss-caret { transform: translateY(-50%) rotate(180deg); }
.ss-drop {
  display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0;
  background: var(--white); border: 1.5px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 500; flex-direction: column; max-height: 240px;
}
.ss-wrap.open .ss-drop { display: flex; }
.ss-search-box { padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ss-search-box input {
  width: 100%; padding: 7px 11px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; outline: none;
}
.ss-search-box input:focus { border-color: var(--primary); }
.ss-opts { overflow-y: auto; flex: 1; }
.ss-opt {
  padding: 9px 13px; cursor: pointer; font-size: 13.5px;
  color: var(--text-1); transition: background 0.1s;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ss-opt:hover, .ss-opt.hl { background: var(--primary-light); }
.ss-opt.sel { background: var(--primary-xlight); font-weight: 600; color: var(--primary); }
.ss-opt-label { flex: 1; }
.ss-opt-stock { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.ss-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--text-4); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.22s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-hdr {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-hdr h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: var(--bg); border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 18px; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── ALERT / TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 13px 20px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; color: #fff;
  box-shadow: var(--shadow-lg); z-index: 2000;
  transform: translateY(80px); opacity: 0; transition: all 0.3s;
  pointer-events: none; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
}
.toast.show  { transform: translateY(0); opacity: 1; }
.toast.ok    { background: var(--green); }
.toast.err   { background: var(--red); }
.toast.info  { background: var(--blue); }

/* ── MASTER LIST ── */
.master-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.master-tab {
  padding: 7px 16px; border: 1.5px solid var(--border);
  border-radius: 99px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--white); color: var(--text-2); transition: all 0.15s;
}
.master-tab:hover { border-color: var(--primary); color: var(--primary); }
.master-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.master-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-1);
}
.master-item:last-child { border-bottom: none; }
.master-item-actions { display: flex; gap: 4px; }
.master-add {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 2px solid var(--border); background: var(--bg);
}
.master-add input {
  flex: 1; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; outline: none;
}
.master-add input:focus { border-color: var(--primary); }

/* ── DASHBOARD SCROLL PANELS ── */
.dash-panel { max-height: 400px; overflow-y: auto; }

/* ── LAPORAN ── */
.laporan-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.laporan-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 18px; box-shadow: var(--shadow);
}
.laporan-card .lc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-3); }
.laporan-card .lc-val { font-size: 30px; font-weight: 700; color: var(--text-1); margin-top: 6px; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1a56db 100%);
  padding: 20px;
}
.login-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .icon { font-size: 44px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text-1); margin-top: 10px; }
.login-logo p  { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.login-demo { text-align: center; font-size: 12px; color: var(--text-4); margin-top: 16px; line-height: 1.9; }

/* ── STOK COLORS ── */
.stok-low  { color: var(--red);    font-weight: 700; }
.stok-warn { color: var(--orange); font-weight: 600; }
.stok-ok   { color: var(--green);  font-weight: 600; }
.num-pos   { color: var(--green);  font-weight: 700; }
.num-neg   { color: var(--red);    font-weight: 700; }

/* ── ALERT BOX ── */
.alert { padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.alert-err  { background: var(--red-bg);    color: var(--red);    border: 1px solid #fca5a5; }
.alert-ok   { background: var(--green-bg);  color: var(--green);  border: 1px solid #6ee7b7; }
.alert-info { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #93c5fd; }

/* ── TWO COLUMN GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ── MOBILE CARD TABLE ── */
/* Tabel diubah jadi card style di mobile */
/* Tambahkan data-label="Nama Kolom" di setiap <td> di file PHP */

/* ── MOBILE (≤ 768px) ── */
@media (max-width: 768px) {
  :root { --topbar-h: 54px; }

  /* Sidebar */
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }
  .main-wrap { margin-left: 0; }
  .topbar-menu { display: flex; }

  /* Layout */
  .page-content { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .stat-card { padding: 14px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .laporan-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-hdr { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-hdr-actions { width: 100%; }
  .page-hdr-actions .btn { flex: 1; justify-content: center; }
  .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* Filter bar — stack vertical */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  .filter-bar input,
  .filter-bar select { width: 100%; min-width: unset; }
  .filter-bar .filter-sep { display: none; }
  .filter-bar .btn { width: 100%; justify-content: center; }
  .filter-bar-row {
    display: flex; gap: 8px;
  }
  .filter-bar-row input,
  .filter-bar-row select { flex: 1; }

  /* ── CARD TABLE — ubah tabel jadi card di mobile ── */
  .table-wrap { overflow-x: unset; }

  /* Sembunyikan header tabel */
  .card-table thead { display: none; }

  /* Setiap baris jadi card */
  .card-table tbody tr {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 10px 0;
    padding: 12px 14px;
    box-shadow: var(--shadow);
  }
  .card-table tbody tr:hover { background: var(--primary-xlight); }

  /* Setiap cell jadi baris label: value */
  .card-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
    font-size: 13px;
    min-height: 28px;
    gap: 8px;
  }
  .card-table tbody td:first-child {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }

  /* Label dari data-label */
  .card-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-4);
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Sembunyikan td kosong / nomor urut */
  .card-table td.td-hide { display: none; }

  /* Baris aksi — rata kanan */
  .card-table td.td-aksi {
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    gap: 6px;
  }
  .card-table td.td-aksi::before { display: none; }

  /* Master barang tabel biasa — scroll horizontal tetap */
  .table-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll-x table { min-width: 700px; }

  /* Dashboard panel scroll */
  .dash-panel { max-height: 320px; }

  /* Laporan tabel biasa — cukup scroll */
  .laporan-table-wrap { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .laporan-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 18px; }
  .page-content { padding: 10px; }
  .card-table tbody tr { padding: 10px 12px; }
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .filter-bar .btn, .btn-icon, .page-hdr-actions { display: none !important; }
  .main-wrap { margin-left: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
