:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e3a8a;
  --secondary: #0f172a;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 10px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: #0f172a;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid #1e293b;
}

.brand-icon {
  font-size: 28px;
  background: #1e293b;
  padding: 8px;
  border-radius: 8px;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  background: #2563eb;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 2px;
}

.nav-menu {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #94a3b8;
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.nav-btn .icon {
  font-size: 17px;
}

.nav-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

.nav-btn.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
  background: #1e293b;
  padding: 8px 12px;
  border-radius: 6px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

/* Main Content */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.topbar-left .subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.period-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.period-picker select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  color: #1e293b;
}

/* Tab panes */
.tab-pane {
  display: none;
  padding: 28px;
  animation: fadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.card-header .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

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

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.bg-blue { background: #dbeafe; }
.stat-icon.bg-green { background: #dcfce7; }
.stat-icon.bg-amber { background: #fef3c7; }
.stat-icon.bg-purple { background: #f3e8ff; }
.stat-icon.bg-rose { background: #ffe4e6; color: #e11d48; }

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

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

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

/* Dashboard Columns */
.dashboard-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.action-tile {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-tile:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tile-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.tile-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.tile-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tpp-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tpp-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.tpp-row.highlight {
  border-bottom: none;
  background: #f0fdf4;
  padding: 8px 10px;
  border-radius: 6px;
  color: #166534;
  font-size: 13.5px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-secondary { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Modules Grid on Dashboard */
.modules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.module-card .card-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.module-card .card-header h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  flex-grow: 1;
}

.module-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.module-row:last-child {
  border-bottom: none;
}

.module-row.total-highlight {
  background: #f0fdf4;
  padding: 10px 14px;
  border-radius: 6px;
  border-bottom: none;
  margin-top: 4px;
}

.module-row.total-highlight span {
  font-weight: 700;
  color: #166534;
}

.module-row.total-highlight strong {
  font-size: 15px;
  color: #166534;
  font-weight: 800;
}

.module-actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Sub-tabs */
.tab-nav-sub {
  display: flex;
  background: #f1f5f9;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.sub-tab-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.sub-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
}

.sub-pane {
  display: none;
  padding: 20px;
}

.sub-pane.active {
  display: block;
}

/* Upload Dropzone */
.upload-box-wrapper {
  margin-bottom: 24px;
}

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.drop-zone h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.drop-zone p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-options {
  max-width: 360px;
  margin: 0 auto 16px auto;
  text-align: left;
}

.upload-options label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.upload-options input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.selected-file-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 10px;
}

/* Tables */
.table-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

.data-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: #1e293b;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.data-table td.text-right,
.data-table th.text-right {
  text-align: right;
}

.data-table td.text-center,
.data-table th.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  background: #334155;
  color: #fff;
}
.btn-secondary:hover { background: #1e293b; }

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover { background: #15803d; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: #334155;
}
.btn-outline:hover {
  background: #f1f5f9;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid #fca5a5;
  color: #dc2626;
}
.btn-outline-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
}

.form-group small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Chips / Badges */
.badge-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.potongan-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
}

.potongan-chip .chip-edit {
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.potongan-chip .chip-edit:hover {
  background: #dbeafe;
}

.potongan-chip .chip-del {
  color: #dc2626;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  padding: 0 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.potongan-chip .chip-del:hover {
  background: #fee2e2;
}

/* Action grid for Potongan menu */
.potongan-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .potongan-action-grid {
    grid-template-columns: 1fr;
  }
}

.potongan-action-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.btn-col-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  font-weight: normal;
}

.btn-col-clear:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-box input {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  min-width: 240px;
}

.filter-box select {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.count-badge {
  font-size: 12px;
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.modal-card form {
  padding: 20px;
}

/* AI Hub styles */
.ai-hub-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.ai-output-area {
  min-height: 380px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.ai-chat-input-bar {
  display: flex;
  gap: 8px;
}

.ai-chat-input-bar input {
  flex-grow: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

/* Markdown formatting in AI replies */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: #0f172a;
  margin-top: 12px;
  margin-bottom: 6px;
}
.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.markdown-body li {
  margin-bottom: 4px;
}
.markdown-body strong {
  color: #1e3a8a;
}
.markdown-body p {
  margin-bottom: 8px;
}

/* Alert Banner */
.alert-banner {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-banner.success { background: #dcfce7; color: #166534; border-bottom: 1px solid #86efac; }
.alert-banner.error { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #fca5a5; }
.alert-banner.hidden { display: none; }

/* Settings Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

/* ========================================================== */
/* PIN LOCK SCREEN OVERLAY                                     */
/* ========================================================== */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lock-screen-overlay.hidden {
  display: none !important;
}

.lock-card {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid #e2e8f0;
}

.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.lock-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.lock-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 22px;
}

.pin-input-group {
  margin-bottom: 18px;
}

.pin-input {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.pin-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.lock-error {
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 8px;
  min-height: 18px;
}

.btn-unlock {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-unlock:hover {
  background: #1d4ed8;
}

/* ========================================================== */
/* SLIP GAJI DESIGN & PRINT RULES                             */
/* ========================================================== */
.slip-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.slip-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 28px 34px;
  box-shadow: var(--shadow-sm);
  max-width: 820px;
  margin: 0 auto;
}

.slip-kop {
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.slip-kop h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.slip-kop h2 {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slip-kop p {
  font-size: 11px;
  color: #475569;
}

.slip-title {
  text-align: center;
  margin-bottom: 16px;
}

.slip-title h3 {
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: underline;
}

.slip-title span {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.slip-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  font-size: 12px;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.slip-meta-row {
  display: flex;
}

.slip-meta-label {
  width: 110px;
  color: #64748b;
  font-weight: 500;
}

.slip-meta-val {
  font-weight: 700;
  color: #0f172a;
}

.slip-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.slip-sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.slip-sub-table th {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  padding: 6px 8px;
  text-align: left;
  border-top: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.slip-sub-table td {
  padding: 5px 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.slip-sub-table tr.total-row td {
  font-weight: 700;
  background: #f1f5f9;
  border-top: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.slip-take-home {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.slip-take-home .th-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e3a8a;
}

.slip-take-home .th-val {
  font-size: 17px;
  font-weight: 800;
  color: #1e3a8a;
  font-family: var(--font-mono);
}

.slip-terbilang {
  font-size: 11px;
  font-style: italic;
  color: #475569;
  margin-bottom: 14px;
}

.slip-ai-note {
  background: #fdf4ff;
  border-left: 3px solid #c084fc;
  padding: 8px 12px;
  font-size: 11px;
  color: #581c87;
  border-radius: 0 4px 4px 0;
  margin-bottom: 18px;
}

.slip-ttd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  font-size: 11.5px;
  margin-top: 10px;
}

.slip-ttd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slip-ttd-space {
  height: 50px;
}

.slip-ttd-name {
  font-weight: 700;
  text-decoration: underline;
}

/* ========================================================== */
/* PRINT MEDIA RULES                                          */
/* ========================================================== */
@media print {
  @page {
    size: 215mm 330mm portrait;
    margin: 8mm 10mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 9.5pt !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .no-print,
  .sidebar,
  .topbar,
  .alert-banner,
  .modal-overlay,
  #tab-slip > .card {
    display: none !important;
  }

  .app-layout,
  .main-content {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
    position: static !important;
  }

  .tab-pane {
    display: none !important;
  }

  #tab-slip {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .slip-container {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .slip-container .empty-state {
    display: none !important;
  }

  .slip-sheet {
    display: block !important;
    position: relative !important;
    box-sizing: border-box !important;
    border: 1.5px solid #0f172a !important;
    box-shadow: none !important;
    padding: 12mm 14mm !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 0 10mm 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slip-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .slip-meta-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 18px !important;
    margin-bottom: 12px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slip-tables-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 12px !important;
  }

  .slip-take-home {
    border: 1.5px solid #0f172a !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slip-sub-table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .slip-sub-table td {
    border-bottom: 1px solid #cbd5e1 !important;
  }

  .slip-ttd-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-top: 14px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
