:root {
    --primary-color: #671f2f;
    --primary-hover: #4a1520;
    --primary-light: #f9f2f4;
    --primary-subtle: rgba(103, 31, 47, 0.08);
    --secondary-color: #2D3436;
    --accent-gold: #D4AF37;
    --sidebar-bg: rgba(30, 30, 30, 0.85);
    --main-bg: #f4f6f9;
    --card-bg: #FFFFFF;
    --text-dark: #1a1a2e;
    --text-grey: #636E72;
    --text-light: #DFE6E9;
    --border-color: #e8ecf1;
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--main-bg);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

/* --- UTILITY CLASSES --- */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.text-primary {
    color: var(--primary-color);
}

/* --- HUB / LOGIN SCREEN --- */
.hub-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #8e2a3f 0%, #671f2f 40%, #2c0b11 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hub-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent-gold);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.1;
    top: -100px;
    right: -100px;
}

.brand-logo {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    letter-spacing: -1px;
    animation: fadeInDown 0.8s ease-out;
}

.brand-logo i {
    color: var(--accent-gold);
}

.module-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 1100px;
    animation: fadeInUp 1s ease-out;
}

.module-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 300px;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.module-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.module-card i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
    transition: 0.3s;
}

.module-card:hover i {
    transform: scale(1.1);
}

.module-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.module-card p {
    font-size: 0.95rem;
    opacity: 0.7;
    line-height: 1.4;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MAIN LAYOUT (Similar to previous, adjusted) --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1.5fr 0.5fr;
    height: 100vh;
    width: 100vw;
}

/* For Furniture Layout, we might want full width or different panels */
.app-container.furniture-mode {
    grid-template-columns: 260px 1fr;
    /* 2 Columns only */
}

/* When the right panel is hidden, let the main content expand to use available space */
.app-container.right-hidden {
    grid-template-columns: 260px 2fr; /* sidebar + main expanded */
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-small {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.5px;
}

.brand-small i {
    color: var(--accent-gold);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 2.5rem;
}

.avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), #8e2a3f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    color: #a0a0a0;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.6rem;
    cursor: pointer;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(103, 31, 47, 0.4);
}

/* Main Content */
.main-content {
    padding: 1.5rem 2rem;
    background: var(--main-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.unit-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.unit-badge.cafe {
    background: #ffeaa7;
    color: #d35400;
}

.unit-badge.furniture {
    background: #dfe6e9;
    color: #2d3436;
}

/* Product Grid (Cafe) */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-grey);
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card-img-top {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.card-body {
    padding: 0.8rem;
}

.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.card-price {
    color: var(--primary-color);
    font-weight: 700;
}

/* Order Panel (Right Side - Cafe) */
.order-panel {
    background: var(--primary-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-left: none;
    color: white;
}

.order-panel h4,
.order-panel .order-header {
    color: white;
    font-weight: 700;
}

.order-panel .cart-row {
    color: white;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.order-panel .cart-row span {
    font-size: 1.1rem;
    font-weight: 700;
}

.order-panel .summary-row {
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.order-panel .total-row,
.order-panel #cafe-total {
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
}

.order-panel .btn-primary {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
}

.order-panel .btn-primary:hover {
    background: #f0f0f0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin: 1rem 0;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

/* FURNITURE MODULE STYLES */
.furnit.module-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.furniture-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    height: 100%;
}

.forms-container {
    overflow-y: auto;
    padding-right: 1rem;
}

.form-card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition-smooth);
    position: relative;
}

.form-card:hover {
    box-shadow: var(--shadow-hover);
}

.form-card h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    background: #fafbfc;
    color: var(--text-dark);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-subtle);
    background: white;
}

.form-control::placeholder {
    color: #b0b8c1;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.status-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 2;
}

.step.active {
    background: var(--primary-color);
    color: white;
}

/* Invoice/Summary Panel for Furniture */
.invoice-preview {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 1.5rem;
}

.summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

.summary-table th {
    text-align: left;
    color: var(--text-grey);
    padding: 0.6rem 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.summary-table td {
    padding: 0.6rem 0;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
}

.total-row {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 2px solid var(--border-color);
    padding-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(103, 31, 47, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(103, 31, 47, 0.3);
    filter: brightness(1.08);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-subtle);
}

.btn-danger {
    background: var(--danger);
    color: white;
    width: auto;
    padding: 0.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 25, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.close-modal {
    background: #f3f4f6;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    color: var(--text-grey);
}

.close-modal:hover {
    background: #e5e7eb;
    color: var(--text-dark);
}

/* Signature Box */
.signature-box {
    border: 2px dashed #ccc;
    height: 100px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-top: 0.5rem;
}

/* =====================================================
   DASHBOARD & WIDGETS
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.stat-card {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-value {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.chart-container-main {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
    grid-column: span 1;
    min-height: 350px;
}

.chart-container-main.large {
    grid-column: span 3;
}

.chart-container-main h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.table-card {
    grid-column: span 4;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    background: #f8f9fb;
    color: var(--text-grey);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #eef0f3;
}

.modern-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.modern-table tbody tr {
    transition: var(--transition-smooth);
}

.modern-table tbody tr:hover {
    background: var(--primary-light);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-success {
    background: #ecfdf5;
    color: #065f46;
}

.badge-warning {
    background: #fffbeb;
    color: #92400e;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container-main.large,
    .chart-container-main {
        grid-column: span 2;
    }
}

/* --- MODERN SPLIT LOGIN --- */
.login-split-container {
    display: flex;
    width: 1100px;
    max-width: 95%;
    height: 650px;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    margin: auto;
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-visual-panel {
    flex: 1.3;
    position: relative;
    overflow: hidden;
    background: #000;
}

.login-form-panel {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #ffffff;
}

@media (max-width: 900px) {
    .login-split-container {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    .login-visual-panel {
        flex: 0.7;
        min-height: 40vh;
    }

    .login-form-panel {
        flex: 1.3;
        padding: 2rem;
        border-radius: 30px 30px 0 0;
        margin-top: -30px;
        z-index: 10;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    }
}


.login-input-field {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid #edeff2;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #fdfdfd;
    color: #4a5568;
    outline: none;
}

.login-input-field:focus {
    border-color: #671f2f;
    background: white;
    box-shadow: 0 5px 15px rgba(103, 31, 47, 0.1);
}

.login-input-field.pin {
    font-size: 1.5rem;
    letter-spacing: 4px;
    font-weight: 700;
    color: #671f2f;
}


.login-btn-modern {
    width: 100%;
    padding: 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, #671f2f 0%, #4a1520 100%);
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(103, 31, 47, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.login-btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(103, 31, 47, 0.35);
    filter: brightness(1.1);
}

.login-error-modern {
    margin-top: 20px;
    background: #FFF5F5;
    color: #671f2f;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #ff7675;
    width: 100%;
}

/* --- MOBILE RESPONSIVENESS & PWA ADAPTATION --- */
@media (max-width: 1024px) {
    .module-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .brand-logo img {
        height: 40px;
    }

    .module-selector {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 90%;
    }

    .module-card {
        width: 100%;
        height: auto;
        padding: 2.5rem 1.5rem;
    }

    .app-container,
    .app-container.furniture-mode {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: visible;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
        overflow-y: visible;
    }

    .order-panel {
        display: none;
        /* Hide order panel on mobile or make it a drawer */
    }

    .furniture-layout {
        grid-template-columns: 1fr;
    }

    .invoice-preview {
        position: static;
        margin-top: 2rem;
    }

    /* Modal fixes */
    .modal-content {
        width: 95%;
        padding: 1rem;
        margin: 10px;
    }

    .row-2,
    .row-3 {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   MODO INVENTARIO - ANCHO COMPLETO
   ============================================================ */
.app-container.inventario-mode {
    grid-template-columns: 260px 1fr !important;
    overflow: visible !important;
}

.app-container.inventario-mode .main-area,
.app-container.inventario-mode .main-content {
    grid-column: span 1;
    max-width: none !important;
    width: 100% !important;
    overflow-y: auto !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

.app-container.inventario-mode .right-panel {
    display: none !important;
}

body.inventario-activo {
    overflow: auto !important;
}

body.inventario-activo .app-container {
    overflow: visible !important;
}

/* ============================================================
   MODERN COTIZACIÓN / FACTURACIÓN STYLES
   ============================================================ */

/* Stats cards grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-pill {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.stat-pill .stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-pill .stat-text {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

/* Modern table wrapper */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.table-modern thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    background: #fafbfc;
    border-bottom: 2px solid #eef0f3;
}

.table-modern thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table-modern tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-dark);
}

.table-modern tbody tr {
    transition: var(--transition-smooth);
}

.table-modern tbody tr:hover {
    background: var(--primary-light);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* Status badge modern */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.pendiente { background: #fef3c7; color: #92400e; }
.status-badge.aprobada  { background: #d1fae5; color: #065f46; }
.status-badge.facturada { background: #dbeafe; color: #1e40af; }
.status-badge.cancelada { background: #fee2e2; color: #991b1b; }

/* Action buttons row */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.8rem;
    color: white;
}

.action-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.action-btn.view    { background: var(--primary-color); }
.action-btn.pdf     { background: #ef4444; }
.action-btn.approve { background: #10b981; }

/* Detail card */
.detail-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3d0d18 100%);
    color: white;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.detail-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.detail-body {
    padding: 2rem 2.5rem;
}

.info-card {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
    transition: var(--transition-smooth);
}

.info-card:hover {
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.info-card .info-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-card .info-label i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.info-card .info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
}

.info-card .info-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Totals summary */
.totals-summary {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
    min-width: 300px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.92rem;
}

.totals-row .label {
    color: #64748b;
    font-weight: 500;
}

.totals-row .value {
    font-weight: 600;
    color: var(--text-dark);
}

.totals-row.total-final {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--primary-color);
    font-size: 1.15rem;
}

.totals-row.total-final .label,
.totals-row.total-final .value {
    font-weight: 800;
    color: var(--primary-color);
}

.totals-row.discount .label,
.totals-row.discount .value {
    color: #10b981;
}

/* Preview panel items */
.preview-item {
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 0.75rem;
    transition: var(--transition-smooth);
}

.preview-item:hover {
    background: #f1f5f9;
    border-left-color: var(--accent-gold);
}

.preview-item .item-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.92rem;
    margin-bottom: 0.2rem;
}

.preview-item .item-detail {
    font-size: 0.8rem;
    color: #94a3b8;
}

.preview-item .item-price {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.preview-item .item-price .qty { color: #64748b; }
.preview-item .item-price .amount { font-weight: 700; color: var(--primary-color); }

/* Client card in preview */
.preview-client-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3d0d18 100%);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    color: white;
    margin-bottom: 1.25rem;
}

.preview-client-card .client-label {
    font-size: 0.72rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.preview-client-card .client-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.preview-client-card .client-info {
    font-size: 0.82rem;
    opacity: 0.85;
    line-height: 1.5;
}

/* Filter bar */
.filter-bar {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.04);
}

.filter-bar label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e8ecf1;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    transition: var(--transition-smooth);
    background: #fafbfc;
    color: var(--text-dark);
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* Modern action button (for headers) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(103, 31, 47, 0.2);
}

.btn-action:hover {
    box-shadow: 0 4px 16px rgba(103, 31, 47, 0.3);
    transform: translateY(-1px);
}

/* Empty state */
.empty-state {
    padding: 3.5rem 2rem;
    text-align: center;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
}
