/* === THALASSA RECEIPTS — OCEAN DESIGN SYSTEM === */

:root {
    /* Paleta Marina: Azul Celeste + Fondos Marinos */
    --ocean-abyss: #0a1628;
    --ocean-deep: #0d2137;
    --ocean-mid: #132d46;
    --ocean-surface: #1a3a5c;
    --ocean-shallow: #1e4976;
    
    --sky-light: #7ec8e3;
    --sky-bright: #58b4d1;
    --sky-vivid: #00b4d8;
    --sky-accent: #48cae4;
    --sky-pale: #ade8f4;
    --sky-wash: #caf0f8;
    
    --foam-white: #e8f4f8;
    --foam-pure: #f0f9ff;
    
    --coral-warm: #ff6b6b;
    --coral-soft: #ffa07a;
    --seaweed-green: #2dd4a8;
    --seaweed-dark: #20b090;
    --sand-gold: #ffd166;
    --sand-warm: #f4a261;
    --pearl-pink: #f8a4c8;
    
    /* Texto */
    --text-primary: #e8f4f8;
    --text-secondary: rgba(173, 232, 244, 0.7);
    --text-muted: rgba(126, 200, 227, 0.5);
    --text-on-light: #0d2137;
    
    /* Superficies */
    --surface-glass: rgba(13, 33, 55, 0.6);
    --surface-glass-hover: rgba(13, 33, 55, 0.75);
    --surface-card: rgba(19, 45, 70, 0.5);
    --surface-card-hover: rgba(26, 58, 92, 0.6);
    --surface-input: rgba(10, 22, 40, 0.5);
    --surface-input-focus: rgba(10, 22, 40, 0.7);
    
    /* Bordes */
    --border-subtle: rgba(126, 200, 227, 0.08);
    --border-light: rgba(126, 200, 227, 0.15);
    --border-active: rgba(72, 202, 228, 0.4);
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(72, 202, 228, 0.15);
    
    /* Tipografía */
    --font-family: 'Outfit', sans-serif;
    
    /* Bordes redondeados */
    --radius-full: 9999px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(160deg, var(--ocean-abyss) 0%, var(--ocean-deep) 30%, var(--ocean-mid) 70%, var(--ocean-surface) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated ocean background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(72, 202, 228, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 180, 216, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(45, 212, 168, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* === LAYOUT PRINCIPAL === */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--sky-vivid), var(--sky-bright));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo-text h1 span {
    color: var(--sky-accent);
}

.logo-text p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--sky-accent);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(126, 200, 227, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(72, 202, 228, 0.12);
    color: var(--sky-accent);
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 16px;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-footer .nav-item {
    font-size: 13px;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
    min-height: 100vh;
    transition: var(--transition);
}

/* === SECTIONS (Pages) === */
.section {
    display: none;
    animation: fadeInSection 0.4s ease;
}

.section.active {
    display: block;
}

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

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-title h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.section-title p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === KPI CARDS === */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sky-accent), transparent);
    opacity: 0;
    transition: var(--transition);
}

.kpi-card:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* ===== AUTH SCREEN ===== */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    padding: 20px;
}

.lock-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    color: white;
}

.lock-logo {
    text-align: center;
    margin-bottom: 30px;
}

.lock-icon {
    background: rgba(255,255,255,0.1);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.lock-logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.lock-logo h1 span {
    color: var(--teal-light);
    font-weight: 300;
}

.lock-logo p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-tab.active {
    background: rgba(255,255,255,0.15);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lock-card .form-group {
    margin-bottom: 20px;
}

.lock-card label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
    font-weight: 500;
}

.lock-card input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.lock-card input:focus {
    background: rgba(0,0,0,0.3);
    border-color: var(--teal-light);
}

.lock-card input::placeholder {
    color: rgba(255,255,255,0.3);
}

.lock-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 16px;
    min-height: 18px;
    text-align: center;
}

.lock-info {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
    background: rgba(0,0,0,0.1);
    padding: 12px;
    border-radius: 12px;
}

.kpi-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-wrapper.blue {
    background: rgba(72, 202, 228, 0.15);
    color: var(--sky-accent);
}

.kpi-icon-wrapper.green {
    background: rgba(45, 212, 168, 0.15);
    color: var(--seaweed-green);
}

.kpi-icon-wrapper.gold {
    background: rgba(255, 209, 102, 0.15);
    color: var(--sand-gold);
}

.kpi-icon-wrapper.coral {
    background: rgba(255, 107, 107, 0.15);
    color: var(--coral-warm);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sky-vivid), var(--sky-bright));
    color: white;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--surface-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--surface-glass-hover);
    border-color: var(--border-active);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--coral-warm);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: var(--coral-warm);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 14px;
}

.btn-ghost:hover {
    background: rgba(126, 200, 227, 0.08);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* === SEARCH BAR === */
.search-bar {
    position: relative;
    max-width: 400px;
    flex: 1;
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
    transition: var(--transition);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--border-active);
    background: var(--surface-input-focus);
    box-shadow: 0 0 0 3px rgba(72, 202, 228, 0.1);
}

.search-bar input:focus + svg {
    color: var(--sky-accent);
}

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar select {
    padding: 10px 14px;
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--border-active);
}

.filter-bar select option {
    background: var(--ocean-deep);
    color: var(--text-primary);
}

.filter-bar input[type="month"] {
    padding: 10px 14px;
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    color-scheme: dark;
}

.filter-bar input[type="month"]:focus {
    outline: none;
    border-color: var(--border-active);
}

/* === RECEIPT CARDS === */
.receipts-grid {
    display: grid;
    gap: 16px;
}

.receipt-card {
    background: var(--surface-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.receipt-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--sky-accent), var(--seaweed-green));
    opacity: 0;
    transition: var(--transition);
}

.receipt-card:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.receipt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.receipt-store-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--sky-vivid), var(--seaweed-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.store-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.receipt-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.receipt-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--sky-accent);
}

.receipt-products-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.product-chip {
    background: rgba(126, 200, 227, 0.08);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-chip.more {
    background: rgba(72, 202, 228, 0.1);
    color: var(--sky-accent);
    font-weight: 600;
}

.receipt-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.receipt-items-count {
    font-size: 12px;
    color: var(--text-muted);
}

.receipt-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(126, 200, 227, 0.1);
    color: var(--sky-accent);
}

.btn-icon.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--coral-warm);
}

/* === PRODUCTS TABLE === */
.products-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.products-table thead {
    background: rgba(126, 200, 227, 0.06);
}

.products-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.products-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.products-table tbody tr {
    transition: var(--transition-fast);
}

.products-table tbody tr:hover {
    background: rgba(126, 200, 227, 0.04);
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.products-table .text-right {
    text-align: right;
}

.products-table .text-center {
    text-align: center;
}

.products-table .total-row {
    background: rgba(72, 202, 228, 0.08);
    font-weight: 700;
}

.products-table .total-row td {
    border-bottom: none;
    color: var(--sky-accent);
}

/* Editable cells in review modal */
.products-table input {
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    transition: var(--transition-fast);
}

.products-table input:focus {
    outline: none;
    border-color: var(--border-active);
}

.products-table input[type="number"] {
    width: 80px;
}

.btn-remove-row {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-remove-row:hover {
    color: var(--coral-warm);
    background: rgba(255, 107, 107, 0.1);
}

/* === SHOPPING LIST === */
.shopping-list-grid {
    display: grid;
    gap: 12px;
}

.shopping-item {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.shopping-item:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-light);
}

.shopping-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shopping-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.shopping-item-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.shopping-item-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shopping-item-total {
    text-align: right;
}

.shopping-item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--sky-accent);
}

.shopping-item-frequency {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* === CHARTS (CSS-only bar charts) === */
.chart-container {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title svg {
    color: var(--sky-accent);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 120px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: rgba(126, 200, 227, 0.06);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--sky-vivid), var(--sky-accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: fit-content;
}

.bar-fill.green {
    background: linear-gradient(90deg, var(--seaweed-dark), var(--seaweed-green));
}

.bar-fill.gold {
    background: linear-gradient(90deg, var(--sand-warm), var(--sand-gold));
}

.bar-fill.coral {
    background: linear-gradient(90deg, var(--coral-warm), var(--coral-soft));
}

.bar-value {
    font-size: 11px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* Two-column chart layout */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* === SUMMARY CARDS for Reports === */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.summary-card .summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--sky-accent);
    line-height: 1.2;
}

.summary-card .summary-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.summary-card .summary-change {
    font-size: 11px;
    margin-top: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.summary-card .summary-change.up {
    color: var(--seaweed-green);
}

.summary-card .summary-change.down {
    color: var(--coral-warm);
}

/* === CATEGORY SUMMARY CARDS (Products) === */
.category-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.category-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.category-card.cat-peluqueria::before { background: var(--sand-gold); }
.category-card.cat-estetica::before { background: var(--coral-soft); }
.category-card.cat-general::before { background: var(--sky-accent); }
.category-card.cat-sin-asignar::before { background: var(--text-muted); }

.category-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.category-card-amount {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-card-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* Category Select Dropdown */
.category-select {
    background: var(--surface-input);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    width: 140px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    outline: none;
}

.category-select:hover, .category-select:focus {
    border-color: var(--border-active);
}

.category-select option {
    background: var(--ocean-deep);
    color: var(--text-primary);
}

/* === PRODUCT DETAIL TABLE (Reports) === */
.chart-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: -12px 0 20px 0;
    line-height: 1.4;
}

.product-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.product-detail-table thead th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.product-detail-table thead th.text-right {
    text-align: right;
}

.product-detail-table thead th.text-center {
    text-align: center;
}

.product-detail-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.product-detail-table tbody tr:hover {
    background: rgba(72, 202, 228, 0.04);
}

.product-detail-table tbody td {
    padding: 12px 12px;
    color: var(--text-primary);
    vertical-align: middle;
}

.product-detail-table tbody td.text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.product-detail-table tbody td.text-center {
    text-align: center;
}

.product-detail-table .product-name-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-detail-table .product-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky-vivid), var(--sky-accent));
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-detail-table .product-rank.rank-top {
    background: linear-gradient(135deg, var(--sand-warm), var(--sand-gold));
}

.product-detail-table .product-spend-highlight {
    color: var(--sky-accent);
    font-weight: 700;
}

.product-detail-table .product-avg-price {
    color: var(--text-secondary);
    font-size: 12px;
}

/* === FORECAST SECTION (Reports) === */
.forecast-container {
    border: 1px solid rgba(72, 202, 228, 0.15);
    background: linear-gradient(135deg, rgba(19, 45, 70, 0.6), rgba(13, 33, 55, 0.5));
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.forecast-card {
    background: rgba(10, 22, 40, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.3s ease;
}

.forecast-card:hover {
    background: rgba(10, 22, 40, 0.6);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.forecast-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.forecast-card-icon.urgency-high {
    background: rgba(255, 107, 107, 0.15);
    color: var(--coral-warm);
}

.forecast-card-icon.urgency-medium {
    background: rgba(255, 209, 102, 0.15);
    color: var(--sand-gold);
}

.forecast-card-icon.urgency-low {
    background: rgba(45, 212, 168, 0.15);
    color: var(--seaweed-green);
}

.forecast-card-body {
    flex: 1;
    min-width: 0;
}

.forecast-card-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forecast-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.forecast-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.forecast-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.forecast-badge.urgency-high {
    background: rgba(255, 107, 107, 0.12);
    color: var(--coral-warm);
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.forecast-badge.urgency-medium {
    background: rgba(255, 209, 102, 0.12);
    color: var(--sand-gold);
    border: 1px solid rgba(255, 209, 102, 0.25);
}

.forecast-badge.urgency-low {
    background: rgba(45, 212, 168, 0.12);
    color: var(--seaweed-green);
    border: 1px solid rgba(45, 212, 168, 0.25);
}

.forecast-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.forecast-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Responsive for product detail table */
@media (max-width: 768px) {
    .product-detail-table {
        font-size: 12px;
    }
    .product-detail-table thead th,
    .product-detail-table tbody td {
        padding: 8px 6px;
    }
    .product-detail-table .product-rank {
        display: none;
    }
    .forecast-grid {
        grid-template-columns: 1fr;
    }
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(145deg, var(--ocean-deep), var(--ocean-mid));
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-content.wide {
    max-width: 820px;
}

.modal-overlay.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 svg {
    color: var(--sky-accent);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--coral-warm);
    transform: rotate(90deg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* === UPLOAD ZONE === */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--sky-accent);
    background: rgba(72, 202, 228, 0.05);
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-zone svg {
    color: var(--sky-accent);
    margin-bottom: 16px;
}

.upload-zone h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Image preview inside upload zone */
.upload-preview {
    max-height: 200px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    object-fit: contain;
}

/* === FORM ELEMENTS === */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(72, 202, 228, 0.1);
}

.form-group select option {
    background: var(--ocean-deep);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

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

/* === AI LOADING STATE === */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 20px;
}

.ai-loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--sky-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-loading p {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
}

.ai-loading .ai-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1100;
    pointer-events: none;
}

.toast {
    background: var(--ocean-deep);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    transition: var(--transition);
}

.toast.success {
    border-left: 4px solid var(--seaweed-green);
}

.toast.success svg { color: var(--seaweed-green); }

.toast.info {
    border-left: 4px solid var(--sky-accent);
}

.toast.info svg { color: var(--sky-accent); }

.toast.error {
    border-left: 4px solid var(--coral-warm);
}

.toast.error svg { color: var(--coral-warm); }

.toast.warning {
    border-left: 4px solid var(--sand-gold);
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === MOBILE BURGER === */
.mobile-burger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.5);
    z-index: 90;
}

.mobile-overlay.open {
    display: block;
}

/* === API KEY BANNER === */
.api-key-banner {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(244, 162, 97, 0.08));
    border: 1px solid rgba(255, 209, 102, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.api-key-banner.hidden {
    display: none;
}

.api-key-banner svg {
    color: var(--sand-gold);
    flex-shrink: 0;
}

.api-key-banner-text {
    flex: 1;
}

.api-key-banner-text h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.api-key-banner-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === DETAIL EXPANSION === */
.receipt-detail {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-top: -8px;
    padding: 20px;
    animation: fadeInSection 0.3s ease;
}

/* === SETTINGS SECTION === */
.settings-grid {
    display: grid;
    gap: 20px;
    max-width: 600px;
}

.settings-group {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.settings-group h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group h3 svg {
    color: var(--sky-accent);
    width: 18px;
    height: 18px;
}

.api-key-input-group {
    display: flex;
    gap: 8px;
}

.api-key-input-group input {
    flex: 1;
    padding: 12px 14px;
    background: var(--surface-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.api-key-input-group input:focus {
    outline: none;
    border-color: var(--border-active);
}

.api-key-status {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-key-status.connected {
    color: var(--seaweed-green);
}

.api-key-status.disconnected {
    color: var(--text-muted);
}

.data-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px 20px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .bar-label {
        width: 90px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .mobile-burger {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select,
    .filter-bar input[type="month"] {
        min-width: unset;
    }
    
    .search-bar {
        max-width: unset;
    }
    
    .receipt-card-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .receipt-total {
        font-size: 18px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-content.wide {
        max-width: 100%;
    }
    
    .api-key-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .kpis-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .receipt-card {
        padding: 16px;
    }
    
    .data-actions {
        flex-direction: column;
    }
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(126, 200, 227, 0.15);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 200, 227, 0.25);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 200, 227, 0.15) transparent;
}

/* === LOCK SCREEN === */
.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(160deg, var(--ocean-abyss) 0%, var(--ocean-deep) 40%, var(--ocean-mid) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.lock-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(72, 202, 228, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 180, 216, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(45, 212, 168, 0.03) 0%, transparent 40%);
    pointer-events: none;
    animation: lockPulse 8s ease-in-out infinite alternate;
}

@keyframes lockPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.lock-screen.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* ===== Facturas flotando en el login (decorativo, SVG + CSS) ===== */
.invoice-float {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.invoice-float .inv {
    position: absolute;
    opacity: 0;
    will-change: transform, opacity;
    animation: invFloat linear infinite;
}
.invoice-float .inv svg {
    display: block;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}
@keyframes invFloat {
    0%   { transform: translateY(16px) rotate(var(--r)); opacity: 0; }
    14%  { opacity: var(--o); }
    86%  { opacity: var(--o); }
    100% { transform: translateY(-28px) rotate(calc(var(--r) * -1)); opacity: 0; }
}
/* En móvil la tarjeta ocupa casi todo el ancho: dejamos solo las de los bordes */
@media (max-width: 560px) {
    .invoice-float .inv:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .invoice-float .inv { animation: none; opacity: var(--o); }
}

.lock-card {
    position: relative;
    z-index: 3;
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(72, 202, 228, 0.08);
    animation: lockCardIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lockCardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lock-logo {
    text-align: center;
    margin-bottom: 32px;
}

.lock-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--sky-vivid), var(--sky-bright));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0, 180, 216, 0.3);
}

.lock-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.lock-logo h1 span {
    color: var(--sky-accent);
}

.lock-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.lock-info {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.lock-screen .form-group {
    margin-bottom: 16px;
}

.lock-screen .form-group input {
    text-align: center;
    font-size: 18px;
    letter-spacing: 4px;
    padding: 14px;
}

.lock-error {
    color: var(--coral-warm);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-height: 18px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.lock-screen .btn {
    margin-top: 4px;
    padding: 14px;
    font-size: 15px;
}

@media (max-width: 480px) {
    .lock-card {
        padding: 32px 24px;
    }
}

/* === PANEL DE ADMINISTRACIÓN === */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.admin-stat-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-table-wrap {
    overflow-x: auto;
    background: var(--surface-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
}
.admin-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.admin-table tbody tr {
    border-bottom: 1px solid rgba(173, 232, 244, 0.08);
}
.admin-table tbody tr:last-child {
    border-bottom: none;
}
.admin-table td {
    color: var(--text-primary);
}
.admin-usage-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}
.admin-bar {
    height: 6px;
    background: rgba(173, 232, 244, 0.12);
    border-radius: 999px;
    overflow: hidden;
}
.admin-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sky-vivid), var(--sky-accent));
    border-radius: 999px;
}
.admin-bar-fill.danger {
    background: linear-gradient(90deg, var(--coral-warm), var(--coral-soft));
}
.admin-count-danger {
    color: var(--coral-warm);
    font-weight: 700;
}

/* === FISCAL MODULE === */
.fiscal-alert {
    background: linear-gradient(135deg, rgba(255, 126, 103, 0.1), rgba(255, 126, 103, 0.02));
    border: 1px solid rgba(255, 126, 103, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.fiscal-alert.hidden {
    display: none;
}

.fiscal-alert-icon {
    color: var(--coral-warm);
    background: rgba(255, 126, 103, 0.1);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fiscal-alert-content h4 {
    color: var(--coral-warm);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.fiscal-alert-content p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.fiscal-summary-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.fiscal-summary-info {
    display: flex;
    gap: 32px;
    margin-bottom: 16px;
}

.fiscal-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fiscal-stat.highlight {
    padding-left: 32px;
    border-left: 2px solid var(--border-light);
}

.fiscal-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.fiscal-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.fiscal-stat.highlight .fiscal-value {
    color: var(--sky-accent);
}

.fiscal-summary-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 600px) {
    .fiscal-summary-info {
        flex-direction: column;
        gap: 20px;
    }
    .fiscal-stat.highlight {
        padding-left: 0;
        border-left: none;
        padding-top: 20px;
        border-top: 2px solid var(--border-light);
    }
}
