/**
 * SOPMEX JSON Validador - Estilos principales
 * Diseño limpio y moderno
 */

/* === Variables CSS === */
:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #0ea5e9;
    --brand-ink: #0369a1;
    --good: #16a34a;
    --warn: #f59e0b;
    --bad: #dc2626;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(2,6,23,.12);
    --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif;
}

/* === Reset básico === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */
.container { max-width: 1100px; margin: 18px auto; padding: 0 16px; }

/* === Header === */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header .bar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}

.brand .logo,
.brand-logo {
    height: 38px;
    width: auto;
    border-radius: 10px;
}

.brand span { color: var(--muted); font-size: .9rem; margin-left: 4px; }

/* Nav */
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background .15s ease;
}
.nav a:hover { background: #f1f5f9; }
.nav a.active { background: var(--brand); color: #fff; }

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown > a {
    cursor: pointer;
}
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}
.nav-dropdown-content a {
    display: block;
    padding: 10px 14px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
}
.nav-dropdown-content a:last-child {
    border-bottom: none;
}
.nav-dropdown-content a:hover {
    background: #f1f5f9;
}
.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

/* === Cards === */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

/* === Botones === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 12px;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
    font-size: inherit;
    transition: filter .15s ease, transform .15s ease;
}
.btn:hover { background: #f1f5f9; }
.btn:focus { outline: 3px solid #bae6fd; outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(59,130,246,.2);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.btn-full, .btn-block { width: 100%; }

/* === Formularios === */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .92rem; color: var(--muted); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: .8rem .9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: inherit;
}
.field input::placeholder { color: #94a3b8; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

/* === Pills / Status === */
.pill {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
}
.pill.ok { background: var(--good); }
.pill.warn { background: var(--warn); }
.pill.bad { background: var(--bad); }

/* === Tablas === */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
thead th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    font-weight: 700;
}
tbody tr:hover { background: #f8fafc; }
td.num { text-align: right; }
td.mono, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}
td.actions { white-space: nowrap; }

/* === Footer === */
.footer {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 16px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* === Tipografía === */
h1, h2, h3 { margin: 0 0 12px 0; }
.muted { color: var(--muted); }
.link { color: var(--brand-ink); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* === Auth Pages === */
.auth-bg {
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 20% -10%, rgba(66,133,244,.15), transparent 60%),
        radial-gradient(1200px 700px at 120% 10%, rgba(16,185,129,.12), transparent 62%),
        linear-gradient(180deg, #0b1020, #111a3a 40%, #1a2b5c);
    color: #e9eef8;
}

.auth-wrapper {
    display: grid;
    place-items: center;
    padding: clamp(24px, 4vw, 48px) 16px 48px;
}

.auth-card {
    width: min(460px, 100%);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.auth-brand { text-align: center; margin-bottom: 10px; }
.auth-logo {
    width: 84px;
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.35));
    margin-bottom: 10px;
}
.auth-title { font-size: 1.6rem; margin: 6px 0 0 0; color: #f5f8ff; font-weight: 700; }
.auth-subtitle { margin: 6px 0 0 0; color: #c6d2ee; font-size: .98rem; }

.auth-form { margin-top: 14px; display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-label { color: #c8d4ef; font-size: .9rem; }
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    color: #f1f5ff;
    outline: none;
    font-size: inherit;
}
.auth-field input::placeholder { color: #9fb0d6; }
.auth-field input:focus {
    border-color: rgba(99,179,237,.65);
    box-shadow: 0 0 0 3px rgba(99,179,237,.18);
}

.auth-password { position: relative; display: grid; }
.auth-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    color: #d3def8;
    opacity: .85;
}
.auth-eye:hover { opacity: 1; }

.auth-links { margin-top: 6px; text-align: center; color: #b8c7ea; font-size: .95rem; }
.auth-links .link { color: #9bc0ff; text-decoration: none; }
.auth-links .link:hover { text-decoration: underline; }
.auth-links .sep { margin: 0 8px; opacity: .6; }

.auth-footnote { text-align: center; color: #98a9cc; font-size: .85rem; margin-top: 6px; }
.auth-footer { text-align: center; padding: 18px; color: #a9b8db; font-size: .9rem; }

/* === Responsive === */
@media (max-width: 768px) {
    .app-header .bar { flex-wrap: wrap; }
    .nav { width: 100%; justify-content: center; margin-top: 8px; }
    table { font-size: 13px; }
}

/* === Utilities === */
.hidden { display: none !important; }
