* {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --accent-50: #FBF3DD;
    --accent-100: #F3DFA0;
    --accent-200: #E8C96B;
    --accent-400: #D4AF37;
    --accent-600: #B8902A;
    --accent-800: #8C6A1C;
    --accent-900: #5C4612;

    --ink: #141414;
    --ink-muted: #6B7280;
    --surface: #FFFFFF;
    --surface-alt: #F7F6F3;
    --border: #E7E5E0;

    --amber-bg: #FAEEDA;
    --amber-text: #633806;
    --green-bg: #EAF3DE;
    --green-text: #27500A;
    --sky-bg: #E6F1FB;
    --sky-text: #0C447C;
    --red-bg: #FCEBEB;
    --red-text: #791F1F;

    --onyx: #0D0D0D;
}

body {
    background: var(--surface-alt);
    color: var(--ink);
    margin: 0;
    font-size: 15px;
}

/* ============ Sidebar (layout admin) ============ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--onyx);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}

.sidebar .brand .icon-box {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent-400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--onyx);
    font-size: 15px;
}

.sidebar .group-label {
    color: #8A8A8A;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 18px 0 8px;
}

.sidebar .group-label:first-of-type {
    margin-top: 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #CFCFCF;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 3px;
}

.sidebar a:hover {
    background: #222222;
    color: #fff;
}

.sidebar a.active {
    background: var(--accent-400);
    color: var(--onyx);
    font-weight: 500;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #262626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar .sidebar-footer a {
    margin: 0;
    padding: 4px;
    color: #CFCFCF;
}

.avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-400);
    color: var(--onyx);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-content {
    flex: 1;
    padding: 30px 40px;
    max-width: 1300px;
}

/* ============ Barra superior mobile (admin) ============ */
.mobile-admin-topbar {
    display: none;
    background: var(--onyx);
    color: #fff;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.mobile-admin-topbar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.mobile-admin-topbar button {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 90;
}

@media (max-width: 860px) {
    .mobile-admin-topbar { display: flex; }
    .app-shell { flex-direction: column; }
    .sidebar {
        position: fixed; top: 0; left: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 100; width: 250px;
    }
    .sidebar.abierto { transform: translateX(0); }
    .sidebar-overlay.abierto { display: block; }
    .app-content { padding: 18px 16px; max-width: 100%; }
    .grid-2, .grid-3, .grid-main-aside, .grid-tiles-aside { grid-template-columns: 1fr; }
}

/* ============ Grillas reutilizables ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-main-aside { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; }
.grid-tiles-aside { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

.hidden { display: none !important; }

.page-title {
    font-size: 25px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i { color: var(--accent-600); }

/* Tarjetas */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.metric .label { font-size: 13px; color: var(--ink-muted); margin: 0; }
.metric .value { font-size: 28px; font-weight: 600; margin: 4px 0 0; }

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: var(--surface-alt); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: var(--onyx);
    border-color: var(--onyx);
    color: var(--accent-400);
}
.btn-primary:hover { background: #262626; border-color: #262626; }

.btn-danger { background: #fff; border-color: #F0ACAC; color: var(--red-text); }
.btn-danger:hover { background: var(--red-bg); }

.btn-success { background: #fff; border-color: #97C459; color: var(--green-text); }
.btn-success:hover { background: var(--green-bg); }

/* Badges de estado */
.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-pendiente { background: var(--amber-bg); color: var(--amber-text); }
.badge-pagada    { background: var(--green-bg); color: var(--green-text); }
.badge-usada     { background: var(--sky-bg); color: var(--sky-text); }
.badge-anulada   { background: var(--red-bg); color: var(--red-text); }

/* Formularios */
input[type="text"], input[type="number"], input[type="password"],
input[type="file"], select, textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    width: 100%;
    background: var(--surface);
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-400);
    box-shadow: 0 0 0 3px var(--accent-50);
}

label { font-size: 14px; color: var(--ink-muted); display: block; margin-bottom: 5px; }

/* Tabla */
table.datos { width: 100%; border-collapse: collapse; }
table.datos th {
    text-align: left; font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--ink-muted);
    padding: 12px 14px; border-bottom: 1px solid var(--border);
}
table.datos td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }

/* ============ Mobile público (sin login) ============ */
.mobile-topbar {
    background: var(--onyx);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-topbar .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; margin: 0; color: var(--accent-400); }
.mobile-topbar .title { font-size: 18px; font-weight: 600; margin: 2px 0 0; font-family: Georgia, 'Times New Roman', serif; }
.mobile-topbar a { color: #fff; font-size: 13px; text-decoration: none; opacity: 0.9; }

/* ============ Login split-screen ============ */
.login-shell { min-height: 100vh; display: flex; align-items: stretch; justify-content: center; background: var(--surface-alt); }
.login-split { width: 100%; max-width: 760px; margin: auto; display: flex; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.login-left { flex: 1.1; background: var(--onyx); padding: 40px 34px; display: flex; flex-direction: column; justify-content: center; }
.login-left .icon-box { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-400); display: flex; align-items: center; justify-content: center; color: var(--onyx); font-size: 22px; margin-bottom: 14px; }
.login-left .title { color: #fff; font-size: 22px; font-weight: 600; margin: 0; font-family: Georgia, 'Times New Roman', serif; }
.login-left .subtitle { color: #B8B8B8; font-size: 13px; margin: 4px 0 22px; }
.login-left .feature { display: flex; align-items: center; gap: 10px; color: #D8D8D8; font-size: 13px; margin-bottom: 12px; }
.login-left .feature i { color: var(--accent-400); }
.login-right { flex: 1; background: var(--surface); padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; }

/* ============ Stepper / carrito de compra ============ */
.stepper-header { background: var(--onyx); padding: 20px 24px 24px; }
.stepper-dots { display: flex; align-items: center; justify-content: space-between; max-width: 260px; margin: 0 auto; position: relative; }
.stepper-dots::before { content: ''; position: absolute; top: 13px; left: 13px; right: 13px; height: 1px; background: #333; z-index: 0; }
.step-circle { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; z-index: 1; background: #2A2A2A; color: #888; }
.step-circle.done { background: var(--accent-400); color: var(--onyx); }
.step-circle.current { background: #fff; color: var(--onyx); }
.stepper-labels { display: flex; justify-content: space-between; max-width: 260px; margin: 6px auto 0; font-size: 10px; color: #999; }
.stepper-labels .current { color: #fff; font-weight: 500; }

.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.qty-btn.filled { background: var(--onyx); color: var(--accent-400); border-color: var(--onyx); }

.sector-cart-row {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}

.cuenta-pago-card {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
    display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.cuenta-pago-card img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: var(--surface-alt); }
.cuenta-pago-card .logo-placeholder {
    width: 36px; height: 36px; border-radius: 8px; background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 14px; flex-shrink: 0;
}
