/* ============================================
   OCTOPUS WEB — PREMIUM DESIGN SYSTEM
   ============================================ */

/* === CSS VARIABLES === */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s var(--ease);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #232838;
    --bg-input: #1e2433;
    --bg-sidebar: #0d1117;

    --border: #2a3042;
    --border-focus: #6366f1;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #818cf8;
    --accent-rgb: 129, 140, 248;
    --accent-hover: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;

    --glass-bg: rgba(26, 31, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f1f5f9;
    --bg-sidebar: #1e293b;

    --border: #e2e8f0;
    --border-focus: #6366f1;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent: #6366f1;
    --accent-rgb: 99, 102, 241;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.08);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.08);
    --info: #3b82f6;

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.05);
}

/* === RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

[data-theme="light"] .sidebar {
    color: #f1f5f9;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .empresa-badge span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .empresa-nombre {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    transition: opacity var(--transition), width var(--transition);
}

.logo-accent {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-toggle i {
    transition: transform var(--transition);
}

.empresa-badge {
    margin: 0.75rem 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(129, 140, 248, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    overflow: hidden;
}

.empresa-nombre {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity var(--transition), width var(--transition);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section {
    padding: 0.5rem 0.75rem;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    padding: 0.5rem 0.75rem 0.25rem;
    display: block;
    transition: opacity var(--transition);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    margin: 2px 0;
    position: relative;
}

.nav-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.nav-link span {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition), width var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
    color: var(--accent);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity var(--transition), width var(--transition);
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.7rem;
    color: #64748b;
}

.logout-btn {
    background: rgba(248, 113, 113, 0.1);
    border: none;
    color: #f87171;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* === SIDEBAR OVERLAY (MOBILE) === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.page-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-title .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 0.9rem;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.content-area {
    padding: 1.5rem 2rem 3rem;
}

/* === ALERTS === */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* === KPI GRID === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--accent-glow), transparent);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.kpi-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon.indigo {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
}

.kpi-icon.emerald {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.kpi-icon.amber {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.kpi-icon.rose {
    background: rgba(251, 113, 133, 0.12);
    color: #fb7185;
}

.kpi-info h3 {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === CHART AREA === */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* === TABLES === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.data-table thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: rgba(96, 165, 250, 0.1);
    color: var(--info);
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* === PAGINATION === */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.pagination-wrapper nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-wrapper nav a,
.pagination-wrapper nav span {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.pagination-wrapper nav a {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.pagination-wrapper nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-wrapper nav span[aria-current="page"] span {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

/* === TOOLBAR === */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    position: relative;
}

.search-input i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-input input {
    padding-left: 2.5rem;
    min-width: 280px;
}

/* === FILTERS INLINE === */
.filter-inline {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    max-width: 180px;
}

/* === RECENT ACTIVITY / LIST === */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
}

.activity-text strong {
    font-size: 0.85rem;
}

.activity-text small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-amount {
    font-weight: 700;
    font-size: 0.88rem;
}

/* === PLAN DE CUENTAS TREE === */
.cuenta-nivel-1 {
    font-weight: 800;
    font-size: 0.95rem;
}

.cuenta-nivel-2 {
    padding-left: 1.5rem;
    font-weight: 600;
}

.cuenta-nivel-3 {
    padding-left: 3rem;
}

.cuenta-nivel-4 {
    padding-left: 4.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === MONEDA FORMAT === */
.money {
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
}

.money-positive {
    color: var(--success);
}

.money-negative {
    color: var(--error);
}

/* === ASIENTO DETAIL === */
.asiento-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.asiento-field label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.asiento-field span {
    font-size: 0.95rem;
    font-weight: 600;
}

.totals-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.totals-bar .total-item {
    display: flex;
    flex-direction: column;
}

.totals-bar .total-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.totals-bar .total-value {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* === AUTH PAGES === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .content-area {
        padding: 1rem;
    }

    .top-bar {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input input {
        min-width: 100%;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === SELECTION === */
::selection {
    background: rgba(var(--accent-rgb), 0.3);
    color: var(--text-primary);
}

/* === UTILITIES === */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* --- OCTOPUS 8 MODULAR DASHBOARD --- */
.module-selector {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1.25rem 0.25rem;
    margin-bottom: 1rem;
    scrollbar-width: thin;
}

.module-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-secondary);
}

.module-tab i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.module-tab span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.module-tab:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--text-primary);
}

.module-tab.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

/* Prisma Dashboard Grid */
.prisma-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .prisma-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .prisma-dashboard {
        grid-template-columns: 1fr;
    }
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.column-header {
    background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.column-links {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1.25rem;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.column-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.column-link i {
    width: 24px;
    text-align: center;
    font-size: 1rem;
    color: #06b6d4;
    /* Color cian Prisma */
    transition: all 0.2s ease;
}

.column-link:hover {
    background: rgba(124, 77, 255, 0.08);
    /* Violeta translucido */
    color: var(--text-primary);
    border-color: rgba(124, 77, 255, 0.2);
    transform: translateX(4px);
}

.column-link:hover i {
    color: #7c3aed;
    /* Violeta Prisma */
    transform: scale(1.1);
}