/* 
   OMNES PLATFORM — INTERNATIONAL BLUE EDITION
   Premium deep-navy design system.
   Font: Inter (Google Fonts)
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* ── Deep Navy Surfaces ── */
    --surface-primary:   #060d1f;
    --surface-secondary: #0b1530;
    --surface-tertiary:  #111e40;
    --surface-card:      #0e1a38;
    --surface-input:     #0f1e42;
    --surface-hover:     #162348;

    /* ── Text ── */
    --text-main:       #e8f0ff;
    --text-secondary:  #94aed4;
    --text-muted:      #5a7aaa;
    --text-on-action:  #ffffff;

    /* ── Blue Accent Spectrum ── */
    --blue-50:  #eff6ff;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --electric: #38bdf8;

    --accent-primary:   var(--blue-500);
    --accent-glow:      rgba(59, 130, 246, 0.35);
    --action-gradient:  linear-gradient(135deg, #1d4ed8 0%, #3b82f6 50%, #38bdf8 100%);
    --sidebar-gradient: linear-gradient(180deg, #0b1530 0%, #060d1f 100%);

    /* ── Status ── */
    --success: #22d3a5;
    --warning: #fbbf24;
    --error:   #f87171;

    /* ── Elevation / Glow ── */
    --shadow-sm:   0 2px 12px rgba(0, 0, 0, 0.5);
    --shadow-md:   0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-blue: 0 4px 24px rgba(59, 130, 246, 0.25);
    --glow-btn:    0 0 24px rgba(59, 130, 246, 0.45);

    /* ── Geometry ── */
    --radius-main: 16px;
    --radius-sm:   10px;
    --radius-full: 100px;

    /* ── Layout ── */
    --sidebar-width: 260px;
}

/* ─────────────────────────────────────────── RESET ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html { font-size: 15px; }

body {
    background-color: var(--surface-primary);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ───────────────────────────────────────── SCREENS ── */
.screen         { display: none; height: 100vh; width: 100%; }
.screen.active  { display: block; }

/* ────────────────────────────────────────── LAYOUT ── */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

/* ─────────────────────────────────────────SIDEBAR ── */
.sidebar {
    background: var(--sidebar-gradient);
    border-right: 1px solid rgba(59, 130, 246, 0.12);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    z-index: 10;
    position: relative;
    overflow: hidden;
}

/* Decorative glowing orb behind sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: -80px; left: -80px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.brand-area h1 {
    font-size: 1.45rem;
    background: var(--action-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.sidebar-nav li {
    padding: 0.875rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
}

.sidebar-nav li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    border-radius: 3px;
    background: var(--action-gradient);
    opacity: 0;
    transition: opacity 0.25s;
}

.sidebar-nav li:hover {
    background: var(--surface-hover);
    color: var(--blue-400);
}

.sidebar-nav li.active {
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.25) 0%, rgba(59, 130, 246, 0.12) 100%);
    color: var(--blue-400);
    font-weight: 600;
}

.sidebar-nav li.active::before { opacity: 1; }

/* ─────────────────────────── MAIN CONTENT AREA ── */
.main-content {
    padding: 2.5rem 3rem;
    overflow-y: auto;
    background: var(--surface-primary);
    background-image:
        radial-gradient(ellipse 60% 50% at 80% 10%, rgba(37, 99, 235, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 90%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
}

.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-thumb { background: var(--surface-tertiary); border-radius: 3px; }
.main-content::-webkit-scrollbar-track { background: transparent; }

/* ──────────────────────────── MODULE VIEWS ── */
.module-view         { display: none; }
.module-view.active  { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────── CARDS ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: var(--surface-card);
    padding: 1.75rem;
    border-radius: var(--radius-main);
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--action-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
    border-color: rgba(59, 130, 246, 0.3);
}

.card:hover::after { opacity: 1; }

.card h3 {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.875rem;
}

.card .value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1;
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-main);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    bottom: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.stat-card:hover { box-shadow: var(--shadow-blue); }

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: var(--action-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ──────────────────────────────────── TABLES ── */
.table-container {
    background: var(--surface-card);
    border-radius: var(--radius-main);
    border: 1px solid rgba(59, 130, 246, 0.1);
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

thead tr { }

th {
    text-align: left;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

td {
    padding: 1rem 1.25rem;
    background: var(--surface-tertiary);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: background 0.2s;
}

tr:hover td { background: var(--surface-hover); }

td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
td:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ──────────────────────────────────── BUTTONS ── */
.btn-primary {
    background: var(--action-gradient);
    color: white;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn-primary:hover {
    box-shadow: var(--glow-btn);
    transform: translateY(-1px) scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-icon {
    background: var(--surface-tertiary);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--surface-hover);
    border-color: var(--blue-500);
    transform: scale(1.05);
}

.btn-icon.delete:hover { border-color: var(--error); color: var(--error); }

.btn-expediente {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--blue-400);
}

.btn-expediente:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--blue-400);
}

/* Tab Buttons */
.tab-btn {
    padding: 0.5rem 1.4rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(59, 130, 246, 0.2);
    cursor: pointer;
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s;
}

.tab-btn:hover {
    border-color: var(--blue-500);
    color: var(--blue-400);
}

.tab-btn.active {
    background: var(--action-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-blue);
}

/* Tab Content */
.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ──────────────────────────────────── FORMS ── */
label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

input, select, textarea {
    background: var(--surface-input);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--text-main);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

select option {
    background: var(--surface-secondary);
    color: var(--text-main);
}

/* ────────────────────────────────────── MODALS ── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(3, 7, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: var(--surface-secondary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 2.5rem;
    border-radius: var(--radius-main);
    width: 90%;
    max-width: 820px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.1);
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

/* ───────────────────────────── LOGIN SCREEN ── */
#login-screen {
    background:
        radial-gradient(ellipse 70% 70% at 50% 0%, rgba(29, 78, 216, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 90% 80%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
        var(--surface-primary);
}

#login-screen .card {
    background: rgba(11, 21, 48, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(20px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* ──────────────────────── ACTIVITY FEED ── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.06);
}

.activity-item:last-child { border-bottom: none; }

.activity-type {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.activity-details p { font-size: 0.87rem; color: var(--text-main); }
.activity-details small { color: var(--text-muted); font-size: 0.75rem; }

/* ─────────────────────── HEADINGS ── */
h2 { 
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Detail Items */
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0;
}

.detail-item span {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Chart canvas background */
canvas {
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.15));
}

/* Scrollbar in modal */
.modal-content::-webkit-scrollbar { width: 5px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 3px; }

/* General utility */
hr {
    border: 0;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    margin: 1rem 0;
}