/* =============================================
   MBA DOR — Main Stylesheet
   ============================================= */

:root {
  --sidebar-bg:     #1E3A5F;
  --sidebar-active: #2E5F8A;
  --sidebar-hover:  #2A4F78;
  --sidebar-text:   #E8EDF2;
  --primary:        #1565C0;
  --primary-dark:   #0D47A1;
  --primary-light:  #E3F2FD;
  --success:        #2E7D32;
  --success-light:  #E8F5E9;
  --warning:        #F57F17;
  --warning-light:  #FFF8E1;
  --danger:         #C62828;
  --danger-light:   #FFEBEE;
  --bg:             #F0F4F8;
  --card:           #FFFFFF;
  --text:           #1A1A2E;
  --text-muted:     #6B7280;
  --border:         #DDE1E7;
  --shadow:         0 1px 4px rgba(0,0,0,0.10);
  --radius:         8px;
  --sidebar-width:  240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* =============================================
   LOGIN SCREEN
   ============================================= */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1E3A5F 0%, #2E5F8A 100%);
}

.login-card {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--sidebar-bg);
  line-height: 1.3;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-logo .school-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* =============================================
   APP LAYOUT
   ============================================= */

#app-screen {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.sidebar-logo span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.sidebar-branch {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
}

.nav-menu {
  flex: 1;
  list-style: none;
  padding: 12px 0;
}

.nav-menu .nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 16px 16px 6px;
}

/* ── Accordion section toggle ── */
.nav-menu li a.nav-section-toggle {
  padding: 14px 14px 7px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #FFB347;
  justify-content: space-between;
  gap: 6px;
  border-radius: 0;
  border-left: none !important;
}
.nav-menu li a.nav-section-toggle:hover {
  background: rgba(255,179,71,0.10);
  color: #FFD080;
}
.nav-section-toggle .nav-section-chevron {
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-section-toggle .nav-section-name {
  flex: 1;
}
.nav-section-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 0;
  transition: background 0.15s;
  cursor: pointer;
}

.nav-menu li a:hover {
  background: var(--sidebar-hover);
}

.nav-menu li a.active {
  background: var(--sidebar-active);
  font-weight: 600;
  border-left: 3px solid #64B5F6;
}

.nav-menu li a .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
  line-height: 1.5;
}

.user-info strong {
  display: block;
  color: #FFFFFF;
  font-size: 13px;
}

/* Main content area */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#page-container {
  flex: 1;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
}

/* =============================================
   CARDS
   ============================================= */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.page-header {
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--sidebar-bg);
}

.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Summary stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.stat-card.green  { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.red    { border-left-color: var(--danger); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.2;
}

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

/* =============================================
   TABS
   ============================================= */

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =============================================
   TABLES
   ============================================= */

.table-wrapper {
  overflow-x: auto;
}

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

thead th {
  background: #F8FAFC;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover { background: #F8FAFC; }

tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

tbody tr:last-child { border-bottom: none; }

.tfoot-row td {
  font-weight: 700;
  background: #F0F4F8;
  border-top: 2px solid var(--border);
}

/* =============================================
   FORMS
   ============================================= */

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

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

label .required { color: var(--danger); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #FFFFFF;
  width: 100%;
  transition: border-color 0.15s;
  min-height: 44px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

input[readonly], select[disabled] {
  background: #F5F7FA;
  color: var(--text-muted);
  cursor: not-allowed;
}

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

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  min-height: 44px;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover { background: #1B5E20; }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B71C1C; }

.btn-outline  {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg); }

.btn-sm { padding: 5px 12px; font-size: 12px; min-height: 32px; }
.btn-full { width: 100%; }

.btn-logout {
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text);
  width: 100%;
  font-size: 12px;
  padding: 8px;
  min-height: 36px;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); }

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* =============================================
   BADGES & TAGS
   ============================================= */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: var(--success-light); color: var(--success); }
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red    { background: var(--danger-light);  color: var(--danger); }
.badge-gray   { background: #F0F4F8; color: var(--text-muted); }
.badge-purple { background: #EDE7F6; color: #6A1B9A; }

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--card);
  border-radius: 10px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

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

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

.modal-body { padding: 20px; }

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

.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}

/* =============================================
   ALERTS & MESSAGES
   ============================================= */

.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #FFCDD2;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

.success-msg {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #C8E6C9;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

.info-msg {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #BBDEFB;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

.offline-banner {
  background: var(--warning);
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
}

/* =============================================
   UTILITIES
   ============================================= */

.hidden { display: none !important; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-bold { font-weight: 700; }

.peso { font-family: monospace; font-size: 13px; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.loading {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* =============================================
   TRANSACTION ENTRY SPECIFIC
   ============================================= */

.pf-summary {
  background: #F0F4F8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 8px;
}

.pf-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.pf-summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
}

.pf-summary-label { color: var(--text-muted); }
.pf-summary-value { font-weight: 600; font-family: monospace; }

/* =============================================
   DOR REPORT — TAB STYLES
   ============================================= */

.dor-tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.dor-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #1565C0;
  background: #DDEAF8;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  margin-right: 3px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.dor-tab:hover {
  color: #1565C0;
  background: #C5D9F0;
}

.dor-tab.active {
  color: #ffffff;
  background: linear-gradient(180deg, #1E3A5F 0%, #3949AB 100%);
  border-bottom-color: #7B1FA2;
  border-radius: 6px 6px 0 0;
}

.dor-tab-badge {
  display: inline-block;
  background: #C62828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
  letter-spacing: 0;
}

.dor-tab.active .dor-tab-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* =============================================
   PRINT UTILITIES
   ============================================= */

.print-only { display: none; }

/* =============================================
   PRINT STYLES — A4 Portrait
   ============================================= */

@media print {
  @page { size: A4 portrait; margin: 15mm; }

  #sidebar          { display: none !important; }
  #main-content     { margin-left: 0 !important; }
  .no-print         { display: none !important; }
  .print-only       { display: block !important; }

  body              { background: #fff !important; }
  .card             { box-shadow: none !important; border: 1px solid #ddd; }

  table             { page-break-inside: avoid; }
  h3                { page-break-after: avoid; }
}

/* =============================================
   PF PAY SLIP — Screen styles
   ============================================= */

.pf-slips-row {
  display: flex;
  gap: 10px;
  min-width: 960px; /* enough for 3 daily slips OR 3 period payout slips */
}

.pf-slip {
  flex: 1;
  border: 1.5px solid #333;
  padding: 10px 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  background: #fff;
  color: #000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pf-slip-school {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.pf-slip-title {
  text-align: center;
  font-size: 11px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.pf-slip-meta {
  margin-bottom: 6px;
}

.pf-meta-row1 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  font-size: 10px;
}

.pf-meta-row2 {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.pf-label {
  white-space: nowrap;
  margin-right: 2px;
}

.pf-box {
  border: 1px solid #555;
  padding: 1px 5px;
  font-size: 10px;
  white-space: nowrap;
}

.pf-copy-label {
  margin-left: auto;
  font-size: 10px;
  font-style: italic;
}

.pf-teacher-name {
  border: 1px solid #555;
  padding: 1px 5px;
  font-size: 10px;
  flex: 1;
}

.pf-caret {
  font-size: 8px;
  color: #1E3A5F;
}

/* ── Slip table ── */

.pf-slip-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
  margin-bottom: 4px;
}

.pf-slip-table thead tr th {
  background: #1E3A5F;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 4px;
  border: 1px solid #1E3A5F;
  text-align: center;
}

.pf-th-no      { width: 8%;  }
.pf-th-student { width: 36%; }
.pf-th-service { width: 36%; }
.pf-th-amount  { width: 20%; }

.pf-tr td {
  border: 1px solid #ccc;
  padding: 2px 4px;
  height: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pf-td-no      { text-align: center; color: #555; }
.pf-td-student { }
.pf-td-service { }
.pf-td-amount  { text-align: right; }

/* ── Totals ── */

.pf-totals {
  border-top: 1.5px solid #333;
  margin-top: 2px;
  padding-top: 2px;
}

.pf-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 1px 4px;
}

.pf-total-net-row {
  font-weight: 700;
  border-top: 1px solid #333;
  margin-top: 1px;
  padding-top: 2px;
}

.pf-total-val {
  text-align: right;
  min-width: 60px;
}

.pf-ewt-val {
  color: #c0392b;
}

/* ── Notice & signature ── */

.pf-notice {
  font-style: italic;
  color: #1565C0;
  font-size: 9px;
  margin-top: 6px;
}

.pf-received {
  font-size: 10px;
  margin-top: 8px;
  margin-bottom: 2px;
}

.pf-sig-line {
  border-bottom: 1px solid #333;
  width: 60%;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   PF PAYOUT SLIP — Weekly / Semi-Monthly / Monthly
   Portrait A4, single copy
   ─────────────────────────────────────────── */

.pf-payout-slip {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000;
  background: #fff;
  border: 1.5px solid #555;
  padding: 16px 20px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Header row: school name left-stretch + copy label right */
.payout-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.payout-copy-label {
  font-size: 9px;
  font-style: italic;
  color: #555;
  white-space: nowrap;
  padding-left: 6px;
}

.payout-school {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1.4;
  flex: 1;
}

.payout-title-bar {
  background: #00A950;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 5px 8px;
  margin-bottom: 12px;
}

.payout-meta {
  margin-bottom: 12px;
}

.payout-for-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.payout-for-label {
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  min-width: 40px;
}

.payout-for-name {
  border: 1px solid #555;
  padding: 2px 8px;
  font-size: 11px;
  flex: 1;
}

.payout-period-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.payout-period-label {
  font-size: 11px;
  white-space: nowrap;
}

.payout-month-box {
  border: 1px solid #555;
  padding: 2px 8px;
  font-size: 11px;
}

.payout-period-val {
  font-size: 11px;
}

/* Payout table */

.payout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 16px;
}

.payout-th-header {
  text-align: center;
  font-weight: 700;
  border: 1px solid #999;
  padding: 4px;
  background: #f5f5f5;
  font-size: 11px;
}

.payout-th {
  border: 1px solid #999;
  padding: 4px 6px;
  font-weight: 700;
  font-size: 11px;
  background: #f0f0f0;
}

.payout-th-left  { text-align: left;  }
.payout-th-right { text-align: right; }

.payout-tr td { border: 1px solid #ccc; }

.payout-td {
  padding: 3px 6px;
  font-size: 11px;
  border: 1px solid #ccc;
}

.payout-td-right { text-align: right; }

/* Totals row */

.payout-total-tr td {
  border-top: 2px solid #555;
  border-bottom: 1px solid #999;
  font-weight: 700;
}

.payout-total-label {
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #999;
}

.payout-total-val {
  padding: 4px 6px;
  text-align: right;
  font-size: 11px;
  border: 1px solid #999;
}

/* Signatures */

.payout-signatures {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 12px;
}

.payout-sig-block {
  flex: 1;
}

.payout-sig-label {
  font-size: 11px;
  margin-bottom: 18px;
}

.payout-sig-line {
  border-bottom: 1px solid #333;
  width: 100%;
}

/* Footer */

.payout-system {
  font-style: italic;
  font-size: 9px;
  color: #555;
  margin-bottom: 4px;
}

.payout-notice {
  font-style: italic;
  font-size: 9px;
  color: #1565C0;
}

/* ── Payout slip inside 3-copy row: stretch to fill, remove max-width cap ── */

.pf-slips-row .pf-payout-slip {
  flex: 1;
  max-width: none;
  min-width: 0;
  box-shadow: none;
}

/* ── Print overrides for payout slip ── */

@media print {
  .pf-payout-slip {
    border: 1pt solid #555;
    box-shadow: none;
    max-width: 100%;
    padding: 8mm 10mm;
    margin: 0;
  }

  .payout-school      { font-size: 12pt; }
  .payout-title-bar   { font-size: 11pt; padding: 4pt 6pt; }
  .payout-for-label,
  .payout-for-name,
  .payout-period-label,
  .payout-month-box,
  .payout-period-val  { font-size: 10pt; }
  .payout-th,
  .payout-th-header,
  .payout-td,
  .payout-total-label,
  .payout-total-val   { font-size: 9pt; }
  .payout-sig-label   { font-size: 10pt; }
  .payout-system,
  .payout-notice      { font-size: 8pt; }

  /* 3-copy payout slip — stretch to fill landscape, match daily slip sizing */
  .pf-slips-row .pf-payout-slip {
    flex: 1;
    max-width: none;
    min-width: 0;
    padding: 4mm 4mm;
    border: 1pt solid #333;
    box-shadow: none;
    font-size: 8pt;
  }
  .pf-slips-row .payout-school     { font-size: 10pt; }
  .pf-slips-row .payout-copy-label { font-size: 7pt; }
  .pf-slips-row .payout-title-bar  { font-size: 9pt; padding: 3pt 5pt; margin-bottom: 5pt; }
  .pf-slips-row .payout-for-label,
  .pf-slips-row .payout-for-name,
  .pf-slips-row .payout-period-label,
  .pf-slips-row .payout-month-box,
  .pf-slips-row .payout-period-val { font-size: 8pt; }
  .pf-slips-row .payout-th,
  .pf-slips-row .payout-th-header,
  .pf-slips-row .payout-td,
  .pf-slips-row .payout-total-label,
  .pf-slips-row .payout-total-val  { font-size: 7pt; padding: 2pt 3pt; }
  .pf-slips-row .payout-sig-label  { font-size: 8pt; }
  .pf-slips-row .payout-system,
  .pf-slips-row .payout-notice     { font-size: 7pt; }
}

/* ── Print overrides for PF Pay Slip ── */

@media print {
  /* Row and slips fill the landscape page */
  .pf-slips-row {
    display: flex;
    gap: 3mm;
    min-width: 0;
    width: 100%;
  }

  .pf-slip {
    flex: 1;
    min-width: 0;
    padding: 4mm 4mm;
    box-shadow: none;
    font-size: 8pt;
    border: 1pt solid #333;
  }

  .pf-slip-school { font-size: 10pt; }
  .pf-slip-title  { font-size: 9pt;  }

  .pf-meta-row1,
  .pf-meta-row2   { font-size: 8pt;  }

  .pf-box,
  .pf-teacher-name { font-size: 8pt; }

  .pf-slip-table,
  .pf-slip-table thead tr th,
  .pf-tr td       { font-size: 7pt; }

  .pf-tr td       { height: 12pt; }

  .pf-total-row   { font-size: 8pt; }
  .pf-notice      { font-size: 7pt; }
  .pf-received    { font-size: 8pt; }
}

/* =============================================
   RESPONSIVE — Mobile adjustments
   ============================================= */

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  #sidebar.open { transform: translateX(0); }

  #main-content { margin-left: 0; }

  #page-container { padding: 16px; }

  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .modal { max-width: 100%; margin: 0; border-radius: 12px 12px 0 0; }

  .modal-overlay { align-items: flex-end; padding: 0; }
}
