﻿/* =========================================================
   ScpBld Design Tokens (Phase 1)
   Drop-in: colors, type, spacing, radius, surfaces
   ========================================================= */

:root {
    /* Brand */
    --brand-primary: #0066CC;
    --brand-primary-hover: #005BB8;
    /* App backgrounds */
    --bg-app: #F5F7FA;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #F9FAFB; /* hover/alt surface */
    /* Text */
    --text-primary: #1A1A1B;
    --text-secondary: #6B7280;
    --text-muted: rgba(107, 114, 128, 0.85);
    /* Borders */
    --border: #E5E7EB;
    --border-strong: rgba(229, 231, 235, 0.95);
    /* Sidebar */
    --sidebar-bg: #0F172A;
    --sidebar-text: rgba(255, 255, 255, 0.92);
    --sidebar-muted: rgba(255, 255, 255, 0.70);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    /* Radius */
    --r-8: 8px;
    --r-12: 12px;
    --r-16: 16px;
    --r-pill: 999px;
    /* Spacing (4px scale) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-45: 20px;
    /* Typography */
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    --text-xs: 12px;
    --text-sm: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 800;
    /* Focus ring */
    --focus: 0 0 0 3px rgba(0, 102, 204, 0.18);
    /* Subtle elevation (border-first aesthetic) */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);

    /* ScopeBuilder theme rollout */
    --sb-blue-start: #0ea5e9;
    --sb-blue-end: #1e3a8a;
    --sb-navy: #102a5c;
    --sb-card-bg: #ffffff;
    --sb-card-border: rgba(148, 163, 184, 0.28);
    --sb-page-bg: #f4f8fc;
    --sb-text: #0f172a;
    --sb-muted: #64748b;
    --sb-radius: 12px;
    --sb-inner-radius: 10px;
    --sb-header-radius: var(--sb-radius);
    --sb-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
}

/* =========================================================
   Base page styles (light touch)
   ========================================================= */

html, body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-app);
}

a {
    color: var(--brand-primary);
}

    a:hover {
        color: var(--brand-primary-hover);
    }

:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: var(--r-8);
}

/* Better numeric alignment for totals/prices */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   Reusable surfaces (you can apply these gradually)
   ========================================================= */

/* Card / panel surface */
.z-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-16);
    box-shadow: var(--shadow-sm);
}

/* ScopeBuilder theme primitives for gradual page-by-page rollout */
.sb-section-shell {
    background: var(--sb-page-bg);
    border-radius: var(--sb-radius);
    min-width: 0;
    padding: var(--s-4);
}

.sb-card {
    background: var(--sb-card-bg);
    border: 1px solid var(--sb-card-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow);
    color: var(--sb-text);
    min-width: 0;
    overflow: hidden;
}

.sb-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-3);
    padding: 12px 14px;
}

.sb-gradient-header {
    background: linear-gradient(135deg, var(--sb-blue-start) 0%, var(--sb-blue-end) 100%);
    border-radius: var(--sb-header-radius);
    color: #ffffff;
}

.sb-card > .sb-card-header:first-child,
.sb-card > .sb-gradient-header:first-child {
    border-radius: calc(var(--sb-radius) - 1px) calc(var(--sb-radius) - 1px) 0 0;
}

.sb-card-title {
    margin: 0;
    color: inherit;
    font-size: var(--text-lg);
    font-weight: var(--fw-black);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.sb-card-subtitle {
    margin: 3px 0 0;
    color: var(--sb-muted);
    font-size: var(--text-xs);
    line-height: 1.35;
}

.sb-gradient-header .sb-card-subtitle {
    color: rgba(255, 255, 255, 0.82);
}

.sb-card-body {
    padding: 14px;
    background: var(--sb-card-bg);
}

.sb-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
    flex-wrap: wrap;
    min-width: 0;
}

.sb-action-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    border: 1px solid var(--sb-navy);
    border-radius: var(--sb-radius);
    background: var(--sb-navy);
    color: #ffffff;
    cursor: pointer;
    padding: 6px 10px;
    font-size: var(--text-xs);
    font-weight: var(--fw-bold);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(15, 42, 92, 0.16);
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.sb-action-btn:hover,
.sb-action-btn:focus-visible {
    background: #0b1f49;
    border-color: #0b1f49;
    color: #ffffff;
}

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

.sb-action-btn:disabled,
.sb-action-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.sb-action-btn-secondary {
    background: #ffffff;
    border-color: rgba(30, 58, 138, 0.35);
    color: var(--sb-navy);
    box-shadow: none;
}

.sb-action-btn-secondary:hover,
.sb-action-btn-secondary:focus-visible {
    background: #eff6ff;
    border-color: rgba(14, 165, 233, 0.72);
    color: var(--sb-navy);
}

.sb-action-btn-danger {
    background: #ffffff;
    border-color: rgba(185, 28, 28, 0.35);
    color: #991b1b;
    box-shadow: none;
}

.sb-action-btn-danger:hover,
.sb-action-btn-danger:focus-visible {
    background: #fef2f2;
    border-color: rgba(185, 28, 28, 0.55);
    color: #7f1d1d;
}

.sb-summary-tile {
    border: 1px solid var(--sb-card-border);
    border-radius: var(--sb-radius);
    background: #ffffff;
    padding: 9px 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

/* Softer inset container (for hover zones) */
.z-surface-2 {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-12);
}

/* Section label style: “CABINETS & VANITIES” */
.z-section-label {
    font-size: var(--text-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* =========================================================
   Buttons (token-driven)
   ========================================================= */

.z-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--r-8);
    padding: 10px 14px;
    font-weight: var(--fw-semibold);
    font-size: var(--text-md);
    line-height: 1;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

    .z-btn:hover {
        background: var(--bg-surface-2);
        border-color: var(--border-strong);
    }

    .z-btn:active {
        transform: translateY(1px);
    }

.z-btn--primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

    .z-btn--primary:hover {
        background: var(--brand-primary-hover);
        border-color: var(--brand-primary-hover);
    }

.z-btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}

.z-btn--danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.55);
    background: transparent;
}

    .z-btn--danger:hover {
        background: rgba(220, 38, 38, 0.08);
        border-color: rgba(220, 38, 38, 0.70);
    }

/* =========================================================
   Chat bubble primitives (token-driven)
   ========================================================= */

.z-bubble {
    display: inline-block;
    max-width: 92%;
    padding: 10px 12px;
    border-radius: var(--r-16);
    font-size: var(--text-md);
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid transparent;
}

.z-bubble--ai {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border);
    border-top-left-radius: var(--r-8);
}

.z-bubble--me {
    background: var(--brand-primary);
    color: #fff;
    border-top-right-radius: var(--r-8);
}

/* =========================================================
   App shell helpers (used in Phase 2, safe to add now)
   ========================================================= */

.z-app-bg {
    background: var(--bg-app);
}
