/* ============================================================
   JC ASSISTÊNCIA — Mobile-First Design System v4
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
    --primary:       #c6a45b;
    --primary-dark:  #8e6f2f;
    --primary-light: #f3e8c4;
    --primary-glow:  rgba(198,164,91,0.2);
    --success:       #10b981;
    --success-light: #d1fae5;
    --success-dark:  #059669;
    --warning:       #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark:  #d97706;
    --danger:        #f43f5e;
    --danger-light:  #ffe4e6;
    --danger-dark:   #be123c;
    --info:          #b89549;
    --info-light:    #f3e8c4;
    --grad-primary:  linear-gradient(135deg, #8e6f2f 0%, #e0c875 100%);
    --grad-success:  linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-danger:   linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --grad-warning:  linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-dark:     linear-gradient(145deg, #242016 0%, #0b0a07 100%);
    --grad-purple:   linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --sb-bg:         #070604;
    --sb-width:      232px;
    --bg:        #f5f1e7;
    --surface:   #fffdf7;
    --surface-2: #faf4e7;
    --surface-3: #f0e6cf;
    --border:    #e0d2af;
    --border-2:  #cbb786;
    --text:           #211b10;
    --text-secondary: #66593d;
    --text-muted:     #94835f;
    --shadow-sm: 0 2px 8px rgba(15,23,42,0.06);
    --shadow:    0 4px 16px rgba(15,23,42,0.08);
    --shadow-md: 0 8px 24px rgba(15,23,42,0.10);
    --shadow-lg: 0 16px 48px rgba(15,23,42,0.14);
    --r-xs: 4px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;
    --bottom-nav-h: 64px;
    --topbar-h: 56px;
}
[data-theme="dark"] {
    --bg: #080704;
    --surface: #12100c;
    --surface-2: #1a1710;
    --surface-3: #241e13;
    --border: #3d3421;
    --border-2: #594a2a;
    --text: #f7f0dc;
    --text-secondary: #cbbd97;
    --text-muted: #968761;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.38);
    --shadow: 0 4px 16px rgba(0,0,0,0.46);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.52);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.62);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}
[data-theme="dark"] body {
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.16), transparent 28%),
        var(--bg);
}
[data-theme="dark"] .hero-panel,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .app-section-card,
[data-theme="dark"] .dashboard-footer-note,
[data-theme="dark"] .dashboard-os-card,
[data-theme="dark"] .service-card,
[data-theme="dark"] .osc,
[data-theme="dark"] .inventory-card,
[data-theme="dark"] .people-card,
[data-theme="dark"] .search-result-card,
[data-theme="dark"] .summary-box,
[data-theme="dark"] .photo-upload-card,
[data-theme="dark"] .config-action-card,
[data-theme="dark"] .status-mini-card,
[data-theme="dark"] .feed-item,
[data-theme="dark"] .detail-card,
[data-theme="dark"] .picker-card,
[data-theme="dark"] .item-row-card,
[data-theme="dark"] .picker-empty {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text);
}
[data-theme="dark"] .metric-card-soft,
[data-theme="dark"] .template-card,
[data-theme="dark"] .tag-check,
[data-theme="dark"] .staff-pill,
[data-theme="dark"] .status-chip {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary);
}
[data-theme="dark"] .service-card.pending-highlight,
[data-theme="dark"] .dashboard-os-card.pending-highlight,
[data-theme="dark"] .pending-spotlight {
    background: linear-gradient(135deg, rgba(93,63,16,0.32), rgba(15,23,42,0.96)) !important;
}
[data-theme="dark"] .os-urgency-strip {
    background: linear-gradient(135deg, rgba(93,63,16,0.4), rgba(120,53,15,0.25)) !important;
    border-color: rgba(245,158,11,0.25) !important;
    color: #fbbf24 !important;
}
[data-theme="dark"] .os-urgency-link {
    border-color: rgba(245,158,11,0.4) !important;
    color: #fbbf24 !important;
}
[data-theme="dark"] .service-card-sub,
[data-theme="dark"] .dashboard-os-price,
[data-theme="dark"] .service-card-price,
[data-theme="dark"] .template-var-chip,
[data-theme="dark"] .service-pill,
[data-theme="dark"] .staff-pill.active,
[data-theme="dark"] .tag-check:has(input:checked) {
    background: rgba(198,164,91,0.18) !important;
    color: #f5eac9 !important;
    border-color: rgba(224,200,117,0.25) !important;
}
[data-theme="dark"] .dashboard-os-device,
[data-theme="dark"] .service-card-sub,
[data-theme="dark"] .search-result-price {
    color: #f3e4b9 !important;
}
[data-theme="dark"] .search-result-card.selected,
[data-theme="dark"] .summary-box,
[data-theme="dark"] .photo-upload-card {
    background: linear-gradient(135deg, rgba(198,164,91,0.16), rgba(15,23,42,0.94)) !important;
}
[data-theme="dark"] .config-action-card.danger {
    background: linear-gradient(180deg, rgba(32,14,22,0.95), rgba(58,22,31,0.95)) !important;
}
[data-theme="dark"] .feed-meta,
[data-theme="dark"] .service-card-meta,
[data-theme="dark"] .service-card-id,
[data-theme="dark"] .dashboard-os-id,
[data-theme="dark"] .status-note,
[data-theme="dark"] .picker-info-line,
[data-theme="dark"] .search-result-meta,
[data-theme="dark"] .item-row-meta {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .dashboard-footer-note strong,
[data-theme="dark"] .service-card-name,
[data-theme="dark"] .dashboard-os-client,
[data-theme="dark"] .item-row-title,
[data-theme="dark"] .picker-title,
[data-theme="dark"] .template-description {
    color: var(--text) !important;
}
[data-theme="dark"] .login-card .form-control,
[data-theme="dark"] .table-search {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .topbar,
[data-theme="dark"] .bottom-nav {
    background: rgba(9,17,31,0.92);
    border-color: var(--border);
}

/* ===== SPLASH ===== */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(224,200,117,0.22), transparent 32%),
        linear-gradient(180deg, #fff9e8, #f3e8c4 52%, #fffdf7);
    transition: opacity 0.32s ease, visibility 0.32s ease;
}
.app-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.app-splash-card {
    min-width: min(320px, 100%);
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 28px 26px;
    border-radius: 28px;
    background: rgba(255,255,255,0.84);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 24px 60px rgba(198,164,91,0.16);
    backdrop-filter: blur(18px);
}
.app-splash-logo {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: linear-gradient(145deg, #c6a45b, #e0c875);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 20px 34px rgba(198,164,91,0.28);
}
.app-splash-logo svg {
    width: 56px;
    height: 56px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-splash-logo svg rect:first-child {
    fill: rgba(255,255,255,0.14);
    stroke: rgba(255,255,255,0.16);
}
.app-splash-logo svg rect:nth-of-type(2),
.app-splash-logo svg rect:nth-of-type(3) {
    fill: none;
}
.app-splash-logo svg circle {
    fill: #ffffff;
    stroke: none;
}
.app-splash-text {
    display: grid;
    gap: 4px;
    text-align: center;
}
.app-splash-text strong {
    font-size: 1.12rem;
    font-weight: 900;
    color: #18140d;
}
.app-splash-text span {
    font-size: 0.9rem;
    color: #66593d;
}
.app-splash-dots {
    display: flex;
    gap: 8px;
}
.app-splash-dots span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #c6a45b;
    opacity: 0.24;
    animation: splashPulse 1.1s infinite ease-in-out;
}
.app-splash-dots span:nth-child(2) { animation-delay: 0.16s; }
.app-splash-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes splashPulse {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.24; }
    40% { transform: translateY(-4px); opacity: 1; }
}
[data-theme="dark"] .app-splash {
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.24), transparent 34%),
        linear-gradient(180deg, #080704, #18140d 60%, #1a1710);
}
[data-theme="dark"] .app-splash-card {
    background: rgba(8,17,31,0.84);
    border-color: rgba(148,163,184,0.16);
    box-shadow: 0 26px 60px rgba(2,6,23,0.42);
}
[data-theme="dark"] .app-splash-text strong { color: #fff9e8; }
[data-theme="dark"] .app-splash-text span { color: #e6d08d; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ===== APP SHELL ===== */
.app {
    display: flex;
    height: 100dvh;
    overflow: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.app.sidebar-collapsed {
    --sb-width: 84px;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 100;
    position: sticky;
    top: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-pdv-btn {
    min-width: 64px;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(198,164,91,0.22);
}
.sidebar-desktop-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.install-app-btn,
.theme-toggle-btn { white-space: nowrap; }
.icon-only-topbar-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 14px;
}
.icon-only-topbar-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.page-title { display: none; }
.menu-toggle {
    width: 40px; height: 40px;
    border: none; background: transparent; cursor: pointer;
    font-size: 18px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s;
}
.menu-toggle:hover { background: var(--surface-2); }
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; padding: 4px 8px; border-radius: var(--r-full);
}
.topbar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--grad-primary); color: white;
    font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.topbar-user-name { font-size: 0.85rem; font-weight: 600; }
.topbar-date { font-size: 0.75rem; color: var(--text-muted); display: none; }

/* ===== CONTENT AREA ===== */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
    -webkit-overflow-scrolling: touch;
}
.app.pdv-mode .sidebar,
.app.pdv-mode .sidebar-overlay,
.app.pdv-mode .topbar,
.app.pdv-mode .fab {
    display: none !important;
}
.app.pdv-mode .main-wrapper {
    margin-left: 0;
    width: 100%;
}
.app.pdv-mode .content {
    padding: 18px;
    max-width: 100%;
}
.app.pdv-mode + .bottom-nav {
    display: none !important;
}
.pdv-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pdv-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pdv-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.pdv-catalog-card,
.pdv-cart-panel {
    padding: 18px;
}
.pdv-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.pdv-product-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,246,255,0.94));
    box-shadow: 0 14px 28px rgba(15,23,42,0.06);
}
.pdv-product-top,
.pdv-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pdv-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(198,164,91,0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}
.pdv-product-stock {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}
.pdv-product-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
}
.pdv-product-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
}
.pdv-cart-count {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(198,164,91,0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}
.pdv-cart-list {
    display: grid;
    gap: 12px;
}
.pdv-cart-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}
.pdv-cart-main,
.pdv-cart-side {
    display: grid;
    gap: 6px;
}
.pdv-cart-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}
.pdv-cart-meta {
    color: var(--text-muted);
    font-size: 13px;
}
.pdv-cart-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    padding: 6px;
    border-radius: 999px;
    background: rgba(198,164,91,0.08);
}
.pdv-qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}
.pdv-floating-checkout {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #8e6f2f);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 18px 34px rgba(198,164,91,0.28);
}
.pdv-checkout-table th:last-child,
.pdv-checkout-table td:last-child,
.wizard-items-table th:last-child,
.wizard-items-table td:last-child {
    text-align: right;
}
.pdv-modal-total-box {
    margin-top: 0;
}

[data-theme="dark"] .pdv-product-card,
[data-theme="dark"] .pdv-cart-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(30,41,59,0.92));
    border-color: var(--border);
}
[data-theme="dark"] .pdv-product-badge,
[data-theme="dark"] .pdv-cart-count,
[data-theme="dark"] .pdv-cart-qty {
    background: rgba(224,200,117,0.16);
}

@media (min-width: 920px) {
    .pdv-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
        align-items: start;
    }
    .pdv-cart-panel {
        position: sticky;
        top: 18px;
    }
    .pdv-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pdv-cart-card {
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
    }
    .pdv-floating-checkout {
        display: none;
    }
    .report-scope-toggle {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ===== SIDEBAR (Desktop) ===== */
.sidebar {
    width: var(--sb-width);
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.24), transparent 30%),
        linear-gradient(180deg, #100d08 0%, #201a0f 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar-header {
    padding: 12px 12px 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon-wrap {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(179,141,61,0.4);
}
.logo-text { font-size: 0.95rem; font-weight: 800; color: #f1f5f9; line-height: 1.2; }
.logo-sub { font-size: 0.65rem; color: rgba(255,255,255,0.4); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.sidebar-close {
    width: 32px; height: 32px; border: none; cursor: pointer;
    background: rgba(255,255,255,0.06); border-radius: var(--r-sm);
    color: rgba(255,255,255,0.5); font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 10px 8px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 0; }
.sidebar-section-label {
    font-size: 0.56rem; font-weight: 700; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.25); text-transform: uppercase;
    padding: 12px 10px 5px; margin-top: 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 11px; border-radius: 13px; margin-bottom: 3px;
    text-decoration: none; color: rgba(255,255,255,0.7);
    font-size: 0.8rem; font-weight: 600;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.nav-label-row {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff9e8;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}
.nav-item.active .nav-badge {
    background: rgba(255,255,255,0.18);
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.06); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(198,164,91,0.22), rgba(29,78,216,0.12));
    color: #fff9e8;
    border-color: rgba(224,200,117,0.35);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.nav-icon {
    width: 32px; height: 32px; border-radius: 10px;
    text-align: center; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
}
.nav-icon svg,
.nav-icon-wrap svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-item.active .nav-icon {
    background: rgba(224,200,117,0.22);
    color: #fff;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-os-summary {
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(198,164,91,0.12));
    border: 1px solid rgba(255,255,255,0.08);
}
.sidebar-os-summary-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.72);
    margin-bottom: 8px;
}
.sidebar-os-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.sidebar-os-summary-card {
    padding: 8px 6px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}
.sidebar-os-summary-card span {
    display: block;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.64);
    line-height: 1.15;
}
.sidebar-os-summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    color: #fff;
}
.sidebar.is-collapsed .logo-sub,
.sidebar.is-collapsed .logo-text,
.sidebar.is-collapsed .sidebar-section-label,
.sidebar.is-collapsed .user-info,
.sidebar.is-collapsed .nav-item span:not(.nav-icon):not(.nav-badge),
.sidebar.is-collapsed .nav-label-row > span:first-child {
    display: none !important;
}
.sidebar.is-collapsed .sidebar-header {
    padding-inline: 10px;
    justify-content: center;
}
.sidebar.is-collapsed .sidebar-user-panel,
.sidebar.is-collapsed .nav-item,
.sidebar.is-collapsed .sidebar-actions {
    justify-content: center;
}
.sidebar.is-collapsed .sidebar-os-summary {
    padding: 8px;
}
.sidebar.is-collapsed .sidebar-os-summary-title,
.sidebar.is-collapsed .sidebar-os-summary-card span {
    display: none;
}
.sidebar.is-collapsed .sidebar-os-summary-grid {
    grid-template-columns: 1fr;
}
.sidebar.is-collapsed .sidebar-os-summary-card {
    padding: 7px 5px;
    text-align: center;
}
.sidebar.is-collapsed .sidebar-os-summary-card strong {
    margin-top: 0;
    font-size: 0.82rem;
}
.sidebar.is-collapsed .nav-item {
    padding-inline: 8px;
}
.sidebar.is-collapsed .nav-label-row {
    justify-content: center;
    flex: 0;
}
.sidebar.is-collapsed .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
}
.sidebar.is-collapsed .sidebar-btn {
    max-width: 54px;
}
.sidebar-user {
    display: flex; align-items: center; gap: 9px;
    padding: 8px; border-radius: var(--r-sm); margin-bottom: 8px;
}
.sidebar-user-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(198,164,91,0.12));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 8px;
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--grad-primary); color: white;
    font-size: 0.85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-name { font-size: 0.8rem; font-weight: 600; color: #e0d2af; }
.user-role { font-size: 0.66rem; color: rgba(255,255,255,0.35); }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-btn {
    flex: 1; padding: 8px 4px; border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.6);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-btn-danger:hover { background: rgba(244,63,94,0.2); border-color: rgba(244,63,94,0.3); color: #fca5a5; }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 24px rgba(15,23,42,0.08);
}
.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-muted); font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.15s; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .nav-icon-wrap {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.bottom-nav-item.active { color: var(--primary-dark); }
.bottom-nav-item.active .nav-icon-wrap {
    transform: scale(1.05);
    background: var(--primary-light);
    border-radius: 10px;
}
.bottom-nav-item:active .nav-icon-wrap { transform: scale(0.9); }

/* ===== FAB (Floating Action Button) ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px);
    right: 16px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white; font-size: 24px; font-weight: 300;
    border: none; cursor: pointer;
    box-shadow: 0 6px 20px rgba(179,141,61,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 190;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.92); }
.fab:hover { box-shadow: 0 8px 28px rgba(179,141,61,0.5); }
.fab-label {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 74px);
    right: 16px;
    background: var(--text);
    color: white;
    font-size: 0.72rem; font-weight: 600;
    padding: 4px 10px; border-radius: var(--r-full);
    pointer-events: none; opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.fab:hover + .fab-label { opacity: 1; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    background: #0c0a06;
    padding: 20px;
    position: relative; overflow: hidden;
}
[data-theme="dark"] .login-screen {
    background: #050403;
}
.login-shell {
    width: min(420px, 100%);
    display: block;
    position: relative;
    z-index: 1;
}
.login-screen::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(179,141,61,0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
.login-screen::after {
    content: '';
    position: absolute;
    top: -30%; left: -20%;
    width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(179,141,61,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-showcase {
    position: relative;
    min-height: 560px;
    border-radius: 28px;
    padding: 36px;
    background:
        radial-gradient(circle at top left, rgba(198,164,91,0.24), transparent 34%),
        linear-gradient(180deg, rgba(9,14,20,0.92), rgba(15,27,52,0.88));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 28px 70px rgba(0,0,0,0.35);
    color: #e0d2af;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.login-showcase-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: fit-content;
}
.login-showcase h1 {
    max-width: 580px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    font-weight: 900;
    margin-top: 22px;
}
.login-showcase > p {
    max-width: 560px;
    margin-top: 16px;
    font-size: 1rem;
    color: rgba(226,232,240,0.74);
}
.login-showcase-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}
.login-point {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}
.login-point strong {
    display: block;
    color: #fffdf7;
    font-size: 0.92rem;
}
.login-point span {
    display: block;
    margin-top: 8px;
    color: rgba(226,232,240,0.66);
    font-size: 0.82rem;
    line-height: 1.5;
}
.login-card {
    width: 100%; max-width: 380px;
    background: linear-gradient(180deg, rgba(10,15,22,0.86), rgba(16,35,37,0.82));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-xl);
    padding: 32px 28px;
    position: relative; z-index: 1;
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    margin: 0 auto;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo-wrap {
    width: 60px; height: 60px; border-radius: 16px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; font-weight: 900; letter-spacing: 0.14em; margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(179,141,61,0.4);
}
.login-brand h1 { font-size: 1.4rem; font-weight: 800; color: #f1f5f9; }
.login-brand p { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-card .form-group label { color: rgba(255,255,255,0.78); }
.login-card .form-control {
    background: rgba(255,255,255,0.97);
    min-height: 52px;
    font-size: 0.98rem;
}
.login-error {
    background: rgba(244,63,94,0.15); border: 1px solid rgba(244,63,94,0.3);
    color: #fca5a5; border-radius: var(--r-sm); padding: 10px 14px;
    font-size: 0.85rem;
}
.login-hint { text-align: center; margin-top: 16px; font-size: 0.75rem; color: rgba(255,255,255,0.25); }
.login-hint code { color: rgba(255,255,255,0.5); }
.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-right: 44px; }
.input-eye {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 44px; border: none; background: transparent;
    cursor: pointer; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}

/* ===== CARDS (Mobile Lists) ===== */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
}
.card:active { transform: scale(0.99); }
.card-body { padding: 14px 16px; }
.card-header-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    margin-bottom: 8px;
}
.card-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.card-meta-item { font-size: 0.75rem; color: var(--text-secondary); }
.card-actions {
    display: flex; gap: 6px; padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.card-actions .btn { flex: 1; }

/* ===== OS NUMBER BADGE ===== */
.os-number {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
    color: var(--text-muted); font-family: monospace;
}

/* ===== TABLE WRAPPER (Desktop) ===== */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 16px;
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.table-header h3 { font-size: 0.95rem; font-weight: 700; }
.table-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-search {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--r-sm); font-size: 0.85rem;
    background: var(--surface-2); width: 200px; outline: none;
    font-family: inherit; transition: border-color 0.15s;
}
.table-search:focus { border-color: var(--primary); }

table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
    padding: 10px 14px; text-align: left;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--text-muted);
    white-space: nowrap;
}
td { padding: 12px 14px; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ===== FORMS ===== */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.req { color: var(--danger); }
.form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 0.9rem; font-family: inherit; color: var(--text);
    background: var(--surface); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(244,63,94,0.14);
}
.phone-field {
    display: grid;
    grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
    gap: 10px;
}
.phone-country-select { font-weight: 700; }
.phone-number-input { letter-spacing: 0.02em; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; min-width: 0; }
.form-actions {
    display: flex; gap: 8px;
    padding-top: 8px; justify-content: flex-end;
}
.form-actions .btn { min-width: 100px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-14 { margin-bottom: 14px; }
.w-flex-2 { flex: 2; }
.section-pad-sm { padding: 16px; }
.hidden-input-file { display: none; }
.wizard-step-pane.is-hidden { display: none; }
.is-hidden { display: none !important; }
.print-pills-media { gap: 12px; flex-wrap: wrap; }

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--r-sm); border: none;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: all 0.15s; white-space: nowrap;
    min-height: 42px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--grad-primary); color: white; box-shadow: 0 2px 8px rgba(179,141,61,0.3); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(179,141,61,0.4); }
.btn-success { background: var(--grad-success); color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.btn-danger { background: var(--grad-danger); color: white; box-shadow: 0 2px 8px rgba(244,63,94,0.25); }
.btn-warning { background: var(--grad-warning); color: white; }
.btn-ghost { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; min-height: 34px; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; min-height: 28px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; min-height: 52px; border-radius: var(--r); }
.btn-icon-only {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 12px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--r-full);
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.badge-pendente     { background: #fef3c7; color: #92400e; }
.badge-andamento    { background: #f3e8c4; color: #7a5b23; }
.badge-finalizado   { background: #d1fae5; color: #065f46; }
.badge-entregue     { background: #e0e7ff; color: #765e2d; }
.badge-cancelado    { background: #ffe4e6; color: #9f1239; }
.badge-ativo        { background: #d1fae5; color: #065f46; }
.badge-inativo      { background: #f1f5f9; color: #64748b; }
.badge-pago         { background: #d1fae5; color: #065f46; }
.badge-pendente-com { background: #ffe4e6; color: #9f1239; }
.badge-tipo         { background: var(--primary-light); color: var(--primary-dark); }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.page-header h2 { font-size: 1rem; font-weight: 700; }

/* ===== SEARCH BAR ===== */
.search-bar-wrap { margin-bottom: 12px; }
.search-bar {
    width: 100%; padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 0.9rem; font-family: inherit; background: var(--surface);
    outline: none; transition: border-color 0.15s;
    min-height: 46px;
}
.search-bar:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-bar-wrap { position: relative; }
.search-bar-wrap::before {
    content: '🔍'; position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); font-size: 14px; pointer-events: none;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500; opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    position: fixed; z-index: 501;
    bottom: -100%; left: 0; right: 0;
    max-height: 92dvh;
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    display: flex; flex-direction: column;
    transition: bottom 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.modal.open { bottom: 0; }
.modal.modal-lg { max-height: 96dvh; }

.modal-handle {
    width: 40px; height: 4px;
    background: var(--border-2); border-radius: var(--r-full);
    margin: 10px auto 0;
    flex-shrink: 0;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 12px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border: none; cursor: pointer;
    background: var(--surface-2); border-radius: 50%;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.15s;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body {
    flex: 1; overflow-y: auto; padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

/* ===== WIZARD (Multi-Step OS) ===== */
.wizard-overlay {
    position: fixed; inset: 0;
    z-index: 600;
    background: var(--bg);
    display: flex; flex-direction: column;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}
.wizard-overlay.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wizard-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: rgba(255,255,255,0.88);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    backdrop-filter: blur(14px);
}
.wizard-window-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.wizard-window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15,23,42,0.12);
    position: relative;
}
.wizard-window-btn-close {
    background: #ff5f57;
    cursor: pointer;
}
.wizard-window-btn-close::before,
.wizard-window-btn-close::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 1.5px;
    background: rgba(123,28,28,0.9);
    opacity: 0;
    transition: opacity 0.16s ease;
}
.wizard-window-btn-close::before { transform: rotate(45deg); }
.wizard-window-btn-close::after { transform: rotate(-45deg); }
.wizard-window-btn-close:hover::before,
.wizard-window-btn-close:hover::after {
    opacity: 1;
}
.wizard-window-btn-min {
    background: #febc2e;
}
.wizard-window-btn-max {
    background: #28c840;
}
.wizard-free-position {
    right: auto !important;
    bottom: auto !important;
    max-width: none !important;
}
.wizard-dragging,
.wizard-dragging * {
    user-select: none !important;
}
.wizard-title { font-size: 1rem; font-weight: 700; flex: 1; }
.wizard-step-indicator { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.wizard-progress {
    height: 3px; background: var(--border); flex-shrink: 0;
    position: relative; overflow: hidden;
}
.wizard-progress-fill {
    height: 100%; background: var(--grad-primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-steps { flex: 1; overflow-y: auto; position: relative; padding: 18px 16px 24px; }
.wizard-step-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}
.wizard-pane-intro {
    padding: 4px 2px 0;
}
.wizard-pane-intro-card {
    padding: 6px 4px 2px;
}
.wizard-pane-intro h3 {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text);
}
.wizard-pane-intro p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}
.wizard-step {
    position: absolute; inset: 0;
    overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}
.wizard-step.active { transform: translateX(0); opacity: 1; }
.wizard-step.prev { transform: translateX(-30%); opacity: 0; }

.wizard-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    background: rgba(255,255,255,0.9); border-top: 1px solid var(--border);
    display: flex; gap: 8px; flex-shrink: 0;
    backdrop-filter: blur(14px);
}
.wizard-footer .btn { flex: 1; }

.step-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px; margin-bottom: 0;
}
.step-card-title {
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--primary);
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.step-card-title::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #242016; color: white;
    padding: 11px 20px; border-radius: var(--r-full);
    font-size: 0.875rem; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; white-space: nowrap;
    max-width: calc(100vw - 32px);
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #065f46; }
.toast.error   { background: #9f1239; }
.toast.warning { background: #92400e; }

/* ===== DASHBOARD / BENTO ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}
.col-span-12 { grid-column: span 12; }
.col-span-8  { grid-column: span 12; }
.col-span-6  { grid-column: span 12; }
.col-span-4  { grid-column: span 12; }
.col-span-3  { grid-column: span 6; }

.bento-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s;
}
.bento-item.dark {
    background: var(--grad-dark); border-color: transparent;
    color: white;
}
.bento-item.glass {
    border-color: transparent;
}
.bento-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 8px; }
.bento-item.dark .bento-label { color: rgba(255,255,255,0.5); }
.bento-value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.bento-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bento-title { font-size: 0.875rem; font-weight: 700; }
.section-body { display: flex; flex-direction: column; gap: 0; }
.icon-box {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.icon-box.white { background: rgba(255,255,255,0.15); }
.icon-box.danger { background: var(--danger-light); }
.icon-box.warning { background: var(--warning-light); }
.icon-box.success { background: var(--success-light); }

.ranking-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.ranking-item:last-child { border-bottom: none; }
.ranking-pos {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-3); color: var(--text-muted);
    font-size: 0.75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ranking-pos.gold   { background: #fef3c7; color: #d97706; }
.ranking-pos.silver { background: #f1f5f9; color: #64748b; }
.ranking-pos.bronze { background: #fde8d8; color: #c2410c; }
.ranking-name { font-size: 0.875rem; font-weight: 600; }
.ranking-sub  { font-size: 0.75rem; color: var(--text-muted); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-value { font-size: 0.875rem; font-weight: 700; }
.text-gradient { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-gradient-success { background: var(--grad-success); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ===== WELCOME ===== */
.welcome-hero {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px;
    margin-bottom: 12px;
    background-image: linear-gradient(135deg, rgba(179,141,61,0.04) 0%, transparent 60%);
}
.welcome-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.welcome-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== COMISSÃO CARDS ===== */
.comissao-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px; margin-bottom: 16px;
}
.comissao-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.comissao-card-name { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.comissao-card-pending { font-size: 1.3rem; font-weight: 800; color: var(--danger); line-height: 1.1; }
.comissao-card-pending.zero { color: var(--success-dark); }
.comissao-card-total { font-size: 0.72rem; color: var(--text-muted); }

/* ===== CHECKLIST ===== */
.checklist-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--surface-2); cursor: pointer;
    font-size: 0.83rem; font-weight: 500;
    transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.checklist-item input[type=checkbox] { display: none; }
.checklist-item .check-mark {
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border-2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.15s; font-size: 11px;
}
.checklist-item:has(input:checked) {
    background: var(--primary-light); border-color: var(--primary);
    color: var(--primary-dark);
}
.checklist-item:has(input:checked) .check-mark {
    background: var(--primary); border-color: var(--primary); color: white;
}
.checklist-item:has(input:checked) .check-mark::after { content: '✓'; }

/* ===== PECA ITEM ===== */
.peca-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--r-sm);
}
.peca-info { flex: 1; min-width: 0; }
.peca-name { font-size: 0.85rem; font-weight: 600; }
.peca-qty  { font-size: 0.75rem; color: var(--text-muted); }
.peca-actions { display: flex; align-items: center; gap: 8px; }
.peca-price { font-size: 0.9rem; font-weight: 700; color: var(--success-dark); }

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 24px; text-align: center; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 0.9rem; }
.empty-state .btn { margin-top: 16px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px; border-radius: var(--r-sm);
    font-size: 0.875rem; border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-light);  border-color: rgba(244,63,94,0.2);  color: var(--danger-dark); }
.alert-info    { background: var(--info-light);    border-color: rgba(59,130,246,0.2); color: var(--info-dark); }
.alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.2); color: var(--warning-dark); }
.alert-success { background: var(--success-light); border-color: rgba(16,185,129,0.2); color: var(--success-dark); }

/* ===== UTILITY ===== */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-green    { color: var(--success-dark); }
.text-red      { color: var(--danger); }
.text-yellow   { color: var(--warning-dark); }
.text-blue     { color: var(--info); }
.fw-semibold   { font-weight: 600; }
.fw-bold       { font-weight: 700; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.divider       { border: none; border-top: 1px solid var(--border); }
.mb-12 { margin-bottom: 12px; }
.section-title-sm {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
}

/* ===== FOTO UPLOAD ===== */
.foto-upload-area {
    border: 2px dashed var(--border-2); border-radius: var(--r);
    padding: 20px; text-align: center; cursor: pointer;
    color: var(--text-muted); font-size: 0.85rem;
    transition: all 0.15s; background: var(--surface-2);
}
.foto-upload-area:hover { border-color: var(--primary); color: var(--primary); }
.fotos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.foto-thumb {
    position: relative; border-radius: var(--r-sm); overflow: hidden;
    aspect-ratio: 1; background: var(--surface-3);
}
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.foto-thumb .foto-del {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0,0,0,0.6); border: none; cursor: pointer;
    width: 24px; height: 24px; border-radius: 50%;
    color: white; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

/* ===== OS DETAIL ===== */
.os-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.os-info-item { }
.os-info-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.os-info-value { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.os-detail-section { margin-bottom: 16px; }
.os-detail-section h4 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }

/* ===== OS PAGE HEADER ===== */
.os-header-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.os-stats-strip {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
}
.os-stat {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 10px 8px; gap: 2px;
}
.os-stat-n { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.os-stat-l { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.os-stat-and .os-stat-n { color: var(--info); }
.os-stat-pend .os-stat-n { color: var(--warning-dark); }
.os-stat-div { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ===== OS SEARCH ===== */
.os-search-wrap {
    position: relative; margin-bottom: 10px;
}
.os-search-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); font-size: 15px; pointer-events: none;
    line-height: 1;
}
.os-search {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--border); border-radius: var(--r-lg);
    font-size: 0.95rem; font-family: inherit; color: var(--text);
    background: var(--surface); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 50px;
}
.os-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.os-search::placeholder { color: var(--text-muted); }

/* ===== STATUS FILTER TABS ===== */
.status-tabs {
    display: flex; gap: 6px;
    overflow-x: auto; padding-bottom: 2px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: var(--r-full);
    font-size: 0.8rem; font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.status-tab:active { transform: scale(0.96); }
.tab-count {
    background: var(--surface-3); border-radius: 99px;
    font-size: 0.68rem; font-weight: 700; padding: 1px 7px; color: var(--text-muted);
}
.status-tab.active { color: white; border-color: transparent; background: var(--primary); }
.status-tab.active .tab-count { background: rgba(255,255,255,0.22); color: white; }
.status-tab.active.tab-andamento { background: var(--info); }
.status-tab.active.tab-pendente  { background: var(--warning-dark); }
.status-tab.active.tab-concluida { background: var(--success-dark); }
.status-tab.active.tab-cancelada { background: var(--danger-dark); }

/* ===== OS CARDS (Nova versão) ===== */
.osc-list { display: flex; flex-direction: column; gap: 10px; }

.osc {
    display: flex; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-lg);
    overflow: hidden; cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.osc:hover {
    border-color: color-mix(in srgb, var(--primary) 26%, var(--border));
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.osc:active { opacity: 0.9; }

/* Rail colorida lateral */
.osc-rail { width: 5px; flex-shrink: 0; }
.osc-rail-pendente  { background: var(--warning); }
.osc-rail-andamento { background: var(--info); }
.osc-rail-concluida,
.osc-rail-finalizado { background: var(--success); }
.osc-rail-entregue { background: #b38d3d; }
.osc-rail-cancelada { background: var(--danger); }
.osc-rail-urg { background: var(--danger) !important; }

.osc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 15px 14px;
    min-width: 0;
}

.osc-row-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0;
}
.osc-num {
    font-size: 0.68rem; font-weight: 800; font-family: monospace;
    color: var(--text-muted); letter-spacing: 0.05em;
}
.osc-tempo { font-size: 0.72rem; color: var(--text-muted); }
.osc-urg-tag {
    font-size: 0.68rem; font-weight: 700;
    background: var(--danger-light); color: var(--danger-dark);
    padding: 2px 8px; border-radius: 99px;
}

.osc-name {
    font-size: 1.05rem; font-weight: 800; color: var(--text);
    line-height: 1.2; margin-bottom: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.osc-sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0;
}
.osc-cat {
    background: var(--primary-light); color: var(--primary-dark);
    padding: 1px 7px; border-radius: 99px; font-size: 0.68rem; font-weight: 700;
}
.osc-tec-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}
.osc-tec-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.osc-tec {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(198,164,91,0.12);
    border: 1px solid rgba(198,164,91,0.18);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
    max-width: 100%;
}
.osc-prob {
    font-size: 0.78rem; color: var(--text-muted); font-style: italic;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 0;
}

.osc-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 2px;
}
.osc-price { font-size: 1rem; font-weight: 800; color: var(--success-dark); flex-shrink: 0; }

.osc-btns { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

/* Botões de ação no card */
.btn-osc {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 8px 12px; border-radius: var(--r-sm);
    font-size: 0.8rem; font-weight: 700; border: none; cursor: pointer;
    font-family: inherit; white-space: nowrap; min-height: 38px;
    transition: all 0.12s; -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.btn-osc:active { transform: scale(0.94); }
.btn-osc-wa   { background: #dcfce7; color: #15803d; padding: 8px 10px; }
.btn-osc-warn { background: var(--warning); color: white; }
.btn-osc-ok   { background: var(--success); color: white; }
.btn-osc-dim  { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); padding: 8px 10px; }


/* pointer-events: o card inteiro é clicável, mas só os botões disparam eventos próprios */
.osc * { pointer-events: none; }
.osc .osc-btns, .osc .osc-btns *,
.osc .osc-cta { pointer-events: auto; }

/* CTA de ação principal — botão grande e destacado dentro do card */
.osc-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px 16px; margin-top: 2px;
    border: none; border-radius: var(--r-sm);
    font-size: 0.9rem; font-weight: 700; letter-spacing: 0.01em;
    cursor: pointer; transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
}
.osc-cta:active { opacity: 0.82; transform: scale(0.98); }
.osc-cta-start  { background: var(--warning); color: #fff; }
.osc-cta-finish { background: var(--success); color: #fff; }
.osc-cta-icon   { font-size: 0.82rem; }

/* Idade de urgência */
.osc-age-warn   { background: #fef3c7 !important; color: #92400e !important; font-weight: 700 !important; padding: 2px 7px; border-radius: 99px; }
.osc-age-urgent { background: #fee2e2 !important; color: #991b1b !important; font-weight: 700 !important; padding: 2px 7px; border-radius: 99px; animation: pulse-urg 1.8s ease-in-out infinite; }
@keyframes pulse-urg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Urgency strip */
.os-urgency-strip {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: var(--r);
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 0.84rem; font-weight: 600; color: #92400e;
}
.os-urgency-icon { font-size: 1rem; flex-shrink: 0; }
.os-urgency-strip > span { flex: 1; }
.os-urgency-link {
    background: none; border: 1.5px solid #d97706; color: #92400e;
    border-radius: var(--r-full); padding: 4px 12px;
    font-size: 0.78rem; font-weight: 700; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    font-family: inherit;
}
.os-urgency-link:active { opacity: 0.75; }

/* ===== PAGINA OS — layout mobile-first ===== */

.os-page { display: flex; flex-direction: column; }

/* Header: fica dentro do padding normal do content, sem margin negativa */
.os-page-header {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(198,164,91,0.16), transparent 34%),
        linear-gradient(135deg, var(--surface), var(--surface-2));
    border: 1px solid rgba(148,163,184,0.28);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 18px 44px rgba(15,23,42,0.08);
}

.os-page-header-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-bottom: 12px;
}
.os-page-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.os-page-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.os-page-title { font-size: 1.18rem; font-weight: 900; color: var(--text); line-height: 1.2; letter-spacing: -0.03em; }
.os-page-date  { font-size: 0.78rem; font-weight: 800; color: var(--primary); }

.os-refresh-btn { white-space: nowrap; }
.os-nova-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.85rem; padding: 8px 16px; border-radius: var(--r-full);
    white-space: nowrap;
}

/* Filtro de data */
.os-filter-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 10px;
    transition: opacity 0.2s;
}
.os-date-mode-tabs {
    display: flex; gap: 3px;
    background: rgba(15,23,42,0.06);
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 18px;
    padding: 3px; flex-shrink: 0;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}
.os-date-mode-tabs::-webkit-scrollbar { display: none; }
.os-date-mode-btn {
    background: none; border: none; cursor: pointer;
    padding: 7px 13px; border-radius: 15px;
    font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
    transition: background 0.15s, color 0.15s; font-family: inherit;
    white-space: nowrap;
}
.os-date-mode-btn:focus-visible,
.os-tab:focus-visible,
.os-search-input:focus-visible,
.osc:focus-visible {
    outline: 3px solid rgba(198,164,91,0.34);
    outline-offset: 3px;
}
.os-date-mode-btn.active { background: #18140d; color: #fff; box-shadow: 0 8px 18px rgba(15,23,42,0.18); }
.os-date-inputs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.os-date-input {
    flex: 1; min-width: 0; max-width: 160px;
    font-size: 0.84rem !important; padding: 6px 10px !important;
    border-radius: var(--r-sm) !important;
}
.os-today-btn {
    font-size: 0.76rem !important; padding: 6px 12px !important;
    border-radius: var(--r-full) !important; flex-shrink: 0;
    border: 1.5px solid var(--border) !important;
}
.os-filter-hint {
    margin: -2px 0 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

/* Stats bar */
.os-stats-bar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    min-height: 28px;
}
.os-stat-pill {
    display: inline-flex; align-items: center;
    padding: 3px 11px; border-radius: var(--r-full);
    font-size: 0.76rem; font-weight: 700;
}
.os-stat-pend { background: var(--warning-light);  color: var(--warning-dark); }
.os-stat-and  { background: var(--info-light);     color: var(--primary-dark); }
.os-stat-conc { background: var(--success-light);  color: var(--success-dark); }
.os-stat-urg  { background: var(--danger-light);   color: var(--danger-dark); }
.os-stat-all-ok {
    font-size: 0.76rem; color: var(--success-dark); font-weight: 700;
    display: flex; align-items: center; gap: 5px;
}
.os-stat-all-ok::before { content: '✓'; }

/* Body da pagina */
.os-page-body {
    display: flex; flex-direction: column; gap: 10px;
    padding-bottom: 80px;
}

/* Search */
.os-search-wrap { position: relative; }
.os-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
    stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
}
.os-search-input {
    width: 100%; padding: 12px 14px 12px 40px;
    border: 1.5px solid rgba(148,163,184,0.42); border-radius: 18px;
    background: var(--surface); color: var(--text); font-size: 0.88rem;
    font-family: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.os-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(198,164,91,0.12); }

/* Tabs de status */
.os-tabs {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.os-tabs::-webkit-scrollbar { display: none; }
.os-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 16px;
    border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-secondary);
    font-size: 0.8rem; font-weight: 700; white-space: nowrap;
    cursor: pointer; font-family: inherit;
    transition: all 0.15s; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.os-tab:active { transform: scale(0.96); }
.os-tab-ct {
    background: var(--surface-3); color: var(--text-muted);
    font-size: 0.7rem; font-weight: 800;
    padding: 1px 7px; border-radius: 99px; min-width: 20px; text-align: center;
}
.os-tab-ct-zero { opacity: 0.4; }
.os-tab.active {
    background: #18140d; color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(15,23,42,0.16);
}
.os-tab.active .os-tab-ct {
    background: rgba(255,255,255,0.25); color: #fff;
}
.os-tab-agend { border-color: rgba(168,85,247,0.35); color: #7c3aed; }
.os-tab-agend.active { background: #7c3aed; border-color: transparent; }
[data-theme="dark"] .os-tab-agend { color: #c084fc; border-color: rgba(192,132,252,0.3); }

/* Estado vazio */
.os-empty {
    text-align: center; padding: 40px 16px;
    color: var(--text-muted); font-size: 0.92rem;
}
#osUrgBanner:empty {
    display: none;
}
#servicosList {
    margin: 0;
}
.os-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
.os-empty small { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--success); }

/* Grupos de label da lista */
.osc-grp-lbl {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--text-muted);
    padding: 12px 2px 6px; margin-top: 4px;
}
.osc-grp-ct {
    margin-left: auto;
    background: var(--surface-3); color: var(--text-muted);
    font-size: 0.65rem; font-weight: 700; padding: 1px 8px; border-radius: 99px;
}
.osc-grp-lbl svg {
    width: 13px; height: 13px; fill: none;
    stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.osc-grp-pend { color: var(--warning-dark); }
.osc-grp-and  { color: var(--info); }
.osc-grp-conc { color: var(--success-dark); }

/* Agendamento info no card */
.osc-agendado-date {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.78rem; font-weight: 700; color: #7c3aed;
    background: rgba(168,85,247,0.1);
    padding: 3px 10px; border-radius: var(--r-full);
    margin-bottom: 0;
}
.osc-agendado-date svg {
    width: 13px; height: 13px; fill: none;
    stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
[data-theme="dark"] .osc-agendado-date { color: #c084fc; background: rgba(192,132,252,0.12); }

.osc-commission {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(245,158,11,0.12);
    color: #92400e;
    border: 1px solid rgba(245,158,11,0.22);
    font-size: 0.78rem;
}
.osc-commission.is-credited {
    background: rgba(16,185,129,0.12);
    color: #047857;
    border-color: rgba(16,185,129,0.24);
}
.osc-commission-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    font-size: 0.74rem;
    font-weight: 900;
    flex-shrink: 0;
}
.osc-commission.is-credited .osc-commission-icon {
    background: #10b981;
    color: #fff;
}
.osc-commission-label {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.82;
    line-height: 1.1;
}
.osc-commission strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.15;
}
[data-theme="dark"] .osc-commission { background: rgba(245,158,11,0.14); color: #fbbf24; }
[data-theme="dark"] .osc-commission.is-credited { background: rgba(16,185,129,0.14); color: #34d399; }
.commission-detail-card {
    border-color: rgba(245,158,11,0.26) !important;
    background: linear-gradient(135deg, rgba(245,158,11,0.12), var(--surface)) !important;
}
.commission-detail-card.is-credited {
    border-color: rgba(16,185,129,0.28) !important;
    background: linear-gradient(135deg, rgba(16,185,129,0.14), var(--surface)) !important;
}

/* Rails extras */
.osc-rail-agendado { background: #a855f7; }
.osc-rail-entregue { background: var(--success-dark); }

/* Badge agendado */
.badge-agendado {
    background: rgba(168,85,247,0.12); color: #7c3aed;
    font-size: 0.68rem; font-weight: 800;
    padding: 2px 8px; border-radius: 99px; letter-spacing: 0.02em;
}
[data-theme="dark"] .badge-agendado { background: rgba(192,132,252,0.15); color: #c084fc; }

/* Badge entregue */
.badge-entregue {
    background: var(--success-light); color: var(--success-dark);
    font-size: 0.68rem; font-weight: 800;
    padding: 2px 8px; border-radius: 99px; letter-spacing: 0.02em;
}
[data-theme="dark"] .badge-entregue { background: rgba(16,185,129,0.15); color: #34d399; }

/* CTA entregar */
.osc-cta-deliver {
    background: var(--primary); color: #fff;
}

/* SVG no CTA */
.osc-cta-svg {
    width: 14px; height: 14px; fill: currentColor; flex-shrink: 0;
}
.osc-cta-finish .osc-cta-svg,
.osc-cta-svg-stroke {
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Wizard — toggle de agendamento */
.wizard-agend-toggle {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--r);
    border: 1.5px solid var(--border);
    cursor: pointer; background: var(--surface-2);
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.wizard-agend-toggle:has(input:checked) {
    border-color: #a855f7; background: rgba(168,85,247,0.06);
}
.wizard-agend-toggle input { display: none; }
.wizard-agend-toggle-content { display: flex; align-items: center; gap: 10px; flex: 1; }
.wizard-agend-toggle-icon {
    width: 36px; height: 36px; border-radius: var(--r-sm);
    background: rgba(168,85,247,0.1); color: #7c3aed;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wizard-agend-toggle-icon svg {
    width: 18px; height: 18px; fill: none;
    stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.wizard-agend-toggle strong { display: block; font-size: 0.92rem; color: var(--text); }
.wizard-agend-toggle small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.wizard-agend-check {
    width: 22px; height: 22px; border-radius: var(--r-sm);
    border: 2px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; background: var(--surface);
}
.wizard-agend-toggle:has(input:checked) .wizard-agend-check {
    background: #a855f7; border-color: #a855f7;
}
.wizard-agend-toggle:has(input:checked) .wizard-agend-check::after {
    content: ''; display: block;
    width: 5px; height: 9px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(42deg) translateY(-1px);
}
[data-theme="dark"] .wizard-agend-toggle { background: var(--surface-3); }
[data-theme="dark"] .wizard-agend-toggle-icon { background: rgba(192,132,252,0.1); color: #c084fc; }
[data-theme="dark"] .os-date-mode-tabs { background: var(--surface-3); }
[data-theme="dark"] .os-filter-row {
    background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(17,24,39,0.96));
    border-color: rgba(148,163,184,0.14);
}

/* Lista de OS em coluna (dashboard) */
.osc-list-col {
    display: flex; flex-direction: column; gap: 10px;
}

/* Layout helpers */
.osc-row-top-right {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.osc-footer-left {
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.osc-device {
    font-size: 0.8rem; color: var(--text-secondary); font-weight: 500;
}

/* Botão deletar */
.btn-osc-del {
    background: var(--danger-light); color: var(--danger-dark);
    padding: 8px 10px; font-size: 1rem; line-height: 1;
}

/* FAB — Nova OS (mobile) */
.os-fab {
    display: none;
    position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); right: 18px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 1.6rem; line-height: 1; font-weight: 300;
    border: none; cursor: pointer;
    box-shadow: 0 4px 18px rgba(198,164,91,0.42);
    z-index: 200;
    align-items: center; justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.os-fab:active { transform: scale(0.92); box-shadow: 0 2px 10px rgba(198,164,91,0.3); }
@media (max-width: 767px) {
    .os-fab { display: flex; }
    /* No mobile, botao header "Nova OS" fica oculto — usa o FAB */
    .os-page-new-btn { display: none; }
}

/* Step dots do wizard */
.wiz-dots {
    display: flex; align-items: center; gap: 6px;
}
.wiz-dot {
    width: 8px; height: 8px; border-radius: 99px;
    background: var(--border-2);
    transition: all 0.2s ease;
}
.wiz-dot.done {
    background: rgba(198,164,91,0.35);
    width: 8px;
}
.wiz-dot.active {
    background: var(--primary);
    width: 20px;
}

/* ===== OS MODAL ACTIONS ===== */
.os-modal-actions {
    display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.os-modal-actions .btn { min-width: 0; }

/* ===== BADGES ===== */
.badge-pendente  { background: #fef3c7; color: #92400e; }
.badge-andamento { background: #f3e8c4; color: #7a5b23; }
.badge-finalizado,
.badge-concluida { background: #d1fae5; color: #065f46; }
.badge-cancelado,
.badge-cancelada { background: #ffe4e6; color: #9f1239; }

/* ===== PRINT ===== */
.print-only { display: none; }
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body > *:not(#printArea) { display: none !important; }
    #printArea { display: block !important; }

    /* Limitar imagens para nao transbordar pagina */
    .print-device-photo { width: 120px !important; height: 120px !important; object-fit: cover !important; }
    .print-photos-row img { width: 110px !important; height: 110px !important; object-fit: cover !important; }
    .print-logo { width: 56px !important; height: 56px !important; }

    /* Evitar quebras indesejadas */
    .print-block, .print-footer, .print-signatures,
    .print-totals, .print-info-grid { page-break-inside: avoid; break-inside: avoid; }
}

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
    :root { --bottom-nav-h: 0px; }

    .bottom-nav { display: none; }
    .fab { display: none; }
    .fab-label { display: none; }
    .sidebar-desktop-toggle { display: inline-flex; }

    .sidebar {
        position: sticky;
        transform: translateX(0);
        top: 0; height: 100dvh;
        flex-shrink: 0;
    }
    .sidebar-overlay { display: none; }
    .sidebar-close { display: none; }
    .menu-toggle { display: none; }

    .content { padding: 24px; padding-bottom: 24px; }

    .topbar-date { display: block; }

    .col-span-8  { grid-column: span 8; }
    .col-span-6  { grid-column: span 6; }
    .col-span-4  { grid-column: span 4; }
    .col-span-3  { grid-column: span 3; }

    .modal {
        inset: auto;
        top: 50%; left: 50%;
        transform: translate(-50%, -48%) scale(0.96);
        bottom: auto;
        max-width: 520px;
        width: calc(100% - 48px);
        border-radius: var(--r-xl);
        max-height: 90dvh;
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
    .modal.modal-lg { max-width: 680px; }
    .modal-handle { display: none; }

    .toast {
        bottom: 24px;
        left: calc(var(--sb-width) + 50%);
        transform: translateX(-50%) translateY(20px);
    }
    .toast.show { transform: translateX(-50%) translateY(0); }

    .wizard-overlay {
        inset: auto;
        top: 0;
        right: auto;
        bottom: 0;
        left: calc(50% + (var(--sb-width) / 2));
        width: calc(100vw - var(--sb-width));
        max-width: calc(100vw - var(--sb-width));
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .wizard-overlay.open { transform: translateX(-50%); }
    .wizard-overlay.wizard-free-position {
        transform: translateY(18px);
        transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
    }
    .wizard-overlay.wizard-free-position.open { transform: translateY(0); }
    .wizard-topbar {
        cursor: move;
    }
    .wizard-topbar button {
        cursor: pointer;
    }

    .bento-value { font-size: 2rem; }

    .card-list { display: none; }
    .osc-list { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .osc-list .osc-grp-lbl,
    .osc-list .os-empty,
    .osc-list .picker-empty { grid-column: 1 / -1; }
    .table-wrapper { display: block; }

    .topbar-h { --topbar-h: 60px; }

    .checklist-grid { grid-template-columns: repeat(3, 1fr); }

    .os-info-grid { grid-template-columns: repeat(3, 1fr); }

    .wizard-steps { padding: 24px 28px; }
    .wizard-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .wizard-form-grid .form-group:last-child { grid-column: 1 / -1; }
    .wizard-stage-layout { grid-template-columns: 3fr 2fr; }
    .wizard-summary-sticky { position: sticky; top: 16px; }
    .wizard-footer { flex-direction: row !important; }
    .wizard-footer .btn { flex: 1; }
    .os-modal-actions { flex-direction: row !important; flex-wrap: wrap; }
    .os-modal-actions .btn { flex: 1 1 auto; width: auto !important; }
}

@media (min-width: 1200px) {
    .osc-list { grid-template-columns: repeat(3, 1fr) !important; }
}

/* Mobile: hide desktop tables in pages that have card views */
@media (max-width: 767px) {
    .desktop-table { display: none !important; }
    .mobile-cards, .osc-list { display: flex !important; flex-direction: column; gap: 10px; }

    .bento-value { font-size: 1.4rem; }

    .form-row { flex-direction: column; gap: 10px; }
    .phone-field { grid-template-columns: 1fr; }

    .os-info-grid { grid-template-columns: 1fr 1fr; }

    .table-header-actions { width: 100%; }
    .table-header-actions .table-search { width: 100%; flex: 1; }
}

@media (min-width: 768px) {
    .mobile-cards {
        display: none !important;
    }
}

@media (max-width: 520px) {
    .modal-header,
    .modal-body,
    .wizard-topbar,
    .wizard-steps,
    .wizard-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .wizard-footer,
    .form-actions,
    .os-modal-actions {
        flex-direction: column;
    }

    .wizard-footer .btn,
    .form-actions .btn,
    .os-modal-actions .btn {
        width: 100%;
    }

    .status-mini-grid,
    .color-picker-row {
        grid-template-columns: 1fr;
    }

    .dashboard-footer-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .feed-item,
    .item-row-card,
    .service-card-top,
    .service-card-meta,
    .service-card-footer,
    .dashboard-os-top,
    .dashboard-os-meta,
    .inventory-card-top,
    .people-card-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .feed-badge-wrap,
    .item-row-side,
    .service-card-top-badges,
    .dashboard-os-badges {
        align-items: flex-start;
        width: 100%;
    }

    .service-card,
    .dashboard-os-card {
        padding: 14px;
    }

    .service-card-footer,
    .dashboard-os-meta {
        gap: 12px;
    }

    .service-card-price,
    .dashboard-os-price {
        width: 100%;
        justify-content: center;
    }

    .picker-info-line,
    .summary-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .os-detail-grid,
    .tag-check-grid,
    .status-summary-grid {
        grid-template-columns: 1fr;
    }

    .wizard-title {
        font-size: 0.92rem;
    }
}

/* ===== REFRESHED APP UI ===== */
.hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(198,164,91,0.22), transparent 30%),
        linear-gradient(145deg, #18140d 0%, #3a2c14 100%);
    color: #fffdf7;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
}

.hero-kicker,
.section-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: var(--primary-dark);
}

.hero-panel .hero-kicker { color: rgba(255,255,255,0.65); }
.hero-title {
    font-size: 1.6rem;
    line-height: 1.1;
    margin-top: 6px;
    font-weight: 800;
}
.hero-copy {
    margin-top: 8px;
    color: rgba(255,255,255,0.72);
    max-width: 60ch;
}
.dashboard-stock-finder {
    position: relative;
    z-index: 4;
    display: grid;
    gap: 10px;
    margin: -3px 0 16px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(198, 164, 91, 0.3);
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% -15%, rgba(224, 200, 117, 0.24), transparent 38%),
        linear-gradient(135deg, #100d08 0%, #211a0e 52%, #18140d 100%);
    box-shadow: 0 18px 42px rgba(3, 18, 35, 0.24), inset 0 1px 0 rgba(255,255,255,0.05);
}
.dashboard-stock-finder::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 24px;
    width: min(220px, 52%);
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #e0c875, #c6a45b, transparent);
    box-shadow: 0 0 18px rgba(224, 200, 117, 0.58);
    pointer-events: none;
}
.dashboard-stock-finder-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-stock-finder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 13px;
    color: #f2dea0;
    border: 1px solid rgba(224, 200, 117, 0.25);
    background: rgba(198, 164, 91, 0.14);
    box-shadow: inset 0 0 16px rgba(224, 200, 117, 0.08);
    font-size: 1rem;
}
.dashboard-stock-finder-head div {
    display: grid;
    gap: 2px;
}
.dashboard-stock-finder-head span:not(.dashboard-stock-finder-icon) {
    color: #f2dea0;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.dashboard-stock-finder-head small {
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.75rem;
}
.dashboard-stock-search-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid rgba(224, 200, 117, 0.2);
    border-radius: 17px;
    background: rgba(3, 13, 25, 0.72);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.dashboard-stock-search-shell:focus-within {
    border-color: rgba(224, 200, 117, 0.68);
    background: rgba(5, 20, 36, 0.94);
    box-shadow: 0 0 0 4px rgba(224, 200, 117, 0.1), 0 12px 28px rgba(142, 111, 47, 0.14);
}
.dashboard-stock-search-icon {
    color: var(--primary);
    font-size: 1rem;
}
.dashboard-stock-search-shell input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fffdf7;
    font: 600 0.94rem/1.2 inherit;
}
.dashboard-stock-search-shell input::placeholder { color: rgba(203, 213, 225, 0.58); }
.dashboard-stock-search-state {
    display: inline-flex;
    width: 20px;
    align-items: center;
    justify-content: center;
}
.dashboard-search-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(198, 164, 91, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dashboard-search-spin 0.65s linear infinite;
}
@keyframes dashboard-search-spin { to { transform: rotate(360deg); } }
.dashboard-stock-results {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    animation: dashboard-results-in 0.22s ease both;
}
.dashboard-stock-results[hidden] { display: none; }
@keyframes dashboard-results-in {
    from { opacity: 0; transform: translateY(-7px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.dashboard-stock-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}
.dashboard-stock-result:last-child { border-bottom: 0; }
.dashboard-stock-result:hover {
    background: var(--surface-2);
    transform: translateX(2px);
}
.dashboard-stock-result-device {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--primary-light);
    font-size: 1.05rem;
}
.dashboard-stock-result-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.dashboard-stock-result-copy > strong {
    overflow-wrap: anywhere;
    font-size: 0.94rem;
    font-weight: 900;
}
.dashboard-stock-result-copy > small {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.dashboard-stock-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}
.dashboard-stock-result-qty {
    display: grid;
    min-width: 47px;
    justify-items: center;
    color: var(--success-dark);
}
.dashboard-stock-result-qty strong { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.dashboard-stock-result-qty small { margin-top: 3px; font-size: 0.62rem; font-weight: 850; text-transform: uppercase; }
.dashboard-stock-result-qty.is-zero { color: var(--danger-dark); }
.dashboard-stock-empty {
    display: grid;
    gap: 4px;
    padding: 18px;
    color: var(--text-muted);
    text-align: center;
}
.dashboard-stock-empty strong { color: var(--text); }

.metric-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.report-toggle-shell {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(239,246,255,0.96));
    border: 1px solid rgba(198,164,91,0.12);
    box-shadow: var(--shadow-sm);
}
.report-toggle-copy h3 {
    margin: 4px 0 6px;
    font-size: 1.05rem;
}
.report-toggle-copy p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}
.report-scope-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.report-scope-btn {
    min-height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.2);
    background: rgba(255,255,255,0.9);
    color: var(--text-secondary);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.report-scope-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.report-scope-btn.is-active {
    color: #fff9e8;
    border-color: transparent;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, white), color-mix(in srgb, var(--primary-dark) 80%, black));
    box-shadow: 0 16px 30px rgba(198,164,91,0.2);
}
.report-page-shell {
    display: grid;
    gap: 18px;
}
.report-scope-section {
    display: grid;
    gap: 16px;
}
.report-scope-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
}
.report-scope-head h3 {
    margin: 4px 0 6px;
    font-size: 1.08rem;
}
.report-scope-head p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}
.report-metric-strip,
.report-overview-strip {
    margin-bottom: 0;
}
.report-inner-grid {
    display: grid;
    gap: 18px;
}
.report-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.report-compare-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}
.report-compare-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.report-trend-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(148,163,184,0.16);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
}
.report-trend-chip.is-positive {
    background: rgba(16,185,129,0.12);
    color: var(--success-dark);
}
.report-trend-chip.is-negative {
    background: rgba(244,63,94,0.12);
    color: var(--danger-dark);
}
.report-shared-grid {
    gap: 18px;
}
.report-page-shell .app-section-card,
.report-page-shell .metric-strip,
.report-page-shell .hero-panel,
.report-page-shell .report-toggle-shell {
    margin-bottom: 0;
}
[data-theme="dark"] .report-toggle-shell {
    background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(17,24,39,0.98));
    border-color: rgba(224,200,117,0.18);
}
[data-theme="dark"] .report-scope-head p {
    color: var(--text-secondary);
}
[data-theme="dark"] .report-scope-btn {
    background: rgba(15,23,42,0.88);
    border-color: rgba(148,163,184,0.14);
}
[data-theme="dark"] .report-compare-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(17,24,39,0.96));
    border-color: rgba(148,163,184,0.14);
}
[data-theme="dark"] .report-trend-chip {
    background: rgba(148,163,184,0.14);
    color: var(--text-secondary);
}
[data-theme="dark"] .report-trend-chip.is-positive {
    background: rgba(16,185,129,0.18);
    color: #6ee7b7;
}
[data-theme="dark"] .report-trend-chip.is-negative {
    background: rgba(244,63,94,0.18);
    color: #fda4af;
}
[data-theme="dark"] .report-scope-btn.is-active {
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 70%, #18140d), color-mix(in srgb, var(--primary-dark) 82%, #050403));
}

.metric-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(15,23,42,0.06);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.metric-card-dark {
    background: linear-gradient(145deg, #18140d 0%, #133336 100%);
    color: white;
}
.metric-card-highlight {
    background: linear-gradient(135deg, #e0c875 0%, #c6a45b 100%);
    color: white;
}
.metric-card-soft {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}
.metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.metric-card-dark .metric-label,
.metric-card-highlight .metric-label { color: rgba(255,255,255,0.72); }
.metric-value {
    display: block;
    margin-top: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}

.app-section-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.wizard-card {
    margin-bottom: 0;
    padding: 18px;
    border-radius: 24px;
}
.wizard-card-hero {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
}
.wizard-stage-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.wizard-workspace-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.wizard-workspace-card {
    overflow: hidden;
}
.wizard-form-grid {
    gap: 16px;
}
.form-control-lg {
    min-height: 50px;
    font-size: 1rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-grid-simple,
.config-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.config-shell {
    display: grid;
    gap: 16px;
}
.config-hero-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.18);
    background:
        radial-gradient(circle at top right, rgba(147,197,253,0.36), transparent 34%),
        linear-gradient(145deg, color-mix(in srgb, var(--primary) 86%, #18140d), color-mix(in srgb, var(--primary-dark) 76%, #050403));
    color: #fff9e8;
    box-shadow: var(--shadow-lg);
}
.config-hero-copy .hero-copy {
    max-width: 680px;
    color: rgba(239,246,255,0.84);
}
.config-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.config-hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f3e8c4;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(10px);
}
.config-tabbar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: none;
}
.config-tabbar::-webkit-scrollbar {
    display: none;
}
.config-tab-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.94));
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.config-tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.config-tab-btn.is-active {
    color: #fff9e8;
    border-color: transparent;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, white), color-mix(in srgb, var(--primary-dark) 82%, black));
    box-shadow: 0 16px 30px rgba(198,164,91,0.2);
}
.config-panels {
    display: grid;
    gap: 14px;
}
.config-panel {
    min-width: 0;
}
.config-grid-wide {
    grid-template-columns: 1fr;
}
.config-grid-compact {
    grid-template-columns: 1fr;
}
.config-card-accent {
    background:
        radial-gradient(circle at top right, rgba(191,219,254,0.42), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
}
.config-helper-card {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(198,164,91,0.12);
    background: linear-gradient(180deg, rgba(239,246,255,0.98), rgba(255,255,255,0.98));
}
.config-helper-card strong {
    font-size: 0.92rem;
    color: var(--text);
}
.config-helper-card span {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.color-picker-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.color-picker-input {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 4px;
    cursor: pointer;
}
.config-action-list {
    display: grid;
    gap: 12px;
}
.config-action-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.config-action-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.config-action-card strong {
    display: block;
    color: var(--text);
    font-size: 0.96rem;
}
.config-action-card span {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}
.config-action-card.danger {
    border-color: rgba(244,63,94,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,241,242,0.96));
}
[data-theme="dark"] .config-tab-btn {
    background: linear-gradient(180deg, rgba(15,23,42,0.88), rgba(17,24,39,0.96));
    border-color: rgba(148,163,184,0.16);
    color: var(--text-secondary);
}
[data-theme="dark"] .config-tab-btn.is-active {
    color: #fff9e8;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 72%, #18140d), color-mix(in srgb, var(--primary-dark) 78%, #050403));
    box-shadow: 0 18px 34px rgba(2,6,23,0.34);
}
[data-theme="dark"] .config-card-accent {
    background:
        radial-gradient(circle at top right, rgba(59,130,246,0.16), transparent 30%),
        linear-gradient(180deg, rgba(15,23,42,0.92), rgba(17,24,39,0.96));
}
[data-theme="dark"] .config-helper-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.88), rgba(30,41,59,0.92));
    border-color: rgba(59,130,246,0.18);
}
[data-theme="dark"] .config-hero-card {
    border-color: rgba(148,163,184,0.14);
    box-shadow: 0 30px 70px rgba(2,6,23,0.4);
}
.template-batch-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.template-grid {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}
.template-card {
    gap: 14px;
}
.template-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}
.template-description {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}
.template-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}
.template-toggle input {
    accent-color: var(--primary);
}
.config-inline-toggle {
    margin-bottom: 14px;
}
.template-variables {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.template-var-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
}
.template-editor {
    min-height: 220px;
    resize: vertical;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
}
.template-card-actions {
    display: flex;
    justify-content: flex-end;
}
.status-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.status-mini-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.status-mini-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
}
.status-mini-card strong {
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.35;
}
.status-note {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}
.auto-refresh-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.8;
}
.auto-refresh-note::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.85);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.auto-refresh-note.is-syncing::before {
    background: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    animation: syncPulse 1.1s ease-in-out infinite;
}
@keyframes syncPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.18); opacity: 1; }
}
/* Banner de instalação do app (dashboard do técnico) */
.dash-install-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--primary-light); border: 1px solid rgba(198,164,91,0.25);
    border-radius: var(--r); padding: 12px 16px;
    margin-bottom: 12px;
}
.dash-install-icon {
    flex-shrink: 0; width: 40px; height: 40px;
    border-radius: 50%; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.dash-install-text {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
    font-size: 0.88rem; color: var(--primary-dark);
}
.dash-install-text strong { font-size: 0.95rem; font-weight: 700; }
[data-theme="dark"] .dash-install-card {
    background: rgba(198,164,91,0.12) !important;
    border-color: rgba(198,164,91,0.3) !important;
}
[data-theme="dark"] .dash-install-text { color: #e6d08d !important; }
[data-theme="dark"] .dash-install-text strong { color: #f3e4b9 !important; }

.dashboard-footer-note {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.96));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.dashboard-footer-note strong {
    color: var(--primary-dark);
    font-size: 0.92rem;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feed-list-spaced { margin-top: 14px; }
.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.payment-employee-card {
    border: 1px solid rgba(198,164,91,0.14);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
}
.payment-employee-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.payment-employee-balance {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(198,164,91,0.14), rgba(224,200,117,0.2));
    border: 1px solid rgba(198,164,91,0.18);
}
.payment-employee-balance-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-dark);
}
.payment-employee-balance-value {
    display: block;
    margin-top: 4px;
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--primary-dark);
}
.payment-employee-stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}
.payment-history-item {
    align-items: flex-start;
}
.payment-history-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(16,185,129,0.12);
    color: var(--success-dark);
    font-size: 0.88rem;
    font-weight: 800;
}
.payment-tech-spotlight {
    margin-top: 16px;
    border: 1px solid rgba(198,164,91,0.16);
    background:
        linear-gradient(135deg, rgba(239,246,255,0.96), rgba(255,255,255,0.98));
}
.payment-tech-spotlight-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.payment-tech-balance-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    padding: 12px 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(198,164,91,0.14), rgba(224,200,117,0.22));
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 900;
}
.payment-tech-spotlight-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.payment-tech-spotlight-stat {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(255,255,255,0.76);
}
.payment-tech-spotlight-stat strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 0.98rem;
}
.payment-tech-spotlight-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.payment-tech-spotlight-actions {
    margin-top: 14px;
}
.badge-success-soft {
    background: rgba(16,185,129,0.12);
    color: var(--success-dark);
}
[data-theme="dark"] .payment-employee-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.98));
    border-color: rgba(224,200,117,0.18);
}
[data-theme="dark"] .payment-employee-balance {
    background: linear-gradient(135deg, rgba(198,164,91,0.18), rgba(30,64,175,0.16));
    border-color: rgba(224,200,117,0.24);
}
[data-theme="dark"] .payment-employee-balance-label,
[data-theme="dark"] .payment-employee-balance-value {
    color: #f3e8c4;
}
[data-theme="dark"] .payment-history-value {
    background: rgba(16,185,129,0.18);
    color: #d1fae5;
}
[data-theme="dark"] .payment-tech-spotlight {
    background: linear-gradient(135deg, rgba(15,23,42,0.98), rgba(17,24,39,0.98));
    border-color: rgba(224,200,117,0.22);
}
[data-theme="dark"] .payment-tech-balance-chip {
    background: linear-gradient(135deg, rgba(198,164,91,0.22), rgba(30,64,175,0.22));
    color: #f3e8c4;
}
[data-theme="dark"] .payment-tech-spotlight-stat {
    background: rgba(15,23,42,0.78);
    border-color: rgba(224,200,117,0.14);
}
[data-theme="dark"] .badge-success-soft {
    background: rgba(16,185,129,0.18);
    color: #d1fae5;
}
.feed-item-button {
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
}
.feed-meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.feed-side {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: right;
}
.feed-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

@media (max-width: 900px) {
    .payment-tech-spotlight-top {
        flex-direction: column;
    }
    .payment-tech-balance-chip {
        width: 100%;
    }
    .payment-tech-spotlight-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-os-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(15,23,42,0.06);
    background: rgba(255,255,255,0.94);
    border-radius: 20px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}
.dashboard-os-card * {
    pointer-events: none;
}
.dashboard-os-card .service-card-actions,
.dashboard-os-card .service-card-actions * {
    pointer-events: auto;
}
.dashboard-os-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.dashboard-os-card.pending-highlight {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 12px 30px rgba(245,158,11,0.16);
    background: linear-gradient(135deg, rgba(255,247,237,0.98), rgba(255,255,255,0.98));
    position: relative;
}
.dashboard-os-card.pending-highlight::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, #f59e0b, #f97316);
}
.dashboard-os-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.dashboard-os-id {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dashboard-os-client {
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}
.dashboard-os-top > div:first-child {
    min-width: 0;
    flex: 1;
}
.dashboard-os-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.dashboard-os-device {
    margin-top: 10px;
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.3;
}
.dashboard-os-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dashboard-os-price {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(198,164,91,0.14), rgba(224,200,117,0.22));
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(198,164,91,0.1);
}
.dashboard-os-card .service-card-actions {
    margin-top: 12px;
}

.status-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.status-summary-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}
.status-summary-card span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.status-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.4rem;
}

.status-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 2px;
}
.status-chip {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.status-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.staff-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.staff-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 700;
}
.staff-pill input {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.staff-pill.active {
    background: var(--primary-light);
    border-color: rgba(198,164,91,0.24);
    color: var(--primary-dark);
}
.staff-pill-grid.is-invalid {
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(244,63,94,0.28);
    background: rgba(255,228,230,0.38);
}

.tag-check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.tag-check {
    position: relative;
    display: block;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
}
.tag-check input {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.tag-check:has(input:checked) {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: rgba(198,164,91,0.24);
}

.photo-upload-card {
    width: 100%;
    border: 1.5px dashed rgba(198,164,91,0.3);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(224,200,117,0.12), rgba(255,255,255,0.92));
    padding: 22px;
    text-align: left;
    cursor: pointer;
}
.photo-upload-card span {
    display: block;
    font-weight: 800;
    color: var(--primary-dark);
}
.photo-upload-card small { color: var(--text-muted); }
.photo-preview-wrap { margin-top: 12px; }
.wizard-photo-preview,
.os-detail-photo,
.brand-preview,
.profile-preview {
    width: 100%;
    max-width: 180px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.profile-preview { max-width: 92px; aspect-ratio: 1; border-radius: 50%; margin-top: 10px; }
.brand-preview { margin-top: 10px; }
.signature-preview {
    width: 100%;
    max-width: 220px;
    max-height: 84px;
    padding: 8px 10px;
    border-radius: 16px;
    object-fit: contain;
    background: linear-gradient(180deg, #ffffff, #fffdf7);
    border: 1px dashed var(--border-2);
}
.signature-pad-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(198,164,91,0.14);
    background: linear-gradient(180deg, rgba(239,246,255,0.88), rgba(255,255,255,0.98));
}
.signature-pad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.signature-pad-head strong {
    font-size: 0.9rem;
    color: var(--text);
}
.signature-current {
    display: grid;
    gap: 8px;
}
.signature-modal-shell {
    display: grid;
    gap: 14px;
}
.signature-pad-wrap {
    position: relative;
    min-height: 170px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px dashed color-mix(in srgb, var(--primary) 28%, transparent);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98)),
        repeating-linear-gradient(0deg, transparent, transparent 34px, rgba(148,163,184,0.12) 34px, rgba(148,163,184,0.12) 35px);
}
.signature-pad-canvas {
    display: block;
    width: 100%;
    height: 170px;
    touch-action: none;
    cursor: crosshair;
}
.signature-pad-wrap-modal {
    min-height: 220px;
}
.signature-pad-canvas-modal {
    height: 220px;
}
.signature-pad-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.98rem;
    font-weight: 800;
    color: rgba(100,116,139,0.8);
    pointer-events: none;
}

.item-split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.wizard-stock-layout {
    align-items: start;
}
.picker-card {
    padding: 16px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.wizard-search-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.picker-card-stock {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,246,255,0.92));
    border-color: rgba(198,164,91,0.14);
    box-shadow: 0 18px 34px rgba(198,164,91,0.08);
}
.picker-card-manual-trigger {
    background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.96));
}
.picker-card-manual-trigger .btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 14px 28px rgba(198,164,91,0.22);
}
#wizardManualPanel {
    border-style: dashed;
    border-color: rgba(198,164,91,0.24);
}
.wizard-manual-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
}
.picker-title {
    font-weight: 800;
    margin-bottom: 12px;
}
.picker-helper-copy {
    margin: -4px 0 12px;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.picker-info-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(198,164,91,0.08);
    border: 1px solid rgba(198,164,91,0.12);
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.wizard-inline-row {
    align-items: end;
    gap: 12px;
}
.wizard-inline-row label {
    min-width: 88px;
    padding-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.wizard-inline-row .form-control {
    flex: 1;
}
.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 240px;
    overflow-y: auto;
}
.search-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(198,164,91,0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    box-shadow: 0 10px 22px rgba(15,23,42,0.04);
}
.search-result-content {
    min-width: 0;
}
.search-result-main {
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.search-result-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.search-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-result-card.selected {
    border-color: rgba(198,164,91,0.35);
    background: linear-gradient(135deg, rgba(224,200,117,0.18), rgba(255,255,255,0.98));
    box-shadow: 0 0 0 3px rgba(198,164,91,0.08);
}
.result-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(198,164,91,0.2);
}
.search-result-title {
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.search-result-meta-row {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.search-result-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 0;
    overflow-wrap: anywhere;
}
.search-result-price {
    font-weight: 800;
    color: var(--primary-dark);
}
.search-result-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 68px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(198,164,91,0.1);
    color: var(--primary-dark);
    font-size: 0.74rem;
    font-weight: 800;
}
.search-result-stock-badge.is-zero {
    background: rgba(244,63,94,0.12);
    color: var(--danger-dark);
}
.result-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.picker-empty {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--text-muted);
    text-align: center;
}

.item-row-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.item-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.item-row-main { min-width: 0; }
.item-row-title {
    font-weight: 700;
}
.item-row-meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.item-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.summary-box {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(224,200,117,0.1), rgba(255,255,255,0.96));
    border: 1px solid rgba(198,164,91,0.1);
}
.wizard-summary-card .summary-box {
    margin-top: 16px;
}
.wizard-summary-sticky {
    align-self: start;
}
.wizard-items-table td,
.wizard-items-table th {
    white-space: nowrap;
}
.wizard-items-table td:first-child,
.wizard-items-table th:first-child {
    white-space: normal;
}
.wizard-items-table-wrap {
    overflow-x: hidden;
}
.wizard-item-price {
    font-weight: 700;
}
.wizard-item-edit-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wizard-item-inline-input {
    width: 110px;
    min-width: 110px;
    text-align: right;
    font-weight: 700;
    height: 36px;
    padding-inline: 10px;
}
.wizard-item-edit-btn {
    margin-left: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.wizard-item-edit-btn:hover {
    border-color: rgba(198,164,91,0.28);
    color: var(--primary-dark);
    background: rgba(198,164,91,0.08);
}
.wizard-item-confirm-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(34,197,94,0.24);
    border-radius: 999px;
    background: rgba(34,197,94,0.12);
    color: #15803d;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.wizard-item-confirm-btn:hover {
    background: rgba(34,197,94,0.2);
    border-color: rgba(34,197,94,0.34);
}
.wizard-item-remove-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(244,63,94,0.18);
    border-radius: 999px;
    background: rgba(244,63,94,0.06);
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.wizard-item-remove-btn:hover {
    background: rgba(244,63,94,0.14);
    border-color: rgba(244,63,94,0.3);
}
.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.summary-line-emphasis {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(198,164,91,0.14);
}

.service-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.service-card-list-spaced { margin-top: 14px; }
.service-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(15,23,42,0.06);
    background: rgba(255,255,255,0.92);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}
.service-card * {
    pointer-events: none;
}
.service-card-actions,
.service-card-actions * {
    pointer-events: auto;
}
.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.service-card.pending-highlight {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 12px 30px rgba(245,158,11,0.16);
    background: linear-gradient(135deg, rgba(255,247,237,0.98), rgba(255,255,255,0.98));
    position: relative;
}
.service-card.pending-highlight::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 22px 0 0 22px;
    background: linear-gradient(180deg, #f59e0b, #f97316);
}
.service-card-top,
.service-card-meta,
.service-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.service-card-top-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.service-card-id {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.service-card-name {
    font-size: 1.08rem;
    font-weight: 800;
    margin-top: 4px;
    color: var(--text);
}
.service-card-head-main {
    min-width: 0;
    flex: 1;
}
.service-card-sub {
    margin: 12px 0 10px;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.96rem;
    min-height: 0;
    line-height: 1.3;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(224,200,117,0.12);
}
.service-card-meta-stack {
    align-items: flex-start;
}
.service-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-wrap: wrap;
    row-gap: 8px;
}
.service-card-meta-item {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: 100%;
}
.service-card-tech-line {
    width: 100%;
}
.service-card-category-pill {
    max-width: 100%;
}
.service-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
}
.service-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.service-card-actions .btn {
    flex: 1 1 120px;
}
.service-card-actions .btn-icon-only {
    flex: 0 0 auto;
}
.btn-delete-os {
    box-shadow: 0 8px 22px rgba(244,63,94,0.22);
}
.service-card-price {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(198,164,91,0.14), rgba(224,200,117,0.22));
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(198,164,91,0.1);
}
.os-age-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.06);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}
.pending-highlight .os-age-badge {
    background: rgba(245,158,11,0.14);
    color: #9a3412;
}
[data-theme="dark"] .picker-card-stock {
    background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(17,28,49,0.95));
    border-color: rgba(224,200,117,0.24);
    box-shadow: 0 18px 34px rgba(2,6,23,0.32);
}
[data-theme="dark"] .picker-card-manual-trigger {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(23,36,59,0.94));
}
[data-theme="dark"] .picker-card-manual-trigger .btn.active {
    box-shadow: 0 16px 30px rgba(198,164,91,0.3);
}
[data-theme="dark"] #wizardManualPanel {
    border-color: rgba(224,200,117,0.28);
}
[data-theme="dark"] .wizard-manual-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,28,49,0.95));
}
[data-theme="dark"] .picker-info-line {
    background: rgba(224,200,117,0.12);
    border-color: rgba(224,200,117,0.2);
    color: #f3e8c4 !important;
}
[data-theme="dark"] .wizard-topbar,
[data-theme="dark"] .wizard-footer {
    background: rgba(8,17,31,0.88);
}
[data-theme="dark"] .wizard-pane-intro p {
    color: var(--text-secondary);
}
[data-theme="dark"] .wizard-card-hero {
    background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(17,28,49,0.96));
}
[data-theme="dark"] .search-result-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(20,31,52,0.96)) !important;
    border-color: rgba(224,200,117,0.16) !important;
    box-shadow: 0 16px 28px rgba(2,6,23,0.24);
}
[data-theme="dark"] .search-result-stock-badge {
    background: rgba(224,200,117,0.16);
    color: #f3e8c4;
}
[data-theme="dark"] .search-result-card.selected {
    background: linear-gradient(135deg, rgba(198,164,91,0.22), rgba(15,23,42,0.98)) !important;
    border-color: rgba(224,200,117,0.3) !important;
}
[data-theme="dark"] .result-add-btn {
    box-shadow: 0 14px 26px rgba(198,164,91,0.28);
}

.inventory-grid,
.people-grid,
.settings-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.grid-list-spaced { margin-top: 14px; }
.inventory-card,
.people-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.inventory-card-top,
.people-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.inventory-card-meta,
.people-card-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.inventory-card-actions,
.people-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.inventory-card-actions .btn,
.people-card-actions .btn { flex: 1; }
.inventory-table-wrap {
    margin-top: 14px;
}
.category-card-title {
    display: inline-flex;
    align-items: center;
}
.category-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(198,164,91,0.1);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(198,164,91,0.12);
    flex: 0 0 auto;
}
.category-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.category-icon-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}
.category-icon-picker .form-control {
    flex: 1;
}
.category-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.category-icon-preview .category-icon {
    width: 34px;
    height: 34px;
}
.inventory-table th:nth-child(n+2),
.inventory-table td:nth-child(n+2) {
    text-align: right;
    white-space: nowrap;
}
.inventory-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}
.inventory-table th:first-child .inventory-sort-button { justify-content: flex-start; }
.inventory-sort-button:hover,
.inventory-sort-button.is-active {
    color: var(--primary);
}
.inventory-sort-button:hover { transform: translateY(-1px); }
.inventory-sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1;
}
.inventory-sort-button.is-active .inventory-sort-indicator {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 5px 12px rgba(198, 164, 91, 0.24);
}
.inventory-sort-alert.is-active { color: #d97706; }
.inventory-sort-alert.is-active .inventory-sort-indicator {
    background: #f59e0b;
    box-shadow: 0 5px 12px rgba(245, 158, 11, 0.25);
}
.inventory-sort-help {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.inventory-sort-help > span {
    color: var(--primary);
    font-size: 1rem;
}
.inventory-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 850;
    white-space: nowrap;
}
.inventory-alert-badge.is-critical {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}
.inventory-alert-badge.is-limit {
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.11);
}
.inventory-alert-badge.is-ok {
    color: #059669;
    border-color: rgba(16, 185, 129, 0.26);
    background: rgba(16, 185, 129, 0.1);
}
.field-optional {
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 650;
}
.inventory-table-name {
    font-weight: 800;
    color: var(--text);
}
.inventory-table-model {
    color: var(--text-muted);
    font-size: 0.82rem;
}
.inventory-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}
.inventory-frame-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.inventory-frame-badge::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
    content: '';
}
.inventory-frame-badge.is-with-frame {
    color: #8e6f2f;
    border-color: rgba(198, 164, 91, 0.35);
    background: rgba(198, 164, 91, 0.12);
}
.inventory-frame-badge.is-without-frame {
    color: var(--text-secondary);
    border-color: var(--border-2);
    background: var(--surface-3);
}
[data-theme="dark"] .inventory-frame-badge.is-with-frame {
    color: #d9bf73;
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(198, 164, 91, 0.14);
}
.inventory-box-badge {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    min-height: 25px;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.11);
    color: #b45309;
    line-height: 1;
    white-space: nowrap;
}
.inventory-box-badge span {
    padding: 5px 6px 5px 9px;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.inventory-box-badge strong {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    min-width: 29px;
    justify-content: center;
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.17);
    font-size: 0.75rem;
    font-weight: 900;
}
[data-theme="dark"] .inventory-box-badge {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.34);
    background: rgba(245, 158, 11, 0.12);
}
.inventory-qty-badge {
    min-width: 78px;
    justify-content: center;
}
.inventory-table-actions {
    display: inline-flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.table-empty {
    padding: 22px 16px;
    text-align: center;
    color: var(--text-muted);
}

.service-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.service-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.detail-card {
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.detail-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* ===== PRINT STYLES ===== */

/* Remove URL e cabecalho do browser na impressao */
@page {
    size: A4;
    margin: 14mm 12mm 14mm 12mm;
}

.print-sheet {
    width: 100%;
    background: white;
    color: #18140d;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

/* Cabecalho */
.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #7a5b23;
    margin-bottom: 16px;
}
.print-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}
.print-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.print-logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c6a45b;
    color: white;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.print-company-name {
    font-size: 16px;
    font-weight: 800;
    color: #18140d;
    line-height: 1.2;
}
.print-company-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.print-company-detail {
    font-size: 11px;
    color: #66593d;
    margin-top: 1px;
}
.print-os-badge {
    text-align: right;
    flex-shrink: 0;
}
.print-os-number {
    font-size: 20px;
    font-weight: 900;
    color: #7a5b23;
    line-height: 1;
}
.print-os-status { margin-top: 6px; }
.print-os-date { font-size: 11px; color: #64748b; margin-top: 4px; }

/* Grid de informacoes 2x2 */
.print-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #e0d2af;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}
.print-info-cell {
    padding: 10px 14px;
    border-right: 1px solid #e0d2af;
    border-bottom: 1px solid #e0d2af;
}
.print-info-cell:nth-child(2n) { border-right: none; }
.print-info-cell:nth-last-child(-n+2) { border-bottom: none; }
.print-info-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94835f;
    margin-bottom: 3px;
}
.print-info-value {
    font-size: 13px;
    font-weight: 700;
    color: #18140d;
}
.print-info-sub { font-size: 11px; color: #64748b; margin-top: 2px; }

/* Bloco generico */
.print-block {
    margin-bottom: 14px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.print-block-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94835f;
    margin-bottom: 6px;
}

/* Problema + foto lado a lado */
.print-entry-photo-block { margin-bottom: 14px; }
.print-entry-photo-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: flex-start;
}
.print-problem-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
    margin: 0;
    padding: 10px 12px;
    background: #fffdf7;
    border-radius: 6px;
    border-left: 3px solid #c6a45b;
}
.print-entry-photo-wrap { text-align: right; }
.print-device-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Fotos resultado */
.print-photos-block { page-break-before: auto; }
.print-photos-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.print-photos-row img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

/* Checklist pills */
.print-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.print-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #bae6fd;
}

/* Tabela de pecas */
.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.print-table thead tr {
    background: #f1f5f9;
}
.print-table th {
    padding: 8px 10px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #66593d;
    text-align: left;
    border-bottom: 1px solid #e0d2af;
}
.print-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.print-table tbody tr:last-child td { border-bottom: none; }

/* Totais */
.print-totals {
    border: 1px solid #e0d2af;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.print-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}
.print-total-row:last-child { border-bottom: none; }
.print-total-final {
    background: #fffdf7;
    font-weight: 700;
    font-size: 14px;
}
.print-total-final strong { color: #7a5b23; font-size: 15px; }

/* Rodape e assinaturas */
.print-footer {
    margin-top: 32px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.print-obs {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 24px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}
.print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}
.print-sig-block { text-align: center; }
.print-sig-line {
    height: 56px;
    border-bottom: 1.5px solid #94835f;
    margin-bottom: 8px;
}
.print-sig-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.print-sig-name {
    font-size: 11px;
    color: #334155;
    margin-top: 3px;
}

.pending-spotlight {
    border-color: rgba(245,158,11,0.25);
    background: linear-gradient(135deg, rgba(255,247,237,0.92), rgba(255,255,255,0.96));
}

.scanner-public-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.18), transparent 28%),
        linear-gradient(180deg, #f3f8ff 0%, #eef6f5 46%, #fffdf7 100%);
}
.scanner-public-shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
    display: grid;
    gap: 18px;
}
.scanner-public-hero,
.scanner-public-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.08);
    backdrop-filter: blur(14px);
}
.scanner-public-hero {
    padding: 26px;
    display: grid;
    gap: 14px;
}
.scanner-public-brand {
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(198,164,91,0.1);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.scanner-public-hero h1 {
    font-size: clamp(1.9rem, 5vw, 3.2rem);
    line-height: 1.02;
}
.scanner-public-hero p {
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 1rem;
}
.scanner-public-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.scanner-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15,23,42,0.06);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}
.scanner-public-card {
    padding: 22px;
}
.scanner-chat-log {
    display: grid;
    gap: 12px;
    min-height: 180px;
    max-height: 420px;
    margin-bottom: 18px;
    padding: 4px 2px 4px 0;
    overflow-y: auto;
}
.scanner-chat-empty {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 20px;
    border: 1px dashed rgba(198,164,91,0.24);
    background: rgba(198,164,91,0.05);
    color: var(--text-secondary);
}
.scanner-bubble {
    max-width: min(100%, 760px);
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
}
.scanner-bubble strong {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.scanner-bubble p {
    color: var(--text-secondary);
}
.scanner-bubble.is-user {
    margin-left: auto;
    border-color: rgba(198,164,91,0.2);
    background: linear-gradient(135deg, rgba(198,164,91,0.12), rgba(191,219,254,0.34));
}
.scanner-bubble.is-assistant {
    border-color: rgba(15,23,42,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
}
.scanner-form {
    display: grid;
    gap: 14px;
}
.scanner-textarea {
    min-height: 160px;
}
.scanner-form-actions {
    display: flex;
    justify-content: flex-start;
}
.scanner-status-note {
    min-height: 22px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.scanner-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.scanner-inline-card + .scanner-inline-card {
    margin-top: 14px;
}
.scanner-summary-highlight {
    border-color: rgba(198,164,91,0.16);
    background: linear-gradient(135deg, rgba(198,164,91,0.08), rgba(255,255,255,0.96));
}
.scanner-grok-body {
    background:
        radial-gradient(circle at top, rgba(67,56,202,0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(198,164,91,0.14), transparent 22%),
        linear-gradient(180deg, #050816 0%, #0b1020 48%, #0e172c 100%);
    color: #e5eefc;
}
.scanner-grok-shell {
    width: min(1260px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 34px;
    display: grid;
    gap: 18px;
}
.scanner-grok-hero,
.scanner-grok-chat-card,
.scanner-grok-result-card,
.scanner-grok-sidecard {
    border: 1px solid rgba(148,163,184,0.12);
    background: linear-gradient(180deg, rgba(8,13,28,0.92), rgba(12,19,38,0.86));
    box-shadow: 0 24px 48px rgba(2,6,23,0.28);
    backdrop-filter: blur(18px);
}
.scanner-grok-hero {
    border-radius: 32px;
    padding: 26px;
    display: grid;
    gap: 18px;
}
.scanner-grok-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.scanner-grok-link {
    color: #cbb786;
    text-decoration: none;
    font-size: 0.92rem;
}
.scanner-grok-link:hover {
    color: #ffffff;
}
.scanner-grok-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(224,200,117,0.12);
    color: #c7ddff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.scanner-grok-headline {
    display: grid;
    gap: 12px;
}
.scanner-grok-headline h1 {
    font-size: clamp(2.3rem, 5vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 880px;
}
.scanner-grok-headline p {
    max-width: 760px;
    color: #b8c5da;
    font-size: 1.02rem;
}
.scanner-grok-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.scanner-grok-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.scanner-grok-sidebar {
    display: grid;
    gap: 16px;
}
.scanner-grok-sidecard {
    border-radius: 24px;
    padding: 20px;
    display: grid;
    gap: 10px;
}
.scanner-side-label {
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 800;
}
.scanner-grok-sidecard strong {
    font-size: 1rem;
    color: #f8fbff;
}
.scanner-grok-sidecard p,
.scanner-side-list {
    color: #b7c6dd;
}
.scanner-side-list {
    margin-left: 18px;
}
.scanner-side-list li + li {
    margin-top: 6px;
}
.scanner-grok-main {
    display: grid;
    gap: 18px;
}
.scanner-grok-chat-card,
.scanner-grok-result-card {
    border-radius: 30px;
    padding: 22px;
}
.scanner-grok-chat-log {
    min-height: 340px;
    max-height: 620px;
}
.scanner-grok-empty {
    background: linear-gradient(135deg, rgba(198,164,91,0.08), rgba(15,23,42,0.66));
    border-color: rgba(224,200,117,0.2);
    color: #c8d5ea;
}
.scanner-grok-form {
    gap: 12px;
}
.scanner-grok-compose {
    display: grid;
    gap: 12px;
}
.scanner-grok-textarea {
    min-height: 150px;
    border-radius: 24px;
    border-color: rgba(148,163,184,0.12);
    background: rgba(15,23,42,0.78);
    color: #eef4ff;
    font-size: 1rem;
    padding: 18px 18px 12px;
}
.scanner-grok-textarea::placeholder {
    color: #7f93b0;
}
.scanner-grok-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.scanner-upload-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(125,211,252,0.24);
    background: rgba(8,13,28,0.84);
    color: #d9efff;
    font-weight: 700;
    cursor: pointer;
}
.scanner-toolbar-copy {
    flex: 1;
    min-width: 240px;
    color: #8ea2bf;
    font-size: 0.92rem;
}
.scanner-grok-submit {
    min-width: 210px;
    box-shadow: 0 16px 36px rgba(198,164,91,0.24);
}
.scanner-result-hero {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(198,164,91,0.14), rgba(8,13,28,0.78));
    border: 1px solid rgba(224,200,117,0.14);
}
.scanner-result-hero-copy {
    display: grid;
    gap: 8px;
}
.scanner-result-hero-copy h3 {
    font-size: 1.4rem;
    color: #f8fbff;
}
.scanner-result-hero-copy p {
    color: #c7d3e7;
}
.scanner-result-hero-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.scanner-metric-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(8,13,28,0.72);
    border: 1px solid rgba(148,163,184,0.1);
}
.scanner-metric-card span {
    color: #89a0be;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
}
.scanner-metric-card strong {
    color: #f8fbff;
    font-size: 1rem;
}

.scanner-mobile-body {
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.18), transparent 28%),
        linear-gradient(180deg, #060b17 0%, #0b1020 50%, #10192f 100%);
    color: #e8eef8;
}
.scanner-mobile-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px 14px 28px;
    display: grid;
    gap: 14px;
}
.scanner-mobile-hero,
.scanner-mobile-chat-card,
.scanner-mobile-disclaimer,
.scanner-mobile-result-card,
.scanner-mobile-inline-card,
.scanner-mobile-highlight {
    border: 1px solid rgba(148,163,184,0.14);
    background: linear-gradient(180deg, rgba(9,14,28,0.94), rgba(13,21,40,0.9));
    box-shadow: 0 18px 40px rgba(2,6,23,0.26);
}
.scanner-mobile-hero {
    border-radius: 24px;
    padding: 18px;
    display: grid;
    gap: 12px;
}
.scanner-mobile-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.scanner-mobile-link {
    color: #c7d2e6;
    text-decoration: none;
    font-size: 0.9rem;
}
.scanner-mobile-hero h1 {
    font-size: clamp(1.8rem, 7vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}
.scanner-mobile-hero p {
    color: #b8c6db;
    font-size: 0.96rem;
}
.scanner-mobile-shortcuts {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.scanner-mobile-shortcuts::-webkit-scrollbar {
    display: none;
}
.scanner-shortcut-btn {
    border: 1px solid rgba(125,211,252,0.18);
    background: rgba(15,23,42,0.76);
    color: #e0efff;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}
.scanner-mobile-chat-card {
    border-radius: 24px;
    padding: 14px;
    display: grid;
    gap: 12px;
}
.scanner-mobile-chat-log {
    min-height: 220px;
    max-height: 48vh;
}
.scanner-mobile-empty {
    background: rgba(224,200,117,0.08);
    border-color: rgba(224,200,117,0.18);
    color: #c8d6ea;
}
.scanner-bubble {
    border-color: rgba(148,163,184,0.14);
    background: rgba(15,23,42,0.9);
}
.scanner-bubble.is-user {
    background: linear-gradient(135deg, rgba(198,164,91,0.22), rgba(30,64,175,0.3));
}
.scanner-bubble.is-assistant {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,28,49,0.94));
}
.scanner-bubble strong {
    color: #fff9e8;
}
.scanner-bubble p {
    color: #c7d2e5;
}
.scanner-mobile-form {
    display: grid;
    gap: 10px;
}
.scanner-mobile-photo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(125,211,252,0.16);
    background: rgba(12,19,36,0.9);
    cursor: pointer;
}
.scanner-mobile-photo span {
    color: #dcecff;
    font-weight: 700;
}
.scanner-mobile-photo strong {
    color: #8ca2bf;
    font-size: 0.84rem;
    text-align: right;
}
.scanner-mobile-textarea {
    min-height: 132px;
    border-radius: 20px;
    border-color: rgba(148,163,184,0.14);
    background: rgba(15,23,42,0.82);
    color: #eef4ff;
    padding: 16px;
    font-size: 0.98rem;
}
.scanner-mobile-textarea::placeholder {
    color: #8395b2;
}
.scanner-mobile-actions {
    display: grid;
    gap: 10px;
}
.scanner-mobile-submit {
    width: 100%;
    min-height: 48px;
}
.scanner-status-note[data-state="error"] {
    color: #fda4af;
}
.scanner-status-note[data-state="success"] {
    color: #e6d08d;
}
.scanner-status-note[data-state="loading"] {
    color: #fcd34d;
}
.scanner-mobile-result-card {
    border-radius: 22px;
    padding: 12px;
}
.scanner-mobile-highlight {
    border-radius: 20px;
    padding: 16px;
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(198,164,91,0.16), rgba(9,14,28,0.92));
}
.scanner-mobile-highlight h3 {
    font-size: 1.2rem;
    color: #f8fbff;
}
.scanner-mobile-highlight p {
    color: #c7d2e5;
}
.scanner-mobile-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.scanner-mini-metric {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15,23,42,0.82);
    border: 1px solid rgba(148,163,184,0.1);
}
.scanner-mini-metric span {
    color: #89a0be;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.scanner-mini-metric strong {
    color: #f8fbff;
    font-size: 0.96rem;
}
.scanner-mobile-inline-card {
    border-radius: 18px;
    padding: 14px;
}
.scanner-mobile-inline-card + .scanner-mobile-inline-card {
    margin-top: 10px;
}
.scanner-mobile-inline-card p,
.scanner-mobile-inline-card .tool-list {
    color: #c7d2e5;
}
.scanner-mobile-disclaimer {
    border-radius: 18px;
    padding: 14px;
}
.scanner-mobile-disclaimer p {
    color: #93a5bf;
    font-size: 0.88rem;
}

[data-theme="dark"] .scanner-public-body {
    background:
        radial-gradient(circle at top, rgba(198,164,91,0.24), transparent 30%),
        linear-gradient(180deg, #080704 0%, #18140d 46%, #1a1710 100%);
}
[data-theme="dark"] .scanner-public-hero,
[data-theme="dark"] .scanner-public-card {
    background: rgba(8,17,31,0.84);
    border-color: rgba(148,163,184,0.16);
    box-shadow: 0 20px 46px rgba(2,6,23,0.34);
}
[data-theme="dark"] .scanner-pill {
    background: rgba(224,200,117,0.12);
    color: #f3e8c4;
}
[data-theme="dark"] .scanner-chat-empty {
    background: rgba(224,200,117,0.08);
    border-color: rgba(224,200,117,0.24);
    color: var(--text-secondary);
}
[data-theme="dark"] .scanner-bubble {
    border-color: rgba(148,163,184,0.14);
    background: rgba(15,23,42,0.9);
}
[data-theme="dark"] .scanner-bubble.is-user {
    background: linear-gradient(135deg, rgba(198,164,91,0.22), rgba(30,64,175,0.32));
}
[data-theme="dark"] .scanner-bubble.is-assistant {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,28,49,0.94));
}
[data-theme="dark"] .scanner-summary-highlight {
    background: linear-gradient(135deg, rgba(198,164,91,0.16), rgba(15,23,42,0.96));
    border-color: rgba(224,200,117,0.18);
}

.tool-catalog-grid,
.tool-findings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.tool-catalog-card.is-active,
.tool-summary-card,
.tool-upload-shell,
.tool-diagnosis-card {
    border-color: rgba(198,164,91,0.18);
    box-shadow: 0 14px 32px rgba(198,164,91,0.08);
}
.tool-diagnosis-callout {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(198,164,91,0.08);
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}
.tool-diagnosis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.tool-copy,
.tool-helper {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.tool-helper {
    margin-top: 12px;
}
.tool-upload-row,
.tool-pill-row,
.tool-finding-head,
.tool-finding-badges {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.tool-paste-shell {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}
.tool-paste-area {
    min-height: 220px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.88rem;
    line-height: 1.45;
}
.tool-detail-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
.tool-list-block {
    margin-top: 14px;
}
.tool-list-block strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}
.tool-list {
    margin-left: 18px;
    color: var(--text-secondary);
}
.tool-list li + li {
    margin-top: 6px;
}
.tool-finding-card h3 {
    font-size: 1.05rem;
}
.status-chip-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}
.status-chip-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}
.status-chip-info {
    background: var(--info-light);
    color: var(--info);
}
[data-theme="dark"] .status-chip-danger {
    background: rgba(244,63,94,0.14);
    color: #fecdd3;
}
[data-theme="dark"] .status-chip-warning {
    background: rgba(245,158,11,0.16);
    color: #fcd34d;
}
[data-theme="dark"] .status-chip-info {
    background: rgba(59,130,246,0.16);
    color: #f3e4b9;
}
[data-theme="dark"] .tool-catalog-card.is-active,
[data-theme="dark"] .tool-summary-card,
[data-theme="dark"] .tool-upload-shell,
[data-theme="dark"] .tool-diagnosis-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,28,49,0.96));
    border-color: rgba(224,200,117,0.16);
}
[data-theme="dark"] .tool-diagnosis-callout {
    background: rgba(224,200,117,0.14);
    color: #fff9e8;
}

@media (min-width: 768px) {
    .login-screen {
        padding: 28px;
    }

    .hero-panel {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .metric-strip {
        grid-template-columns: repeat(4, 1fr);
    }
    .report-overview-strip {
        grid-template-columns: repeat(4, 1fr);
    }
    .scanner-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .scanner-grok-layout {
        grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
        align-items: start;
    }
    .scanner-result-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
        align-items: start;
    }
    .scanner-mobile-shell {
        width: min(100%, 920px);
        padding: 26px 18px 34px;
    }
    .scanner-mobile-chat-card {
        padding: 18px;
    }
    .scanner-mobile-actions {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .scanner-mobile-submit {
        width: auto;
        min-width: 180px;
    }
    .scanner-mobile-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .report-toggle-shell {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .report-scope-toggle {
        min-width: 260px;
    }
    .report-inner-grid,
    .report-shared-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .dashboard-grid-simple,
    .config-grid,
    .template-grid,
    .tool-findings-grid,
    .tool-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tool-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tool-diagnosis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .config-grid-wide {
        grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
        align-items: start;
    }
    .config-grid-compact {
        grid-template-columns: minmax(0, 1fr);
    }
    .config-hero-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
    .config-tabbar {
        gap: 12px;
    }

    .inventory-grid,
    .people-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-split-grid {
        grid-template-columns: 1fr 1fr;
    }

    .wizard-stock-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    }

    .wizard-stage-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
        align-items: start;
    }

    .service-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .wizard-overlay {
        left: calc(50% + (var(--sb-width) / 2));
        right: auto;
        width: min(1180px, calc(100vw - var(--sb-width) - 48px));
        max-width: min(1180px, calc(100vw - var(--sb-width) - 48px));
        top: 24px;
        bottom: 24px;
        border-radius: 28px;
        overflow: hidden;
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(15,23,42,0.08);
    }

    .wizard-steps {
        padding: 24px;
    }
}

@media (max-width: 919px) {
    .login-shell {
        max-width: 420px;
    }

    .login-card {
        max-width: none;
        justify-self: stretch;
    }
}

@media (min-width: 1280px) {
    .service-card-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .dashboard-stock-finder {
        padding: 12px;
        border-radius: 19px;
    }
    .dashboard-stock-search-shell { min-height: 52px; }
    .dashboard-stock-result {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
    }
    .dashboard-stock-result-device {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }
    .dashboard-stock-result-copy > strong { font-size: 0.88rem; }
    .dashboard-stock-result-qty { min-width: 36px; }
    .dashboard-stock-result-qty strong { font-size: 1.12rem; }

    .wizard-steps {
        padding: 16px 14px 20px;
    }

    .wizard-card {
        padding: 16px;
        border-radius: 22px;
    }

    .wizard-pane-intro-card {
        padding-inline: 2px;
    }

    .search-result-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px 11px;
        border-radius: 16px;
    }

    .search-result-actions {
        justify-content: center;
        align-self: stretch;
    }

    .search-result-topline {
        align-items: flex-start;
        gap: 8px;
    }

    .search-result-title {
        font-size: 0.92rem;
        line-height: 1.25;
    }

    .search-result-meta-row {
        gap: 4px;
        margin-top: 6px;
    }

    .search-result-meta {
        font-size: 0.73rem;
        line-height: 1.2;
    }

    .search-result-stock-badge {
        font-size: 0.68rem;
        padding: 4px 7px;
        min-width: 54px;
    }

    .result-add-btn {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        font-size: 20px;
    }

    .wizard-items-table {
        width: 100%;
        table-layout: fixed;
    }

    .wizard-items-table thead {
        display: none;
    }

    .wizard-items-table,
    .wizard-items-table tbody,
    .wizard-items-table tr,
    .wizard-items-table td {
        display: block;
        width: 100%;
    }

    .wizard-items-table tr {
        padding: 12px;
        border: 1px solid rgba(148,163,184,0.14);
        border-radius: 16px;
        background: var(--surface-2);
        margin-bottom: 10px;
    }

    .wizard-items-table tr:last-child {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .wizard-items-table td {
        padding: 0 2px;
        border: none;
        white-space: normal !important;
    }

    .wizard-items-table td + td {
        margin-top: 6px;
    }

    .wizard-items-table td:nth-child(2) .category-inline {
        font-size: 0.72rem;
    }

    .wizard-items-table td:nth-child(3) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .wizard-items-table td:last-child {
        display: flex;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .wizard-item-edit-row {
        width: 100%;
        justify-content: flex-end;
    }

    .wizard-item-inline-input {
        width: 92px;
        min-width: 92px;
    }

    .service-card {
        padding: 14px;
    }

    .service-card-top {
        align-items: flex-start;
        gap: 10px;
    }

    .service-card-top-badges {
        width: 100%;
        justify-content: flex-start;
    }

    .service-card-name {
        font-size: 1rem;
        line-height: 1.25;
    }

    .service-card-sub {
        margin: 10px 0;
        font-size: 0.9rem;
        min-height: 58px;
        display: flex;
        align-items: center;
    }

    .service-card-meta {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .service-card-footer {
        margin-top: 10px;
    }

    .service-card-actions {
        margin-top: 10px;
        justify-content: flex-start;
    }

    .wizard-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wizard-inline-row label {
        padding-bottom: 0;
        min-width: 0;
    }
}

@media print {
    .print-sheet { padding: 0; }
    /* Ocultar badges coloridos que podem nao imprimir bem */
    .badge { border: 1px solid #94835f !important; background: transparent !important; color: #334155 !important; }
}

/* ===== RELATORIOS REDESIGN ===== */

/* Hero with KPI strip */
.rpt-hero {
    grid-template-columns: 1fr;
    gap: 18px;
}
.rpt-hero-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.rpt-kpi-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.15);
}
.rpt-kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.65);
    font-weight: 600;
}
.rpt-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.rpt-kpi-value.profit-positive { color: #86efac; }
.rpt-kpi-value.profit-negative { color: #fca5a5; }

/* Tab bar */
.rpt-tab-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.rpt-tab-bar::-webkit-scrollbar { display: none; }

.rpt-tab-btn {
    flex-shrink: 0;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.rpt-tab-btn:hover {
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(198,164,91,0.12);
}
.rpt-tab-btn.is-active {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(198,164,91,0.28);
}

[data-theme="dark"] .rpt-tab-btn {
    background: rgba(15,23,42,0.8);
    border-color: rgba(148,163,184,0.16);
}
[data-theme="dark"] .rpt-tab-btn.is-active {
    background: var(--primary);
}

/* Report tables */
.report-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin-top: 2px;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 500px;
}
.report-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: rgba(198,164,91,0.05);
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}
.report-table th.td-money {
    text-align: right;
}
.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover { background: rgba(198,164,91,0.03); }
.report-table tfoot .tfoot-total td {
    background: rgba(198,164,91,0.05);
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding: 12px 14px;
}
.td-money {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.td-muted { color: var(--text-secondary); }
.td-dia { white-space: nowrap; }
.dia-semana {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.2;
}
.rpt-row-current { background: rgba(198,164,91,0.04); }
.rpt-badge-atual {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: rgba(198,164,91,0.1);
    border-radius: 6px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 4px;
}
.profit-positive { color: #16a34a; }
.profit-negative { color: #dc2626; }
.rpt-empty { padding: 20px 0; }

[data-theme="dark"] .report-table th { background: rgba(224,200,117,0.07); }
[data-theme="dark"] .report-table tbody tr:hover { background: rgba(224,200,117,0.04); }
[data-theme="dark"] .report-table tfoot .tfoot-total td { background: rgba(224,200,117,0.06); }
[data-theme="dark"] .rpt-row-current { background: rgba(224,200,117,0.06); }
[data-theme="dark"] .profit-positive { color: #4ade80; }
[data-theme="dark"] .profit-negative { color: #f87171; }
[data-theme="dark"] .rpt-badge-atual { color: #e6d08d; background: rgba(224,200,117,0.14); }

/* Month picker */
.report-month-picker-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.report-month-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.report-month-input {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.report-month-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198,164,91,0.12);
}
[data-theme="dark"] .report-month-input {
    background: rgba(15,23,42,0.8);
    border-color: rgba(148,163,184,0.2);
}

.voice-debug-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}
.voice-allowed-list {
    display: grid;
    gap: 10px;
}
.voice-allowed-row {
    display: grid;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(198,164,91,0.05);
}
.voice-allowed-remove {
    width: 100%;
}
.voice-debug-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(148,163,184,0.06);
    padding: 12px;
}
.voice-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.voice-debug-text,
.voice-debug-error {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(198,164,91,0.08);
    color: var(--text);
    line-height: 1.45;
}
.voice-debug-error {
    background: rgba(239,68,68,0.1);
    color: #b91c1c;
}
.voice-debug-item details {
    margin-top: 8px;
}
.voice-debug-item summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
}
.voice-debug-item pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 8px 0 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(15,23,42,0.06);
    font-size: 0.78rem;
}
[data-theme="dark"] .voice-debug-item {
    background: rgba(15,23,42,0.55);
    border-color: rgba(148,163,184,0.18);
}
[data-theme="dark"] .voice-allowed-row {
    background: rgba(15,23,42,0.55);
    border-color: rgba(148,163,184,0.18);
}
[data-theme="dark"] .voice-debug-error {
    color: #fecaca;
}
[data-theme="dark"] .voice-debug-item pre {
    background: rgba(2,6,23,0.55);
}

@media (min-width: 480px) {
    .report-compare-card { padding: 14px; }
    .metric-value { font-size: 1.25rem; }
}
@media (min-width: 640px) {
    .voice-allowed-row {
        grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    }
    .voice-allowed-remove {
        width: auto;
    }
    .rpt-hero {
        grid-template-columns: 1fr auto;
        align-items: start;
    }
    .rpt-hero-kpis {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        flex-shrink: 0;
    }
    .report-compare-card { padding: 16px; }
    .metric-value { font-size: 1.35rem; }
    .report-compare-grid { gap: 12px; }
}
@media (min-width: 900px) {
    .rpt-hero-kpis {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }
    .report-compare-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tabela report-table: colunas compactas no mobile */
@media (max-width: 479px) {
    .report-table { font-size: 0.78rem; min-width: 420px; }
    .report-table th,
    .report-table td { padding: 8px 8px; }
    .report-table tfoot .tfoot-total td { padding: 10px 8px; }
    .report-compare-grid { gap: 8px; }
    .metric-label { font-size: 0.68rem; }
}

.raffle-shell {
    display: grid;
    gap: 18px;
}
.raffle-hero {
    display: grid;
    gap: 16px;
    overflow: hidden;
    position: relative;
    padding: clamp(18px, 3vw, 28px);
    background:
        radial-gradient(circle at 15% 10%, rgba(34,197,94,0.2), transparent 28%),
        radial-gradient(circle at 90% 20%, rgba(198,164,91,0.18), transparent 26%),
        var(--surface);
    border-radius: 24px;
}
.raffle-hero h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.45rem, 4vw, 2.4rem);
}
.raffle-hero p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 720px;
}
.raffle-hero-actions,
.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.raffle-grid {
    display: grid;
    gap: 16px;
}
.raffle-list {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 16px;
    border-radius: 22px;
}
.raffle-list-items {
    display: grid;
    gap: 10px;
}
.raffle-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0 13px;
    background: var(--surface);
    color: var(--text-secondary);
}
.raffle-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198,164,91,.1);
}
.raffle-search span {
    font-size: 1.35rem;
    line-height: 1;
}
.raffle-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    padding: 12px 8px;
    background: transparent;
    color: var(--text);
}
.raffle-search-compact {
    margin-bottom: 2px;
}
.raffle-list-card {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    color: var(--text);
    display: grid;
    gap: 6px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.raffle-list-card:hover,
.raffle-list-card.active {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: 0 18px 45px rgba(15,23,42,0.1);
}
.raffle-status {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .72rem;
    font-weight: 800;
}
.raffle-status.on {
    background: rgba(34,197,94,.14);
    color: #15803d;
}
.raffle-status.off {
    background: rgba(148,163,184,.18);
    color: #66593d;
}
.raffle-progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148,163,184,.2);
}
.raffle-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #c6a45b);
}
.raffle-main {
    display: grid;
    gap: 16px;
}
.raffle-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px !important;
    background:
        radial-gradient(circle at 88% 20%, rgba(198,164,91,.17), transparent 28%),
        var(--surface);
}
.raffle-selected h3 {
    margin: 8px 0 3px;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
}
.raffle-selected p {
    margin: 0;
    color: var(--text-secondary);
}
.raffle-selected-actions {
    flex: 0 0 auto;
}
.raffle-main > .card,
.raffle-editor {
    padding: clamp(16px, 2vw, 22px);
    border-radius: 22px;
}
.raffle-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.raffle-metric-card {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(198,164,91,0.12), transparent 34%),
        var(--surface);
    box-shadow: 0 12px 32px rgba(15,23,42,0.08);
}
.raffle-metric-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.raffle-metric-card strong {
    display: block;
    color: var(--text);
    font-size: clamp(1.2rem, 2.4vw, 1.85rem);
    font-weight: 950;
    line-height: 1;
}
.raffle-metric-card.success {
    border-color: rgba(16,185,129,.28);
    background: radial-gradient(circle at top right, rgba(16,185,129,.17), transparent 38%), var(--surface);
}
.raffle-metric-card.warning {
    border-color: rgba(245,158,11,.3);
    background: radial-gradient(circle at top right, rgba(245,158,11,.17), transparent 38%), var(--surface);
}
.raffle-card-count,
.raffle-result-count {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(198,164,91,.1);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}
.raffle-form,
.raffle-upload-grid,
.raffle-sliders {
    display: grid;
    gap: 12px;
}
.raffle-form {
    margin-top: 14px;
}
.raffle-prize-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(198,164,91,0.26);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(198,164,91,0.2), transparent 34%),
        linear-gradient(135deg, rgba(198,164,91,0.1), rgba(198,164,91,0.08));
}
.raffle-prize-field span {
    display: block;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.raffle-prize-field strong {
    display: block;
    margin-top: 2px;
    color: var(--text);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.1;
}
.raffle-prize-field small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-weight: 700;
}
.raffle-money-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0;
}
.raffle-money-input span {
    display: inline-grid;
    place-items: center;
    min-height: 50px;
    min-width: 54px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0;
}
.raffle-money-input .form-control {
    min-height: 50px;
    font-size: 1.15rem;
    font-weight: 900;
}
.raffle-form .form-group,
.raffle-upload-grid .form-group {
    display: grid;
    gap: 7px;
}
.raffle-upload-grid {
    margin-top: 14px;
}
.raffle-upload-grid .btn {
    width: 100%;
    min-height: 42px;
}
.raffle-upload-grid input[type="file"].form-control {
    height: auto;
    padding: 10px;
    cursor: pointer;
}
.raffle-upload-grid input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 12px;
    margin-right: 10px;
    padding: 9px 12px;
    background: rgba(198,164,91,0.1);
    color: var(--primary-dark);
    font-weight: 800;
    cursor: pointer;
}
.raffle-form .span-2 {
    grid-column: 1 / -1;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(198,164,91,.07);
    font-weight: 700;
}
.raffle-preview-zone {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}
.raffle-card-preview {
    aspect-ratio: 1.76 / 1;
    min-height: 170px;
    border-radius: 24px;
    border: 1px dashed var(--border);
    background: linear-gradient(135deg, rgba(15,23,42,.08), rgba(198,164,91,.1)) center/cover no-repeat;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    color: var(--text-muted);
    font-weight: 800;
}
.raffle-card-preview.back {
    --qr-x: 62%;
    --qr-y: 42%;
    --qr-size: 26%;
}
.raffle-qr-placeholder {
    position: absolute;
    left: var(--qr-x);
    top: var(--qr-y);
    width: var(--qr-size);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    background:
        linear-gradient(90deg, #111827 10%, transparent 10% 90%, #111827 90%),
        linear-gradient(#111827 10%, white 10% 90%, #111827 90%);
    border: 8px solid #fff;
    box-shadow: 0 18px 35px rgba(0,0,0,.2);
    display: grid;
    place-items: center;
    color: #111827;
    font-size: .8rem;
}
.raffle-sliders label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}
.raffle-sliders strong {
    color: var(--primary);
}
.raffle-empty {
    margin: 0;
}
.raffle-message-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}
.raffle-message-status.sent {
    background: rgba(16,185,129,0.12);
    color: #047857;
}
.raffle-message-status.failed {
    background: rgba(245,158,11,0.14);
    color: #92400e;
}
.raffle-message-status.pending {
    background: rgba(59,130,246,0.13);
    color: #8e6f2f;
}
.raffle-message-status.delivered {
    background: rgba(20,184,166,0.14);
    color: #0f766e;
}
.raffle-message-status.read {
    background: rgba(179,141,61,0.14);
    color: #4338ca;
}
.raffle-message-checked {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.raffle-resend-btn {
    min-width: 92px;
    white-space: nowrap;
}
.raffle-resend-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}
.raffle-participant-filters {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.raffle-participant-filters .form-control {
    min-height: 48px;
}
.raffle-participant-list {
    display: grid;
    gap: 10px;
}
.raffle-participant-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(148,163,184,.045);
}
.raffle-participant-card.is-winner {
    border-color: rgba(245,158,11,.48);
    background:
        radial-gradient(circle at top right, rgba(250,204,21,.16), transparent 30%),
        rgba(245,158,11,.07);
    box-shadow: 0 14px 34px rgba(245,158,11,.12);
}
.raffle-winner-mark {
    display: inline-flex;
    width: fit-content;
    margin-right: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(245,158,11,.16);
    color: #92400e;
    font-size: .68rem;
    font-weight: 950;
    text-transform: uppercase;
}
.raffle-winner-message {
    margin-top: 3px;
    font-weight: 800;
    white-space: normal !important;
}
.raffle-winner-message.sent { color: #047857; }
.raffle-winner-message.failed { color: #b45309; }
.raffle-participant-number {
    display: grid;
    place-items: center;
    min-height: 60px;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--primary), #c6a45b);
    color: #fff;
    box-shadow: 0 10px 24px rgba(198,164,91,.2);
}
.raffle-participant-number span {
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
}
.raffle-participant-number strong {
    font-size: 1.2rem;
    line-height: 1;
}
.raffle-participant-person {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.raffle-participant-person strong,
.raffle-participant-person a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.raffle-participant-person a {
    color: var(--primary);
    font-weight: 750;
    text-decoration: none;
}
.raffle-participant-person small {
    color: var(--text-secondary);
}
.raffle-participant-delivery {
    display: grid;
    justify-items: end;
}
.raffle-participant-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.raffle-action-toast {
    position: fixed;
    z-index: 5000;
    left: 50%;
    bottom: 24px;
    width: min(calc(100% - 24px), 540px);
    display: grid;
    gap: 13px;
    padding: 16px;
    border: 1px solid rgba(198,164,91,.3);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(15,23,42,.28);
    transform: translate(-50%, 24px) scale(.98);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
}
.raffle-action-toast.show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}
.raffle-action-toast.danger {
    border-color: rgba(239,68,68,.34);
}
.raffle-action-toast strong {
    display: block;
    font-size: 1.02rem;
}
.raffle-action-toast p {
    margin: 4px 0 0;
    color: var(--text-secondary);
}
.raffle-action-toast-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.raffle-print-dialog {
    display: grid;
    gap: 16px;
}
.raffle-print-quantity {
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(198,164,91,.055);
}
.raffle-print-quantity label {
    font-weight: 900;
}
.raffle-print-quantity small {
    color: var(--text-secondary);
}
.raffle-print-options {
    display: grid;
    gap: 10px;
}
.raffle-print-option {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 2px 12px;
    align-items: center;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.raffle-print-option:hover,
.raffle-print-option:focus-visible {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(198,164,91,.12);
    outline: none;
}
.raffle-print-option.featured {
    border-color: rgba(198,164,91,.35);
    background: linear-gradient(135deg, rgba(198,164,91,.1), rgba(198,164,91,.08));
}
.raffle-print-option-icon {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--primary), #c6a45b);
    color: #fff;
    font-size: .85rem;
    font-weight: 950;
}
.raffle-print-option strong {
    align-self: end;
}
.raffle-print-option small {
    align-self: start;
    color: var(--text-secondary);
}
.raffle-shell .section-header.compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.raffle-shell .section-header.compact h3 {
    margin: 0;
}
.raffle-shell .section-header.compact p {
    margin: 4px 0 0;
    color: var(--text-secondary);
}
.raffle-shell .form-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.raffle-public-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(34,197,94,.35), transparent 32%),
        radial-gradient(circle at bottom right, rgba(198,164,91,.28), transparent 34%),
        linear-gradient(145deg, #050403 0%, #18140d 45%, #111827 100%);
    color: #fffdf7;
}
.raffle-public-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.raffle-public-card {
    width: min(100%, 520px);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 32px;
    padding: clamp(22px, 5vw, 36px);
    background: rgba(15,23,42,.78);
    box-shadow: 0 28px 90px rgba(0,0,0,.38);
    backdrop-filter: blur(18px);
}
.raffle-public-badge {
    width: fit-content;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(34,197,94,.16);
    color: #bbf7d0;
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.raffle-public-card h1 {
    margin: 18px 0 10px;
    font-size: clamp(1.8rem, 8vw, 3.2rem);
    line-height: .98;
}
.raffle-public-card p {
    color: #cbb786;
    line-height: 1.55;
}
.raffle-public-number {
    margin: 18px 0;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(198,164,91,.14));
    color: #e0f2fe;
}
.raffle-public-number strong {
    display: block;
    margin-top: 4px;
    font-size: 2rem;
    color: #fff;
}
.raffle-public-form {
    display: grid;
    gap: 14px;
}
.raffle-public-form label {
    display: grid;
    gap: 7px;
    color: #e0d2af;
    font-weight: 800;
}
.raffle-public-error {
    padding: 12px;
    border-radius: 14px;
    background: rgba(239,68,68,.18);
    color: #fecaca;
}
.raffle-public-note {
    display: block;
    margin-top: 14px;
    color: #94835f;
    line-height: 1.45;
}
.raffle-public-loader {
    display: grid;
    gap: 14px;
    place-items: center;
    min-height: 220px;
}
.raffle-public-loader span {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 4px solid rgba(255,255,255,.18);
    border-top-color: #22c55e;
    animation: spin .8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 720px) {
    .raffle-hero {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
    .raffle-grid {
        grid-template-columns: minmax(260px, 320px) 1fr;
        align-items: start;
    }
    .raffle-form,
    .raffle-upload-grid,
    .raffle-preview-zone,
    .raffle-sliders {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .raffle-sliders {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .raffle-participant-filters {
        grid-template-columns: minmax(260px, 1fr) minmax(180px, 230px);
    }
}

@media (max-width: 719px) {
    .raffle-prize-field {
        grid-template-columns: 1fr;
    }
    .raffle-selected {
        align-items: stretch;
        flex-direction: column;
    }
    .raffle-selected-actions .btn {
        width: 100%;
    }
    .raffle-participant-card {
        grid-template-columns: 58px minmax(0, 1fr);
    }
    .raffle-participant-delivery {
        justify-items: start;
        grid-column: 2;
    }
    .raffle-participant-card .raffle-resend-btn {
        width: auto;
    }
    .raffle-participant-actions .btn {
        flex: 1 1 130px;
    }
    .raffle-action-toast {
        bottom: 82px;
    }
    .raffle-action-toast-buttons .btn {
        flex: 1;
    }
}

[data-theme="dark"] .raffle-list-card {
    background: rgba(15,23,42,.55);
}
[data-theme="dark"] .raffle-metric-card {
    background:
        radial-gradient(circle at top right, rgba(198,164,91,0.15), transparent 34%),
        rgba(15,23,42,0.72);
    border-color: rgba(148,163,184,0.18);
}
