:root {
    --bg-main: #0B1120;
    --bg-card: #1E293B;
    --bg-card-hover: #26334D;
    --bg-input: #0F172A;
    --border-color: #334155;
    --border-light: rgba(255, 255, 255, 0.08);

    --primary: #E5A93C;          /* Barber Gold / Vintage Amber */
    --primary-hover: #C58212;
    --primary-light: rgba(229, 169, 60, 0.15);

    --accent-gold: #F59E0B;      /* Champagne Gold */
    --accent-gold-light: rgba(245, 158, 11, 0.15);

    --accent-cyan: #38BDF8;      /* Sky Blue Barber Accent */
    --accent-cyan-light: rgba(56, 189, 248, 0.15);

    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.15);

    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.15);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(229, 169, 60, 0.25);

    --sidebar-width: 260px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ==================== LAYOUT ==================== */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #131D31 0%, #0D1526 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #BE185D 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--accent-gold);
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item button .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active button {
    background: linear-gradient(90deg, var(--primary-light) 0%, rgba(244, 63, 94, 0.02) 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-cash-box {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-cash-box span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.quick-cash-box strong {
    font-size: 14px;
    color: var(--success);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}

/* TOPBAR */
.topbar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(19, 29, 49, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar-left h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-left p {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* CONTENT VIEW AREA */
.view-area {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
    display: block;
}

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

/* ==================== BUTTONS & BADGES ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #BE185D 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #059669;
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}
.btn-outline-gold:hover {
    background: var(--accent-gold-light);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-md);
}

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

.badge-success { background: var(--success-light); color: #34D399; }
.badge-warning { background: var(--accent-gold-light); color: #FBBF24; }
.badge-danger { background: var(--danger-light); color: #F87171; }
.badge-info { background: var(--accent-cyan-light); color: #38BDF8; }
.badge-primary { background: var(--primary-light); color: #FB7185; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.gold::before { background: var(--accent-gold); }
.stat-card.green::before { background: var(--success); }
.stat-card.cyan::before { background: var(--accent-cyan); }
.stat-card.danger::before { background: var(--danger); }

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== POS & CAJA LAYOUT ==================== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 120px);
}

.pos-catalog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}
.search-input:focus {
    border-color: var(--primary);
}

.category-chips {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
}

.chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.chip.active, .chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.items-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.item-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.item-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}

.item-card .item-type {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-weight: 600;
}
.item-card h4 {
    font-size: 13px;
    margin: 4px 0 8px 0;
    color: var(--text-main);
    line-height: 1.3;
}
.item-card .item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.item-card .item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--success);
}

/* POS CART / RECEIPT AREA */
.pos-cart {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.cart-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.cart-client-select {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.form-select, .form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 12.5px;
    outline: none;
}
.form-select:focus, .form-input:focus {
    border-color: var(--primary);
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
}

.cart-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
}

.stylist-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 6px;
}

.cart-summary {
    background: var(--bg-input);
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-muted);
}
.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}
.summary-row.total span:last-child {
    color: var(--primary);
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.pay-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 6px 4px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}
.pay-btn.active, .pay-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ==================== TABLES ==================== */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.custom-table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ==================== FICHA TECNICA MODAL & CARDS ==================== */
.ficha-tecnica-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 10px;
}

.ficha-field {
    margin-bottom: 8px;
}
.ficha-field strong {
    color: var(--accent-gold);
    font-size: 11.5px;
    display: block;
    margin-bottom: 2px;
}
.ficha-field p {
    font-size: 12.5px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 6px;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== THERMAL TICKET STYLING (58mm / 80mm) ==================== */
.ticket-preview-container {
    background: #FFFFFF;
    color: #000000;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.35;
    max-width: 320px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.ticket-preview-container.format-58mm {
    max-width: 240px;
    padding: 10px;
    font-size: 11px;
}

.ticket-preview-container.format-80mm {
    max-width: 320px;
    padding: 16px;
    font-size: 12.5px;
}

.ticket-preview-container .t-center { text-align: center; }
.ticket-preview-container .t-bold { font-weight: bold; }
.ticket-preview-container .t-line { border-top: 1px dashed #000; margin: 8px 0; }
.ticket-preview-container .t-row { display: flex; justify-content: space-between; gap: 4px; }

@media print {
    @page {
        size: auto;
        margin: 0mm;
    }
    body {
        background: #FFF !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body * {
        visibility: hidden !important;
    }
    .modal-overlay, .modal-box {
        position: static !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .ticket-printable, .ticket-printable * {
        visibility: visible !important;
    }
    .ticket-printable {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 80mm !important;
        padding: 4mm !important;
        margin: 0 !important;
        background: #FFF !important;
        color: #000 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .ticket-printable.format-58mm {
        max-width: 58mm !important;
        font-size: 10.5px !important;
    }
    .ticket-printable.format-80mm {
        max-width: 80mm !important;
        font-size: 12px !important;
    }
}

/* ==================== AI ADVISOR & CUADRE STYLING ==================== */
.ai-advisor-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.ai-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(229, 169, 60, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E5A93C, #38BDF8, #10B981);
}

.ai-chat-box {
    display: flex;
    flex-direction: column;
    height: 380px;
    background: #0B1120;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.4;
    max-width: 90%;
}

.ai-msg.bot {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(229, 169, 60, 0.2);
    align-self: flex-start;
    color: var(--text-main);
}

.ai-msg.user {
    background: var(--primary);
    color: #000;
    font-weight: 600;
    align-self: flex-end;
}

.ai-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ai-quick-chip {
    background: rgba(229, 169, 60, 0.1);
    border: 1px solid rgba(229, 169, 60, 0.3);
    color: var(--primary);
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.ai-quick-chip:hover {
    background: var(--primary);
    color: #000;
}

.role-badge-locked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.role-badge-owner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(229, 169, 60, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.badge-mobiliario {
    background: rgba(168, 85, 247, 0.15);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

