/* ═══════════════════════════════════════════════════════════════
   ANDRÓMEDA ADMIN — DESIGN SYSTEM
   Paleta: #DDDCDB · #FD7B41 · #EDBF9B · #3C4044
   Tipografía: Syne (display) + DM Sans (body)
═══════════════════════════════════════════════════════════════ */

:root {
  --sand:    #DDDCDB;
  --flame:   #FD7B41;
  --peach:   #EDBF9B;
  --charcoal:#3C4044;
  --bg:      #1e2124;
  --surface: #252a2e;
  --surface2:#2d3236;
  --border:  rgba(221,220,219,0.1);
  --text:    #DDDCDB;
  --text-dim:#8a9099;
  --radius:  12px;
  --radius-sm:8px;
  --shadow:  0 4px 24px rgba(0,0,0,0.4);
}

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

body { font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }

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

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: 240px; min-height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 20px; border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 28px; color: var(--flame); line-height: 1; flex-shrink: 0; }
.brand-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 14px; letter-spacing: .12em; color: var(--sand); }
.brand-sub  { font-size: 11px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); text-decoration: none;
  font-size: 14px; font-weight: 400; letter-spacing: .01em;
  transition: all .2s;
}
.nav-item:hover { background: var(--surface2); color: var(--sand); }
.nav-item.active { background: rgba(253,123,65,.15); color: var(--flame); font-weight: 500; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--flame);
  color: #fff; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-email { font-size: 12px; color: var(--sand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text-dim); }
.logout-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 14px; transition: all .2s; flex-shrink: 0;
}
.logout-btn:hover { border-color: var(--flame); color: var(--flame); }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  margin-left: 240px; flex: 1; padding: 32px 36px;
  min-height: 100vh; background: var(--bg);
}

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.page-title  { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 28px; color: var(--sand); letter-spacing: -.02em; }
.page-desc   { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.page-date   { font-size: 13px; color: var(--text-dim); margin-top: 8px; text-transform: capitalize; }

.back-link { font-size: 13px; color: var(--text-dim); text-decoration: none; display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--flame); }

/* ── KPI CARDS ──────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }

.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  transition: transform .2s, border-color .2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(221,220,219,0.2); }

.kpi-primary { border-left: 3px solid var(--flame); }
.kpi-accent  { border-left: 3px solid var(--peach); }

.kpi-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.kpi-value { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 26px; color: var(--sand); }
.kpi-primary .kpi-value { color: var(--flame); }
.kpi-accent .kpi-value  { color: var(--peach); }
.kpi-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ── DASHBOARD GRID ─────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
@media(max-width:1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-header { margin-bottom: 20px; }
.card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; color: var(--sand); }
.chart-card .chart-wrap { height: 280px; }

.top-events { display: flex; flex-direction: column; gap: 12px; }
.top-event-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; background: var(--surface2); }
.rank-badge { width: 26px; height: 26px; border-radius: 50%; background: var(--flame); color: #fff; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.event-info { flex: 1; min-width: 0; }
.event-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.event-revenue { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; color: var(--peach); flex-shrink: 0; }
.empty-text { color: var(--text-dim); font-size: 13px; }

/* ── EVENTS GRID ────────────────────────────────────────────── */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 32px; }

.event-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.event-card:hover { transform: translateY(-3px); border-color: rgba(253,123,65,.3); }
.event-card.inactive { opacity: .6; }

.event-poster { position: relative; height: 180px; background: var(--surface2); overflow: hidden; }
.event-poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 48px; color: var(--text-dim); }

.event-type-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(60,64,68,.85); backdrop-filter: blur(4px);
  color: var(--sand); font-size: 11px; padding: 3px 8px;
  border-radius: 20px; font-weight: 500;
}
.event-status {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 600;
}
.status-active   { background: rgba(253,123,65,.2); color: var(--flame); }
.status-inactive { background: rgba(221,220,219,.1); color: var(--text-dim); }

.event-body  { padding: 16px; flex: 1; }
.event-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; color: var(--sand); margin-bottom: 6px; }
.event-venue, .event-duration { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.event-desc  { font-size: 13px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

.event-actions { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* ── FILTER BAR ─────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 24px; }
.filter-pill {
  padding: 6px 16px; border-radius: 20px; font-size: 13px;
  color: var(--text-dim); text-decoration: none; border: 1px solid var(--border);
  transition: all .2s;
}
.filter-pill:hover  { border-color: var(--flame); color: var(--flame); }
.filter-pill.active { background: var(--flame); color: #fff; border-color: var(--flame); }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--surface2); padding: 12px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(253,123,65,.04); }

.font-medium { font-weight: 500; color: var(--sand); }
.text-muted  { color: var(--text-dim); font-size: 13px; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active   { background: rgba(253,123,65,.15); color: var(--flame); }
.badge-inactive { background: rgba(221,220,219,.1);  color: var(--text-dim); }
.badge-soldout  { background: rgba(237,191,155,.15); color: var(--peach); }
.badge-neutral  { background: rgba(221,220,219,.1);  color: var(--sand); }

.seat-counter { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--flame); color: #fff; border: none;
  padding: 10px 22px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block;
  transition: all .2s; font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover { background: #e8682d; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(253,123,65,.35); }

.btn-secondary {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); padding: 10px 22px;
  border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-block; transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-secondary:hover { border-color: var(--sand); color: var(--sand); }

.btn-outline {
  background: transparent; color: var(--flame);
  border: 1px solid var(--flame); padding: 8px 18px;
  border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  transition: all .2s; font-family: 'DM Sans', sans-serif;
}
.btn-outline:hover { background: rgba(253,123,65,.1); }

.btn-sm { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; }
.btn-edit   { background: rgba(237,191,155,.15); color: var(--peach); text-decoration: none; display: inline-block; }
.btn-edit:hover { background: rgba(237,191,155,.25); }
.btn-delete { background: rgba(231,76,60,.15); color: #e74c3c; }
.btn-delete:hover { background: rgba(231,76,60,.25); }

/* ── FORM CARD ──────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; max-width: 760px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.span-2 { grid-column: span 2; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--sand); text-transform: uppercase; letter-spacing: .07em; }
.field-input {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--sand); padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'DM Sans', sans-serif; width: 100%;
  transition: border-color .2s;
}
.field-input:focus { outline: none; border-color: var(--flame); }
.field-input::placeholder { color: var(--text-dim); }
.field-input option { background: var(--surface2); }
.field-textarea { min-height: 100px; resize: vertical; }
.field-hint { font-size: 12px; color: var(--text-dim); }
.field-hint a { color: var(--peach); }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.form-error-banner { background: rgba(231,76,60,.15); border: 1px solid rgba(231,76,60,.3); color: #e74c3c; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }

.section-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; margin: 24px 0 16px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── SEAT BUILDER ───────────────────────────────────────────── */
.seat-builder { margin-bottom: 16px; }
#rowList { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.seat-row-builder { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 13px; color: var(--text-dim);
  border: 1px solid var(--border); transition: all .2s;
}
.page-btn:hover  { border-color: var(--flame); color: var(--flame); }
.page-btn.active { background: var(--flame); color: #fff; border-color: var(--flame); }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; color: var(--sand); }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; transition: color .2s; }
.modal-close:hover { color: var(--sand); }
.modal-box .field-group { margin-bottom: 16px; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  animation: slideIn .3s ease, fadeOut .5s ease 3.5s forwards;
}
.toast-success { background: rgba(39,174,96,.2); border: 1px solid rgba(39,174,96,.4); color: #2ecc71; }
.toast-error   { background: rgba(231,76,60,.2);  border: 1px solid rgba(231,76,60,.4);  color: #e74c3c; }
@keyframes slideIn  { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut  { to { opacity: 0; pointer-events: none; } }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state a { color: var(--flame); }

/* ── ROLES GRID ─────────────────────────────────────────────── */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 20px; margin-bottom: 32px; }
.role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.role-icon { font-size: 32px; margin-bottom: 12px; }
.role-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; color: var(--sand); margin-bottom: 8px; }
.role-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }
.role-perms { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.role-perms li { font-size: 13px; color: var(--text-dim); }
.role-perms li:first-of-type,
.role-perms li:nth-of-type(2) { color: var(--sand); }

/* ══ LOGIN PAGE ══════════════════════════════════════════════ */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); position: relative; overflow: hidden; }

.login-bg { position: fixed; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: .25;
}
.orb1 { width: 500px; height: 500px; background: var(--flame); top: -150px; right: -100px; }
.orb2 { width: 400px; height: 400px; background: var(--peach);  bottom: -100px; left: -100px; }
.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(221,220,219,.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(221,220,219,.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-container {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 44px; box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.login-brand { text-align: center; margin-bottom: 36px; }
.login-icon  { font-size: 48px; color: var(--flame); display: block; margin-bottom: 12px; }
.login-title {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 26px;
  letter-spacing: .15em; color: var(--sand);
}
.login-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; letter-spacing: .05em; }

.login-error { background: rgba(231,76,60,.15); border: 1px solid rgba(231,76,60,.3); color: #e74c3c; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 20px; text-align: center; }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-btn {
  background: var(--flame); color: #fff; border: none;
  padding: 13px; border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px;
  letter-spacing: .05em; cursor: pointer; margin-top: 8px;
  transition: all .25s;
}
.login-btn:hover { background: #e8682d; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(253,123,65,.4); }
.login-footer { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 32px; }
