/**
 * ════════════════════════════════════════════════════════════════════════════
 * UNIVERSAL POS SAAS DESIGN SYSTEM (pos-saas/public/css/pos.css)
 * ════════════════════════════════════════════════════════════════════════════
 * Strict brand conformance:
 * Deep Logo Navy: #0B2545
 * Logo Royal Blue: #2B78C5 / #1D4E89
 * Accent Gold / Amber: #F59E0B / #D97706
 * Surfaces: #FFFFFF / #F8FAFC / #0F172A
 * Complete with ESC/POS 58mm & 80mm thermal receipt printing styles.
 */

:root {
    --navy-dark: #0B2545;
    --navy-header: #132D4A;
    --blue-primary: #2B78C5;
    --blue-hover: #1D4E89;
    --blue-light: #EFF6FF;
    --gold-accent: #F59E0B;
    --gold-hover: #D97706;
    --gold-light: #FEF3C7;
    --surface-white: #FFFFFF;
    --surface-slate: #F8FAFC;
    --surface-border: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --success-green: #10B981;
    --success-light: #D1FAE5;
    --danger-red: #EF4444;
    --danger-light: #FEE2E2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: #F1F5F9;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glass & Card Utilities */
.pos-glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(11, 37, 69, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pos-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(43, 120, 197, 0.12);
}

/* Top Navigation Bar */
.pos-navbar {
    background: var(--navy-dark);
    color: #FFFFFF;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 50;
}

.pos-brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--blue-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(43, 120, 197, 0.4);
}

.pos-nav-links {
    display: flex;
    gap: 8px;
}

.pos-nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pos-nav-link:hover, .pos-nav-link.active {
    background: rgba(43, 120, 197, 0.3);
    color: #FFFFFF;
}

/* Buttons */
.btn-primary-blue {
    background: var(--blue-primary);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-blue:hover {
    background: var(--blue-hover);
    box-shadow: 0 4px 12px rgba(43, 120, 197, 0.3);
}

.btn-gold {
    background: var(--gold-accent);
    color: #0B2545;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-gold:hover {
    background: var(--gold-hover);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--surface-slate);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

/* Badges */
.badge-blue {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-gold {
    background: var(--gold-light);
    color: #92400E;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: var(--success-light);
    color: #065F46;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-red {
    background: var(--danger-light);
    color: #991B1B;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

/* Modals */
.pos-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 37, 69, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.pos-modal-box {
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header-safe {
    padding: 20px 24px;
    padding-right: 3.5rem;
    border-bottom: 1px solid var(--surface-border);
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: #FFFFFF;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Table Styling */
.pos-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
}

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

.pos-table th {
    background: #F8FAFC;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--surface-border);
}

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

.pos-table tr:hover td {
    background: #F8FAFC;
}

/* Form Inputs */
.pos-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: #FFFFFF;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pos-input:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(43, 120, 197, 0.15);
}

/* ════════════════════════════════════════════════════════════════════════════
   THERMAL RECEIPT PRINTING STYLES (58mm & 80mm ESC/POS COMPLIANT)
   ════════════════════════════════════════════════════════════════════════════ */
.receipt-paper {
    background: #FFFFFF;
    color: #000000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 16px;
    margin: 0 auto;
    border: 1px dashed #CBD5E1;
    border-radius: 4px;
}

.receipt-58mm {
    width: 210px; /* ~58mm physical width */
    font-size: 11px;
}

.receipt-80mm {
    width: 290px; /* ~80mm physical width */
    font-size: 12px;
}

.receipt-divider {
    border-top: 1px dashed #000000;
    margin: 8px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    #receipt-print-container, #receipt-print-container * {
        visibility: visible;
    }
    #receipt-print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .receipt-paper {
        border: none;
        width: 100%;
        max-width: 80mm;
        margin: 0;
        padding: 4mm;
    }
    .no-print {
        display: none !important;
    }
}
