/* Salon Billing SaaS - Sleek Glassmorphic Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #090a0f;
    --bg-surface: rgba(22, 25, 41, 0.7);
    --bg-surface-solid: #161929;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(168, 85, 247, 0.3);
    
    /* Neon gradients & colors */
    --primary: #a855f7;
    --primary-glow: rgba(168, 85, 247, 0.5);
    --secondary: #ec4899;
    --secondary-glow: rgba(236, 72, 153, 0.5);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.5);
    
    --text-main: #f0f1f7;
    --text-muted: #94a3b8;
    --text-inverse: #090a0f;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --card-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility card */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(168, 85, 247, 0.25);
    box-shadow: 0 8px 32px 0 rgba(168, 85, 247, 0.08);
}

/* App Header & Navbar */
header.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 10, 15, 0.8);
    backdrop-filter: var(--card-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: var(--text-main);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--primary-glow);
}

nav.main-nav {
    display: flex;
    gap: 10px;
}

nav.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

nav.main-nav a:hover, nav.main-nav a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

nav.main-nav a.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role-badge {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Auth Login Screen */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-glow);
    background: rgba(255, 255, 255, 0.06);
}

/* Custom buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Core Dashboard Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.dashboard-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-title-row h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Entry Form split grid layout */
.entry-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    align-items: start;
}

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

.form-panel {
    padding: 30px;
}

.form-panel h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--primary);
}

.split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Multi-select and dynamic lists */
.pill-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.pill-checkbox {
    cursor: pointer;
}

.pill-checkbox input {
    display: none;
}

.pill-checkbox span {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.pill-checkbox input:checked + span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Personnel and product selection rows */
.dynamic-split-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* Spreadsheet Grid Theme */
.spreadsheet-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(22, 25, 41, 0.4);
}

table.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

table.spreadsheet-table th, table.spreadsheet-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
}

table.spreadsheet-table th {
    background: rgba(22, 25, 41, 0.9);
    font-weight: 600;
    color: var(--text-muted);
}

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

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

table.spreadsheet-table th:last-child, table.spreadsheet-table td:last-child {
    border-right: none;
}

/* Column group colors matching client screenshot */
.col-service { font-weight: 500; }
.col-payment { background: rgba(6, 182, 212, 0.05); }
.col-personnel { background: rgba(168, 85, 247, 0.04); }
.col-products { background: rgba(245, 158, 11, 0.05); }
.col-expense { background: rgba(239, 68, 68, 0.04); }
.col-tip { background: rgba(16, 185, 129, 0.04); }

/* Table Totals Row */
tr.totals-row td {
    background: rgba(22, 25, 41, 0.9) !important;
    font-weight: 700 !important;
    border-top: 2px solid var(--border-color);
    color: var(--text-main);
}

/* Custom Tabs */
.tabs-wrapper {
    margin-bottom: 30px;
}

.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--primary);
    border: 1px solid var(--border-color);
    border-bottom-color: var(--bg-main);
    background: var(--bg-main);
    box-shadow: 0 -4px 10px rgba(168, 85, 247, 0.05);
}

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

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

/* Analytics Cards Dashboard */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stats-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card.primary-glow .value {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modal configuration */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-card {
    width: 95%;
    max-width: 600px;
    transform: scale(0.9);
    transition: var(--transition);
    padding: 30px;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    animation: slideUp 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Date filter container styling */
.filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-bar input[type="date"], .filter-bar input[type="month"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text-main);
    font-family: var(--font-sans);
    outline: none;
}

/* ==========================================================================
   Mobile Segmented Navigation & Card View (Responsive Enhancements)
   ========================================================================== */

/* Mobile view switcher - hidden on desktop */
.mobile-view-tabs {
    display: none;
    grid-template-columns: 1fr 1fr;
    background: rgba(22, 25, 41, 0.8);
    backdrop-filter: var(--card-blur);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 6px;
}

.mobile-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.mobile-tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

/* Mobile Transaction Card View */
.mobile-tx-list {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.mobile-tx-card {
    background: rgba(22, 25, 41, 0.7);
    backdrop-filter: var(--card-blur);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    transition: var(--transition);
}

.mobile-tx-card:active, .mobile-tx-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.mobile-tx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-tx-cust {
    display: flex;
    flex-direction: column;
}

.mobile-tx-cust-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.mobile-tx-cust-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-tx-actions {
    display: flex;
    gap: 8px;
}

.mobile-tx-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.mobile-tx-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mobile-tx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.mobile-tx-badge.service-badge {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #e9d5ff;
}

.mobile-tx-badge.payment-badge {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #a5f3fc;
}

.mobile-tx-badge.staff-badge {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}

.mobile-tx-badge.exp-badge {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.mobile-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.mobile-tx-row-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   Responsive Media Queries (Mobile First & Mobile Optimization)
   ========================================================================== */

@media (max-width: 768px) {
    /* Header optimization for mobile */
    header.app-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        padding: 6px;
    }

    nav.main-nav {
        gap: 4px;
    }

    nav.main-nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .user-role-badge {
        font-size: 0.72rem;
        padding: 4px 8px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Container & Layout */
    .dashboard-container {
        margin: 15px auto;
        padding: 0 12px;
    }

    .dashboard-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 15px;
    }

    .dashboard-title-row h2 {
        font-size: 1.35rem;
    }

    .filter-bar {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0;
    }

    .filter-bar input[type="date"] {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    /* Enable mobile view switcher */
    .mobile-view-tabs {
        display: grid;
    }

    .entry-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Hide tab content on mobile depending on active tab class */
    .mobile-hide-panel {
        display: none !important;
    }

    .form-panel {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .form-panel h3 {
        font-size: 1.15rem;
        margin-bottom: 14px;
    }

    /* Touch input optimization - prevent iOS auto zoom */
    .form-control, 
    .filter-bar input[type="date"] {
        font-size: 16px !important;
        padding: 12px 14px;
        border-radius: 10px;
    }

    /* Split rows adapt to 1 column on mobile screens */
    .split-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Payment split inputs grid on mobile */
    .split-row[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }

    .split-row[style*="grid-template-columns: 1fr 1fr 1fr"] .form-group label {
        font-size: 0.75rem !important;
    }

    .split-row[style*="grid-template-columns: 1fr 1fr 1fr"] input {
        padding: 10px 8px;
        text-align: center;
    }

    /* Service & Personnel Pill selector touch optimizations */
    .pill-selector {
        gap: 6px;
    }

    .pill-checkbox span {
        padding: 10px 14px;
        border-radius: 20px;
        font-size: 0.85rem;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .btn-product-select {
        min-height: 38px;
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
    }

    /* Dynamic rows in mobile form */
    .dynamic-row {
        grid-template-columns: 1.4fr 1fr auto;
        gap: 8px;
        padding: 8px 10px;
    }

    /* Buttons touch targets */
    .btn {
        min-height: 44px;
        font-size: 0.95rem;
    }

    /* Summary cards on mobile */
    .glass-panel[style*="padding: 25px"] {
        padding: 16px !important;
        border-radius: 14px;
    }

    .stats-card-row {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }

    .stat-card {
        padding: 10px 8px !important;
        text-align: center;
    }

    .stat-card .label {
        font-size: 0.68rem !important;
        letter-spacing: 0;
    }

    .stat-card .value {
        font-size: 1.15rem !important;
        margin-top: 4px !important;
    }

    /* Desktop table view vs Mobile card list */
    .spreadsheet-wrapper {
        display: none; /* Hide spreadsheet table on mobile screens */
    }

    .mobile-tx-list {
        display: flex; /* Show mobile card list */
    }

    /* Toast notifications full width bottom bar on mobile */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }

    .toast {
        padding: 14px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header.app-header {
        padding: 10px 12px;
    }

    .user-profile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .user-profile #logoutBtn {
        grid-column: span 2;
        width: 100%;
        padding: 6px !important;
    }

    .stats-card-row {
        grid-template-columns: 1fr 1fr 1fr !important;
    }

    .dynamic-row {
        grid-template-columns: 1fr 1fr auto;
    }
}

