/* ============================================
   AGENDA OST - Styles Principaux
   /assets/css/style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --primary:       #1e3a8a;
  --primary-light: #1e40af;
  --primary-pale:  #dbeafe;
  --accent:        #0ea5e9;
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0891b2;

  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;

  --sidebar-w:     260px;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(30,58,138,.08);
  --shadow-md:     0 4px 24px rgba(30,58,138,.12);
  --transition:    all .2s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.auth-brand {
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 60px;
  position: relative; overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(59,130,246,.15) 0%, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(14,165,233,.1) 0%, transparent 50%);
}
.auth-brand-logo {
  font-size: 52px; margin-bottom: 20px;
  position: relative; z-index: 1;
}
.auth-brand h1 {
  color: #fff; font-size: 32px; font-weight: 800;
  letter-spacing: -1px; position: relative; z-index: 1;
  margin-bottom: 12px;
}
.auth-brand p {
  color: #93c5fd; font-size: 15px; text-align: center;
  max-width: 300px; position: relative; z-index: 1;
  line-height: 1.7;
}
.auth-features {
  margin-top: 48px; display: flex; flex-direction: column; gap: 12px;
  position: relative; z-index: 1;
}
.auth-feature-item {
  display: flex; align-items: center; gap: 12px;
  color: #bfdbfe; font-size: 14px;
}
.auth-feature-item i { color: #60a5fa; width: 20px; }

.auth-form-side {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 60px 40px;
}
.auth-form-container {
  width: 100%; max-width: 420px;
}
.auth-form-container h2 {
  font-size: 26px; font-weight: 800; color: var(--text);
  margin-bottom: 6px; letter-spacing: -0.5px;
}
.auth-form-container .auth-subtitle {
  color: var(--text-muted); font-size: 14px; margin-bottom: 32px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 11px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; color: var(--text);
  background: #f8fafc;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(30,64,175,.1);
}
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 42px; }
.input-icon-wrap .field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 15px; pointer-events: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(30,64,175,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; color: var(--primary-light); border: 1.5px solid var(--primary-light); }
.btn-outline:hover { background: var(--primary-pale); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; width: 100%; }
.btn-icon { padding: 8px 10px; }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; margin-bottom: 20px;
}
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.alert-info    { background: #f0f9ff; color: #0c4a6e; border: 1px solid #bae6fd; }

/* ===== DASHBOARD LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: #0f172a;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: var(--transition);
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #1e40af, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; font-weight: 800;
}
.sidebar-logo span { color: #fff; font-size: 17px; font-weight: 700; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: #475569; text-transform: uppercase;
  padding: 12px 8px 6px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  color: #94a3b8; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #cbd5e1; }
.nav-item.active { background: rgba(30,64,175,.4); color: #93c5fd; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-info {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 8px;
  margin-bottom: 8px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.user-name  { color: #e2e8f0; font-size: 13px; font-weight: 600; }
.user-role  { color: #64748b; font-size: 11px; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content-area { padding: 32px; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.card-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body  { padding: 24px; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 0 0 0 100%;
  opacity: .07;
}
.stat-card.blue::after   { background: #1e40af; }
.stat-card.green::after  { background: #16a34a; }
.stat-card.orange::after { background: #d97706; }
.stat-card.red::after    { background: #dc2626; }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.stat-card.blue  .stat-icon { background: #dbeafe; color: #1e40af; }
.stat-card.green .stat-icon { background: #dcfce7; color: #16a34a; }
.stat-card.orange .stat-icon { background: #fef3c7; color: #d97706; }
.stat-card.red   .stat-icon { background: #fee2e2; color: #dc2626; }

.stat-value  { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; }
.stat-label  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f8fafc; padding: 12px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border); text-align: left;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ===== ENGAGEMENT CARDS ===== */
.engagements-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 18px; }
.engagement-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: var(--transition); overflow: hidden;
}
.engagement-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.eng-header {
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
.eng-cat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.eng-title { font-size: 15px; font-weight: 700; color: var(--text); }
.eng-cat   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.eng-body  { padding: 16px 18px; }
.eng-meta  { display: flex; justify-content: space-between; align-items: center; }
.eng-date  { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.eng-days  { font-size: 20px; font-weight: 800; letter-spacing: -1px; }
.eng-days.urgent   { color: var(--danger); }
.eng-days.warning  { color: var(--warning); }
.eng-days.normal   { color: var(--primary-light); }
.eng-days.past     { color: var(--text-muted); }
.eng-footer { padding: 12px 18px; background: #f8fafc; display: flex; justify-content: space-between; align-items: center; }
.eng-amount { font-size: 14px; font-weight: 700; color: var(--text); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: 16px; width: 520px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .2s;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 22px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 18px; padding: 4px; }
.modal-body   { padding: 28px; }
.modal-footer { padding: 18px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-dot {
  position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid;
}
.tl-dot.danger  { border-color: var(--danger); background: #fee2e2; }
.tl-dot.warning { border-color: var(--warning); background: #fef3c7; }
.tl-dot.success { border-color: var(--success); background: #dcfce7; }
.tl-dot.info    { border-color: var(--info); background: #e0f2fe; }
.tl-date { font-size: 12px; color: var(--text-muted); }
.tl-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 2px 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .content-area { padding: 20px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.progress-bar { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--primary-light); transition: width .4s; }
