:root {
    --bg: #f5f7fb;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #0a84ff;
    --accent-dark: #0066cc;
    --shadow: 0 18px 45px rgba(31, 41, 55, 0.10);
    --radius: 22px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(135deg, #f7f9fc 0%, #eef3f8 100%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.app-shell.nav-top {
    display: flex;
    flex-direction: column;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px;
    border-right: 1px solid rgba(229, 231, 235, 0.9);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}
.nav-top .sidebar {
    z-index: 5;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    width: 100%;
    height: auto;
    padding: 14px 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}
.nav-top .main {
    width: 100%;
}
.brand, .profile-menu, .section-head, .action-row, .toolbar, .product-meta {
    display: flex;
    align-items: center;
}
.brand { gap: 12px; font-weight: 760; font-size: 18px; margin-bottom: 34px; }
.nav-top .brand { margin-bottom: 0; white-space: nowrap; }
.brand-mark, .auth-logo, .avatar {
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, #111827, #3b82f6);
    box-shadow: 0 12px 28px rgba(10, 132, 255, 0.22);
}
.brand-mark { width: 42px; height: 42px; border-radius: 14px; font-size: 13px; }
.nav { display: grid; gap: 8px; }
.nav-top .nav {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 3px 2px 5px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border-radius: 16px;
    color: #4b5563;
    font-weight: 650;
}
.nav-group { position: relative; }
.nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.nav-chevron {
    margin-left: auto;
    color: var(--muted);
    transition: transform .18s ease;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group.active > .nav-group-toggle {
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}
.nav-flyout {
    display: none;
    margin: 8px 0 4px;
    padding: 10px;
    border: 1px solid rgba(229,231,235,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 16px 36px rgba(17,24,39,.10);
}
.nav-group.open .nav-flyout { display: grid; gap: 6px; }
.nav-top .nav-flyout {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 20;
    width: 292px;
    margin: 0;
}
.breadcrumb-title {
    padding: 7px 9px 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
}
.crumb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 13px;
    color: #374151;
    font-weight: 680;
}
.crumb-link:hover, .crumb-link.active {
    color: var(--text);
    background: #f3f7ff;
}
.nav-top .nav-link { white-space: nowrap; }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}
.main { padding: 28px 34px 50px; overflow: hidden; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 680; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 32px; line-height: 1.12; letter-spacing: 0; }
h2 { margin-bottom: 18px; font-size: 20px; letter-spacing: 0; }
.profile-menu { gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid rgba(255,255,255,.8); border-radius: 20px; box-shadow: var(--shadow); }
.profile-menu span { display: block; color: var(--muted); font-size: 13px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; font-weight: 750; }
.menu-position-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    margin: 0 0 22px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #374151;
    background: rgba(255,255,255,.82);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 730;
    box-shadow: 0 8px 20px rgba(17,24,39,.06);
}
.menu-position-toggle:hover { background: #fff; }
.nav-top .menu-position-toggle { margin: 0; white-space: nowrap; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card, .content-card, .metric-card, .product-card, .settings-tile {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-card { width: min(430px, 100%); padding: 34px; text-align: center; }
.auth-card.wide { width: min(620px, 100%); }
.auth-logo { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 18px; font-weight: 800; }
.auth-card p { color: var(--muted); }
.auth-links { display: flex; justify-content: center; gap: 18px; margin-top: 18px; color: var(--accent); font-weight: 650; }

.client-status-page {
    min-height: 100vh;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(245,247,251,.92), rgba(235,244,255,.9)),
        url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}
.client-status-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 24px;
    align-items: end;
    max-width: 1120px;
    min-height: 420px;
    margin: 0 auto 24px;
    padding: 34px;
    border-radius: 28px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(8,17,32,.88), rgba(20,43,74,.78)),
        url("https://images.unsplash.com/photo-1581092160607-ee22731c2c5a?auto=format&fit=crop&w=1800&q=80") center / cover;
    box-shadow: 0 34px 90px rgba(15,23,42,.22);
}
.client-status-copy {
    max-width: 640px;
}
.client-status-copy .eyebrow,
.client-status-copy p {
    color: rgba(255,255,255,.76);
}
.client-status-copy h1 {
    margin: 8px 0 12px;
    font-size: 46px;
}
.client-status-copy p {
    max-width: 520px;
    line-height: 1.55;
}
.client-check-form {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 22px;
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(18px);
}
.client-check-form label {
    color: rgba(255,255,255,.88);
}
.client-alert,
.client-results {
    max-width: 1120px;
    margin: 0 auto 24px;
}
.client-alert {
    padding: 16px 18px;
    border-radius: 18px;
    color: #b42318;
    background: #fef3f2;
    box-shadow: var(--shadow);
    font-weight: 700;
}
.client-results {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow);
}
.client-order-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}
.client-order-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}
.client-order-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}
.client-order-head h3 {
    margin: 10px 0 6px;
    font-size: 24px;
}
.client-order-head p {
    color: var(--muted);
}
.client-order-head > strong {
    font-size: 24px;
    white-space: nowrap;
}
.client-order-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 0;
}
.client-order-facts div,
.client-payments div {
    padding: 13px;
    border-radius: 16px;
    background: #f8fafc;
}
.client-order-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}
.client-order-facts dd {
    margin: 6px 0 0;
    line-height: 1.45;
}
.client-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.client-timeline div {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 82px;
    padding: 14px 14px 14px 40px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfdff;
}
.client-timeline span {
    position: absolute;
    top: 18px;
    left: 14px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(10,132,255,.12);
}
.client-timeline small,
.client-payments small,
.client-payments span {
    color: var(--muted);
}
.client-table table {
    min-width: 620px;
}
.client-payments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.client-payments strong {
    display: block;
    margin: 5px 0;
    font-size: 20px;
}
.client-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.client-photo-grid a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: #f3f4f6;
}
.client-photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card { padding: 24px; margin-bottom: 22px; }
.content-card.narrow { max-width: 760px; }
.metric-grid, .product-grid, .settings-grid, .split-layout {
    display: grid;
    gap: 18px;
}
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.metric-card { padding: 22px; }
.metric-card span { color: var(--muted); font-weight: 650; }
.metric-card strong { display: block; margin-top: 14px; font-size: 30px; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.product-card { padding: 20px; min-height: 250px; display: flex; flex-direction: column; gap: 12px; }
.product-card h2 { margin-bottom: 0; font-size: 18px; }
.product-card p { color: var(--muted); line-height: 1.45; flex: 1; }
.product-meta { justify-content: space-between; gap: 12px; color: var(--muted); }
.product-meta strong { color: var(--text); font-size: 20px; }
.shop-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.shop-groups {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.shop-groups-head, .shop-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.catalog-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.shop-groups-head h2, .shop-results-head h2 { margin-bottom: 0; }
.shop-groups-head span { color: var(--muted); font-size: 13px; font-weight: 700; }
.group-node { margin-top: 6px; }
.group-node summary {
    display: block;
    list-style: none;
}
.group-node summary::-webkit-details-marker { display: none; }
.group-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 13px;
    color: #374151;
    font-size: 14px;
    font-weight: 690;
}
.group-link:hover, .group-link.active {
    color: var(--text);
    background: #fff;
    box-shadow: 0 8px 18px rgba(17,24,39,.06);
}
.group-link.child {
    min-height: 34px;
    margin-left: 12px;
    padding-left: 14px;
    color: var(--muted);
    font-size: 13px;
}
.group-children { display: grid; gap: 2px; margin: 3px 0 8px; }
.shop-results { min-width: 0; }
.shop-product-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.shop-product-card {
    min-height: 318px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 24px rgba(17,24,39,.06);
}
.view-switch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}
.view-switch-button:hover {
    background: #f3f6fb;
}
.view-switch-button.active {
    background: #dff0ff;
    box-shadow: inset 0 0 0 1px rgba(10,132,255,.18);
}
.view-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    color: #4b5563;
}
.view-switch-button.active .view-icon {
    color: var(--accent);
}
.icon-grid::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 4px;
    background:
        radial-gradient(currentColor 1.4px, transparent 1.5px) 0 0 / 6px 6px;
}
.icon-list::before,
.icon-list::after,
.icon-rows::before,
.icon-rows::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}
.icon-list::before { top: 3px; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.icon-list::after {
    top: 2px;
    left: 2px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}
.icon-rows::before { top: 2px; box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor; }
.icon-rows::after {
    top: 2px;
    left: 2px;
    right: auto;
    width: 14px;
    height: 2px;
    background: transparent;
}
.catalog-layout.view-list .shop-product-grid,
.catalog-layout.view-compact .shop-product-grid {
    grid-template-columns: 1fr;
}
.catalog-layout.view-list .shop-product-card,
.catalog-layout.view-compact .shop-product-card {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 0;
    gap: 16px;
    padding: 16px 18px;
}
.catalog-layout.view-list .product-thumb,
.catalog-layout.view-compact .product-thumb {
    width: 108px;
    aspect-ratio: 1 / 1;
}
.catalog-layout.view-list .shop-product-card .pill,
.catalog-layout.view-compact .shop-product-card .pill {
    grid-column: 2;
    margin-bottom: -4px;
}
.catalog-layout.view-list .shop-product-card h2,
.catalog-layout.view-compact .shop-product-card h2 {
    grid-column: 2;
    font-size: 18px;
    line-height: 1.28;
}
.catalog-layout.view-list .shop-product-card .product-price-stack,
.catalog-layout.view-compact .shop-product-card .product-meta,
.catalog-layout.view-list .shop-product-card .product-meta,
.catalog-layout.view-compact .shop-product-card .product-price-stack {
    grid-column: 3;
    justify-self: end;
    text-align: right;
    margin-top: 0;
}
.catalog-layout.view-list .shop-product-card .product-price-stack strong,
.catalog-layout.view-compact .shop-product-card .product-price-stack strong {
    font-size: 24px;
}
.catalog-layout.view-list .shop-product-card .product-meta,
.catalog-layout.view-compact .shop-product-card .product-meta {
    display: grid;
    gap: 4px;
}
.catalog-layout.view-compact .shop-product-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 16px;
}
.catalog-layout.view-compact .product-thumb,
.catalog-layout.view-compact .shop-product-card .pill {
    display: none;
}
.catalog-layout.view-compact .shop-product-card h2 {
    grid-column: 1;
    font-size: 17px;
}
.catalog-layout.view-compact .shop-product-card .product-price-stack,
.catalog-layout.view-compact .shop-product-card .product-meta {
    grid-column: 2;
}
.catalog-layout.view-compact .shop-product-card .product-price-stack strong {
    font-size: 20px;
}
.shop-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(31,41,55,.14);
}
.product-thumb {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #edf4ff);
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-thumb span { font-size: 42px; }
.service-thumb {
    background: linear-gradient(135deg, #f7fbff, #eef8f3);
}
.product-price-stack { display: grid; gap: 4px; margin-top: auto; }
.product-price-stack strong { font-size: 22px; }
.product-price-stack span { color: var(--muted); font-size: 13px; font-weight: 650; }
.product-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.product-modal.open { display: flex; }
.product-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.36);
    backdrop-filter: blur(10px);
}
.product-modal-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(0, 1.15fr);
    gap: 22px;
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 34px 90px rgba(15,23,42,.22);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}
.product-modal-media {
    display: grid;
    place-items: center;
    min-height: 300px;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
    font-size: 64px;
}
.product-modal-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-modal-body { display: grid; align-content: start; gap: 14px; padding-right: 28px; }
.product-modal-body h2 { margin-bottom: 0; font-size: 24px; }
.product-modal-body p { color: var(--muted); line-height: 1.5; }
.modal-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.modal-price-grid div {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}
.modal-price-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}
.modal-price-grid strong { display: block; margin-top: 6px; font-size: 18px; }
.modal-code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}
.modal-code-row span:not(:empty) {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f3f4f6;
}
.cart-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 17px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 18px 42px rgba(10,132,255,.34);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}
.cart-fab span {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    color: var(--accent);
    background: #fff;
    font-size: 13px;
}
.cart-drawer {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 110;
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 24px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 34px 90px rgba(15,23,42,.22);
    transform: translateX(calc(100% + 40px));
    transition: transform .22s ease;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.cart-drawer-head h2 { margin-bottom: 0; }
.cart-items {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 4px;
    flex: 1;
}
.cart-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}
.cart-item strong { font-size: 15px; }
.cart-item span { color: var(--muted); font-size: 13px; }
.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cart-qty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cart-qty button, .cart-remove {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.cart-remove { color: #b42318; }
.cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 18px;
}
.cart-feedback {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}
.cart-feedback.error {
    color: #b42318;
    background: #fef3f2;
}
.cart-feedback.success {
    color: #067647;
    background: #ecfdf3;
}
.danger-button { color: #b42318; }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.settings-tile { padding: 24px; transition: transform .18s ease, box-shadow .18s ease; }
.settings-tile:hover { transform: translateY(-2px); box-shadow: 0 22px 55px rgba(31, 41, 55, 0.14); }
.split-layout { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); align-items: start; }

.toolbar { justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 13px;
    background: rgba(255,255,255,.92);
    color: var(--text);
    font: inherit;
    outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(10,132,255,.6); box-shadow: 0 0 0 4px rgba(10,132,255,.12); }
.filters input { max-width: 360px; }
.filters select { max-width: 220px; }
.form-stack { display: grid; gap: 14px; text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; text-align: left; }
.form-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.form-grid p, .form-stack p { margin: 0; }
.form-grid .errorlist, .form-stack .errorlist { color: #b42318; margin: 0 0 6px; padding-left: 18px; }
label { display: block; margin-bottom: 7px; color: #374151; font-weight: 650; font-size: 14px; }

.primary-button, .secondary-button, .ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 10px 17px;
    cursor: pointer;
    font: inherit;
    font-weight: 720;
    white-space: nowrap;
}
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 12px 25px rgba(10,132,255,.24); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { color: var(--text); background: #fff; border: 1px solid var(--line); }
.ghost-button { color: var(--muted); background: transparent; }
.small { min-height: 34px; padding: 7px 12px; font-size: 13px; }
.full { width: 100%; }
.pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    color: #2563eb;
    background: #eff6ff;
    font-size: 12px;
    font-weight: 720;
}
.muted, .empty-state { color: var(--muted); }
.empty-state { grid-column: 1 / -1; padding: 30px; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 760; }
tr:hover td { background: rgba(255,255,255,.5); }
.section-head { justify-content: space-between; gap: 16px; }
.messages { display: grid; gap: 10px; margin-bottom: 18px; }
.message { padding: 13px 16px; border-radius: 16px; background: #ecfdf3; color: #067647; font-weight: 650; }
.message.error { background: #fef3f2; color: #b42318; }
.total-box { padding: 16px; border-radius: 18px; background: #f8fafc; font-size: 18px; }
.mini-list { display: grid; gap: 12px; }
.mini-list div { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mini-list span { color: var(--muted); }

.repair-calc {
    --calc-navy: #07111f;
    --calc-blue: #1d74ff;
    --calc-violet: #7c3aed;
    --calc-emerald: #10b981;
    --calc-orange: #f97316;
    display: grid;
    gap: 18px;
}
.repair-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 22px;
    overflow: hidden;
    padding: 28px;
    border-radius: 30px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(7,17,31,.96), rgba(17,36,82,.94) 48%, rgba(47,26,96,.94)),
        radial-gradient(circle at 82% 12%, rgba(29,116,255,.42), transparent 32%);
    box-shadow: 0 34px 90px rgba(7,17,31,.28);
}
.repair-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.08), transparent 38%),
        radial-gradient(circle at 18% 88%, rgba(16,185,129,.18), transparent 34%);
    pointer-events: none;
}
.repair-hero-copy, .repair-hero-stats { position: relative; z-index: 1; }
.calc-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
    font-size: 13px;
    font-weight: 760;
}
.repair-hero h2 {
    margin: 16px 0 10px;
    font-size: 38px;
    line-height: 1.05;
}
.repair-hero p {
    max-width: 720px;
    color: rgba(255,255,255,.74);
    line-height: 1.55;
}
.repair-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.glass-button {
    color: #fff;
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
}
.repair-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-self: end;
}
.repair-hero-stats div {
    min-height: 112px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 22px;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
}
.repair-hero-stats span {
    display: block;
    color: rgba(255,255,255,.66);
    font-size: 12px;
    font-weight: 760;
}
.repair-hero-stats strong {
    display: block;
    margin-top: 18px;
    font-size: 24px;
}
.calc-tabs {
    display: inline-flex;
    width: fit-content;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.calc-tab {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 9px 16px;
    color: #475569;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 760;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.calc-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--calc-blue), var(--calc-violet));
    box-shadow: 0 14px 28px rgba(29,116,255,.24);
}
.calc-panel { display: none; }
.calc-panel.active { display: block; }
.calc-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: 18px;
    align-items: start;
}
.calc-glass-card, .calc-result-card, .summary-card {
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 26px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 22px 60px rgba(15,23,42,.09);
    backdrop-filter: blur(22px);
}
.calc-glass-card { padding: 22px; }
.calc-form-card { display: grid; gap: 18px; }
.calc-card-head, .calc-control-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.calc-card-head h3, .calc-control-band h3, .insight-grid h3 {
    margin: 0;
    font-size: 20px;
}
.calc-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--calc-emerald);
    box-shadow: 0 0 0 8px rgba(16,185,129,.12), 0 0 24px rgba(16,185,129,.52);
}
.calc-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.calc-field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-field-grid label {
    margin: 0;
    color: #334155;
}
.calc-field-grid input, .calc-field-grid select {
    margin-top: 7px;
    border-radius: 18px;
    background: rgba(248,250,252,.9);
}
.calc-source-field {
    display: grid;
    gap: 9px;
    min-width: 0;
}
.calc-source-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.calc-source-head > label {
    margin: 0;
    color: #334155;
    font-weight: 650;
}
.calc-checkline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #64748b;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 750;
}
.calc-checkline input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--calc-blue);
}
.calc-source-field select,
.calc-source-field .calc-manual-field {
    width: 100%;
    margin-top: 0;
}
.calc-source-field .calc-manual-field {
    display: none;
}
.calc-source-field.manual select {
    display: none;
}
.calc-source-field.manual .calc-manual-field {
    display: block;
}
.master-settings-band {
    margin: 16px 0 14px;
    padding: 14px;
    border: 1px solid rgba(226,232,240,.92);
    border-radius: 22px;
    background: rgba(248,250,252,.78);
}
.segmented-control {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
}
.segmented-control button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 760;
}
.segmented-control button.active {
    color: #fff;
    background: var(--calc-navy);
}
.calc-result-card {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 16px;
    overflow: hidden;
    padding: 22px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(7,17,31,.98), rgba(14,30,58,.96) 55%, rgba(40,24,78,.96)),
        radial-gradient(circle at 72% 18%, rgba(29,116,255,.28), transparent 35%);
}
.result-topline {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}
.result-topline span {
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 760;
}
.result-topline strong {
    font-size: 32px;
    line-height: 1;
    text-align: right;
}
.result-ring {
    display: grid;
    place-items: center;
    min-height: 190px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background:
        radial-gradient(circle, rgba(29,116,255,.2) 0 36%, transparent 37%),
        conic-gradient(from 220deg, var(--calc-emerald), var(--calc-blue), var(--calc-violet), var(--calc-orange), var(--calc-emerald));
}
.result-ring div {
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: rgba(7,17,31,.92);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.result-ring span { color: rgba(255,255,255,.62); font-weight: 760; }
.result-ring strong { font-size: 30px; }
.result-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.result-metrics div {
    padding: 13px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(255,255,255,.08);
}
.result-metrics span {
    display: block;
    color: rgba(255,255,255,.62);
    font-size: 12px;
    font-weight: 760;
}
.result-metrics strong { display: block; margin-top: 7px; font-size: 18px; }
.calc-warning {
    padding: 12px 14px;
    border-radius: 18px;
    color: #ffedd5;
    background: rgba(249,115,22,.14);
}
.settings-calc-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.profile-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248,250,252,.86);
}
.profile-item strong { display: block; }
.profile-item span { color: var(--muted); font-size: 13px; }
.expense-table {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}
.expense-head, .expense-row {
    display: grid;
    grid-template-columns: 60px 1.3fr 1fr 120px 110px 110px;
    gap: 10px;
    align-items: center;
}
.expense-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}
.expense-row {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248,250,252,.86);
}
.expense-row input, .expense-row select {
    min-height: 38px;
    border-radius: 13px;
}
.expense-row .expense-cost {
    color: #0f172a;
    font-weight: 800;
}
.expense-toggle {
    width: 42px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
}
.expense-toggle.active { background: var(--calc-emerald); }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.summary-card {
    padding: 20px;
}
.summary-card span {
    display: block;
    color: var(--muted);
    font-weight: 740;
}
.summary-card strong {
    display: block;
    margin-top: 12px;
    font-size: 25px;
}
.insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.insight-grid p {
    color: var(--muted);
    line-height: 1.5;
}
.calc-toast {
    position: fixed;
    right: 22px;
    bottom: 90px;
    z-index: 130;
    max-width: min(360px, calc(100vw - 28px));
    padding: 14px 16px;
    border-radius: 18px;
    color: #fff;
    background: rgba(7,17,31,.92);
    box-shadow: 0 22px 60px rgba(15,23,42,.24);
    backdrop-filter: blur(18px);
    font-weight: 760;
}

@media (max-width: 980px) {
    .app-shell,
    .app-shell.nav-top {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    .sidebar,
    .nav-top .sidebar {
        position: sticky;
        z-index: 10;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
        height: auto;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    }
    .brand { margin-bottom: 0; min-width: 0; }
    .brand span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .menu-position-toggle {
        margin: 0;
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
    }
    .menu-position-toggle .toggle-text { display: none; }
    .nav,
    .nav-top .nav {
        grid-column: 1 / -1;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 2px 0 4px;
    }
    .nav-link {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 10px 12px;
        white-space: nowrap;
    }
    .nav-group { flex: 0 0 auto; }
    .nav-group-toggle { white-space: nowrap; }
    .nav-flyout,
    .nav-top .nav-flyout {
        position: fixed;
        top: 112px;
        left: 12px;
        right: 12px;
        z-index: 30;
        width: auto;
        max-width: none;
        margin: 0;
        border-radius: 20px;
    }
    .main { padding: 22px 16px 42px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .metric-grid, .split-layout { grid-template-columns: 1fr; }
    .client-status-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .client-order-head {
        align-items: stretch;
        flex-direction: column;
    }
    .client-order-head > strong {
        white-space: normal;
    }
    .shop-layout { grid-template-columns: 1fr; }
    .shop-groups {
        position: static;
        max-height: 320px;
    }
    .product-modal-card {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .product-modal-media { min-height: 220px; }
    .product-modal-body { padding-right: 0; }
    .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .profile-menu { width: 100%; justify-content: space-between; }
    .shop-results-head {
        align-items: stretch;
        flex-direction: column;
    }
    .catalog-head-actions {
        justify-content: space-between;
    }
    .catalog-layout.view-list .shop-product-card,
    .catalog-layout.view-compact .shop-product-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .catalog-layout.view-list .shop-product-card .product-price-stack,
    .catalog-layout.view-list .shop-product-card .product-meta,
    .catalog-layout.view-compact .shop-product-card .product-price-stack,
    .catalog-layout.view-compact .shop-product-card .product-meta {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }
    .repair-hero,
    .calc-workspace,
    .settings-calc-grid,
    .summary-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }
    .repair-hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .calc-result-card {
        position: static;
    }
    .calc-field-grid,
    .calc-field-grid.two {
        grid-template-columns: 1fr;
    }
    .expense-head {
        display: none;
    }
    .expense-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 25px; }
    h2 { font-size: 18px; }
    .main { padding: 18px 12px 34px; }
    .content-card, .metric-card, .product-card, .settings-tile { border-radius: 18px; }
    .content-card { padding: 18px; }
    .metric-grid, .product-grid, .settings-grid { gap: 12px; }
    .product-grid { grid-template-columns: 1fr; }
    .shop-product-card { min-height: 0; }
    .catalog-head-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .view-switcher {
        width: fit-content;
        align-self: flex-end;
    }
    .catalog-layout.view-list .shop-product-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }
    .catalog-layout.view-list .product-thumb {
        width: 72px;
    }
    .catalog-layout.view-list .shop-product-card h2,
    .catalog-layout.view-compact .shop-product-card h2 {
        font-size: 16px;
    }
    .catalog-layout.view-list .shop-product-card .product-price-stack strong,
    .catalog-layout.view-compact .shop-product-card .product-price-stack strong {
        font-size: 18px;
    }
    .modal-price-grid { grid-template-columns: 1fr; }
    .product-modal { padding: 10px; }
    .product-modal-card {
        max-height: calc(100vh - 20px);
        padding: 16px;
        border-radius: 20px;
    }
    .cart-fab {
        right: 12px;
        bottom: 12px;
    }
    .cart-drawer {
        inset: 8px;
        width: auto;
        border-radius: 20px;
    }
    .auth-page { padding: 14px; }
    .client-status-page {
        padding: 12px;
    }
    .client-status-hero {
        padding: 22px;
        border-radius: 22px;
    }
    .client-status-copy h1 {
        font-size: 32px;
    }
    .client-results,
    .client-order-card {
        padding: 18px;
        border-radius: 20px;
    }
    .auth-card { padding: 24px 18px; border-radius: 20px; }
    .profile-menu {
        display: grid;
        grid-template-columns: auto 1fr auto;
        border-radius: 18px;
    }
    .profile-menu form { justify-self: end; }
    .ghost-button { padding: 8px 10px; }
    .filters input, .filters select { max-width: none; }
    .primary-button, .secondary-button { width: 100%; }
    .action-row { align-items: stretch; flex-direction: column; }
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }
    .pill { max-width: 100%; }
    .repair-hero {
        padding: 22px;
        border-radius: 24px;
    }
    .repair-hero h2 {
        font-size: 29px;
    }
    .repair-hero-stats,
    .result-metrics,
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .repair-hero-actions,
    .calc-card-head,
    .calc-source-head,
    .calc-control-band,
    .result-topline {
        align-items: stretch;
        flex-direction: column;
    }
    .calc-checkline {
        width: fit-content;
    }
    .calc-tabs {
        width: 100%;
        overflow-x: auto;
    }
    .calc-tab {
        flex: 1 0 auto;
    }
    .expense-row {
        grid-template-columns: 1fr;
    }
    .calc-result-card,
    .calc-glass-card,
    .summary-card {
        border-radius: 22px;
    }
}
