/* ===== ERP PHP Page Supplements ===== */

/*
 * The document form pages (po_form, so_form, pi_form, etc.) use inline styles
 * with CSS variables designed for the finance dark theme. Define light-theme
 * equivalents here so those variables resolve correctly in the ERP light theme.
 */
:root {
  --bg-input:    #ffffff;
  --bg-elevated: #f1f5f9;
  --text-muted:  var(--text-2);
  --font-mono:   ui-monospace, 'Cascadia Code', monospace;
  --gold:        #c9a84c;
}

/* Modal aliases — PHP pages use .modal/.modal-header/.modal-body/.modal-footer */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto; }
.modal-backdrop[style*="flex"] { display: flex !important; }

.modal {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px; margin: auto; display: flex; flex-direction: column;
  max-height: calc(100vh - 40px);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 18px; padding: 4px; border-radius: 4px; transition: color .15s;
}
.modal-close:hover { color: var(--danger); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* Flash message spacing */
.flash-msg { margin-bottom: 16px; }

/* Sidebar brand padding (PHP uses .sidebar-brand class) */
.sidebar-brand { padding: 16px 12px; border-bottom: 1px solid var(--sb-border); }
.brand-logo { font-size: 20px; }

/* Ensure sidebar-nav has padding */
.sidebar-nav { padding: 8px 0; }

/* Section items collapsed by default */
.nav-section-items { display: none; }

/* Page header spacing */
.page-header { margin-bottom: 20px; }

/* Topbar display flex */
.topbar { display: flex; }

/* Table text-right utility (already in main CSS but ensure) */
.table .text-right { text-align: right; }

/* Alert for PHP flash messages */
.alert { padding: 10px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.2); color: #166534; }
.alert-danger  { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.3);  color: #991b1b; }
.alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #92400e; }
.alert-info    { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.2); color: #1e40af; }

/* Sidebar footer */
.sidebar-footer { padding: 12px; border-top: 1px solid var(--sb-border); }

/* toggleSidebar support */
@media (max-width: 768px) {
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
  .sidebar-overlay.active { display: block; }
}
