/* ═══════════════════════════════════════
   Facturas — Panel Operativo
   Built on Lism CSS design tokens
   ═══════════════════════════════════════ */

/* ─── PAGE LAYOUT ───────────────────── */
.page {
  max-width: var(--sz--xl, 1280px);
  margin: 0 auto;
  width: 100%;
  padding-top: 24px;
}
.page > h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ─── NAVBAR ─────────────────────────── */
.c--navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f172a;
  color: #f1f5f9;
}
.c--nav-link {
  color: #94a3b8;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.c--nav-link:hover,
.c--nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.c--nav-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.c--nav-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* ─── LOGIN ──────────────────────────── */
#login-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}
#login-page.hidden {
  display: none !important;
}

.c--login-card {
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}
.c--login-card input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.c--login-card input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.c--login-card button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font: inherit;
  transition: background 0.15s;
}
.c--login-card button:hover { background: #2563eb; }

/* ─── CARD ───────────────────────────── */
.c--card {
  background: #fff;
}
.c--card.-bxsh\:20 { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06); }
.c--card.-bxsh\:15 { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }

/* ─── METRIC CARDS ──────────────────── */
.c--metric {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c--metric strong { font-size: 2rem; }
.c--metric--warn { border-left: 4px solid #f59e0b; }
.c--metric--danger { border-left: 4px solid #ef4444; }
.c--metric--info { border-left: 4px solid #3b82f6; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.c--summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.c--grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ─── INPUTS ─────────────────────────── */
.c--input {
  border: 1px solid #e2e8f0;
  background: #fff;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.c--input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ─── BUTTONS ────────────────────────── */
.c--btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.c--btn:active { transform: scale(0.97); }
.c--btn--primary { background: #3b82f6; color: #fff; }
.c--btn--primary:hover { background: #2563eb; }
.c--btn--danger { background: #ef4444; color: #fff; }
.c--btn--danger:hover { background: #dc2626; }
.c--btn--ghost { background: #f1f5f9; color: #334155; }
.c--btn--ghost:hover { background: #e2e8f0; }

/* ─── TABLE ──────────────────────────── */
.table-wrap { overflow-x: auto; }
.case-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.case-table th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
}
.case-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.case-table tbody tr:hover { background: #f8fafc; }
.case-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }

/* ─── BADGES ─────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-pending_validation,
.badge-missing_info { background: #fef3c7; color: #92400e; }
.badge-pending_assignee { background: #dbeafe; color: #1e40af; }
.badge-pending_approval { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-pending_withholdings { background: #fce7f3; color: #9d174d; }
.badge-ready_for_payment { background: #dbeafe; color: #1e40af; }
.badge-sent_to_payment { background: #e0e7ff; color: #3730a3; }
.badge-payment_scheduled { background: #f3e8ff; color: #6b21a8; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-closed { background: #e2e8f0; color: #475569; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ─── BACK LINK ──────────────────────── */
.c--back-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.c--back-link:hover { text-decoration: underline; }

/* ─── TIMELINE ───────────────────────── */
.c--timeline-item {
  border-left: 3px solid #93c5fd;
  padding-left: 14px;
  padding-bottom: 12px;
}
.c--timeline-item:last-child { padding-bottom: 0; }

/* ─── ACTION SECTION ─────────────────── */
.c--action-section {
  background: #fafcff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}

/* ─── MODAL ──────────────────────────── */
.c--modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.c--modal {
  width: 100%;
  max-width: 480px;
}

/* ─── KANBAN ─────────────────────────── */
.c--kanban-item { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.c--kanban-item:hover { border-color: #3b82f6 !important; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15); }

/* ─── UTILITY ────────────────────────── */
.hidden { display: none !important; }
.success { color: #16a34a; }
.error { color: #dc2626; }

/* ─── RESPONSIVE ─────────────────────── */
@media (max-width: 960px) {
  .c--navbar { flex-wrap: wrap; padding: 12px 16px; }
  .c--navbar > .l--flex { order: 3; width: 100%; flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr !important; }
  .panel-grid { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }
}
