/* ============================================================
   BordaHub · Sistema de Solicitudes de Pago
   assets/css/app.css
   ============================================================ */

:root {
  --sidebar-w: 260px;
  --topbar-h: 60px;

  /* Paleta corporativa */
  --primary:      #1a3c5e;
  --primary-dark: #102840;
  --primary-light:#2a5c8e;
  --accent:       #e8a020;
  --accent-dark:  #c88010;

  --bg-body:   #f0f4f8;
  --bg-card:   #ffffff;
  --bg-sidebar:#0f2235;

  --text-main: #1a2733;
  --text-sub:  #5a7080;
  --text-muted:#8fa5b5;
  --border:    #dde6ef;

  --success:  #198754;
  --warning:  #cc8800;
  --danger:   #dc3545;
  --info:     #0d6efd;

  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:0 4px 24px rgba(0,0,0,.12);

  --font-body:  'Plus Jakarta Sans', sans-serif;
  --font-brand: 'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: #0f2235;
  min-height: 0;
  overflow: hidden;
}

.sidebar-logo-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
  display: block;
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 12px;
  color: #ffffff;
  display: block;
  line-height: 1.15;
  font-weight: 700;
}
.brand-sub {
  font-size: 9.5px;
  color: rgba(255,255,255,.55);
  letter-spacing: .03em;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.3);
  padding: 12px 8px 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .18s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,160,32,.35);
}

.nav-item i { font-size: 17px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  display: none;
}
.nav-badge.show { display: inline-block; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 15px;
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name {
  display: block;
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  display: block;
  font-size: 11px; color: rgba(255,255,255,.5);
  text-transform: capitalize;
}

.btn-logout {
  color: rgba(255,255,255,.4);
  font-size: 18px;
  text-decoration: none;
  transition: color .18s;
}
.btn-logout:hover { color: var(--danger); }

/* ── MAIN WRAPPER ────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* ── TOPBAR ─────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
  display: none;
}

.page-title {
  font-family: var(--font-brand);
  font-size: 17px;
  color: var(--text-main);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── MAIN CONTENT ───────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px 40px;
}

/* ── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h5, .card-header h6 {
  font-family: var(--font-brand);
  font-size: 15px;
  color: var(--text-main);
  margin: 0;
}

.card-body { padding: 20px; }

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(26,60,94,.1);  color: var(--primary); }
.stat-icon.gold   { background: rgba(232,160,32,.15); color: var(--accent-dark); }
.stat-icon.green  { background: rgba(25,135,84,.1); color: var(--success); }
.stat-icon.red    { background: rgba(220,53,69,.1); color: var(--danger); }

.stat-body { flex: 1; }
.stat-value {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* ── TABLES ─────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table thead th {
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  padding: 12px 14px;
  white-space: nowrap;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f5f8fb; }
.table td { padding: 11px 14px; vertical-align: middle; border-color: var(--border); }

/* ── BADGES ─────────────────────────────────────────── */
.badge { font-weight: 600; font-size: 11.5px; padding: 4px 9px; border-radius: 6px; }
.badge-success   { background: rgba(25,135,84,.12); color: var(--success); }
.badge-warning   { background: rgba(204,136,0,.12); color: var(--warning); }
.badge-danger    { background: rgba(220,53,69,.12); color: var(--danger); }
.badge-secondary { background: rgba(108,117,125,.12); color: #6c757d; }
.badge-dark      { background: rgba(33,37,41,.12); color: #212529; }
.badge-info      { background: rgba(13,110,253,.12); color: var(--info); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-accent {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

/* ── FORMS ──────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; color: var(--text-main); margin-bottom: 5px; }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  padding: 9px 13px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,60,94,.1);
}

/* ── LOGIN PAGE ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  justify-content: center;
}

.login-icon {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
}

.login-brand-text .brand-name {
  font-family: var(--font-brand);
  font-size: 22px;
  color: var(--primary);
}
.login-brand-text .brand-sub {
  color: var(--accent-dark);
}

.login-title {
  font-size: 15px;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 28px;
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-toggle { display: block; }
  .main-wrapper { margin-left: 0; }
  .main-content { padding: 16px; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── UTILITIES ──────────────────────────────────────── */
.text-money { font-weight: 700; font-family: var(--font-brand); color: var(--primary); }
.section-header { margin-bottom: 24px; }
.section-header h4 { font-family: var(--font-brand); font-size: 20px; }
.section-header p { color: var(--text-sub); font-size: 14px; margin: 0; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 15px; }

/* Print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0; }
}