/* ============================================================
   Abeja Reina — estilos compartidos (app + portal)
   ============================================================ */
:root {
    --bg-0: #0a0a0f;
    --bg-1: #12121a;
    --bg-2: #1a1a26;
    --bg-3: #232333;
    --border: #2a2a3a;
    --border-strong: #3a3a4d;
    --text-1: #f5f5fa;
    --text-2: #a8a8b8;
    --text-3: #6b6b7d;
    --amber: #f5c518;
    --amber-dim: #c99a13;
    --honey: #ffb627;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --shadow-lg: 0 20px 60px rgba(0,0,0,.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: var(--text-1);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    width: 100%;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245,197,24,.15);
}

/* === Logo === */
.logo-hex {
    background: linear-gradient(135deg, var(--amber), var(--honey));
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.logo-row { display: inline-flex; align-items: center; gap: 12px; }
.logo-row .logo-hex { width: 36px; height: 36px; }
.logo-row .brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

/* === Layout splash === */
.splash {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 30%, #1a1a26 0%, #0a0a0f 100%);
    z-index: 9999;
    transition: opacity .35s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash .logo-hex { width: 96px; height: 96px; box-shadow: 0 0 60px rgba(245,197,24,0.45); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.88; }
}
.splash h1 { margin-top: 24px; font-size: 26px; font-weight: 700; }
.splash p { margin-top: 8px; color: var(--text-2); font-size: 14px; }

/* === Auth screen === */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
    .auth-wrap { grid-template-columns: 1.1fr 1fr; }
}
.auth-side {
    background: radial-gradient(circle at 30% 30%, rgba(245,197,24,.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 80%, rgba(99,102,241,.08) 0%, transparent 60%),
                var(--bg-0);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 40px;
    border-right: 1px solid var(--border);
}
.auth-side h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    max-width: 480px;
    background: linear-gradient(135deg, #fff 0%, #a8a8b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-side p { color: var(--text-2); margin-top: 12px; max-width: 460px; line-height: 1.6; }
.auth-side .features { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.auth-side .feat {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.auth-side .feat .dot {
    width: 8px; height: 8px;
    background: linear-gradient(135deg, var(--amber), var(--honey));
    border-radius: 50%;
}
.auth-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}
.auth-card h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--text-2); margin-top: 6px; margin-bottom: 28px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text-1);
    cursor: pointer;
    transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
    width: 100%;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--amber); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--amber), var(--honey));
    color: #1a1100; border-color: transparent; font-weight: 700;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px rgba(245,197,24,.3); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-ok { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }

.auth-foot {
    margin-top: 28px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
}
.auth-foot a { color: var(--text-2); text-decoration: underline; }

/* === App shell === */
.app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}
.app-side {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.app-side .logo-row { padding: 0 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.nav-section { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(245,197,24,.15), rgba(255,182,39,.05));
    color: var(--amber);
    border: 1px solid rgba(245,197,24,.2);
}
.nav-item .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }

.app-side .user-card {
    margin-top: auto;
    padding: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), var(--honey));
    color: #1a1100;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .role { font-size: 11px; color: var(--text-3); }

.app-main { display: flex; flex-direction: column; }
.app-topbar {
    height: 60px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-0);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.app-topbar h1 { font-size: 16px; font-weight: 600; }
.app-content { padding: 28px; flex: 1; }

/* === Tarjetas dashboard === */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.module-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.module-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.module-card .icon-wrap {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}
.module-card.proyectos .icon-wrap { background: rgba(99,102,241,.15); color: var(--accent); }
.module-card.contenido .icon-wrap { background: rgba(139,92,246,.15); color: var(--accent-2); }
.module-card.ads .icon-wrap { background: rgba(245,197,24,.15); color: var(--amber); }
.module-card h3 { font-size: 17px; font-weight: 700; }
.module-card p { color: var(--text-2); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.module-card .badge {
    position: absolute; top: 14px; right: 14px;
    padding: 3px 9px;
    background: var(--bg-3);
    color: var(--text-3);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.section-title { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 10px; }

.welcome {
    background: linear-gradient(135deg, rgba(245,197,24,.12), rgba(99,102,241,.06));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}
.welcome h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.welcome p { color: var(--text-2); margin-top: 6px; font-size: 14px; }

.empty-state {
    background: var(--bg-1);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 60px 28px;
    text-align: center;
    color: var(--text-3);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-1); font-size: 18px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 380px; margin: 0 auto; }

/* Mobile */
@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-side {
        position: fixed; left: -260px; transition: left .25s ease;
        width: 248px; z-index: 100;
        box-shadow: var(--shadow-lg);
    }
    .app-side.open { left: 0; }
    .menu-btn { background: var(--bg-2); border: 1px solid var(--border); padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-1); }
}
@media (min-width: 769px) {
    .menu-btn { display: none; }
}
