/* ============================================
   DESIGN TOKENS — DARK MODE (default)
   ============================================ */
:root {
  --bg: #0f1117;
  --bg2: #161821;
  --bg3: #1e2030;
  --bg4: #252840;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8eaf0;
  --text2: #8b90a8;
  --text3: #555a72;
  --accent: #6c8cff;
  --accent2: #8b5cf6;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --teal: #22d3ee;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #ffffff;
  --bg3: #f5f7fc;
  --bg4: #eaecf5;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.14);
  --text: #1a1d2e;
  --text2: #5a6184;
  --text3: #9399b5;
  --accent: #4a6ef5;
  --accent2: #7c3aed;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --teal: #0891b2;
  --shadow: 0 8px 32px rgba(100,110,180,0.12);
  --shadow-sm: 0 2px 8px rgba(100,110,180,0.08);
}

/* ============================================
   BASE RESET
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ============================================
   SIDEBAR
   ============================================ */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.5rem 1rem; gap: 8px;
  transition: background 0.3s;
}
.sidebar-brand { padding: 0 0.5rem 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.sidebar-brand .logo { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.sidebar-brand .logo span { color: var(--accent); }
.sidebar-brand .sub { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: 'DM Mono', monospace; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--text2); cursor: pointer;
  transition: all 0.15s; border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(108,140,255,0.12); color: var(--accent); border-color: rgba(108,140,255,0.2); }
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px 4px; font-family: 'DM Mono', monospace; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 1rem; display: flex; flex-direction: column; gap: 8px; }

/* Theme Toggle */
.theme-toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid var(--border);
  margin-bottom: 4px;
}
.theme-label { font-size: 11px; color: var(--text2); font-weight: 500; }
.theme-toggle {
  position: relative; width: 52px; height: 26px;
  border-radius: 13px; border: 1px solid var(--border2); cursor: pointer;
  background: var(--bg4);
  display: flex; align-items: center; padding: 0 4px;
  transition: background 0.3s; flex-shrink: 0;
}
.theme-icon { font-size: 12px; position: absolute; transition: opacity 0.2s; }
.theme-icon-dark { left: 5px; }
.theme-icon-light { right: 5px; }
[data-theme="dark"] .theme-icon-light { opacity: 0.3; }
[data-theme="light"] .theme-icon-dark { opacity: 0.3; }
[data-theme="light"] .theme-toggle { background: #e0e7ff; }
.theme-thumb {
  position: absolute; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent);
  left: 3px; transition: left 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
[data-theme="light"] .theme-thumb { left: 28px; }

/* ============================================
   MAIN & TOPBAR
   ============================================ */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-direction: column; gap: 15px;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg2); position: sticky; top: 0; z-index: 20;
  transition: background 0.3s;
}
.topbar-main { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-filters { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.page-title { font-size: 15px; font-weight: 600; color: var(--text); margin-right: 8px; }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text3); pointer-events: none; }
.search-wrap input { background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 7px 12px 7px 32px; border-radius: var(--radius); font-size: 13px; font-family: 'Plus Jakarta Sans', sans-serif; width: 220px; outline: none; transition: border 0.15s; }
.search-wrap input:focus { border-color: var(--accent); }

select.filter { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 7px 10px; border-radius: var(--radius); font-size: 12px; font-family: 'Plus Jakarta Sans', sans-serif; outline: none; cursor: pointer; }
select.filter:focus { border-color: var(--accent); }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; transition: 0.15s;
}
.btn-add:hover { opacity: 0.9; transform: translateY(-1px); }

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */
.notif-wrap { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); transition: 0.15s; }
.notif-wrap:hover { background: var(--bg4); }
.notif-wrap svg { width: 18px; height: 18px; color: var(--text2); }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: white; font-size: 9px; font-weight: 800; width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg2); }
.notif-popup { display: none; position: absolute; top: 48px; right: 0; width: 320px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 100; flex-direction: column; cursor: default; overflow: hidden; }
.notif-popup.show { display: flex; animation: slideIn 0.2s ease; }
.notif-header { padding: 12px 15px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; transition: 0.15s; }
.notif-item:hover { background: var(--bg3); }
.notif-title { font-size: 12px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.notif-desc { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; }

/* ============================================
   STATS CARDS
   ============================================ */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; position: relative; overflow: hidden; transition: background 0.3s; }
.stat-card::before { content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px; border-radius: 50%; opacity: 0.06; }
.stat-card.blue::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.teal::before { background: var(--teal); }
.stat-label { font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; text-transform: uppercase; margin-bottom: 6px; }
.stat-val { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-badge { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 600; margin-top: 6px; }
.stat-card.blue .stat-badge { background: rgba(108,140,255,0.15); color: var(--accent); }
.stat-card.green .stat-badge { background: rgba(52,211,153,0.15); color: var(--green); }
.stat-card.amber .stat-badge { background: rgba(251,191,36,0.15); color: var(--amber); }
.stat-card.teal .stat-badge { background: rgba(34,211,238,0.15); color: var(--teal); }

/* ============================================
   BULK ACTION BAR
   ============================================ */
.bulk-action-bar { display: none; align-items: center; justify-content: space-between; background: var(--accent); color: white; padding: 12px 20px; border-radius: var(--radius-lg); margin: 1.25rem 1.5rem 0 1.5rem; animation: slideDown 0.2s ease-out; box-shadow: 0 4px 15px rgba(108,140,255,0.3); }
.bulk-action-bar.active { display: flex; }
.bulk-btns { display: flex; gap: 8px; }
.btn-bulk { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: all 0.15s; }
.btn-bulk:hover { background: rgba(0,0,0,0.4); transform: translateY(-1px); }
.btn-bulk.danger { background: rgba(248,113,113,0.9); border-color: transparent; }
.btn-bulk.danger:hover { background: var(--red); }
input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; accent-color: var(--accent); }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================
   TABLE
   ============================================ */
.table-section { padding: 1.25rem 1.5rem; flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; overflow-y: auto; background: var(--bg2); flex: 1; }
table { width: 100%; border-collapse: collapse; min-width: 1800px; }
thead th { background: var(--bg3); padding: 10px 12px; text-align: left; font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap; border-bottom: 1px solid var(--border); font-family: 'DM Mono', monospace; position: sticky; top: 0; z-index: 2; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 10px 12px; font-size: 12px; color: var(--text); border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.batal-row td { opacity: 0.5; }
.batal-row .customer-name { text-decoration: line-through; }
.empty-state { text-align: center; color: var(--text3); padding: 2.5rem !important; font-size: 13px; white-space: normal !important; }

/* ============================================
   CABANG COLOR PILLS
   ============================================ */
.cabang-pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; font-family: 'DM Mono', monospace; letter-spacing: 0.5px; }
.bg-SBY { background: #e2e8f0; color: #334155; }
.bg-KDR { background: #fecdd3; color: #be123c; }
.bg-JBR { background: #fed7aa; color: #c2410c; }
.bg-BLI { background: #fef08a; color: #a16207; }
.bg-LBK { background: #bbf7d0; color: #15803d; }
.bg-SLO { background: #bae6fd; color: #0369a1; }
.bg-YGY { background: #e5e7eb; color: #4b5563; }
.bg-PWK { background: #e9d5ff; color: #7e22ce; }
.bg-TSK { background: #334155; color: #f8fafc; }
.bg-CKP { background: #dc2626; color: #ffffff; }
.bg-JKT { background: #92400e; color: #ffffff; }
.bg-SKB { background: #166534; color: #ffffff; }
.bg-MKSR { background: #1e3a8a; color: #ffffff; }
.bg-default { background: var(--bg4); color: var(--text2); }

/* ============================================
   BADGES & ACTION BUTTONS
   ============================================ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 4px; font-size: 9px; font-weight: 700; white-space: nowrap; font-family: 'DM Mono', monospace; }
.badge-red { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.badge-amber { background: rgba(251,191,36,0.15); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }
.kode-pill { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 10px; background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.15); font-family: 'DM Mono', monospace; }
.act-btn { padding: 4px 9px; border-radius: 6px; font-size: 11px; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: all 0.15s; border: 1px solid var(--border2); background: transparent; color: var(--text2); margin-right: 4px; }
.act-btn:hover { background: var(--bg4); color: var(--text); }
.act-btn.so-btn { background: rgba(108,140,255,0.08); color: var(--accent); border-color: rgba(108,140,255,0.2); }
.act-btn.so-btn:hover { background: rgba(108,140,255,0.18); }
.act-btn.danger:hover { background: rgba(248,113,113,0.1); color: var(--red); border-color: rgba(248,113,113,0.2); }
.mono { font-family: 'DM Mono', monospace; }
.text-right { text-align: right; }
.text-muted { color: var(--text3); }
td.price { font-family: 'DM Mono', monospace; font-size: 12px; text-align: right; }
.customer-name { font-weight: 600; color: var(--text); }

/* ============================================
   STATUS DROPDOWNS
   ============================================ */
.status-select { appearance: none; -webkit-appearance: none; border: none; outline: none; cursor: pointer; font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 600; padding: 3px 22px 3px 9px; border-radius: 20px; background-position: right 6px center; background-repeat: no-repeat; background-size: 10px; transition: opacity 0.15s; }
.status-select:hover { opacity: 0.82; }
.status-select.bayar-sudah { background-color: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select.bayar-belum { background-color: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select.kirim-terkirim { background-color: rgba(34,211,238,0.12); color: var(--teal); border: 1px solid rgba(34,211,238,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select.kirim-proses { background-color: rgba(251,191,36,0.12); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select.kirim-belum { background-color: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select.kirim-batal { background-color: rgba(85,90,114,0.12); color: var(--text3); border: 1px solid rgba(85,90,114,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23555a72' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.status-select option { background: var(--bg3); color: var(--text); font-size: 12px; }
.date-input-inline { background: transparent; border: none; border-bottom: 1px dashed var(--border2); color: var(--text); font-family: 'DM Mono', monospace; font-size: 12px; padding: 2px 4px; outline: none; width: 100px; cursor: pointer; border-radius: 4px; }
.date-input-inline:hover { border-bottom-color: var(--accent); background: rgba(108,140,255,0.05); }

/* ============================================
   MODAL — BASE
   ============================================ */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; padding: 1rem; }
.overlay.show { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  width: min(680px, 96vw);
}
.modal-form-only  { width: min(720px, 96vw); }
.modal-preview-full { width: min(940px, 97vw); }
@keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border2); background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: 0.15s; flex-shrink: 0; }
.modal-close:hover { background: var(--bg4); color: var(--text); }

/* ============================================
   MODAL SINGLE-COLUMN BODY
   ============================================ */
.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.modal-body-scroll::-webkit-scrollbar { width: 4px; }
.modal-body-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* Preview Modal Body */
.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  background: #e8eaf0;
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem;
  min-height: 0;
}
#so-preview-content {
  width: 794px;
  max-width: 100%;
  background: white;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  border-radius: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5pt;
  color: #1a1a2e;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-section { margin-bottom: 1.1rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase;
  margin-bottom: 10px; font-family: 'DM Mono', monospace;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 10.5px; color: var(--text3); font-weight: 500; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 7px 10px; border-radius: var(--radius);
  font-size: 12.5px; font-family: 'Plus Jakarta Sans', sans-serif; outline: none; transition: border 0.15s;
}
.form-group textarea { resize: vertical; font-family: 'Plus Jakarta Sans', sans-serif; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }

/* Small helper labels & badges in form */
.auto-hint {
  font-size: 9px; color: var(--accent); font-family: 'DM Mono', monospace;
  font-weight: 500; white-space: nowrap;
}
.badge-so-inline {
  font-size: 9px; background: rgba(52,211,153,0.12); color: var(--green);
  border: 1px solid rgba(52,211,153,0.2); padding: 1px 6px; border-radius: 4px;
  font-family: 'DM Mono', monospace; font-weight: 600; white-space: nowrap;
}
.so-info-section {
  background: rgba(108,140,255,0.04);
  border: 1px solid rgba(108,140,255,0.12);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-top: 4px;
}
.so-info-section .form-group input,
.so-info-section .form-group select,
.so-info-section .form-group textarea {
  background: var(--bg2);
}

/* ============================================
   MODAL FOOTER
   ============================================ */
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.btn-cancel {
  padding: 8px 18px; border-radius: var(--radius); font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer;
  border: 1px solid var(--border2); background: transparent; color: var(--text2); transition: 0.15s;
}
.btn-cancel:hover { background: var(--bg3); }
.btn-save {
  padding: 8px 20px; border-radius: var(--radius); font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer;
  border: none; background: var(--accent); color: #fff; font-weight: 600; transition: 0.15s;
}
.btn-save:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-save-so {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius); font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer;
  border: none; background: var(--green); color: #fff; font-weight: 600; transition: 0.15s;
}
.btn-save-so:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-save-so:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ============================================
   TOAST
   ============================================ */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--bg3); border: 1px solid var(--border2); color: var(--text); padding: 10px 16px; border-radius: var(--radius); font-size: 13px; display: none; z-index: 999; animation: slideIn 0.25s ease; border-left: 3px solid var(--green); box-shadow: var(--shadow); }
.toast.show { display: block; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-preview-full { width: 98vw; }
  .preview-modal-body { padding: 1rem 0.5rem; }
  #so-preview-content { width: 100%; overflow-x: auto; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .topbar-filters { gap: 6px; }
  .bulk-btns { flex-wrap: wrap; }
  .modal-footer { flex-wrap: wrap; gap: 6px; }
}

/* ============================================
   INVOICE / PRINT STYLES
   ============================================ */
#inv-doc, #inv-doc * {
  color: #000000 !important;
  background-color: transparent !important;
  border-color: #000000 !important;
  box-sizing: border-box !important;
}
#inv-doc {
  background-color: #ffffff !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 10pt !important;
  line-height: 1.5 !important;
  width: 100% !important;
  padding: 40px !important;
  margin: 0 auto !important;
  max-width: 794px !important;
}
#inv-doc a {
  color: #2563eb !important;
  text-decoration: underline !important;
}
#inv-doc .inv-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 20px !important;
}
#inv-doc .inv-th {
  border: 1px solid #111827 !important;
  background-color: #f3f4f6 !important;
  color: #111827 !important;
  padding: 10px 8px !important;
  font-weight: bold !important;
  text-transform: uppercase !important;
  font-size: 8.5pt !important;
  text-align: left;
}
#inv-doc .inv-th.center { text-align: center !important; }
#inv-doc .inv-th.right { text-align: right !important; }

#inv-doc .inv-td {
  border: 1px solid #d1d5db !important;
  padding: 8px 10px !important;
  color: #1f2937 !important;
  font-size: 9.5pt !important;
  vertical-align: top !important;
}
#inv-doc .inv-num {
  text-align: right !important;
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 10pt !important;
}
#inv-doc .inv-section-title {
  font-size: 8.5pt !important;
  font-weight: bold !important;
  color: #6b7280 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  margin-bottom: 6px !important;
  display: block !important;
}
#inv-doc .inv-card {
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  padding: 12px 16px !important;
  min-height: 100px !important;
  background-color: #f8fafc !important;
}
#inv-doc strong { font-weight: bold !important; color: #000 !important; }
#inv-doc .val { color: #111827 !important; font-weight: 600 !important; }
#inv-doc .lbl { color: #4b5563 !important; }