/* ============================================================
   Aniversarios Caseros — Estilos principales
   Paleta: azul institucional + dorado senatorial
   ============================================================ */

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

:root {
    --blue-900: #0c1e3d;
    --blue-800: #163060;
    --blue-700: #1e4080;
    --blue-600: #1a56db;
    --blue-400: #4d8ef0;
    --blue-100: #dbeafe;
    --blue-50:  #eff6ff;

    --gold-600: #b7791f;
    --gold-400: #e9a827;
    --gold-100: #fef3c7;
    --gold-50:  #fffbeb;

    --green-600: #15803d;
    --green-100: #dcfce7;
    --red-600:   #dc2626;
    --red-100:   #fee2e2;
    --amber-600: #d97706;
    --amber-100: #fef3c7;

    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --gray-50:  #f9fafb;
    --white:    #ffffff;

    --sidebar-w: 240px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);

    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
}

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

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--blue-600);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gold-400);
    color: var(--blue-900);
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.brand-name { font-size: 13px; font-weight: 600; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,.5); }

.sidebar__nav {
    padding: 16px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item--active, .nav-item.active { background: rgba(255,255,255,.25); color: #fff; }

.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 10px 0; }

.sidebar__footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-chip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gold-400); color: var(--blue-900);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.4); text-transform: capitalize; }
.btn-logout { color: rgba(255,255,255,.4); transition: color .15s; flex-shrink: 0; }
.btn-logout:hover { color: var(--red-100); }

/* ── MAIN CONTENT ─────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    padding: 28px 32px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.page-title    { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--blue-900); }
.page-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 3px; }
.page-actions  { display: flex; gap: 10px; align-items: center; flex-shrink: 0; padding-top: 4px; }
.page-body     { padding: 24px 32px 40px; flex: 1; }

/* ── CARDS / PANELS ───────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card__title {
    font-size: 14px; font-weight: 600; color: var(--gray-700);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

/* ── STAT CARDS ───────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-card__icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
}
.stat-card__icon svg { width: 20px; height: 20px; }
.stat-card__val  { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card__lbl  { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.stat-card__sub  { font-size: 12px; color: var(--gray-500); }

.stat--blue  .stat-card__icon { background: var(--blue-50);  color: var(--blue-600); }
.stat--blue  .stat-card__val  { color: var(--blue-800); }
.stat--gold  .stat-card__icon { background: var(--gold-50);  color: var(--gold-600); }
.stat--gold  .stat-card__val  { color: var(--gold-600); }
.stat--green .stat-card__icon { background: var(--green-100); color: var(--green-600); }
.stat--green .stat-card__val  { color: var(--green-600); }
.stat--red   .stat-card__icon { background: var(--red-100);  color: var(--red-600); }
.stat--red   .stat-card__val  { color: var(--red-600); }

/* ── URGENCY BADGES ───────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge--urgent  { background: var(--red-100);   color: var(--red-600); }
.badge--soon    { background: var(--amber-100);  color: var(--amber-600); }
.badge--normal  { background: var(--green-100);  color: var(--green-600); }
.badge--info    { background: var(--blue-100);   color: var(--blue-600); }
.badge--neutral { background: var(--gray-100);   color: var(--gray-700); }

/* ── TABLE ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left; padding: 10px 14px;
    font-size: 11px; font-weight: 600; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--gray-300);
    background: var(--gray-50);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ── BUTTONS ──────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    border: none; text-decoration: none; transition: opacity .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { opacity: .88; }
.btn:active { opacity: .75; }
.btn--primary  { background: var(--blue-600); color: #fff; }
.btn--gold     { background: var(--gold-400); color: var(--blue-900); }
.btn--outline  { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn--danger   { background: var(--red-600); color: #fff; }
.btn--sm       { padding: 5px 12px; font-size: 12.5px; }
.btn--icon     { padding: 7px; }

/* ── FORMS ────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 9px 13px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; color: var(--gray-900);
    background: var(--white); transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── COUNTDOWN / URGENCY ──────────────────────── */
.countdown {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500;
}
.countdown--urgent { color: var(--red-600); }
.countdown--soon   { color: var(--amber-600); }
.countdown--ok     { color: var(--green-600); }

/* ── CALENDAR ─────────────────────────────────── */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-header-day {
    text-align: center; font-size: 11px; font-weight: 600;
    color: var(--gray-500); padding: 8px 0; text-transform: uppercase;
}
.cal-day {
    min-height: 72px; background: var(--white);
    border: 1px solid var(--gray-100); border-radius: var(--radius-sm);
    padding: 6px 8px; cursor: default;
    transition: background .1s;
}
.cal-day--other { background: var(--gray-50); }
.cal-day--today { border-color: var(--blue-600); border-width: 2px; }
.cal-day__num { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.cal-day--today .cal-day__num {
    background: var(--blue-600); color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.cal-event {
    font-size: 10px; padding: 2px 5px; border-radius: 4px;
    margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer;
}
.cal-event--urgent { background: var(--red-100);   color: var(--red-600); }
.cal-event--soon   { background: var(--amber-100);  color: var(--amber-600); }
.cal-event--normal { background: var(--blue-100);   color: var(--blue-600); }

/* ── FLYER PREVIEW ────────────────────────────── */
.flyer-preview-wrap {
    position: relative; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-md);
    max-width: 500px;
}
.flyer-canvas {
    width: 100%; aspect-ratio: 1;
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, #1e3a6e 100%);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px; color: #fff; text-align: center; position: relative;
    overflow: hidden;
}
.flyer-canvas::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(233,168,39,.15) 0%, transparent 60%);
    pointer-events: none;
}
.flyer-aniversario {
    font-family: 'Playfair Display', serif;
    font-size: 18px; color: var(--gold-400); margin-bottom: 8px; letter-spacing: .1em;
    text-transform: uppercase;
}
.flyer-num {
    font-family: 'Playfair Display', serif;
    font-size: 88px; font-weight: 700; line-height: 1;
    color: #fff; position: relative;
}
.flyer-num::after {
    content: 'AÑOS';
    display: block; font-size: 18px; color: var(--gold-400);
    letter-spacing: .2em; margin-top: -8px;
}
.flyer-nombre {
    font-size: 18px; font-weight: 600; margin: 20px 0 12px;
    line-height: 1.3;
}
.flyer-mensaje {
    font-size: 12.5px; color: rgba(255,255,255,.75); line-height: 1.6;
    max-width: 340px; margin-bottom: 24px;
}
.flyer-firma {
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 16px; font-size: 14px;
    color: var(--gold-400); font-weight: 600;
}
.flyer-cargo { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

/* ── SOCIAL BUTTONS ───────────────────────────── */
.social-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    border: none; color: #fff; transition: opacity .15s;
}
.social-btn:hover { opacity: .88; }
.social-btn--fb { background: #1877f2; }
.social-btn--ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* ── MODAL ────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 999; padding: 20px;
}
.modal {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 28px; width: 100%; max-width: 560px;
    box-shadow: var(--shadow-md); position: relative;
    max-height: 90vh; overflow-y: auto;
}
.modal__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal__title  { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--blue-900); }
.modal__close  { background: none; border: none; cursor: pointer; color: var(--gray-500); padding: 4px; }
.modal__footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; border-top: 1px solid var(--gray-100); padding-top: 18px; }

/* ── TOAST ────────────────────────────────────── */
.toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); font-size: 14px; max-width: 380px;
    animation: slideIn .3s ease;
}
.toast--success { background: var(--green-100); color: var(--green-600); }
.toast--error   { background: var(--red-100);   color: var(--red-600); }
.toast--info    { background: var(--blue-100);   color: var(--blue-600); }
.toast button   { background: none; border: none; cursor: pointer; color: inherit; opacity: .6; font-size: 16px; }

@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── SEARCH / FILTER BAR ─────────────────────── */
.filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; margin-bottom: 20px;
}
.filter-bar .form-input { max-width: 260px; }

/* ── PROGRESS RING ────────────────────────────── */
.progress-ring { transform: rotate(-90deg); }
.progress-ring__bg   { fill: none; stroke: var(--gray-100); }
.progress-ring__fill { fill: none; transition: stroke-dashoffset .5s ease; }

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-240px); transition: transform .3s; width: 240px; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .stats-grid  { grid-template-columns: 1fr 1fr; }
}

/* ── LOGIN PAGE ───────────────────────────────── */
.login-page {
    min-height: 100vh; background: var(--blue-900);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-box {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 44px 40px; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-md);
}
.login-logo {
    text-align: center; margin-bottom: 28px;
}
.login-logo .brand-mark { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 20px; }
.login-logo h1 { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--blue-900); }
.login-logo p  { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.login-footer  { text-align: center; font-size: 12px; color: var(--gray-500); margin-top: 20px; }

.nav-section{font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.3);padding:16px 12px 4px;margin:0;}
