/* ============================================================
   SISTEMA DE DISEÑO ZULUETA — Base reutilizable
   Extraído de "Reserva PC Productivo" (Material 3 inspired).
   Copia este archivo a cada sistema nuevo para mantener
   consistencia visual entre plataformas.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== TOKENS DE DISEÑO ===== */
:root {
    /* Marca */
    --primary: #1e3a8a;
    --primary-dark: #1e293b;
    --primary-light: #3b82f6;
    --accent: #3b82f6;
    --accent-light: #60a5fa;

    /* Semánticos */
    --success: #059669;
    --success-light: #10b981;
    --warning: #d97706;
    --warning-light: #f59e0b;
    --danger: #dc2626;
    --danger-light: #ef4444;

    /* Superficies y fondos */
    --bg: #f1f5f9;
    --bg-soft: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f8faff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Texto */
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    /* Radios */
    --radius: 10px;
    --radius-sm: 7px;
    --radius-lg: 14px;

    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
    --shadow-lg: 0 12px 24px -8px rgba(15,23,42,0.12), 0 4px 8px rgba(15,23,42,0.06);
    --shadow: var(--shadow-sm);

    /* Curva de animación */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 0% 0%, rgba(59,130,246,0.04), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16,185,129,0.04), transparent 50%),
        var(--bg);
    color: var(--text); line-height: 1.5; font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    padding: 0 1.5rem; height: 60px;
    display: flex; align-items: center;
    box-shadow: 0 1px 3px rgba(15,23,42,0.12);
    position: sticky; top: 0; z-index: 50;
}
.navbar-container { max-width: 1400px; margin: 0 auto; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { color: white; text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 0.65rem; }
.logo .logo-badge { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.14); border-radius: 9px; color: white; transition: background 0.2s var(--ease); }
.logo:hover .logo-badge { background: rgba(255,255,255,0.22); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a, .nav-links span { color: rgba(255,255,255,0.78); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.15s var(--ease); }
.nav-links a:hover { color: white; }

/* ===== LAYOUT ===== */
.main-container { max-width: 1400px; margin: 0 auto; padding: 1.75rem 1.5rem; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ===== SECTION TITLE ===== */
.section-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 1.75rem 0 0.85rem; }

/* ===== MAIN TABS (pill) ===== */
.main-tabs { display: flex; gap: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; overflow: hidden; box-shadow: var(--shadow-sm); padding: 4px; }
.main-tab { flex: 1; padding: 0.75rem 1rem; text-align: center; text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.85rem; transition: all 0.2s var(--ease); border-radius: var(--radius-sm); }
.main-tab:hover { background: var(--surface-hover); color: var(--text); }
.main-tab.active { background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%); color: white; font-weight: 600; box-shadow: 0 2px 6px rgba(30,58,138,0.25); }

/* ===== TABS (underline) ===== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { padding: 0.625rem 1rem; background: none; border: none; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== ALERTS ===== */
.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.875rem; border-left: 4px solid; box-shadow: var(--shadow-xs); }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #10b981; border-left-color: #10b981; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #ef4444; border-left-color: #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; border-left-color: #f59e0b; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; font-family: inherit; border: none; cursor: pointer; transition: all 0.18s var(--ease); text-decoration: none; box-shadow: var(--shadow-xs); letter-spacing: -0.005em; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%); color: white; box-shadow: 0 1px 2px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover { background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-success { background: linear-gradient(180deg, #10b981 0%, #059669 100%); color: white; box-shadow: 0 1px 2px rgba(16,185,129,0.3); }
.btn-success:hover { background: linear-gradient(180deg, #059669 0%, #047857 100%); }
.btn-danger { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: white; box-shadow: 0 1px 2px rgba(239,68,68,0.3); }
.btn-danger:hover { background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.3); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; letter-spacing: -0.005em; }
.form-input, .form-select { width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.9rem; background: white; font-family: inherit; transition: all 0.15s var(--ease); }
.form-input:hover, .form-select:hover { border-color: #94a3b8; }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

/* ===== CARDS ===== */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 1.25rem; overflow: hidden; transition: box-shadow 0.2s var(--ease); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-soft); }
.card-header h2, .card-header h3 { font-size: 0.95rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: var(--text); }
.card-body { padding: 1.15rem; }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ===== CHIPS ===== */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 32px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.85rem; background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); border: 1px solid #93c5fd; border-radius: 999px; font-size: 0.78rem; color: #1e40af; font-weight: 600; box-shadow: 0 1px 2px rgba(37,99,235,0.1); }
.chip button { background: none; border: none; color: #1e3a8a; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0.15rem; border-radius: 50%; transition: all 0.15s var(--ease); }
.chip button:hover { background: rgba(30,58,138,0.15); color: var(--danger); transform: scale(1.1); }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 700; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1.5px solid var(--border-strong); }
tbody tr { transition: background 0.12s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; animation: fadeIn 0.18s var(--ease); }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); width: 100%; max-width: 420px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35), 0 8px 16px -4px rgba(0,0,0,0.12); animation: modalIn 0.22s var(--ease); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-soft); flex-shrink: 0; }
.modal-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.modal-close { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 50%; transition: all 0.15s var(--ease); }
.modal-close:hover { background: #fee2e2; color: var(--danger); }
.modal-body { padding: 1.15rem 1.35rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-footer { padding: 0.85rem 1.35rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.6rem; background: var(--surface); flex-shrink: 0; box-shadow: 0 -4px 12px -4px rgba(15,23,42,0.12); }
.modal-footer .btn { min-width: 110px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .icon-svg { width: 72px; height: 72px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border-radius: 18px; color: var(--text-soft); }
.empty-state p { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }

/* ===== AUTH ===== */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.auth-card { background: white; border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); }
.auth-title { font-size: 1.25rem; font-weight: 600; text-align: center; margin-bottom: 0.375rem; color: var(--primary); }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.25rem; font-size: 0.875rem; }

/* ===== ANIMACIONES ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .navbar-container { flex-direction: column; gap: 0.5rem; padding: 0.5rem 0; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .main-tabs { flex-direction: column; }
}

/* ===== UTILIDADES ===== */
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
