/* ===== VARIABLES ===== */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --dark: #1e2a3a;
  --sidebar-bg: #1e2a3a;
  --sidebar-hover: #2d3f54;
  --sidebar-active: #1a73e8;
  --topbar-bg: #fff;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --border: #dee2e6;
  --text: #333;
  --text-muted: #6c757d;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --sidebar-width: 220px;
  --topbar-height: 56px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e2a3a 0%, #2d4a6e 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center;
}
.login-logo { margin-bottom: 20px; }
.login-logo i { font-size: 48px; color: var(--primary); }
.login-logo h2 { font-size: 24px; font-weight: 700; color: var(--dark); margin: 8px 0 4px; }
.login-logo p { color: var(--text-muted); font-size: 13px; }
.login-card h3 { font-size: 18px; margin-bottom: 24px; color: var(--text); }
.login-card .form-group { margin-bottom: 16px; }
.login-card input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); outline: none; transition: border-color .2s; }
.login-card input:focus { border-color: var(--primary); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height);
  background: var(--topbar-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--primary); }
.topbar-brand i { font-size: 20px; }
.topbar-stats { display: flex; gap: 12px; flex: 1; overflow: hidden; }
.stat-pill {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  background: var(--primary-light); border-radius: 20px; font-size: 12px; color: var(--primary-dark); white-space: nowrap;
}
.stat-pill i { font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ===== LAYOUT ===== */
.app { min-height: 100vh; }
.layout { display: flex; margin-top: var(--topbar-height); min-height: calc(100vh - var(--topbar-height)); }

/* ===== SIDEBAR ===== */
:root { --sidebar-collapsed-width: 52px; }

.sidebar {
  width: var(--sidebar-collapsed-width);
  background: var(--sidebar-bg); color: #fff;
  position: fixed; top: var(--topbar-height); bottom: 0; left: 0;
  overflow: hidden;
  transition: width .25s ease;
  z-index: 90;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
/* Expand on hover */
.sidebar:hover {
  width: var(--sidebar-width);
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,.3);
}
.sidebar-nav { padding: 8px 0; }
.nav-item {
  display: flex; align-items: center; gap: 0; padding: 11px 0;
  color: rgba(255,255,255,.75); transition: background .15s, color .15s;
  cursor: pointer; white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
/* Icon cell — fixed 52px wide always */
.nav-item i {
  min-width: 52px; width: 52px; text-align: center;
  font-size: 16px; flex-shrink: 0;
}
/* Label hidden when collapsed, visible on hover via parent */
.nav-item span {
  opacity: 0; transition: opacity .15s ease;
  font-size: 13px; font-weight: 500;
}
.sidebar:hover .nav-item span { opacity: 1; }

/* ── Collapsible nav-group ── */
.nav-group { position: relative; }

/* Parent item: the toggle row */
.nav-parent { position: relative; }
.nav-parent .nav-arrow {
  min-width: auto; width: auto; font-size: 10px;
  margin-left: auto; margin-right: 14px;
  transition: transform .2s ease;
  opacity: 0;
}
.sidebar:hover .nav-parent .nav-arrow { opacity: 1; }
.nav-group.open .nav-parent .nav-arrow { transform: rotate(180deg); }
.nav-group.open .nav-parent { background: var(--sidebar-hover); color: #fff; }

/* Children container: hidden by default */
.nav-children {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  background: rgba(0,0,0,.15);
}
.nav-group.open .nav-children { max-height: 200px; }

/* Individual child row */
.nav-child {
  padding: 9px 0 9px 52px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-child span { opacity: 0; transition: opacity .15s ease; }
.sidebar:hover .nav-child span { opacity: 1; }

/* The "+" action button inside the child */
/* Link inside nav-child (when using div wrapper) */
.nav-child-link {
  flex: 1; color: inherit; text-decoration: none; display: flex; align-items: center;
}

.nav-child-action {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: 14px;
  width: 28px; height: 28px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; transition: all .15s;
  opacity: 0;
}
.sidebar:hover .nav-child-action { opacity: 1; }
.nav-child-action:hover {
  background: var(--sidebar-active); color: #fff;
}

/* Hide children completely when sidebar is collapsed */
.sidebar:not(:hover) .nav-children { max-height: 0 !important; }

/* Divider */
.nav-divider {
  height: 0; overflow: hidden; opacity: 0;
  transition: opacity .15s ease, height .15s ease;
  padding: 0 18px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,.35); font-weight: 600;
  white-space: nowrap;
}
.sidebar:hover .nav-divider {
  height: 28px; opacity: 1;
  display: flex; align-items: flex-end; padding-bottom: 4px; padding-top: 12px;
}

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: var(--sidebar-collapsed-width); flex: 1; padding: 24px; transition: margin-left .25s; }
.main-content.expanded { margin-left: 0; }

/* ===== CARDS ===== */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 16px; font-weight: 600; color: var(--dark); }
.card-body { padding: 20px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-weight: 500; transition: all .2s; cursor: pointer; border: none; font-size: 13px; }
.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: #218838; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-warning { background: var(--warning); color: #333; }
.btn-warning:hover { background: #e0a800; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-icon { width: 34px; height: 34px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .2s; }
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color .2s; background: #fff; color: var(--text);
}
.form-control:focus { border-color: var(--primary); }
.form-control-sm { padding: 6px 10px; font-size: 13px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Section titles inside forms */
.form-section-title {
  margin: 0 0 14px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Role checkboxes (persona form) */
.role-checkboxes {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.role-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-size: 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.role-check:last-child { border-bottom: none; }
.role-check:hover { background: var(--primary-light); }
.role-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* Active state for nav-child */
.nav-child.active { background: rgba(255,255,255,.1); color: #fff; }

/* ── Read-only form mode ── */
.form-readonly {
  position: relative;
  background: #f5f6f8;
  border-radius: var(--radius);
  padding: 20px;
  cursor: not-allowed;
}
.form-readonly::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  z-index: 1;
  pointer-events: none;
}
.form-readonly .form-control,
.form-readonly select.form-control {
  background: #e9ecef;
  color: #495057;
  cursor: not-allowed;
  border-color: #d5d8dc;
}
.form-readonly .role-check {
  cursor: not-allowed;
  opacity: .7;
}
.form-readonly .role-check:hover { background: transparent; }
.form-readonly input[type=checkbox] { cursor: not-allowed; }
.form-readonly-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin-bottom: 16px;
  background: #fff3cd; border: 1px solid #ffc107;
  border-radius: var(--radius); font-size: 13px; color: #856404;
}
.form-readonly-banner i { font-size: 16px; }

/* Filter labels */
.filter-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── Invoice success banner ── */
.invoice-success-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; margin-bottom: 0;
  background: #d4edda; border: 1px solid #28a745;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 14px; font-weight: 600; color: #155724;
}
.invoice-success-banner i { font-size: 18px; }

/* ── Invoice toolbar ── */
.invoice-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 16px;
  background: #f0f2f5; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 14px; min-width: 60px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: all .15s; color: var(--text);
  font-size: 11px; font-weight: 500;
}
.toolbar-btn i { font-size: 18px; color: var(--primary); }
.toolbar-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.toolbar-btn:disabled { opacity: .5; cursor: not-allowed; }
.toolbar-sep {
  width: 1px; height: 40px; background: var(--border); margin: 0 6px;
}

/* Document filter rows */
.doc-filters-row {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.doc-filter-field { display: flex; flex-direction: column; }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; }
.data-table th { background: #f8f9fa; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.table-actions { display: flex; gap: 4px; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* ===== SEARCH BAR ===== */
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-input-wrap { position: relative; }
.search-input-wrap input { padding-left: 36px; min-width: 240px; }
.search-input-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; }
.pagination .page-info { color: var(--text-muted); font-size: 13px; margin-right: auto; }
.page-btn { width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); font-size: 13px; color: var(--text); transition: all .2s; background: #fff; cursor: pointer; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 680px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box.modal-lg { max-width: 900px; }
.modal-box.modal-sm { max-width: 440px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ===== ALERTS ===== */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ===== DASHBOARD ===== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #d4edda; color: var(--success); }
.stat-icon.orange { background: #fff3cd; color: #e67e22; }
.stat-icon.red { background: #f8d7da; color: var(--danger); }
.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--dark); }
.stat-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== INVOICE FORM ===== */
.invoice-form { background: #f8f9fa; border-radius: var(--radius); padding: 16px; }
.invoice-form-header { padding: 16px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--primary-light), #fff); border-radius: var(--radius) var(--radius) 0 0; }
.invoice-form-header h2 { font-size: 15px; font-weight: 600; color: var(--primary-dark); }
.invoice-form-header h2 i { margin-right: 8px; }
.invoice-client-row { padding: 16px 20px; display: flex; gap: 16px; align-items: flex-end; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

/* Document info grid (Contifico-style) */
.doc-info-grid { display: flex; flex-direction: column; gap: 10px; }
.doc-info-row { display: flex; align-items: center; gap: 10px; }
.doc-info-row > label { width: 150px; flex-shrink: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); text-align: right; }
.doc-info-row > input, .doc-info-row > select { max-width: 350px; }
.doc-info-row > div { flex: 1; max-width: 500px; }
.invoice-client-info { flex: 1; min-width: 260px; }
.invoice-client-name { font-weight: 600; color: var(--dark); font-size: 15px; }
.invoice-client-email { font-size: 12px; color: var(--text-muted); }
.invoice-meta { display: flex; gap: 16px; }
.invoice-meta-field label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.invoice-meta-field input { border: 1.5px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 13px; width: 150px; }

.product-search-row { padding: 14px 20px; border-bottom: 1px solid #f0f0f0; display: flex; gap: 10px; align-items: center; background: #fafbfc; }
.product-autocomplete { position: relative; flex: 1; }
.product-autocomplete input { width: 100%; }
.autocomplete-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 50; max-height: 280px; overflow-y: auto; }
.autocomplete-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.autocomplete-item:hover { background: var(--primary-light); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item .item-name { font-weight: 500; font-size: 13px; }
.autocomplete-item .item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.invoice-items { padding: 0 20px 16px; }
.invoice-items table { margin-top: 8px; }
.invoice-items th { font-size: 11px; }
.invoice-items td input { width: 80px; padding: 5px 8px; border: 1.5px solid var(--border); border-radius: 4px; text-align: right; }
.invoice-items td input.qty { width: 60px; text-align: center; }
.invoice-items td input.price { width: 100px; }
.invoice-items td input.disc { width: 80px; }

.invoice-totals { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.totals-box { width: 320px; }
.total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.total-row.final { border-top: 2px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 16px; }

.invoice-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; gap: 10px; }
.payment-section { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.payment-select { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: #fff; }
.payment-select label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.payment-select input[type="number"] { width: 100px; border: none; outline: none; font-size: 13px; }

/* ===== CLIENT SEARCH AUTOCOMPLETE ===== */
.client-search-wrap { position: relative; flex: 1; min-width: 260px; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--dark); }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ===== CONFIG ===== */
.config-section { margin-bottom: 24px; }
.config-section-title { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.logo-preview { width: 120px; height: 80px; object-fit: contain; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 8px; background: #fff; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: var(--radius); color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: slideIn .3s ease; display: flex; align-items: center; gap: 8px; min-width: 240px; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); color: #333; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 0; }
  .sidebar.open { width: var(--sidebar-width); }
  .sidebar.open .nav-item span { opacity: 1; }
  .sidebar.open .nav-divider { height: 28px; opacity: 1; display:flex;align-items:flex-end;padding-bottom:4px;padding-top:12px; }
  .main-content { margin-left: 0; padding: 16px; }
  .topbar-stats { display: none; }
  .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-2 { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .login-card { width: 100%; margin: 16px; }
}

/* ===== PRINT ===== */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: #fff; }
}

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--primary); }

/* ===== STATUS COLORS ===== */
.status-pagada { color: var(--success); }
.status-pendiente { color: var(--warning); }
.status-enviada { color: var(--primary); }
.status-autorizada { color: var(--success); }
.status-anulada { color: var(--danger); }
