@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #e2e8f0;
    --bg-secondary: #f8fafc;
    --bg-card: #f8fafc;
    --bg-card-hover: #ffffff;
    --bg-input: #f1f5f9;
    --border-primary: #cbd5e1;
    --border-focus: #25b5e4;
    --accent-primary: #25b5e4;
    --accent-secondary: #0082ac;
    --accent-glow: rgba(37, 181, 228, 0.15);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.2);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --warning-border: rgba(217, 119, 6, 0.2);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --danger-border: rgba(220, 38, 38, 0.2);
    --info: #0284c7;
    --info-bg: rgba(2, 132, 199, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --gradient-1: linear-gradient(135deg, #25b5e4 0%, #3cd070 100%);
    --gradient-2: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-3: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --gradient-4: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 181, 228, 0.12);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === BACKGROUND EFFECTS === */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(30, 58, 138, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(15, 23, 42, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(5, 150, 105, 0.02) 0%, transparent 50%);
    z-index: -1;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(2%, -1%) rotate(1deg);
    }

    66% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* === HEADER === */
.header {
    background: var(--accent-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: #ffffff;
    color: var(--accent-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
    }
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.logo-text span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.header-stat:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-stat .stat-icon {
    font-size: 1.1rem;
}

.header-stat .stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.header-stat .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #ffffff;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
}

/* === DASHBOARD CHARTS === */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.05) !important;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 350px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(37, 181, 228, 0.15) !important;
    border-color: rgba(37, 181, 228, 0.45) !important;
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

@media (max-width: 1100px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

/* === MAIN LAYOUT === */
.main-container {
    max-width: 100%;
    padding: 1.5rem 2.5rem;
}

/* === TABS NAVIGATION === */
.tabs-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
    background: #e2e8f0;
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 160px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(30, 58, 138, 0.05);
}

.tab-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.tab-btn .tab-icon {
    font-size: 1.1rem;
}

.tab-content {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(30, 58, 138, 0.2);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-title .title-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.card-title .icon-purple {
    background: rgba(30, 58, 138, 0.15);
}

.card-title .icon-green {
    background: rgba(5, 150, 105, 0.15);
}

.card-title .icon-red {
    background: rgba(220, 38, 38, 0.15);
}

.card-title .icon-yellow {
    background: rgba(217, 119, 6, 0.15);
}

.card-title .icon-blue {
    background: rgba(59, 130, 246, 0.15);
}

/* === DASHBOARD STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1;
    color: #ffffff;
    border: none;
}

.stat-card.purple {
    background: var(--gradient-1);
}

.stat-card.green {
    background: var(--gradient-2);
}

.stat-card.yellow {
    background: var(--gradient-4);
}

.stat-card.red {
    background: var(--gradient-3);
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    top: -80px;
    right: -80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card:hover::after {
    opacity: 0.8;
    transform: scale(1.1);
}

.stat-card.purple:hover {
    box-shadow: 0 20px 25px -5px rgba(37, 181, 228, 0.3), 0 8px 10px -6px rgba(37, 181, 228, 0.15);
}

.stat-card.green:hover {
    box-shadow: 0 20px 25px -5px rgba(5, 150, 105, 0.3), 0 8px 10px -6px rgba(5, 150, 105, 0.15);
}

.stat-card.yellow:hover {
    box-shadow: 0 20px 25px -5px rgba(217, 119, 6, 0.3), 0 8px 10px -6px rgba(217, 119, 6, 0.15);
}

.stat-card.red:hover {
    box-shadow: 0 20px 25px -5px rgba(220, 38, 38, 0.3), 0 8px 10px -6px rgba(220, 38, 38, 0.15);
}

.stat-card .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    width: 100%;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(3deg);
    background: rgba(255, 255, 255, 0.3);
}

.stat-card .stat-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2px;
}

.stat-card .badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(4px);
}

.stat-card .stat-number {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 1rem 0 0.25rem 0;
    letter-spacing: -0.03em;
    transition: all 0.3s ease;
    color: #ffffff !important;
}

.stat-card:hover .stat-number {
    transform: scale(1.02);
}

.stat-card .stat-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === FORMS === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .required {
    color: var(--danger);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

/* === BUTTONS === */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 181, 228, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(37, 181, 228, 0.5);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(5, 150, 105, 0.5);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--gradient-3);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--gradient-4);
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 6px 25px rgba(217, 119, 6, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(30, 58, 138, 0.05);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === SEARCH BAR === */
.search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.search-bar input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
}

.search-bar .search-count {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* === TABLE === */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

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

thead th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

thead th:hover {
    color: var(--accent-secondary);
}

tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.2s;
}

tbody tr:hover {
    background: rgba(30, 58, 138, 0.03);
}

tbody tr.low-stock {
    background: var(--warning-bg);
}

tbody tr.out-of-stock {
    background: var(--danger-bg);
}

tbody td {
    padding: 12px 16px;
    font-size: 0.88rem;
    vertical-align: middle;
}

.product-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-name-cell .name {
    font-weight: 600;
    color: var(--text-primary);
}

.product-name-cell .sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-primary {
    background: rgba(30, 58, 138, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(30, 58, 138, 0.25);
}

.badge-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-primary);
}

/* Voided / Annulled Transaction Styling */
.voided-transaction {
    position: relative;
    pointer-events: auto;
}

.voided-transaction::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    width: 90%;
    height: 1px;
    background: var(--danger);
    opacity: 0.2;
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-bar {
    width: 60px;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.price-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--success);
}

/* === BARCODE LABELS === */
.labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.label-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    border: 2px dashed #d1d5db;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
    display: block;
}

.label-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.label-card .label-company {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    font-weight: 600;
}

.label-card .label-product {
    font-size: var(--text-size-product, 0.95rem);
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.label-card .label-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.label-card canvas,
.label-card svg {
    max-width: 100%;
}

.label-card .label-sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
}

.label-card .label-select {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* === MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-primary);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === TOAST / NOTIFICATION === */
.toast-container {
    position: fixed;
    top: 85px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-success {
    background: rgba(5, 150, 105, 0.15);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.toast-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.toast-warning {
    background: rgba(217, 119, 6, 0.15);
    border: 1px solid var(--warning-border);
    color: var(--warning);
}

.toast-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* === MOVEMENTS LOG === */
.movement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.movement-item:hover {
    background: var(--bg-card-hover);
}

.movement-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.movement-icon.entry {
    background: var(--success-bg);
}

.movement-icon.exit {
    background: var(--danger-bg);
}

.movement-icon.delete {
    background: rgba(107, 114, 128, 0.15);
}

.movement-details {
    flex: 1;
}

.movement-details .mov-product {
    font-weight: 600;
    font-size: 0.9rem;
}

.movement-details .mov-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.movement-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* === CATEGORY TAGS === */
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(30, 58, 138, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(30, 58, 138, 0.2);
}

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

.filter-bar .form-select {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-width: 160px;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state .empty-desc {
    font-size: 0.88rem;
}

/* === PRINT STYLES === */
@media print {
    body * {
        visibility: hidden;
    }

    .print-area,
    .print-area * {
        visibility: visible;
    }

    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(var(--print-cols, 1), 1fr) !important;
        gap: 15px !important;
    }

    .label-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #000;
        margin: 0 auto !important;
        padding: 15px !important;
        width: 100% !important;
        max-width: 280px !important;
        box-sizing: border-box !important;
        display: block !important;
        text-align: center;
        background: white !important;
    }

    .label-card .label-select {
        display: none !important;
    }

    .label-card .label-copies-control {
        display: none !important;
    }

    .label-card.no-print-label {
        display: none !important;
    }
}

/* === QUICK ACTIONS === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.quick-action-text h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.quick-action-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .header-stats {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .header {
        padding: 0 1rem;
    }

    .tabs-nav {
        overflow-x: auto;
    }

    .tab-btn {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 10px 14px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .labels-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .clock {
        display: none;
    }

    .btn-group {
        flex-direction: column;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-select {
        width: 100%;
    }
}

/* === ANIMATIONS === */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick move modal inline */
.quick-move-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quick-move-section {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.quick-move-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Inactive products row */
tbody tr.inactive-row {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Confirmation dialog */
.confirm-content {
    text-align: center;
    padding: 1rem 0;
}

.confirm-content .confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.confirm-content .product-highlight {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
}

/* === POS (PUNTO DE VENTA) === */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
    }
}

.pos-scanner-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 150px);
}

.pos-cart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 90px;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.pos-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--bg-secondary);
}

.pos-item-info {
    flex: 1;
}

.pos-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pos-item-sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pos-item-price {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.pos-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pos-qty-btn {
    background: var(--bg-input);
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
}

.pos-qty-btn:hover {
    background: var(--bg-card-hover);
}

.pos-item-qty input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-primary);
    border-right: 1px solid var(--border-primary);
    padding: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    outline: none;
}

.pos-item-total {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    min-width: 70px;
    text-align: right;
}

.pos-total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 2px dashed var(--border-primary);
    margin-top: 0.5rem;
}

.pos-total-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.pos-total-amount {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.pos-scanner-input {
    font-size: 1.2rem;
    padding: 16px;
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    width: 100%;
    transition: all 0.3s;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    letter-spacing: 2px;
}

.pos-scanner-input:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
    outline: none;
}

.remove-item-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.remove-item-btn:hover {
    background: var(--danger-bg);
}

/* Sale Summary in Modal */
.sale-confirm-body {
    text-align: center;
    padding: 0.5rem 0;
}

.sale-confirm-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--success);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.sale-confirm-total {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent-secondary);
    margin: 0.5rem 0 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
}

.sale-summary-list {
    text-align: left;
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.sale-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.9rem;
}

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

.sale-summary-item .item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.sale-summary-item .item-qty {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 8px;
}

.sale-summary-item .item-subtotal {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--success);
}

/* === RESPONSIVE (MOBILE) === */
@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }

    .header-content {
        height: auto !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        gap: 10px;
    }

    .header-stats {
        display: none;
    }

    .clock {
        display: none;
    }

    .main-container {
        padding: 1rem;
    }

    .tabs-nav {
        padding: 4px;
        gap: 4px;
    }

    .tab-btn {
        min-width: 110px;
        padding: 10px;
        font-size: 0.8rem;
        flex: none;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Dashboard */
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        height: 300px;
    }

    /* Quick Actions */
    .quick-actions {
        grid-template-columns: 1fr;
    }

    /* Filter Bar */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filter-bar select {
        width: 100%;
    }

    /* Tables to Cards Layout */
    .table-container table,
    .table-container thead,
    .table-container tbody,
    .table-container th,
    .table-container td,
    .table-container tr {
        display: block;
    }

    .table-container thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-container tr {
        border: 1px solid var(--border-primary);
        margin-bottom: 1rem;
        border-radius: var(--radius-lg);
        background: var(--bg-card);
        padding: 0.5rem;
        box-shadow: var(--shadow-sm);
    }

    .table-container td {
        border: none;
        border-bottom: 1px solid var(--bg-input);
        position: relative;
        padding-left: 45%;
        text-align: right;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .table-container td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-left: 12px;
        margin-top: 10px;
        background: var(--bg-secondary);
        border-radius: var(--radius-md);
    }

    .table-container td:before {
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
    }

    /* POS Mobile */
    .pos-container {
        grid-template-columns: 1fr;
    }

    .pos-scanner-area {
        height: auto;
    }

    .pos-cart {
        position: relative;
        top: 0;
        margin-top: 1rem;
    }

    .pos-cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pos-item-controls {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--border-primary);
        padding-top: 10px;
    }

    .pos-item-total {
        min-width: auto;
    }

    /* Modals */
    .modal {
        padding: 1.5rem;
        max-width: 95%;
        margin: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* === RECEPTION MODULE === */
.reception-mode-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    padding: 5px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.reception-mode-btn {
    flex: 1;
    padding: 11px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reception-mode-btn:hover {
    color: var(--text-secondary);
    background: rgba(5, 150, 105, 0.05);
}

.reception-mode-btn.active {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.rec-product-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    animation: scaleIn 0.3s ease;
}

.rec-product-card.found {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.rec-product-card.not-found {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.rec-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.rec-product-header h3 {
    font-size: 1.15rem;
}

.rec-product-header .sku-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.rec-product-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rec-meta-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
}

.rec-meta-item .meta-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.rec-meta-item .meta-value {
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 2px;
}

.rec-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.rec-qty-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rec-qty-group input {
    width: 70px;
    text-align: center;
    padding: 10px;
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    border: 2px solid var(--success-border);
    border-radius: var(--radius-md);
    background: white;
    outline: none;
}

.rec-qty-group input:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.rec-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    background: var(--bg-secondary);
    animation: fadeSlideIn 0.3s ease;
}

.rec-log-item .log-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rec-log-item .log-icon.new-prod {
    background: rgba(217, 119, 6, 0.15);
}

.rec-log-item .log-icon.add-stock {
    background: var(--success-bg);
}

.rec-log-item .log-details {
    flex: 1;
}

.rec-log-item .log-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.rec-log-item .log-info {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rec-log-item .log-qty {
    font-family: 'JetBrains Mono';
    font-weight: 700;
    color: var(--success);
}

/* === PDF RECEIPT STYLES (Hidden from UI) === */
#receipt-template {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 800px;
    padding: 40px;
    background: white;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #1e3a8a;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.receipt-logo {
    font-size: 40px;
    margin-bottom: 10px;
}

.receipt-title {
    font-size: 28px;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.receipt-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 14px;
    color: #64748b;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.receipt-table th {
    text-align: left;
    background: #f1f5f9;
    padding: 12px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    color: #475569;
}

.receipt-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.receipt-total-row {
    text-align: right;
    margin-top: 20px;
}

.receipt-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

.receipt-total-value {
    font-size: 24px;
    font-weight: 800;
    color: #1e3a8a;
    margin-top: 5px;
}

.receipt-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
}

/* =============================================
   === PANTALLA DE LOGIN (DESIGN PREMIUM SPLIT) ===
   ============================================= */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('../imagenes/fondo_login2.png') no-repeat center center;
    background-size: cover;
    display: none;
    /* controlado dinámicamente */
    z-index: 9999;
    overflow: hidden;
}

.login-split-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* PANEL VISUAL IZQUIERDO */
.login-visual-panel {
    flex: 1.2;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem 4rem;
    border-right: none;
    position: relative;
}

.login-features {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    border-top: none;
    padding-top: 0;
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(79, 209, 197, 0.12);
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-text h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.feature-text p {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
}

/* PANEL DE FORMULARIO DERECHO */
.login-form-panel {
    flex: 0.8;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow-y: auto;
}

.login-card-premium {
    background: #ffffff;
    border-radius: 24px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.03),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        0 10px 10px -5px rgba(0, 0, 0, 0.02);
    width: 100%;
    max-width: 440px;
    padding: 1rem 2.5rem;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 5;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header-premium {
    text-align: center;
    margin-bottom: 2.2rem;
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.login-logo-premium {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    border: 3px solid #00bcac;
    box-shadow: 0 0 20px rgba(0, 188, 172, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
    overflow: hidden;
    background: #ffffff;
    padding: 6px;
    transition: transform 0.3s ease;
}

.login-logo-premium:hover {
    transform: scale(1.04);
}

.login-logo-premium img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header-premium h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #10b981 0%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header-premium p {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
}

/* FORMULARIOS PREMIUM */
.form-group-premium {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-card-premium form>.form-group-premium:nth-child(1) {
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.login-card-premium form>.form-group-premium:nth-child(2) {
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.form-label-premium {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.input-wrapper-premium {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-badge {
    position: absolute;
    left: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.form-input-premium {
    width: 100%;
    padding: 13px 16px 13px 56px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #1e293b;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-input-premium::placeholder {
    color: #94a3b8;
}

.form-input-premium:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* OJO CONTRASEÑA EN LOGIN */
.login-overlay .btn-toggle-password {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    outline: none;
    transition: color 0.2s;
}

.login-overlay .btn-toggle-password:hover {
    color: #0284c7 !important;
}

/* OPCIONES Y BOTONES */
.form-options-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    font-size: 0.85rem;
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.checkbox-container-premium {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.checkbox-container-premium input {
    accent-color: #0284c7;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-password-link {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.btn-submit-premium {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00bcac 0%, #0284c7 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

.btn-submit-premium:hover {
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

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

.btn-submit-icon-wrapper {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FOOTER PREMIUM */
.login-footer-premium {
    margin-top: 2.2rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.6rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    opacity: 0;
    animation: loginFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

.footer-divider-badge {
    position: absolute;
    top: -13px;
    background: #ffffff;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #0284c7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-text {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .login-visual-panel {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .login-visual-panel {
        display: none !important;
    }

    .login-form-panel {
        flex: 1;
        width: 100%;
        height: 100%;
        background: #f8fafc;
        padding: 1.5rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        overflow-y: auto;
    }

    .login-card-premium {
        padding: 2rem 1.25rem;
        margin: auto 0;
        /* Centrado vertical inteligente y scrollable */
        max-width: 100%;
        box-shadow: none;
        /* Más limpio en pantallas móviles */
        border: none;
    }

    .login-logo-premium {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }

    .login-header-premium h2 {
        font-size: 1.6rem;
    }

    .login-header-premium {
        margin-bottom: 1.5rem;
    }

    .form-group-premium {
        margin-bottom: 1.1rem;
    }

    .form-options-premium {
        margin-bottom: 1.4rem;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .login-footer-premium {
        margin-top: 1.5rem;
        padding-top: 1.2rem;
    }
}


/* =============================================
   === ESTADOS DE SESIÓN (MOSTRAR/OCULTAR) ===
   ============================================= */
body.logged-out .header,
body.logged-out .tabs-nav,
body.logged-out .main-container {
    display: none !important;
}

body.logged-out .login-overlay {
    display: flex !important;
}

.user-profile {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =============================================
   === BADGES Y ALERTAS DE CADUCIDAD (ALIMENTOS) ===
   ============================================= */
.badge-expired {
    background: rgba(220, 38, 38, 0.15) !important;
    border: 1px solid var(--danger-border) !important;
    color: var(--danger) !important;
}

.badge-soon {
    background: rgba(217, 119, 6, 0.15) !important;
    border: 1px solid var(--warning-border) !important;
    color: var(--warning) !important;
}

/* Filas destacadas en listado de productos */
tr.expired-row {
    background: rgba(220, 38, 38, 0.06) !important;
    border-left: 4px solid var(--danger) !important;
}

tr.soon-row {
    background: rgba(217, 119, 6, 0.04) !important;
    border-left: 4px solid var(--warning) !important;
}

/* Alertas de caducidad en el dashboard */
#expiryAlerts .movement-item {
    border-left: 4px solid var(--danger);
}

#expiryAlerts .movement-item.warning {
    border-left: 4px solid var(--warning);
}

/* === PWA CAMERA SCANNER STYLES === */
#pwaReader video,
#posReader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#pwaReader,
#posReader {
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* =============================================
   === MÓDULO DE ADMINISTRACIÓN Y CONFIGURACIÓN ===
   ============================================= */
.admin-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.admin-sidebar {
    flex: 0 0 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.admin-sidebar-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar-btn:hover {
    background: rgba(30, 58, 138, 0.05);
    color: var(--text-secondary);
}

.admin-sidebar-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.admin-main {
    flex: 1;
    min-width: 0;
}

.admin-subtab {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}

.admin-subtab.active {
    display: block;
}

/* --- LÍNEA DE TIEMPO DE AUDITORÍA --- */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin-left: 0.5rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 2px;
    background: var(--border-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-2rem - 6px);
    top: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    z-index: 2;
    transition: all 0.2s;
}

.timeline-item:hover::before {
    transform: scale(1.2);
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-content {
    margin-bottom: 0 !important;
    padding: 1.25rem !important;
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Adaptación responsiva para móviles */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-sidebar {
        flex: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        white-space: nowrap;
    }

    .admin-sidebar-btn {
        width: auto;
        flex: 1;
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .timeline-container {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: calc(-1.5rem - 6px);
    }
}

/* Custom Select with Autocomplete Search */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    margin-top: 4px;
}

.custom-select-options.hidden {
    display: none;
}

.custom-option {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-input);
    transition: background 0.2s;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: var(--bg-input);
}

.custom-option .opt-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.custom-option .opt-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.custom-option .opt-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.custom-option .opt-stock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* =============================================
   === ESTADO DE CARGA DE SESIÓN (PREVENT FLICKER) ===
   ============================================= */
body.auth-checking .header,
body.auth-checking .tabs-nav,
body.auth-checking .main-container,
body.auth-checking .login-overlay {
    display: none !important;
}

body.auth-checking {
    background: #f8fafc !important;
    /* Fondo premium claro del login */
}

body.auth-checking::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #f8fafc;
    z-index: 100000;
}

body.auth-checking::after {
    content: '';
    position: fixed;
    top: calc(50% - 22px);
    left: calc(50% - 22px);
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(2, 132, 199, 0.1);
    border-top-color: #0284c7;
    border-radius: 50%;
    z-index: 100001;
    animation: authSpinner 0.85s linear infinite;
}

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

/* =============================================
   === SLIDER DE RECUPERACIÓN DE CLAVE (Premium Slider) ===
   ============================================= */
.login-slider-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 0.5rem 0;
}

.login-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    width: 400%;
    /* Para 4 vistas: Login, Paso 1, Paso 2, Paso 3 */
}

.login-slide {
    width: 25%;
    /* Cada slide ocupa el 25% del track (es decir, el 100% del container) */
    flex-shrink: 0;
    box-sizing: border-box;
    transition: opacity 0.4s ease;
}

/* Cuando no están activas, bajar opacidad para evitar saltos visuales */
.login-slide:not(.active-slide) {
    opacity: 0;
    pointer-events: none;
}

.login-slide.active-slide {
    opacity: 1;
    pointer-events: auto;
}

/* =============================================
   === REDISEÑO DE INTERFAZ VERTICAL/LATERAL Y MOVIL ===
   ============================================= */

/* Contenedor general */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Ocultar barra de navegación horizontal vieja */
.tabs-nav {
    display: none !important;
}

/* BARRA LATERAL (SIDEBAR) ESCRITORIO */
.sidebar {
    width: 230px;
    background: linear-gradient(180deg, #0e90ad 0%, #064b5b 100%);
    /* Azul Mar Coral degradado */
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-logo .logo-text h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.sidebar-logo .logo-text span {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: block;
}

/* Botón colapsar menú */
.btn-collapse-sidebar {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    outline: none;
    flex-shrink: 0;
}

.btn-collapse-sidebar:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    transform: scale(1.1);
}

/* Navegación interna de la barra lateral */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 1.25rem 1rem;
    flex: 1;
    overflow-y: auto;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botones del menú lateral */
.sidebar-nav .tab-btn {
    width: 100%;
    min-width: unset;
    /* Deshabilitar min-width global de 160px para evitar desbordes */
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #ffffff;
    /* Letras blancas para todos los módulos */
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    white-space: nowrap;
    outline: none;
    overflow: hidden;
}

.sidebar-nav .tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.sidebar-nav .tab-btn.active {
    background: var(--gradient-1);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 181, 228, 0.3);
}

.sidebar-nav .tab-btn .tab-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav .tab-btn .tab-label {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
}

/* Footer de la barra lateral */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CONTENIDO PRINCIPAL (DERECHA) */
.main-content {
    flex: 1;
    margin-left: 230px;
    /* Ancho de la barra lateral */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   === ESTILOS PARA ESTADO COLAPSADO (COLLAPSED) ===
   ============================================= */
.app-layout.collapsed .sidebar {
    width: 76px;
}

.app-layout.collapsed .sidebar-logo {
    padding: 1.5rem 18px;
    gap: 0;
}

.app-layout.collapsed .sidebar-logo .logo-text {
    opacity: 0;
    max-width: 0;
}

.app-layout.collapsed .sidebar-nav {
    padding: 1.5rem 10px;
}

.app-layout.collapsed .sidebar-nav .tab-btn {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
    transform: none;
}

.app-layout.collapsed .sidebar-nav .tab-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

.app-layout.collapsed .sidebar-nav .tab-btn .tab-label {
    opacity: 0;
    max-width: 0;
}

.app-layout.collapsed .sidebar-nav .tab-btn .tab-icon {
    font-size: 1.45rem;
}

.app-layout.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
}

.app-layout.collapsed .main-content {
    margin-left: 76px;
}

/* HEADER AJUSTADO */
.header {
    background: #0e90ad;
    /* Fondo Azul Mar Coral del logo */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
    padding: 0 2rem;
}

.header-content {
    height: 72px;
    max-width: 100%;
}

/* Ocultar el logo del header en escritorio */
.header .logo-section {
    display: none !important;
}

/* Cambiar texto del header a blanco y usar fondo semi-transparente */
.header .clock {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.header .header-stat {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header .header-stat:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
}

.header .header-stat .stat-value {
    color: #ffffff;
}

.header .header-stat .stat-label {
    color: rgba(255, 255, 255, 0.85);
}

.header #btnLogout {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.header #btnLogout:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #ffffff !important;
}

.header #userProfileName {
    color: #ffffff !important;
}

.header #userProfileCedula {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* OCULTAR NAV MÓVIL POR DEFECTO */
.mobile-bottom-nav,
.mobile-sheet-overlay {
    display: none;
}

/* ESTADOS DE SESIÓN */
body.logged-out .app-layout {
    display: none !important;
}

/* AJUSTES RESPONSIVOS (MÓVIL Y TABLET) */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 95px;
        /* Espacio para el bottom nav flotante */
    }

    .header {
        padding: 0 1rem;
        background: #0e90ad;
    }

    .header .logo-section {
        display: flex !important;
    }

    .header .logo-text h1 {
        font-size: 1.1rem;
        color: #ffffff;
    }

    .header .logo-text span {
        display: none;
    }

    .header .logo-icon {
        width: 36px;
        height: 36px;
    }

    .header #btnLogout {
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
        height: 28px !important;
        line-height: 1 !important;
        border-radius: 6px !important;
    }

    .header #userProfileName {
        font-size: 0.75rem !important;
    }

    .header #userProfileCedula {
        display: none !important;
    }

    /* Mostrar navegación móvil inferior (Floating Scrollable Dock) */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 12px;
        left: 12px;
        right: 12px;
        height: 66px;
        background: rgba(255, 255, 255, 0.9);
        /* Fondo glassmorphism */
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 18px;
        /* Bordes redondeados premium */
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        z-index: 200;
        overflow-x: auto;
        /* Permitir scroll horizontal */
        scroll-behavior: smooth;
        justify-content: flex-start;
        align-items: center;
        padding: 0 12px;
        gap: 8px;
        scrollbar-width: none;
        /* Ocultar scrollbar en Firefox */
    }

    .mobile-bottom-nav::-webkit-scrollbar {
        display: none;
        /* Ocultar scrollbar en Chrome/Safari */
    }

    .mobile-bottom-nav .tab-btn {
        flex: 0 0 auto;
        /* Evitar que se encojan */
        width: 80px;
        /* Ancho fijo para cada botón */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: none;
        background: transparent;
        color: var(--text-muted);
        gap: 2px;
        padding: 6px 0;
        cursor: pointer;
        min-width: unset;
        transition: all 0.2s;
        border-radius: 10px;
    }

    .mobile-bottom-nav .tab-btn .tab-icon {
        font-size: 1.35rem;
    }

    .mobile-bottom-nav .tab-btn .tab-label {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1px;
    }

    .mobile-bottom-nav .tab-btn.active {
        color: var(--accent-primary) !important;
        background: rgba(37, 181, 228, 0.08) !important;
        /* Resaltado de fondo suave */
        box-shadow: none !important;
    }

    /* PANEL DESPLEGABLE MÓVIL (BOTTOM SHEET) */
    .mobile-sheet-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-sheet-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-sheet {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        max-height: 80vh;
        overflow-y: auto;
    }

    .mobile-sheet.active {
        transform: translateY(0);
    }

    .mobile-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-primary);
    }

    .mobile-sheet-header h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .btn-close-sheet {
        border: none;
        background: var(--bg-input);
        color: var(--text-muted);
        font-size: 1rem;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }

    .btn-close-sheet:hover {
        background: var(--border-primary);
    }

    .mobile-sheet-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding-bottom: 2rem;
    }

    .mobile-sheet-content .tab-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 1.25rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-primary);
        border-radius: var(--radius-lg);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
        text-align: center;
        outline: none;
    }

    .mobile-sheet-content .tab-btn:hover {
        background: var(--bg-card-hover);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
        transform: translateY(-2px);
    }

    .mobile-sheet-content .tab-btn.active {
        background: var(--success-bg) !important;
        border-color: var(--success) !important;
        color: var(--success) !important;
        box-shadow: none !important;
    }
}