@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Poppins:wght@500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --primary-blue: #007BFF;
    --electric-blue: #00B8FF;
    --brand-yellow: #FFC107;
    --brand-orange: #FF9F2F;
    --brand-black: #070B14;
    --bg-main: #070B14;
    --bg-secondary: #0A1020;
    --bg-card: #0D1426;
    --bg-card-soft: #111B30;
    --border-soft: rgba(255, 255, 255, 0.10);
    --border-blue: rgba(0, 184, 255, 0.35);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-soft: #CBD5E1;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #38BDF8;
    --radius-card: 24px;
    --radius-button: 16px;
    --radius-input: 14px;
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.35);
    --shadow-blue: 0 0 35px rgba(0, 184, 255, 0.35);
    --shadow-yellow: 0 0 35px rgba(255, 193, 7, 0.25);
    --transition-fast: all 0.25s ease;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg-main); color: var(--text-main); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.btn { border: 1px solid var(--border-soft); border-radius: var(--radius-button); display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 46px; padding: .85rem 1.1rem; color: var(--text-main); cursor: pointer; background: rgba(255,255,255,.04); transition: var(--transition-fast); font-weight: 800; }
.btn:hover { transform: translateY(-2px); border-color: var(--border-blue); box-shadow: var(--shadow-blue); }
.btn-primary { border: none; background: linear-gradient(135deg, var(--primary-blue), var(--electric-blue)); box-shadow: var(--shadow-blue); }
.btn-soft { background: rgba(255,255,255,.08); }
.btn-ghost { background: transparent; }
.btn-xl { min-height: 56px; padding-inline: 1.35rem; }
.eyebrow { color: var(--brand-yellow); text-transform: uppercase; letter-spacing: .12em; font-weight: 900; font-size: .78rem; display: inline-flex; gap: .45rem; align-items: center; }
.brand { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.brand img { width: 60px; height: 60px; object-fit: cover; border-radius: 18px; border: 1px solid rgba(255,255,255,.18); background: #fff; }
.brand strong { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 1.2rem; letter-spacing: .06em; display: block; }
.brand small { color: var(--text-muted); display: block; margin-top: .05rem; font-size: .74rem; }
.flash { width: min(1120px, calc(100% - 32px)); margin: 1rem auto 0; border: 1px solid var(--border-soft); border-radius: 18px; padding: .9rem 1rem; background: rgba(255,255,255,.06); color: var(--text-main); }
.flash-success { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); }
.flash-error { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); }
.icon-bubble { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: var(--text-main); background: linear-gradient(135deg, rgba(0,123,255,.25), rgba(0,184,255,.12)); border: 1px solid var(--border-blue); box-shadow: var(--shadow-blue); }
.glass-card, .module-card, .panel-card, .kpi-card, .auth-card, .hero-card { background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); border: 1px solid var(--border-soft); border-radius: var(--radius-card); box-shadow: var(--shadow-soft); backdrop-filter: blur(18px); }
.debug-box { overflow: auto; padding: 1rem; border-radius: 14px; background: rgba(0,0,0,.35); color: var(--brand-yellow); }
@media (max-width: 760px) { .brand small, .public-navlinks { display: none; } .brand img { width: 48px; height: 48px; } }

/* ==========================================================
   Bloque 18 · UI/UX premium global
   ========================================================== */
:root {
    --surface-glass: rgba(255,255,255,.065);
    --surface-glass-strong: rgba(255,255,255,.105);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

::selection { background: rgba(255,193,7,.35); color: var(--text-main); }
:focus-visible { outline: 3px solid rgba(255,193,7,.9); outline-offset: 3px; border-radius: 12px; }
html { -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

.skip-link {
    position: fixed;
    left: 1rem;
    top: -4rem;
    z-index: 9999;
    padding: .85rem 1rem;
    border-radius: 14px;
    background: var(--brand-yellow);
    color: var(--brand-black);
    font-weight: 900;
    box-shadow: var(--shadow-yellow);
    transition: var(--transition-fast);
}
.skip-link:focus { top: 1rem; }

.btn {
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
    transition: transform .58s ease;
}
.btn:hover::after { transform: translateX(120%); }
.btn[disabled], .btn.is-loading { opacity: .62; cursor: wait; transform: none; }
.btn-warning { border: none; background: linear-gradient(135deg, var(--brand-yellow), var(--brand-orange)); color: var(--brand-black); box-shadow: var(--shadow-yellow); }
.btn-danger { border-color: rgba(239,68,68,.36); background: rgba(239,68,68,.13); color: #FECACA; }
.btn-success { border-color: rgba(34,197,94,.36); background: rgba(34,197,94,.13); color: #BBF7D0; }
.btn-icon { width: 46px; min-width: 46px; padding: 0; }

input, select, textarea {
    min-height: 46px;
    caret-color: var(--brand-yellow);
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: rgba(148,163,184,.68); }
input[type='search']::-webkit-search-cancel-button { filter: invert(1); }

.badge,
.status-pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 30px;
    padding: .32rem .68rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,.06);
    color: var(--text-soft);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge .badge-icon,
.status-pill .badge-icon,
.status-badge .badge-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    stroke-width: 2.7;
}
.badge-icon-only {
    width: 34px;
    height: 34px;
    padding: 0;
}
.badge-primary, .status-primary { border-color: rgba(0,184,255,.38); background: rgba(0,184,255,.13); color: #BAE6FD; }
.badge-success, .status-success, .status-active, .status-paid, .status-approved, .status-delivered { border-color: rgba(34,197,94,.38); background: rgba(34,197,94,.13); color: #BBF7D0; }
.badge-warning, .status-warning, .status-pending, .status-partial, .status-prepared { border-color: rgba(245,158,11,.42); background: rgba(245,158,11,.13); color: #FDE68A; }
.badge-danger, .status-danger, .status-cancelled, .status-overdue, .status-inactive, .status-rejected { border-color: rgba(239,68,68,.42); background: rgba(239,68,68,.13); color: #FECACA; }
.badge-muted, .status-muted, .status-draft { color: var(--text-muted); }

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    gap: .75rem;
    min-height: 220px;
    border: 1px dashed rgba(255,255,255,.18);
    border-radius: var(--radius-card);
    background: rgba(255,255,255,.035);
    color: var(--text-muted);
    padding: 1.5rem;
}
.empty-state i { width: 44px; height: 44px; color: var(--brand-yellow); }

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    border-radius: 14px;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
    animation: mirutaSkeleton 1.25s infinite;
}
@keyframes mirutaSkeleton { to { transform: translateX(100%); } }

.toast-stack {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + var(--safe-bottom));
    display: grid;
    gap: .65rem;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    max-width: min(360px, calc(100vw - 2rem));
    border: 1px solid var(--border-blue);
    border-radius: 18px;
    background: rgba(7,11,20,.94);
    color: var(--text-main);
    box-shadow: var(--shadow-blue);
    padding: .9rem 1rem;
    font-weight: 800;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 720px) {
    .btn { min-height: 50px; width: 100%; }
    .btn-icon { width: 50px; min-width: 50px; }
    .module-actions .btn, .hero-actions .btn, .public-actions .btn { width: auto; }
    .flash { width: calc(100% - 24px); }
}

/* Bloque 22.1 · Corrección visual de logo MIRUTA */
.brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
    padding: .38rem;
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.brand strong { letter-spacing: .05em; }
@media (max-width: 760px) {
    .brand img { width: 46px; height: 46px; border-radius: 14px; padding: .3rem; }
}
