:root {
    --primary: #0f172a;
    /* Dark Navy */
    --secondary: #5597fc;
    /* Light Blue */
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --accent-success: #22c55e;
    --accent-danger: #ef4444;
    --accent-warn: #eab308;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    outline: none;
}

/* Mobile touch improvements */
button,
.btn,
.btn-add,
.btn-header,
.fab-main,
.fab-action,
.section-chip,
.tab-item,
.service-row,
.mobile-cart-sticky,
.mobile-quote-item,
input[type="number"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on interactive elements */
button,
.btn,
.section-chip,
.tab-item {
    -webkit-user-select: none;
    user-select: none;
}

/* Improve scrolling on mobile */
.services-list-container,
.cart-items,
.section-nav {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar (Left Panel) */
.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    flex-shrink: 0;
}

/* Center Panel (Main Content) */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}

.wizard-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    flex-shrink: 0;
}

/* Right Panel (Cart) */
.cart-panel {
    width: 360px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 20;
    flex-shrink: 0;
}

/* Header */
.top-bar {
    height: 56px;
    background: var(--bg-surface);
    color: var(--text-main);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.brand {
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand span {
    opacity: 0.7;
    font-weight: 500;
    font-size: 11px;
    margin-left: 4px;
    background: var(--bg-body);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.quote-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quote-select {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    max-width: 200px;
}

.btn-header {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 28px;
}

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

.btn-header:active {
    transform: translateY(1px);
}

.btn-header.danger:hover {
    background: var(--accent-danger);
    color: white;
    border-color: var(--accent-danger);
}

/* Left Panel - Sections Nav */
.search-area {
    padding: 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-body);
    transition: 0.2s;
}

.search-input:focus {
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.section-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.section-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: 0.1s;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.section-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.section-item.active {
    background: #eff6ff;
    color: var(--secondary);
    border-right: 3px solid var(--secondary);
}

.section-arrow {
    font-size: 10px;
    opacity: 0.5;
}

/* Center Panel - Subsection Tabs */
.subsection-tabs {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-top: 16px;
}

.subsection-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-item:hover {
    color: var(--text-main);
}

.tab-item.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.tab-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.tab-item.active .tab-count {
    background: #dbface;
    color: #166534;
}

/* Service List (Center Body) */
.services-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: 0.1s;
    box-shadow: var(--shadow-sm);
}

.service-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.service-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    touch-action: manipulation;
}

.qty-input-sm {
    width: 50px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    font-size: 16px;
    /* Prevent zoom on iOS */
    font-weight: 500;
    touch-action: manipulation;
    transition: border-color 0.2s;
}

.qty-input-sm:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(85, 151, 252, 0.1);
}

.btn-add {
    background: var(--secondary);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.1s;
    font-size: 22px;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-add:active {
    transform: scale(0.95);
    background: var(--primary);
}

.price-badge {
    font-weight: 600;
    color: var(--text-main);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Cart (Right Panel) */
.cart-header {
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.cart-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.area-input-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.area-label {
    font-size: 12px;
    color: #0369a1;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.area-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-lg {
    flex: 1;
    padding: 8px;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #0284c7;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-lg:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

.client-info-box {
    margin-bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.input-std {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.input-std:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(85, 151, 252, 0.1);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f8fafc;
}

.cart-item {
    background: white;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid transparent;
}

.cart-item.fixed-cleaning {
    border-left-color: var(--secondary);
    background: #f0f9ff;
}

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

.cart-item-name {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
}

.btn-remove {
    color: #cbd5e1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
}

.btn-remove:hover {
    color: var(--accent-danger);
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-price {
    font-weight: 600;
    color: var(--text-main);
}

.cart-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.02);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 12px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.discount-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-copy {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-copy:hover {
    background: #1e293b;
}

.btn-copy:active {
    transform: translateY(1px);
}

/* Admin & Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.modal.active {
    display: flex;
}

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

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

.modal-body {
    padding: 16px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: white;
    font-size: 13px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

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

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

/* Auth Modal */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.auth-box {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.pin-circles {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.pin-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    transition: 0.2s;
}

.pin-circle.filled {
    background: #3b82f6;
    border-color: #3b82f6;
}

.pin-circle.error {
    border-color: #ef4444;
    background: #fee2e2;
    animation: shake 0.3s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.num-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: 0.1s;
}

.num-btn:active {
    background: #e2e8f0;
    transform: scale(0.95);
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        display: none;
    }

    .section-nav {
        display: none;
    }

    /* Mobile Header */
    .top-bar {
        padding: 0 10px;
        justify-content: space-between;
        height: 50px;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Header content visibility */
    .quote-selector {
        display: none;
    }

    /* Hide desktop quote selector */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: white;
        transition: opacity 0.2s;
    }

    .mobile-menu-btn:active {
        opacity: 0.7;
    }

    /* Mobile Section Chips */
    .mobile-sections {
        display: flex;
        overflow-x: auto;
        padding: 10px;
        background: white;
        white-space: nowrap;
        border-bottom: 1px solid var(--border);
        -webkit-overflow-scrolling: touch;
        gap: 8px;
    }

    .section-chip {
        padding: 6px 12px;
        background: #f1f5f9;
        border-radius: 20px;
        font-size: 13px;
        color: var(--text-secondary);
        border: 1px solid transparent;
        font-weight: 500;
    }

    .section-chip.active {
        background: var(--secondary);
        color: white;
        border-color: var(--secondary);
    }

    /* Show search on mobile in main content */
    .mobile-search-container {
        display: block;
        padding: 10px;
        background: white;
        border-bottom: 1px solid var(--border);
    }

    .mobile-search-container .search-input {
        padding-left: 32px;
    }

    .main-content {
        padding: 0;
    }

    /* Mobile Cart */
    .cart-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border: none;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 2000;
        display: flex;
    }

    .cart-panel.open {
        transform: translateX(0);
    }

    .cart-trigger {
        display: flex;
    }

    .cart-header {
        padding-top: 50px;
        /* Space for close button */
    }
}

/* SVG Icons classes */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

/* Auto-expand textarea */
textarea.auto-expand {
    resize: none;
    overflow: hidden;
    min-height: 38px;
    line-height: 1.4;
    padding-top: 8px;
}

/* Utility */
.desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

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

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
}

/* Utility */
.hidden {
    display: none !important;
}

.text-red {
    color: var(--accent-danger);
}

.text-green {
    color: var(--accent-success);
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-disabled {
    background: #e2e8f0;
    color: #64748b;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 200;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    bottom: 30px;
}

.search-breadcrumb {
    font-size: 10px;
    color: #94a3b8;
    display: block;
    margin-bottom: 2px;
}

/* Mobile Sticky Footer */
.mobile-cart-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary);
    color: white;
    padding: 12px 16px;
    /* display controlled by mobile-only class */
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 -2px 10px rgba(85, 151, 252, 0.3);
}

.cart-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.cart-preview-action {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
}

.cart-arrow {
    font-size: 12px;
    opacity: 0.8;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Brand Logo */
.brand-logo {
    height: 32px;
    width: auto;
}

/* Full Width Mobile Search */
@media (max-width: 768px) {
    .mobile-search-container {
        width: 100%;
        padding: 10px;
        background: white;
        border-bottom: 1px solid var(--border);
    }

    .mobile-search-container .search-input-wrapper {
        width: 100%;
    }

    .mobile-search-container .search-input {
        width: 100%;
        border-radius: 8px;
        background: #f1f5f9;
        border: none;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .services-list-container {
        padding-bottom: 70px;
        /* Space for sticky footer */
    }

    /* Hide old FAB if needed */
    .cart-trigger {
        display: none;
    }

    /* Service Rows on Mobile */
    .service-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }

    .service-info {
        width: 100%;
        gap: 6px;
    }

    .service-name {
        font-size: 14px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .service-meta {
        font-size: 11px;
        flex-wrap: wrap;
    }

    .service-controls {
        width: 100%;
        justify-content: space-between;
    }

    .qty-input-sm {
        width: 60px;
        font-size: 16px;
        padding: 8px;
    }

    .btn-add {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .price-badge {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 80px;
    /* Above sticky footer */
    right: 20px;
    z-index: 1001;
    /* display controlled by mobile-only class */
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
    /* Container doesn't block touches */
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    /* Button is clickable */
    transition: transform 0.2s, background 0.2s;
}

.fab-main:active {
    transform: scale(0.95);
}

.fab-main.active {
    background: #1e293b;
    transform: rotate(45deg);
}

.fab-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: 0.2s;
}

.fab-actions.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-action {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.1s;
}

.fab-action:active {
    transform: scale(0.98);
    background: #f8fafc;
}

.fab-action span {
    margin-right: 4px;
}

.fab-action-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--accent-danger);
}

.fab-action-danger:active {
    background: #fee2e2;
}

/* Mobile quote list item */
.mobile-quote-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-quote-item:hover {
    background: #f8fafc;
}

.mobile-quote-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--secondary);
}

.mobile-quote-item-name {
    font-weight: 600;
    font-size: 14px;
}

.mobile-quote-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Admin Panel Styles */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-body);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100vw;
}

.admin-panel.hidden {
    display: none;
}

.admin-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.admin-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.admin-header-actions {
    display: flex;
    gap: 8px;
}

.admin-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 0;
}

.admin-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: 0.2s;
}

.admin-tab:hover {
    color: var(--text-main);
    background: #f8fafc;
}

.admin-tab.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    background: white;
}

.admin-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-body);
    overflow-x: hidden;
    max-width: 100%;
}

.admin-tab-content.hidden {
    display: none;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.admin-services-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-service-row {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}

.admin-service-row:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-md);
}

.admin-service-row.inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.admin-service-info {
    flex: 1;
}

.admin-service-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.admin-service-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-service-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-sections-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-section-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-section-header strong {
    font-size: 16px;
    color: var(--text-main);
}

.admin-subsections {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-subsection-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-main);
}

.btn-xs {
    padding: 2px 6px;
    font-size: 10px;
    min-width: auto;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-base {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

/* Admin mode - dim main app */
body.admin-mode .app-container {
    opacity: 0.3;
    pointer-events: none;
}

body.admin-mode .mobile-cart-sticky {
    opacity: 0.3;
    pointer-events: none;
}

body.admin-mode .fab-container {
    opacity: 0.3;
    pointer-events: none;
}

/* Mobile Admin Panel Optimizations */
@media (max-width: 768px) {
    /* Admin Header */
    .admin-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .admin-header h2 {
        font-size: 18px;
        text-align: center;
    }

    .admin-header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-header-actions .btn {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* Admin Tabs */
    .admin-tabs {
        padding: 0 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-tab {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Admin Content */
    .admin-tab-content {
        padding: 12px;
    }

    .admin-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .admin-section-header h3 {
        font-size: 16px;
    }

    .admin-section-header > div {
        flex-direction: column;
        width: 100%;
    }

    .admin-section-header select {
        width: 100% !important;
    }

    /* Service Rows in Admin */
    .admin-service-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }

    .admin-service-info {
        width: 100%;
    }

    .admin-service-name {
        font-size: 14px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .admin-service-meta {
        font-size: 11px;
        flex-wrap: wrap;
    }

    .admin-service-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 8px;
    }

    .admin-service-actions .btn {
        flex: 1;
        min-height: 36px;
        font-size: 12px;
    }

    /* Section Management */
    .admin-section-item {
        padding: 12px;
    }

    .admin-section-header-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .admin-section-header strong {
        font-size: 14px;
    }

    .admin-subsections {
        gap: 6px;
    }

    .admin-subsection-item {
        padding: 6px 10px;
        font-size: 12px;
        flex-wrap: wrap;
    }

    /* Modal Optimizations for Mobile */
    .modal {
        width: 95%;
        max-height: 85vh;
        max-width: none;
        overflow: hidden;
    }

    .modal-header {
        padding: 12px;
        font-size: 15px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .modal-body {
        padding: 12px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .modal-body input[type="text"],
    .modal-body input[type="number"],
    .modal-body select,
    .modal-body textarea {
        font-size: 16px !important;
        /* Prevent iOS zoom */
        padding: 10px;
    }

    .modal-footer {
        padding: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Service Edit Modal Specific */
    #editServiceModal .modal {
        max-width: 95%;
    }

    #editServiceModal .modal-body {
        gap: 16px;
    }

    #editServiceModal label {
        font-size: 12px !important;
    }

    #editServiceModal small {
        font-size: 11px !important;
    }

    /* Data Management Cards */
    .admin-tab-content > div {
        max-width: 100% !important;
    }

    .admin-tab-content > div > div {
        padding: 16px !important;
    }

    .admin-tab-content h4 {
        font-size: 15px !important;
    }

    .admin-tab-content p {
        font-size: 12px !important;
    }

    .admin-tab-content button {
        width: 100%;
        padding: 12px !important;
        font-size: 14px !important;
    }

    /* Services Count */
    #adminServicesCount {
        font-weight: 600;
        color: var(--secondary);
    }

    /* Better touch targets */
    .admin-service-row .btn-header,
    .admin-section-item .btn-xs {
        min-height: 36px;
        min-width: 36px;
        padding: 8px;
    }

    /* Archive Modal */
    #archiveModal .modal {
        width: 95%;
    }

    #archiveModal .modal-body {
        padding: 12px;
    }

    #archiveList {
        height: 50vh !important;
    }

    /* Section Item Improvements */
    .admin-section-item .admin-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .admin-section-item .admin-section-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .admin-section-item .admin-section-header strong {
        flex: 1 1 100%;
        margin-bottom: 4px;
    }

    .admin-section-item .admin-section-header .btn {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    /* Subsection Items */
    .admin-subsection-item {
        width: 100%;
        justify-content: space-between;
    }

    .admin-subsection-item button {
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Move buttons - improve touch targets */
    .admin-service-row button[onclick*="moveUp"],
    .admin-service-row button[onclick*="moveDown"],
    .admin-subsection-item button,
    .admin-section-item button {
        min-height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    /* Edit and Delete buttons in sections */
    .btn-sm {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 36px;
    }

    /* Input fields in modals */
    input[list] {
        font-size: 16px !important;
    }

    /* Grid layouts in modal */
    .modal-body > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .modal-body > div > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }

    /* Responsive 2-column grids become 1-column on mobile */
    #normalServiceGroup > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    #baseServiceGroup > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Client info on mobile */
    .client-info-box {
        grid-template-columns: 1fr !important;
    }

    /* Discount row on mobile */
    .discount-row {
        grid-template-columns: 1fr !important;
    }

    /* Cart item improvements */
    .cart-item-name {
        font-size: 13px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Top bar brand */
    .brand-logo {
        height: 28px;
    }

    .brand span {
        font-size: 10px;
    }

    /* Services list padding adjustment */
    .services-list-container {
        padding: 12px;
    }

    /* Tab counts on mobile */
    .tab-count {
        font-size: 9px;
        padding: 2px 5px;
    }

    /* Wizard header on mobile */
    .wizard-header {
        padding: 0 12px;
    }

    /* Subsection tabs improvements */
    .subsection-tabs {
        gap: 16px;
        padding-bottom: 2px;
    }

    .tab-item {
        font-size: 12px;
        padding-bottom: 12px;
    }
}

/* Extra Small Devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    /* Admin header ultra compact */
    .admin-header {
        padding: 10px 12px;
    }

    .admin-header h2 {
        font-size: 16px;
    }

    .admin-header-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 80px;
    }

    /* Modal even more compact */
    .modal {
        width: 98%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 10px;
        font-size: 14px;
    }

    .modal-body {
        padding: 10px;
    }

    .modal-footer {
        padding: 10px;
    }

    /* Service rows ultra compact */
    .admin-service-row {
        padding: 10px;
    }

    .admin-service-name {
        font-size: 13px;
    }

    .admin-service-meta {
        font-size: 10px;
    }

    /* Section items */
    .admin-section-item {
        padding: 10px;
    }

    /* Buttons more compact */
    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .btn-sm {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }

    /* Admin tabs */
    .admin-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Service controls */
    .qty-input-sm {
        width: 55px;
        font-size: 16px;
    }

    .btn-add {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    /* Cart improvements */
    .cart-item {
        padding: 8px 10px;
    }

    .cart-item-name {
        font-size: 12px;
    }

    /* Top bar */
    .top-bar {
        height: 48px;
        padding: 0 8px;
    }

    .brand-logo {
        height: 26px;
    }

    /* Mobile sticky cart */
    .mobile-cart-sticky {
        padding: 10px 12px;
    }

    .cart-preview-info {
        font-size: 13px;
    }

    .cart-preview-action {
        font-size: 15px;
        padding: 5px 10px;
    }
}