/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --bg2:         #161b22;
  --bg3:         #1c2128;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --blue:        #2563eb;
  --blue-light:  #388bfd;
  --green:       #22c55e;
  --orange:      #f97316;   /* functional/warning orange */
  --red:         #ef4444;
  --accent:      #1f6feb;

  /* ── Brand tokens (Chicken Kitchen orange palette) ── */
  --ck-orange:        #d4822a;   /* brand chrome: nav, buttons, glow    */
  --ck-orange-hover:  #b86e20;   /* pressed brand orange                */
  --ck-gold:          #e09545;   /* lighter highlight / link-on-dark    */
  --ck-brand-tint:    rgba(212,130,42,0.12);
  --ck-brand-border:  rgba(212,130,42,0.25);

  /* ── Typography ── */
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --font-mono:    'Consolas', 'Menlo', 'SF Mono', monospace;

  /* ── Radius scale ── */
  --radius:      6px;
  --radius-sm:   7px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   16px;
  --radius-pill: 20px;

  /* ── Elevation ── */
  --shadow-sm:        0 4px 16px rgba(0,0,0,0.4);
  --shadow-dropdown:  0 12px 36px rgba(0,0,0,0.5);
  --shadow-modal:     0 24px 60px rgba(0,0,0,0.6);
  --glow-orange:      0 0 28px rgba(200,100,20,0.28), 0 10px 30px rgba(0,0,0,0.55);

  --transition: 0.15s ease;

  /* Status badge colors */
  --c-cargada:    #14532d;
  --c-faltante:   #7f1d1d;
  --c-revisar:    #78350f;
  --c-pendiente:  #374151;
  --c-no-vendor:  #c2410c;
  --c-no-org:     #92400e;
  --c-ready:      #15803d;
  --c-api-nc:     #4b5563;
  --c-pending:    #374151;
  --c-dup:        #854d0e;

  /* PDF status colors */
  --pdf-ok:      #22c55e;
  --pdf-miss:    #f97316;
  --pdf-ready:   #38bdf8;
  --pdf-pend:    #6b7280;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 13px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── Language switcher ─────────────────────────────────────────────────── */
.lang-bar { display: flex; gap: 4px; align-items: center; }

.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  line-height: 1;
  transition: var(--transition);
  opacity: 0.6;
  display: flex;
  align-items: center;
}
.lang-btn:hover  { opacity: 0.9; background: var(--bg3); }
.lang-btn.active { opacity: 1; border-color: var(--blue-light); background: rgba(56,139,253,0.12); }

.flag-svg {
  width: 28px;
  height: 18px;
  border-radius: 2px;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════════
   PORTAL PAGE
══════════════════════════════════════════════════════════════════════════ */
.portal-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 70px 24px 80px;
  background: radial-gradient(ellipse at 50% 10%, #0e1e38 0%, #080e1a 70%);
}

/* ── Top bar (user + bell) ──────────────────────────────────────────────── */
.portal-topbar {
  position: fixed;
  top: 0; right: 0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
}
.portal-topbar-user {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e6edf3;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s;
}
.portal-topbar-user:hover { background: rgba(255,255,255,0.09); }
.portal-topbar-bell {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  color: #e6edf3;
  transition: background 0.15s;
}
.portal-topbar-bell:hover { background: rgba(255,255,255,0.09); }

/* ── Lang bar ───────────────────────────────────────────────────────────── */
.portal-page > .lang-bar {
  position: fixed;
  top: 14px;
  left: 20px;
}

/* ── Header / logo ──────────────────────────────────────────────────────── */
.portal-wrap { text-align: center; width: 100%; max-width: 1160px; padding: 0 16px; }
.portal-header { margin-bottom: 40px; }
.portal-logo   { margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.portal-company-logo { max-height: 190px; max-width: 340px; object-fit: contain; }
.portal-tagline {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 5px;
  color: rgba(230, 237, 243, 0.6);
  margin-top: 2px;
}

/* ── Cards — 3 in a single row ──────────────────────────────────────────── */
.portal-cards {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: nowrap;
}
.portal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 310px;
  min-width: 220px;
  position: relative;
  background: linear-gradient(170deg, #111a2e 0%, #0c1422 100%);
  border: 1px solid rgba(200, 120, 40, 0.22);
  border-radius: 16px;
  padding: 30px 24px 0;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
  color: #e6edf3;
}
.portal-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 120, 40, 0.7);
  box-shadow: 0 0 28px rgba(200, 100, 20, 0.28), 0 10px 30px rgba(0,0,0,0.55);
}

/* Icon area */
.portal-card-icon-wrap {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.portal-card-icon-wrap svg {
  width: 100px; height: 100px;
  filter: drop-shadow(0 0 10px rgba(200,100,20,0.5));
}

.portal-card-name {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #e6edf3;
  line-height: 1.35;
}

/* Bottom counter strip */
.portal-card-counter {
  width: calc(100% + 48px);
  margin: auto -24px 0;
  padding: 11px 20px;
  border-top: 1px solid rgba(200, 120, 40, 0.15);
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 0 0 16px 16px;
}
.portal-card-counter svg   { flex-shrink: 0; }
.portal-card-counter .cnt-num   { font-weight: 700; font-size: 16px; color: #d4822a; }
.portal-card-counter .cnt-label { font-size: 13px; color: #7d8590; }

/* Badge override for portal */
.portal-card .badge { margin-bottom: 4px; }

/* Locked card — no view permission */
.portal-card--locked {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.6);
  position: relative;
}
.card-lock-badge {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: #7d8590;
  pointer-events: none;
}

/* Azahar (kept for future use) */
.portal-card--azahar       { border-color: #6b3a2a; }
.portal-card--azahar:hover { border-color: #a0522d; }
.portal-card--azahar .portal-card-name { color: #fff; }

/* Legacy img wrap (unused) */
.portal-card-imgwrap { display: none; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.portal-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(8,14,26,0.97);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-footer-left {
  display: flex; align-items: center; gap: 12px;
  color: #7d8590; font-size: 12px;
}
.portal-footer-logo { height: 30px; object-fit: contain; }
.portal-footer-right {
  display: flex; align-items: center;
}
.portal-footer-link {
  display: flex; align-items: center; gap: 6px;
  color: #7d8590; font-size: 13px; cursor: pointer;
  padding: 4px 20px;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: color 0.15s;
}
.portal-footer-link:last-child { border-right: none; }
.portal-footer-link:hover { color: #e6edf3; }

/* Settings dropdown — floats upward from footer */
.portal-settings-btn { position: relative; }
.settings-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.55);
  z-index: 500;
  overflow: hidden;
}
.settings-dropdown.open { display: block; }

/* ── User dropdown ──────────────────────────────────────────────────────── */
.portal-topbar-user { position: relative; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  z-index: 500;
  overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dd-email {
  padding: 10px 16px 8px;
  font-size: 11px;
  color: #7d8590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid #30363d;
}
.user-dd-divider { height: 1px; background: #30363d; margin: 2px 0; }

.user-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  color: #e6edf3;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.user-dd-item:hover        { background: rgba(255,255,255,0.06); }
.user-dd-item--admin       { color: #d4822a; }
.user-dd-item--admin:hover { background: rgba(212,130,42,0.1); }
.user-dd-item--danger      { color: #f87171; }
.user-dd-item--danger:hover{ background: rgba(239,68,68,0.1); }

/* ── Auth + Admin modals ────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  position: relative;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
  padding: 28px 32px 32px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-box--wide { width: 760px; max-height: 85vh; overflow-y: auto; }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: #7d8590; font-size: 18px; cursor: pointer;
  transition: color 0.12s;
}
.modal-close:hover { color: #e6edf3; }

.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: #e6edf3; }

.modal-tabs {
  display: flex;
  border-bottom: 1px solid #30363d;
  margin-bottom: 22px;
  gap: 0;
}
.modal-tab {
  flex: 1;
  background: none; border: none;
  padding: 8px 0;
  font-size: 13px; font-weight: 600;
  color: #7d8590; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
.modal-tab.active { color: #d4822a; border-bottom-color: #d4822a; }

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #7d8590;
}
.modal-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 7px;
  color: #e6edf3;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.12s;
}
.modal-input:focus { border-color: #d4822a; }

.modal-error { color: #f87171; font-size: 12px; min-height: 16px; margin-bottom: 10px; }

.modal-btn {
  width: 100%;
  padding: 10px;
  background: #d4822a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.modal-btn:hover { background: #b86e20; }

/* ── Admin panel ────────────────────────────────────────────────────────── */
.admin-user-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
  transition: outline 0.3s;
}
.admin-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-user-name  { display: block; font-size: 14px; font-weight: 700; color: #e6edf3; }
.admin-user-email { display: block; font-size: 11px; color: #7d8590; margin-top: 2px; }
.admin-user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.admin-role-sel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e6edf3;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  cursor: pointer;
}
.admin-btn-save {
  padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer;
  background: #d4822a; color: #fff; font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background 0.12s;
}
.admin-btn-save:hover { background: #b86e20; }
.admin-btn-delete {
  padding: 4px 12px; border-radius: 6px; border: 1px solid #7f1d1d; cursor: pointer;
  background: rgba(127,29,29,0.25); color: #f87171; font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background 0.12s;
}
.admin-btn-delete:hover { background: rgba(127,29,29,0.5); }

.admin-perm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-perm-table th {
  padding: 5px 10px; color: #7d8590; font-weight: 600; text-align: center;
  border-bottom: 1px solid #30363d;
}
.admin-perm-table th:first-child { text-align: left; }
.admin-sec-label { padding: 6px 10px; color: #e6edf3; }
.admin-perm-cell { text-align: center; padding: 6px; }
.admin-perm-cell input[type=checkbox] { accent-color: #d4822a; width: 15px; height: 15px; cursor: pointer; }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD PAGE
══════════════════════════════════════════════════════════════════════════ */

/* Top nav */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 44px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-back { color: var(--blue-light); font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.nav-back:hover { background: rgba(56,139,253,0.1); }
.nav-client { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.nav-client-logo { height: 28px; width: auto; object-fit: contain; }
.nav-client-logo--azahar { height: 22px; filter: brightness(1); }

/* Tab bar */
.tab-bar {
  display: flex;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 2px;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); background: rgba(255,255,255,0.04); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--blue-light); }

/* Tab panes */
.tab-pane { display: none; flex-direction: column; height: calc(100vh - 90px); }
.tab-pane.active { display: flex; }

.tab-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}
.tab-placeholder-icon { font-size: 32px; }

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-bar label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.date-input, .select-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color-scheme: dark;
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  width: 120px;
}
.select-input { width: 180px; }
.date-input:focus, .select-input:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 2px rgba(56,139,253,0.2);
}

.search-status { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

/* Stats bar (Bill.com tab) */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 12px;
}
.stats-label { color: var(--text-muted); font-weight: 600; }
.stats-item  { color: var(--text); }
.stats-item strong { color: var(--blue-light); font-size: 14px; margin-right: 3px; }
.stats-sep   { color: var(--border); }
.stats-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* Buttons */
.btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 14px;
  font-size: 12px;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn:hover { background: var(--bg2); border-color: var(--text-muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-light); border-color: var(--blue-light); }
.btn-accent    { background: #1e3a5f; border-color: var(--blue); color: var(--blue-light); }
.btn-accent:hover { background: #254975; }
.btn-validate  { background: #1c3320; border-color: #22c55e; color: #86efac; }
.btn-validate:hover { background: #14532d; }
.btn-success { background: #14532d; border-color: var(--green); color: var(--green); }
.btn-success:hover { background: #166534; }
.btn-danger  { background: #450a0a; border-color: var(--red); color: var(--red); }
.btn-danger:hover  { background: #7f1d1d; }
.btn-upload  { background: #1a2e1a; border-color: #4ade80; color: #4ade80; }
.btn-upload:hover  { background: #14532d; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* Spinner */
.spinner {
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ─────────────────────────────────────────────────────────────── */
.table-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.inv-table thead th {
  background: var(--bg2);
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
.inv-table thead th.sortable { cursor: pointer; user-select: none; }
.inv-table thead th.sortable:hover { color: var(--text); }
.inv-table thead th .sort-icon { margin-left: 4px; opacity: 0.4; font-size: 10px; }
.inv-table thead th.sort-asc  .sort-icon,
.inv-table thead th.sort-desc .sort-icon { opacity: 1; color: var(--blue-light); }

.inv-table tbody tr {
  border-bottom: 1px solid rgba(48,54,61,0.6);
  transition: background var(--transition);
}
.inv-table tbody tr:nth-child(even)  { background: rgba(22,27,34,0.5); }
.inv-table tbody tr:hover            { background: rgba(56,139,253,0.06); }
.inv-table tbody tr.row-error        { background: rgba(194,65,12,0.08); }
.inv-table tbody tr.row-error:hover  { background: rgba(194,65,12,0.14); }

.inv-table td {
  padding: 7px 10px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.inv-table td.col-amount {
  font-family: 'Consolas', monospace;
  text-align: right;
  background: rgba(37,99,235,0.08);
  color: #93c5fd;
  font-weight: 600;
}

/* Column widths */
.col-check       { width: 36px; text-align: center; }
.col-store-code  { width: 56px; max-width: 60px; text-align: center; font-weight: 700;
                   font-size: 12px; letter-spacing: 0.5px; color: var(--blue-light); }
.col-inv-num     { width: 82px; max-width: 82px; font-family: 'Consolas', monospace; font-size: 11px; }
.inv-table--billcom th:nth-child(2)  { min-width: 56px;  max-width: 60px;  }  /* Store code */
.inv-table--billcom th:nth-child(3)  { min-width: 160px; }                     /* Bill.com */
.inv-table--billcom th:nth-child(4)  { min-width: 82px;  max-width: 82px;  }  /* Invoice # */
.inv-table--billcom th:nth-child(5)  { min-width: 90px;  }                     /* Amount */
.inv-table--billcom th:nth-child(6)  { min-width: 100px; }                     /* Inv Date */
.inv-table--billcom th:nth-child(7)  { min-width: 100px; }                     /* Due Date */
.col-account     { min-width: 160px; max-width: 170px; }
.inv-table--billcom th:nth-child(9)  { min-width: 100px; }                     /* Status */
.col-approvers   { min-width: 110px; max-width: 120px; }
.inv-table--billcom th:nth-child(11) { min-width: 90px;  }                     /* Validar PDF */
.col-approval-cell { min-width: 140px; }

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

/* Checkbox */
.inv-table input[type=checkbox] { accent-color: var(--blue-light); width: 14px; height: 14px; cursor: pointer; }

/* ── Status badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Table status badges */
.badge-cargada   { background: var(--c-cargada);   color: #bbf7d0; }
.badge-faltante  { background: var(--c-faltante);  color: #fca5a5; }
.badge-revisar   { background: var(--c-revisar);   color: #fde68a; }
.badge-pendiente { background: var(--c-pendiente); color: #9ca3af; }
.badge-no-vendor { background: var(--c-no-vendor);  color: #fed7aa; }
.badge-no-org    { background: var(--c-no-org);     color: #fde68a; }
.badge-ready     { background: var(--c-ready);      color: #bbf7d0; }
.badge-api-nc    { background: var(--c-api-nc);     color: #d1d5db; }
.badge-pending   { background: var(--c-pending);    color: #9ca3af; }
.badge-dup       { background: var(--c-dup);        color: #fde68a; }

/* Portal badges */
.badge-billcom  { background: rgba(37,99,235,0.2); color: var(--blue-light); border: 1px solid rgba(37,99,235,0.4); margin-top: 4px; }
.badge-standard { background: rgba(75,85,99,0.3);  color: #d1d5db; border: 1px solid rgba(107,114,128,0.4); margin-top: 4px; }

/* ── PDF status ────────────────────────────────────────────────────────── */
.pdf-ok      { color: #22c55e; font-weight: 700; }   /* verde */
.pdf-falta   { color: #ef4444; font-weight: 700; }   /* rojo */
.pdf-pending { color: #eab308; font-weight: 600; }   /* amarillo */
.pdf-missing { color: #f97316; font-weight: 600; }   /* naranja (legacy) */
.pdf-ready   { color: #38bdf8; font-weight: 600; }

/* Bill.com vendor cell error */
.billcom-no-vendor { color: var(--c-no-vendor); font-style: italic; font-size: 11px; }
.billcom-no-org    { color: #d97706; font-style: italic; font-size: 11px; }

/* ── Provider multi-checkbox picker ───────────────────────────────────── */
.prov-picker { position: relative; display: inline-block; }
.prov-picker-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 180px;
  transition: var(--transition);
}
.prov-picker-btn:hover { border-color: var(--text-muted); background: var(--bg2); }
.prov-caret { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.prov-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.prov-picker-dropdown.hidden { display: none; }
.prov-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}
.prov-check-label:hover { background: rgba(56,139,253,0.08); }
.prov-check-label input[type=checkbox] { accent-color: var(--blue-light); cursor: pointer; }

/* ── Account dropdown in table ─────────────────────────────────────────── */
.account-sel {
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 2px 4px;
  width: 100%;
  max-width: 160px;
  cursor: pointer;
}
.account-sel:hover  { border-color: var(--border); }
.account-sel:focus  { outline: none; border-color: var(--blue-light); }

/* ── Aprobación tab header ──────────────────────────────────────────────── */
.aprob-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  flex-wrap: wrap;
}

/* ── Approval column buttons ───────────────────────────────────────────── */
.approval-btns {
  display: flex;
  gap: 4px;
}
.approval-btn {
  flex: 1;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.approval-btn:hover { background: var(--bg2); color: var(--text); }
.approval-btn--active-si {
  background: #14532d;
  border-color: var(--green);
  color: #bbf7d0;
}
.approval-btn--active-pend {
  background: #374151;
  border-color: #6b7280;
  color: #d1d5db;
}

/* ── Bill.com connection bar ───────────────────────────────────────────── */
.billcom-conn-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.conn-dot {
  font-size: 14px;
  line-height: 1;
  transition: color var(--transition);
}
.conn-idle    { color: var(--text-muted); }
.conn-running { color: var(--orange); animation: conn-pulse 1.2s infinite alternate; }
.conn-success { color: var(--green); }
.conn-error   { color: var(--red); }

@keyframes conn-pulse { from { opacity: 0.4; } to { opacity: 1; } }

.conn-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-connect {
  border: 1px solid var(--border);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}
.btn-connect:disabled { opacity: 0.6; cursor: default; }

.btn-conn-disconnected {
  background: #450a0a;
  border-color: var(--red);
  color: var(--red);
}
.btn-conn-disconnected:hover:not(:disabled) { background: #5c0f0f; }

.btn-conn-pending {
  background: #431407;
  border-color: var(--orange);
  color: var(--orange);
  animation: conn-pulse 1.2s infinite alternate;
}

.btn-conn-connected {
  background: #14532d;
  border-color: var(--green);
  color: var(--green);
}
.btn-conn-connected:hover:not(:disabled) { background: #166534; }

/* ── Sidebar active state ──────────────────────────────────────────────── */
.sidebar-item--active {
  color: var(--ck-orange) !important;
  background: var(--ck-brand-tint) !important;
  border-color: rgba(212,130,42,0.45) !important;
  font-weight: 600 !important;
}
.sidebar-item--active svg { opacity: 1 !important; }

/* ── Toast notifications ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toast-in 0.2s ease;
  max-width: 320px;
}
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
