/* ===================================================================
   Panel Sanet TV - Tokens de diseño
   Paleta oficial extraída de Theme.swift (app Mac SanetTV)
   =================================================================== */

:root {
    /* === MARCA SANET (oficial) === */
    --sanet-blue:        #1E6BFF;
    --sanet-blue-bright: #3D8BFF;
    --sanet-blue-deep:   #0A3FAA;
    --sanet-blue-glow:   rgba(30, 107, 255, 0.55);

    /* === FONDOS === */
    --bg-0:    #000000;
    --bg-1:    #0A0A0E;
    --bg-2:    #14141C;
    --bg-3:    #1E1E2A;
    --bg-card: rgba(20, 20, 28, 0.55);

    /* === TEXTO === */
    --text-1: #FFFFFF;
    --text-2: #C9CDD6;
    --text-3: #6B7280;

    /* === BORDES === */
    --border-soft:  rgba(255, 255, 255, 0.10);
    --border-mid:   rgba(255, 255, 255, 0.18);
    --border-focus: rgba(61, 139, 255, 0.95);

    /* === ESTADOS === */
    --success: #22C55E;
    --warning: #F59E0B;
    --error:   #FF6B6B;
    --live:    #FF3B5C;

    /* === RADIOS === */
    --radius-card:  24px;
    --radius-input: 14px;
    --radius-tile:  16px;
    --radius-pill:  999px;

    /* === SOMBRAS === */
    --shadow-card: 0 20px 30px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 24px var(--sanet-blue-glow);

    /* === LAYOUT === */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --content-padding: 24px;
}

/* ===================================================================
   TEMA CLARO (alternativo, switch desde topbar)
   =================================================================== */

[data-theme="light"] {
    --bg-0: #F4F6FA;
    --bg-1: #FFFFFF;
    --bg-2: #FFFFFF;
    --bg-3: #F0F2F7;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-1: #0A0A0E;
    --text-2: #4B5563;
    --text-3: #9CA3AF;
    --border-soft: rgba(0, 0, 0, 0.06);
    --border-mid: rgba(0, 0, 0, 0.12);
}

/* ===================================================================
   RESET + BASE
   =================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-1);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Tipografía accent (uppercase tracked - como Rajdhani) */
.accent {
    font-family: 'Rajdhani', 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ===================================================================
   FONDO BASE CON GRADIENTE RADIAL AZUL
   (replica SanetBackground del Mac)
   =================================================================== */

body {
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at top,
        rgba(30, 107, 255, 0.18) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] body::before {
    background: radial-gradient(
        ellipse at top,
        rgba(30, 107, 255, 0.08) 0%,
        transparent 60%
    );
}

/* ===================================================================
   COMPONENTES GENERALES
   =================================================================== */

/* GlassCard (replica del Mac GlassCard) */
.glass-card {
    background: linear-gradient(
        to bottom,
        rgba(20, 20, 28, 0.65),
        rgba(10, 10, 14, 0.78)
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card);
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.20) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(30, 107, 255, 0.30) 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-input);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--sanet-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 107, 255, 0.35);
}

.btn-primary:hover {
    background: var(--sanet-blue-bright);
    box-shadow: 0 6px 16px rgba(30, 107, 255, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-2);
    color: var(--text-1);
    border: 1px solid var(--border-mid);
}

.btn-secondary:hover {
    background: var(--bg-3);
    border-color: var(--border-focus);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
}

/* Inputs */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-input);
    color: var(--text-1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="light"] .input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: white;
    border-color: var(--border-mid);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.15);
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
}

/* Tablas */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-input);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    text-align: left;
    padding: 14px 18px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-soft);
}

table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-1);
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Pills / Badges */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
}

.pill-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.pill-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.pill-error   { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.pill-info    { background: rgba(30, 107, 255, 0.15); color: var(--sanet-blue-bright); }
.pill-live    { background: rgba(255, 59, 92, 0.15); color: var(--live); }

/* Scrollbar custom */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--sanet-blue); }

/* Utilidades */
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-3); }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
