/**
 * ReceiptLog - Main Stylesheet
 * Following LeadLog design patterns and color palette
 */

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #E54B51;
    --primary-light: #eb6f74;
    --primary-dark: #c93a40;
    --primary-rgb: 229, 75, 81;

    /* Secondary Colors */
    --secondary: #376F86;
    --secondary-light: #4a8ba6;
    --secondary-dark: #2a5a6d;
    --secondary-rgb: 55, 111, 134;

    /* Tertiary / Accent */
    --tertiary: #F25D2C;
    --tertiary-light: #f57d52;
    --tertiary-dark: #d94a1a;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;

    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;

    --error: #ef4444;
    --error-light: #f87171;
    --error-dark: #dc2626;

    --info: #3b82f6;
    --info-light: #60a5fa;
    --info-dark: #2563eb;

    /* Neutrals */
    --white: #FFFFFF;
    --bg-light: #F7F8F9;
    --bg-alt: #F0F4F6;
    --text-primary: #1F2933;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --border-dark: #D1D5DB;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

    /* Layout */
    --header-height: 56px;
    --dock-height: 64px;
    --sidebar-width: 240px;
    --content-max-width: 600px;
    --modal-max-width: 500px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* Safe Areas (iOS) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Z-Index Scale */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-toast: 600;
}


/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-light);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}


/* ============================================
   APP LAYOUT - MOBILE FIRST
   ============================================ */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: calc(var(--header-height) + var(--safe-top));
    padding-bottom: calc(var(--dock-height) + var(--safe-bottom));
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    z-index: var(--z-fixed);
}

.header-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--secondary-dark);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Main Content */
.app-main {
    flex: 1;
    padding: var(--space-md);
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Bottom Dock (Mobile Navigation) */
.app-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--dock-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-fixed);
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: color var(--transition-fast);
    min-width: 64px;
}

.dock-btn i {
    font-size: 24px;
}

.dock-btn.active {
    color: var(--primary);
}

.dock-btn:hover {
    color: var(--primary-light);
}


/* ============================================
   DESKTOP LAYOUT
   ============================================ */
@media (min-width: 900px) {
    .app-container {
        padding-bottom: 0;
        padding-top: 0;
        margin-left: var(--sidebar-width);
        padding-left: 0;
        min-height: 100vh;
    }

    .app-header {
        left: var(--sidebar-width);
    }

    .app-dock {
        display: none;
    }

    /* Sidebar */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        background: var(--secondary-dark);
        padding: var(--space-lg);
        display: flex;
        flex-direction: column;
        z-index: var(--z-fixed);
    }

    /* Ensure main content stays in its lane */
    .app-main {
        position: relative;
        z-index: var(--z-base);
        padding-top: var(--space-xl);
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding-bottom: var(--space-lg);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: var(--space-lg);
    }

    .sidebar-logo img {
        width: 40px;
        height: 40px;
        border-radius: var(--radius);
    }

    .sidebar-logo span {
        color: var(--white);
        font-size: var(--font-size-lg);
        font-weight: 600;
    }

    .sidebar-nav {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: var(--space-xs);
    }

    .sidebar-btn {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
        background: none;
        border: none;
        border-radius: var(--radius);
        color: rgba(255, 255, 255, 0.7);
        font-size: var(--font-size-sm);
        cursor: pointer;
        transition: all var(--transition-fast);
        text-align: left;
    }

    .sidebar-btn i {
        font-size: 20px;
        width: 24px;
    }

    .sidebar-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }

    .sidebar-btn.active {
        background: var(--primary);
        color: var(--white);
    }

    .sidebar-footer {
        padding-top: var(--space-lg);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .app-main {
        max-width: 800px;
        padding: var(--space-xl);
    }

    /* Hide mobile header elements on desktop */
    .mobile-only {
        display: none !important;
    }
}

/* Show sidebar on mobile */
@media (max-width: 899px) {
    .app-sidebar {
        display: none;
    }

    .desktop-only {
        display: none !important;
    }
}


/* ============================================
   SCREENS (SPA Navigation)
   ============================================ */
.screen {
    display: none;
    animation: fadeIn var(--transition) ease;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
}

#setup-screen.active {
    display: block;
    min-height: 100vh;
}

/* Content screens within app-screen */
.content-screen {
    display: none;
}

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

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


/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.auth-logo h1 {
    font-size: var(--font-size-2xl);
    color: var(--secondary-dark);
    margin-bottom: var(--space-xs);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
}

/* Install CTA on auth screen */
.install-cta {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.btn-install {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-install::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-install:hover::before {
    left: 100%;
}

.btn-install:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-install:active {
    transform: translateY(0);
}

.btn-install .spinner {
    border-color: rgba(255,255,255,0.3);
    border-top-color: white;
}

.install-hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-sm);
    margin-bottom: 0;
}

.install-cta.installed {
    display: none;
}


/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
}

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

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-alt);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: var(--error-dark);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
}

.btn-block {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn-icon i {
    font-size: 20px;
}

/* Google Sign In Button */
.btn-google {
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-google:hover:not(:disabled) {
    background: var(--bg-light);
    border-color: var(--border-dark);
}

.btn-google img {
    width: 20px;
    height: 20px;
}


/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.form-label .required {
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

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

.form-control:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-valid {
    border-color: var(--success);
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
    padding-right: var(--space-xl);
}

/* Form Help Text */
.form-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--error);
    margin-top: var(--space-xs);
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Checkbox / Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-dark);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}


/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: var(--space-md);
}

.card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

/* Clickable Card */
.card-clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-clickable:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}


/* ============================================
   LISTS
   ============================================ */
.list-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.list-item:hover {
    background: var(--bg-light);
}

.list-item-clickable {
    cursor: pointer;
}

.list-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius);
    color: var(--secondary);
    font-size: 18px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.list-item-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Empty State */
.list-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.list-empty i {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}


/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
    pointer-events: none;
    visibility: hidden;
}

.modal.active {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

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

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-alt);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-md);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Desktop modal styling */
@media (min-width: 600px) {
    .modal {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        max-width: var(--modal-max-width);
        width: calc(100% - var(--space-xl));
        max-height: 80vh;
        border-radius: var(--radius-xl);
        padding-bottom: 0;
    }

    .modal.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Install Steps (for iOS/Android instructions) */
.install-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.install-step-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.install-step-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    padding: var(--space-sm) 0;
}

.install-step-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-step-icon i {
    font-size: 20px;
    color: var(--secondary);
}

.install-step-text {
    flex: 1;
}

.install-step-text .font-weight-500 {
    margin-bottom: 2px;
}


/* ============================================
   TOASTS
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) + var(--space-md));
    left: var(--space-md);
    right: var(--space-md);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideIn var(--transition) ease;
    pointer-events: auto;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--error);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast.toast-info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 20px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 600px) {
    .toast-container {
        left: auto;
        right: var(--space-lg);
        max-width: 400px;
    }
}


/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(var(--secondary-rgb), 0.1);
    color: var(--secondary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-muted {
    background: var(--bg-alt);
    color: var(--text-muted);
}


/* ============================================
   SETUP WIZARD
   ============================================ */
.setup-container {
    max-width: 500px;
    margin: 0 auto;
}

.setup-progress {
    margin-bottom: var(--space-xl);
}

.setup-progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.setup-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition);
}

.setup-step-indicator {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
}

.setup-section {
    animation: fadeIn var(--transition) ease;
}

.setup-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.setup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius-full);
    font-size: 28px;
    color: var(--secondary);
}

.setup-title {
    font-size: var(--font-size-xl);
    color: var(--secondary-dark);
    margin-bottom: var(--space-xs);
}

.setup-subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.setup-content {
    margin-bottom: var(--space-xl);
}

.setup-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
}

.setup-footer .btn {
    flex: 1;
}

/* Setup Cards (Direct Mode) */
.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.setup-card {
    padding: var(--space-md);
    text-align: center;
}

.setup-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 24px;
    color: var(--secondary);
}

.setup-card-title {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.setup-card-status {
    font-size: var(--font-size-xs);
}

.setup-card.complete .setup-card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.setup-card.complete .setup-card-status {
    color: var(--success);
}

.setup-card.pending .setup-card-status {
    color: var(--warning);
}


/* ============================================
   RECEIPT CREATION
   ============================================ */
.receipt-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
}

.receipt-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.receipt-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.receipt-section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

/* Line Items */
.line-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.line-item {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius);
}

.line-item-content {
    flex: 1;
}

.line-item-remove {
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
}

.line-item-remove:hover {
    color: var(--error);
}

/* Line Item Quantity Controls */
.line-item-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.qty-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.qty-display {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
}

/* Service Selector Quantity */
.service-select-item {
    border-bottom: 1px solid var(--border-color);
}

.service-select-item:last-child {
    border-bottom: none;
}

.service-select-item .list-item {
    border-radius: 0;
    border-bottom: none;
}

.service-select-item .list-item-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    margin-left: auto;
    font-size: 14px;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    flex-shrink: 0;
}

.service-select-item .list-item-chevron.rotated {
    transform: rotate(180deg);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    padding-top: 0;
    background: var(--bg-light);
}

.quantity-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 4px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quantity-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-with-qty-btn {
    margin-left: auto;
}

.add-line-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-line-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Custom Item Section (ad-hoc items in service selector) */
.custom-item-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-md);
}

.custom-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius);
}

.custom-item-header:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.custom-item-header .custom-item-chevron {
    margin-left: auto;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.custom-item-form {
    background: var(--bg-alt);
    padding: var(--space-md);
    border-radius: var(--radius);
    margin-top: var(--space-sm);
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

/* Receipt Total */
.receipt-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--secondary);
    color: var(--white);
    border-radius: var(--radius);
    margin-top: var(--space-lg);
}

.receipt-total-label {
    font-weight: 500;
}

.receipt-total-amount {
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

/* VAT Summary */
.vat-summary {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-md);
}

.vat-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
}


/* ============================================
   RECEIPT HISTORY
   ============================================ */
.history-filters {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.filter-chip {
    padding: var(--space-xs) var(--space-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.receipt-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.receipt-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.receipt-number {
    font-weight: 600;
    color: var(--secondary);
    font-size: var(--font-size-sm);
    background: var(--bg-alt);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
}

.receipt-details {
    flex: 1;
    min-width: 0;
}

.receipt-client {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.receipt-amount {
    font-weight: 600;
    color: var(--text-primary);
}

/* Load More Button */
.load-more-container {
    padding: var(--space-md) 0;
    margin-top: var(--space-sm);
}

.load-more-container .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

/* Pull to Refresh */
.pull-refresh-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--bg-alt);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    transition: height 0.2s ease;
    z-index: 10;
}

.pull-refresh-indicator .spinner {
    width: 18px;
    height: 18px;
}

/* Infinite Scroll Sentinel */
#scroll-sentinel {
    height: 1px;
    width: 100%;
}


/* ============================================
   PROFILE / SETTINGS
   ============================================ */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--secondary);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.profile-email {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.settings-section {
    margin-bottom: var(--space-lg);
}

.settings-section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}


/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }

.flex-1 { flex: 1; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.w-100 { width: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-alt) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Verification Banner */
.verification-banner {
    background: var(--warning-light);
    color: var(--warning-dark);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.verification-banner a {
    color: var(--warning-dark);
    font-weight: 500;
    text-decoration: underline;
}

/* Offline Banner */
.offline-banner {
    background: var(--error);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    text-align: center;
    display: none;
}

.offline-banner.active {
    display: block;
}


/* ============================================
   LOGO UPLOAD
   ============================================ */
.logo-upload {
    text-align: center;
}

.logo-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logo-preview:hover {
    border-color: var(--primary);
}

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

.logo-preview i {
    font-size: 48px;
    color: var(--text-muted);
}

.logo-preview.has-logo {
    border-style: solid;
    border-color: var(--border-color);
}

.logo-upload-input {
    display: none;
}

.logo-upload-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}


/* ============================================
   BRAND COLORS / COLOR PICKER
   ============================================ */
.color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.color-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-preset-btn:hover {
    border-color: var(--secondary);
    transform: scale(1.05);
}

.color-preset-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 75, 81, 0.2);
}

.preset-primary,
.preset-secondary {
    width: 100%;
    height: 20px;
    border-radius: 4px;
}

.preset-primary {
    border-radius: 4px 4px 0 0;
}

.preset-secondary {
    border-radius: 0 0 4px 4px;
}

.color-input-group {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.color-picker {
    width: 50px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-hex-input {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
}

.brand-preview {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
}

.brand-preview-header {
    padding: var(--space-sm) var(--space-md);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.brand-preview-body {
    padding: var(--space-md);
}

.brand-preview-line {
    height: 3px;
    margin-bottom: var(--space-sm);
}

.brand-preview-text {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
}

.brand-preview-total {
    font-weight: 600;
    text-align: right;
}

/* Color swatch in settings */
.color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Receipt Template Selector */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

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

.template-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--white);
}

.template-card:hover {
    border-color: var(--primary-light);
}

.template-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.template-card .template-check {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    color: var(--primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.template-card.active .template-check {
    opacity: 1;
}

.template-preview {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    min-height: 80px;
}

.template-preview-header {
    height: 12px;
    background: var(--secondary);
    border-radius: 2px;
    margin-bottom: var(--space-xs);
}

.template-preview-body {
    padding-top: var(--space-xs);
}

.template-preview-line {
    height: 6px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 4px;
}

.template-preview-line.short {
    width: 60%;
}

.template-preview-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    margin: var(--space-xs) 0;
}

.template-preview-table > div {
    height: 6px;
    background: var(--border-dark);
    border-radius: 2px;
}

/* Template style variations */
.template-preview-simple .template-preview-header {
    height: 8px;
}

.template-preview-professional .template-preview-header {
    height: 16px;
}

.template-preview-compact .template-preview-header {
    height: 6px;
}

.template-preview-compact {
    min-height: 60px;
    padding: var(--space-xs);
}

.template-info {
    text-align: center;
}

.template-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.template-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.3;
}


/* ============================================
   SEARCHABLE CLIENT SELECTOR
   ============================================ */
.client-selector {
    position: relative;
}

.client-selector-input-wrap {
    position: relative;
}

.client-selector-input {
    padding-right: 36px;
}

.client-selector-input.has-selection {
    background-color: var(--bg-light);
    font-weight: 500;
}

.client-selector-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.client-selector-clear:hover {
    background: var(--error-light);
    color: var(--error);
}

.client-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    max-height: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.client-dropdown-list {
    flex: 1;
    overflow-y: auto;
    max-height: 260px;
}

.client-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.client-dropdown-item:last-child {
    border-bottom: none;
}

.client-dropdown-item:hover,
.client-dropdown-item.highlighted {
    background: var(--bg-light);
}

.client-dropdown-item.highlighted {
    background: rgba(var(--primary-rgb), 0.1);
}

.client-dropdown-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius-full);
    color: var(--secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.client-dropdown-item-content {
    flex: 1;
    min-width: 0;
}

.client-dropdown-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-dropdown-item-name mark {
    background: rgba(var(--primary-rgb), 0.2);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.client-dropdown-item-detail {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-dropdown-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.client-dropdown-empty i {
    font-size: 32px;
    margin-bottom: var(--space-sm);
    opacity: 0.5;
}

.client-dropdown-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-sm);
    background: var(--bg-light);
}

/* Hide mobile search header on desktop */
.client-dropdown-search {
    display: none;
}

/* Mobile overlay backdrop */
.client-selector-backdrop {
    display: none;
}

/* Mobile adjustments - fullscreen overlay so results appear above keyboard */
@media (max-width: 599px) {
    .client-selector-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        border-radius: 0;
        max-height: none;
        padding-top: var(--safe-top);
        z-index: var(--z-modal);
        background: var(--white);
    }

    .client-selector-dropdown::before {
        display: none;
    }

    /* Mobile search header inside dropdown */
    .client-dropdown-search {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-color);
        background: var(--white);
    }

    .client-dropdown-search .form-control {
        flex: 1;
    }

    .client-dropdown-search .btn-close-search {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-alt);
        border: none;
        border-radius: var(--radius-full);
        color: var(--text-muted);
        cursor: pointer;
        flex-shrink: 0;
    }

    .client-dropdown-list {
        max-height: calc(100vh - 180px);
        padding-bottom: var(--space-xl);
    }

    .client-dropdown-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding-bottom: calc(var(--space-sm) + var(--safe-bottom));
    }

    /* Larger touch targets on mobile */
    .client-dropdown-item {
        padding: var(--space-md);
    }

    .client-dropdown-item-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}


/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .app-header,
    .app-dock,
    .app-sidebar,
    .no-print {
        display: none !important;
    }

    .app-container {
        padding: 0;
    }

    body {
        background: white;
    }
}
