/* ════════════════════════════════════════════════════════
   styles2.css — Estilos completos de La Agenda
   Cubre: login, registro, agenda anual, día, panel admin
════════════════════════════════════════════════════════ */

/* ── Reset & Tokens ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        lab(70.31% -21.66 -35.21);
    --surface:   #16182a;
    --surface2:  #1e2035;
    --border:    #2c2f50;
    --accent:    #7c6bff;
    --accent-lt: lab(49.98% 71.72 53.1);
    --glow:      rgba(124,107,255,0.20);
    --danger:    #ff5f7e;
    --success:   #4ade80;
    --hoy:       #ff9f43;
    --text:      #e8eaf6;
    --muted:     #6b7099;
    --radius:    10px;
    --sans: 'Inter', system-ui, sans-serif;
    --mono: 'Inter', monospace;
}

body {
    background:  var(--bg);
    color:       var(--text);
    font-family: var(--mono);
    min-height:  100vh;
}

a { color: var(--accent-lt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ─────────────────────────────────────────── */
.ag-header {
    background:    var(--surface);
    border-bottom: 2px solid var(--accent);
    padding:       0 28px;
    position:      sticky;
    top:           0;
    z-index:       100;
}

.ag-header-inner {
    max-width:   1200px;
    margin:      0 auto;
    display:     flex;
    align-items: center;
    gap:         16px;
    padding:     14px 0;
    flex-wrap:   wrap;
}

.ag-brand {
    font-family:    var(--sans);
    font-weight:    800;
    font-size:      1.15rem;
    color:          var(--accent-lt);
    white-space:    nowrap;
    letter-spacing: -0.02em;
}

.ag-form-year {
    display:     flex;
    gap:         8px;
    align-items: center;
    flex:        1;
}

.ag-form-year input[type="number"] {
    background:  var(--bg);
    border:      1.5px solid var(--border);
    border-radius: 7px;
    padding:     8px 12px;
    font-size:   0.9rem;
    color:       var(--text);
    font-family: var(--mono);
    outline:     none;
    width:       110px;
    transition:  border-color 0.2s;
}
.ag-form-year input:focus { border-color: var(--accent); }

.ag-header-user {
    display:     flex;
    align-items: center;
    gap:         10px;
    font-size:   0.8rem;
    color:       var(--muted);
    margin-left: auto;
    white-space: nowrap;
}
.ag-header-user strong { color: var(--accent-lt); }

/* ── AVATAR ─────────────────────────────────────────── */
.ag-avatar {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           28px;
    height:          28px;
    border-radius:   50%;
    background:      var(--accent);
    color:           #fff;
    font-family:     var(--sans);
    font-weight:     700;
    font-size:       0.75rem;
    text-transform:  uppercase;
    flex-shrink:     0;
}
.ag-avatar.admin { background: var(--hoy); }

/* ── BOTONES ────────────────────────────────────────── */
.ag-btn-primary {
    background:   var(--accent);
    color:        #fff;
    border:       none;
    border-radius: 7px;
    padding:      9px 18px;
    font-size:    0.88rem;
    font-weight:  700;
    font-family:  var(--sans);
    cursor:       pointer;
    transition:   opacity 0.2s, transform 0.1s;
    white-space:  nowrap;
    display:      inline-block;
    text-align:   center;
    text-decoration: none;
}
.ag-btn-primary:hover        { opacity: 0.85; text-decoration: none; }
.ag-btn-primary:active       { transform: scale(0.97); }
.ag-btn-block                { width: 100%; padding: 11px; }

.ag-btn-back {
    background:    var(--surface2);
    border:        1px solid var(--border);
    border-radius: 7px;
    padding:       7px 13px;
    font-size:     0.78rem;
    color:         var(--muted);
    text-decoration: none;
    white-space:   nowrap;
    transition:    color 0.2s, border-color 0.2s;
}
.ag-btn-back:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.ag-btn-salir {
    background:    transparent;
    border:        1.5px solid var(--border);
    border-radius: 7px;
    padding:       6px 13px;
    color:         var(--muted);
    font-size:     0.78rem;
    font-family:   var(--mono);
    cursor:        pointer;
    transition:    border-color 0.2s, color 0.2s;
}
.ag-btn-salir:hover { border-color: var(--danger); color: var(--danger); }

.ag-btn-danger {
    background:    var(--danger);
    color:         #fff;
    border:        none;
    border-radius: 7px;
    padding:       6px 13px;
    font-size:     0.78rem;
    font-family:   var(--mono);
    cursor:        pointer;
    width:         100%;
    transition:    opacity 0.2s;
}
.ag-btn-danger:hover { opacity: 0.85; }

/* ── MENSAJES ────────────────────────────────────────── */
.ag-error {
    background:    rgba(255,95,126,0.12);
    border:        1px solid var(--danger);
    border-radius: 8px;
    padding:       10px 14px;
    font-size:     0.83rem;
    color:         var(--danger);
    margin-bottom: 12px;
}

.ag-success {
    background:    rgba(74,222,128,0.12);
    border:        1px solid var(--success);
    border-radius: 8px;
    padding:       10px 14px;
    font-size:     0.83rem;
    color:         var(--success);
    margin-bottom: 12px;
    text-align:    center;
}

/* ── CAMPOS FORMULARIO ───────────────────────────────── */
.ag-campo {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    margin-bottom:  14px;
}

.ag-campo label {
    font-size:      0.73rem;
    font-weight:    600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color:          var(--muted);
}

.ag-campo input,
.ag-campo textarea {
    background:    var(--bg);
    border:        1.5px solid var(--border);
    border-radius: 7px;
    padding:       9px 12px;
    font-size:     0.9rem;
    color:         var(--text);
    font-family:   var(--mono);
    outline:       none;
    width:         100%;
    transition:    border-color 0.2s, box-shadow 0.2s;
}
.ag-campo input:focus,
.ag-campo textarea:focus {
    border-color: var(--accent);
    box-shadow:   0 0 0 3px var(--glow);
}
.ag-campo textarea {
    resize:     vertical;
    min-height: 90px;
}

/* ── CARDS ───────────────────────────────────────────── */
.ag-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       22px 20px;
}

.ag-card h2 {
    font-family:    var(--sans);
    font-size:      0.75rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color:          var(--accent);
    margin-bottom:  18px;
}

/* ── MAIN ────────────────────────────────────────────── */
.ag-main {
    max-width: 1200px;
    margin:    0 auto;
    padding:   32px 24px 60px;
}

.ag-year-title {
    font-family:    var(--sans);
    font-size:      1.8rem;
    font-weight:    800;
    letter-spacing: -0.04em;
    color:          var(--accent-lt);
    margin-bottom:  6px;
    text-align:     center;
}

.ag-user-subtitle {
    text-align:    center;
    font-size:     0.8rem;
    color:         var(--muted);
    margin-bottom: 24px;
}
.ag-user-subtitle span { color: var(--accent-lt); font-weight: 600; }

.ag-empty {
    text-align: center;
    padding:    40px 20px;
    color:      var(--muted);
}
.ag-empty span { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.ag-empty.small { padding: 30px 10px; }
.ag-empty.small span { font-size: 2rem; }

/* ── BADGE ───────────────────────────────────────────── */
.ag-badge {
    background:    var(--glow);
    border:        1px solid var(--accent);
    border-radius: 20px;
    padding:       4px 12px;
    font-size:     0.75rem;
    font-weight:   600;
    color:         var(--accent-lt);
    white-space:   nowrap;
}

.ag-badge-admin {
    background:    rgba(255,159,67,0.15);
    border:        1px solid var(--hoy);
    border-radius: 20px;
    padding:       3px 10px;
    font-size:     0.7rem;
    color:         var(--hoy);
    font-weight:   600;
}

/* ── GRID MESES ─────────────────────────────────────── */
.ag-grid-meses {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   20px;
}
@media (max-width: 860px) { .ag-grid-meses { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .ag-grid-meses { grid-template-columns: 1fr; } }

/* ── TABLA MES ───────────────────────────────────────── */
.ag-mes {
    background:      var(--surface);
    border:          1px solid var(--border);
    border-collapse: collapse;
    width:           100%;
    font-size:       0.88rem;
}

.ag-mes caption {
    background:     var(--accent);
    color:          #fff;
    font-family:    var(--sans);
    font-weight:    700;
    font-size:      0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding:        9px 0;
    caption-side:   top;
}

.ag-mes thead th {
    padding:        7px 4px;
    font-size:      0.7rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          var(--muted);
    text-align:     center;
    border-bottom:  1px solid var(--border);
}
.ag-mes thead th:nth-child(6),
.ag-mes thead th:nth-child(7) { color: var(--accent-lt); }

.ag-mes tbody td {
    border:          1px solid var(--border);
    padding:         4px 2px;
    text-align:      center;
    height:          34px;
    vertical-align:  middle;
}

.ag-mes tbody td a {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           26px;
    height:          26px;
    border-radius:   50%;
    font-size:       0.82rem;
    color:           var(--text);
    text-decoration: none;
    transition:      background 0.15s, color 0.15s;
}
.ag-mes tbody td a:hover { background: var(--accent); color: #fff; }

.ag-mes tbody td:nth-child(6) a,
.ag-mes tbody td:nth-child(7) a { color: var(--accent-lt); }

.ag-mes tbody td.ag-hoy a {
    background:  var(--hoy);
    color:       #fff;
    font-weight: 700;
}

/* ── PÁGINA DÍA ─────────────────────────────────────── */
.ag-dia-header {
    display:       flex;
    align-items:   center;
    gap:           14px;
    margin-bottom: 26px;
    flex-wrap:     wrap;
}

.ag-dia-header h1 {
    font-family:    var(--sans);
    font-size:      1.4rem;
    font-weight:    700;
    letter-spacing: -0.03em;
    text-transform: capitalize;
}

.ag-dia-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   20px;
}
@media (max-width: 640px) { .ag-dia-grid { grid-template-columns: 1fr; } }

/* ── LISTA EVENTOS ───────────────────────────────────── */
.ag-lista-eventos {
    list-style:     none;
    display:        flex;
    flex-direction: column;
    gap:            10px;
}

.ag-evento-item {
    display:       flex;
    gap:           12px;
    align-items:   flex-start;
    background:    var(--surface2);
    border:        1px solid var(--border);
    border-radius: 8px;
    padding:       11px 13px;
}

.ag-evento-hora {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    min-width:      50px;
}

.ag-hora     { font-size: 0.92rem; font-weight: 700; color: var(--accent-lt); }
.ag-duracion { font-size: 0.67rem; color: var(--muted); margin-top: 2px; }

.ag-evento-desc {
    font-size:   0.87rem;
    color:       var(--text);
    line-height: 1.5;
    word-break:  break-word;
}

/* ── LOGIN / REGISTRO ────────────────────────────────── */
.ag-auth-page {
    min-height:      100vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         24px 16px;
}

.ag-auth-box { width: 100%; max-width: 400px; }

.ag-auth-logo {
    text-align:    center;
    margin-bottom: 28px;
}

.ag-auth-icon {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           64px;
    height:          64px;
    background:      var(--glow);
    border:          1.5px solid var(--accent);
    border-radius:   16px;
    font-size:       2rem;
    margin-bottom:   12px;
}

.ag-auth-logo h1 {
    font-family:    var(--sans);
    font-size:      1.6rem;
    font-weight:    800;
    letter-spacing: -0.04em;
    color:          var(--accent-lt);
}

.ag-auth-logo p {
    color:      var(--muted);
    font-size:  0.82rem;
    margin-top: 4px;
}

.ag-auth-form {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       28px 24px;
    margin-bottom: 14px;
}

.ag-auth-links {
    display:         flex;
    justify-content: center;
    gap:             16px;
    font-size:       0.78rem;
    color:           var(--muted);
    flex-wrap:       wrap;
    text-align:      center;
}

/* ── PANEL ADMIN ─────────────────────────────────────── */
.ag-admin-title {
    font-family: var(--sans);
    font-size:   1.5rem;
    font-weight: 800;
    color:       var(--hoy);
    margin-bottom: 4px;
}

.ag-admin-sub { font-size: 0.8rem; color: var(--muted); }

.ag-admin-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   16px;
    margin-top:            24px;
}

.ag-user-card {
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    padding:        18px 20px;
    display:        flex;
    flex-direction: column;
    gap:            12px;
    transition:     border-color 0.2s;
}
.ag-user-card:hover { border-color: var(--accent); }

.ag-user-card-header {
    display:     flex;
    align-items: center;
    gap:         12px;
}

.ag-user-card-info h3 {
    font-family: var(--sans);
    font-size:   0.95rem;
    font-weight: 700;
    color:       var(--text);
}

.ag-user-card-info p {
    font-size:  0.72rem;
    color:      var(--muted);
    margin-top: 2px;
}

.ag-stat {
    background:    var(--surface2);
    border:        1px solid var(--border);
    border-radius: 7px;
    padding:       8px 12px;
    flex:          1;
    text-align:    center;
}

.ag-stat-val {
    font-family: var(--sans);
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--accent-lt);
}

.ag-stat-lbl {
    font-size:      0.65rem;
    color:          var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Eventos en panel admin */
.ag-eventos-admin {
    list-style:     none;
    display:        flex;
    flex-direction: column;
    gap:            8px;
    margin-top:     16px;
}

.ag-ev-admin {
    background:    var(--surface2);
    border:        1px solid var(--border);
    border-radius: 8px;
    padding:       10px 14px;
    font-size:     0.82rem;
}

.ag-ev-admin-fecha {
    font-family: var(--sans);
    font-weight: 700;
    color:       var(--accent-lt);
    font-size:   0.78rem;
    margin-bottom: 4px;
}

.ag-ev-row {
    display:     flex;
    gap:         12px;
    align-items: flex-start;
    margin-top:  4px;
}

.ag-ev-hora-mini  { color: var(--accent-lt); font-weight: 700; min-width: 45px; font-size: 0.8rem; }
.ag-ev-desc-mini  { color: var(--text); font-size: 0.8rem; }

.ag-back-admin {
    display:         inline-flex;
    align-items:     center;
    gap:             6px;
    margin-bottom:   20px;
    font-size:       0.82rem;
    color:           var(--muted);
    text-decoration: none;
    border:          1px solid var(--border);
    border-radius:   7px;
    padding:         6px 12px;
    background:      var(--surface2);
    transition:      color 0.2s, border-color 0.2s;
}
.ag-back-admin:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: var(--bg); }
::-webkit-scrollbar-thumb       { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }