/* =============================================================
   SYNCABRICK, BRAND IDENTITY CSS
   Single source of truth for all portal styling.
   Include on every page: <link rel="stylesheet" href="/css/brand.css">
   ============================================================= */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
    /* Primary palette, SyncaBrick (navy for actions, yellow for accents only) */
    --croco-green:        #0F172A;
    --croco-green-dark:   #1E293B;
    --croco-green-light:  #334155;
    --croco-green-subtle: #F1F5F9;

    /* SyncaBrick tokens */
    --synca-yellow:        #F7C325;
    --synca-yellow-dark:   #D4A800;
    --synca-yellow-light:  #FACC15;
    --synca-yellow-subtle: #FEF9C3;
    --synca-dark:          #0F172A;
    --synca-dark-800:      #1E293B;
    --synca-dark-700:      #334155;
    --synca-primary:       #0F172A;  /* alias, several pages reference --synca-primary for the action color */

    /* Accent */
    --lego-yellow:        #F7C325;
    --lego-yellow-dark:   #D4A800;
    --lego-yellow-light:  #FEF9C3;
    --lego-red:           #DC2626;
    --lego-red-light:     #FEE2E2;

    /* Neutrals (warm-tinted) */
    --neutral-900: #18181B;
    --neutral-800: #27272A;
    --neutral-700: #3F3F46;
    --neutral-600: #71717A;
    --neutral-500: #A1A1AA;
    --neutral-400: #A1A1AA;
    --neutral-300: #D4D4D8;
    --neutral-200: #E5E5E3;
    --neutral-100: #F5F5F3;
    --neutral-50:  #FAFAF8;
    --white:       #FFFFFF;

    /* Semantic shortcuts */
    --primary:       #0F172A;
    --primary-hover: #1E293B;

    /* Functional */
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-error:   #DC2626;
    --color-info:    #3B82F6;

    /* Channel accents (ticket #245, decision 5): a dot, logo or border, never a
       button fill. The brand colour where it reaches 3:1 on white, otherwise a
       darker shade of the same hue; red, amber and green stay reserved for
       error, warning and success, yellow for SyncaBrick itself. */
    --channel-bricklink:    #D7181C;  /* logo red */
    --channel-shopify:      #5E8E3E;  /* brand #95BF47 is 2.1:1 */
    --channel-vinted:       #007782;
    --channel-bolcom:       #0000A4;
    --channel-ebay:         #0064D2;  /* the blue of the logo; its red would read as an error */
    --channel-brickowl:     #ED541D;
    --channel-amazon:       #C45500;  /* brand #FF9900 is 2.1:1 and reads as a warning */
    --channel-whatnot:      #71717A;  /* brand yellow is SyncaBrick's own accent */
    --channel-brickvillage: #005BB5;
    --channel-marktplaats:  #B9692A;  /* brand #EDA566 is 2.1:1 */
    --channel-woocommerce:  #7F54B3;
    --channel-brickscout:   #C2611F;  /* logo #FF8F3D is 2.3:1 */
    --channel-storefront:   #71717A;
    --channel-local:        #71717A;

    /* Typography */
    --font-display:  'Plus Jakarta Sans', sans-serif;
    --font-heading:  'Plus Jakarta Sans', sans-serif;
    --font-body:     'Inter', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;

    /* Spacing */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    /* Shadows */
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:    0 8px 24px rgba(0,0,0,0.12);
    --shadow-green: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* ── BASE FONT ────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* Form controls do not inherit the page font: the browser gives them its own
   (Arial on Windows), so every button without a font rule of its own fell
   back to Arial. The family only, on purpose: `font: inherit` would also pull
   in the parent's size and line-height and grow every button that leans on the
   browser's default size. */
button, input, select, textarea {
    font-family: inherit;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.header {
    background: var(--white);
    color: var(--neutral-900);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-900);
    margin: 0;
}

.header .subtitle {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--neutral-500);
    margin-top: 3px;
}

.header .breadcrumb {
    font-size: 11px;
    color: var(--neutral-400);
    margin-bottom: 3px;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.3px;
}

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

/* ── HEADER BUTTONS ───────────────────────────────────────── */
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    color: var(--neutral-700);
}

.header-btn:hover {
    background: var(--neutral-200);
    color: var(--neutral-900);
}

.header-btn.primary {
    background: var(--synca-dark);
    color: #ffffff;
    border-color: var(--synca-dark);
    font-weight: 700;
}

.header-btn.primary:hover {
    background: var(--synca-dark-800);
    border-color: var(--synca-dark-800);
    color: #ffffff;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--neutral-200);
    color: var(--neutral-500);
    text-decoration: none;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
    border-color: var(--neutral-300);
}

/* ── HEADER HAMBURGER MENU (partials/header, $menu) ──────── */
.header-menu {
    position: relative;
}

.header-menu-toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    background: var(--white);
    color: var(--neutral-700);
    cursor: pointer;
    transition: all 0.2s;
}

.header-menu-toggle::-webkit-details-marker { display: none; }

.header-menu-toggle:hover,
.header-menu[open] > .header-menu-toggle {
    background: var(--neutral-100);
    color: var(--neutral-900);
}

.header-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1050;
    min-width: 220px;
    padding: 6px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.header-menu-panel form { margin: 0; }

.header-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-700);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.header-menu-item:hover { background: var(--neutral-100); color: var(--neutral-900); }
.header-menu-item.danger { color: #dc2626; }
.header-menu-item.danger:hover { background: #fef2f2; color: #b91c1c; }

.header-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--neutral-200);
}

/* ── PAGE HEADER ALIAS (.page-header) ────────────────────── */
.page-header {
    background: var(--white);
    color: var(--neutral-900);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.page-header .page-title,
.page-header h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
}

.page-header .page-sub,
.page-header .page-subtitle {
    font-size: 13px;
    color: var(--neutral-500);
    margin-top: 3px;
}

/* ── CARDS / WIDGETS ──────────────────────────────────────── */
.stat-card,
.widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.widget h2 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* ── STAT CARDS ───────────────────────────────────────────── */
.stat-label {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-500);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--neutral-500);
}

.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--lego-red); }

.stat-progress {
    width: 100%;
    height: 6px;
    background: var(--neutral-100);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    background: var(--synca-yellow);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── TABLES ───────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--neutral-100);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-500);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 14px;
    color: var(--neutral-700);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--synca-yellow-subtle); }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge.success  { background: #dcfce7; color: #15803d; }
.badge.warning  { background: var(--synca-yellow-subtle); color: #92400e; }
.badge.danger   { background: var(--lego-red-light); color: #991b1b; }
.badge.info     { background: #dbeafe; color: #1e40af; }

/* ── BUTTONS (general) ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--synca-dark);
    color: #ffffff;
    box-shadow: var(--shadow-green);
}
.btn-primary:hover { background: var(--synca-dark-800); }

.btn-secondary {
    background: var(--synca-dark);
    color: var(--white);
    border: 2px solid var(--synca-dark);
}
.btn-secondary:hover { background: var(--synca-dark-800); }

.btn-accent {
    background: var(--synca-dark);
    color: #ffffff;
    font-weight: 700;
}
.btn-accent:hover { background: var(--synca-dark-800); }

.btn-danger {
    background: var(--lego-red);
    color: var(--white);
}
.btn-danger:hover { background: #b91c1c; }

/* ── QUICK ACTION BUTTONS ─────────────────────────────────── */
.action-btn {
    padding: 16px;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-700);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--synca-dark);
    border-color: var(--synca-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-icon { font-size: 24px; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert-box {
    background: var(--synca-yellow-subtle);
    border-left: 4px solid var(--synca-yellow);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.alert-box h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-item {
    color: #92400e;
    margin-bottom: 6px;
    padding-left: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── ACTIVITY FEED ────────────────────────────────────────── */
.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-bottom: 1px solid var(--neutral-100);
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

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

.activity-item:hover {
    background: var(--synca-yellow-subtle);
}

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--synca-yellow-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.activity-content { flex: 1; }

.activity-title {
    font-size: 14px;
    color: var(--neutral-800);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: var(--neutral-400);
}

/* ── DIVIDER ──────────────────────────────────────────────── */
hr, .divider {
    border: none;
    height: 1px;
    background: var(--neutral-200);
    margin: 16px 0;
}

/* ── FORM ELEMENTS ────────────────────────────────────────── */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
select,
textarea {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--neutral-800);
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--synca-dark);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* ── TOUCH / MOBILE FIXES ─────────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }

a, button, input, select, textarea, label,
[role="button"], [tabindex], [onclick] {
    touch-action: manipulation;
}

.table-view, .panel-body, .card-body, .modal-body,
.table-card, .overflow-x-auto { -webkit-overflow-scrolling: touch; }

@media (max-width: 1024px) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover   { background: var(--synca-dark); box-shadow: var(--shadow-green); }
    .btn-secondary:hover { background: var(--synca-dark); }
    .btn-accent:hover    { background: var(--synca-dark); }
    .btn-danger:hover    { background: var(--lego-red); }
    .action-btn:hover    { background: var(--neutral-50); border-color: var(--neutral-200); color: var(--neutral-700); transform: none; box-shadow: none; }
    .header-btn:hover    { background: var(--neutral-100); }
    .table tr:hover td   { background: unset; }
    .activity-item:hover { background: unset; }
}

/* ── RESPONSIVE: PAGE HEADER + HAMBURGER CLEARANCE ────────── */
/* The hamburger button is fixed at top-left and only appears below 1024px.
   Without clearance it overlaps the page title. We also let the header wrap
   so a long title + action buttons never overflow on small screens. */
@media (max-width: 1023px) {
    .header,
    .page-header {
        padding-left: 64px;
        flex-wrap: wrap;
        row-gap: 10px;
    }
    .header .header-actions,
    .page-header .header-actions {
        flex-wrap: wrap;
    }
}
@media (max-width: 600px) {
    .header,
    .page-header {
        padding-top: 14px;
        padding-bottom: 14px;
        padding-right: 16px;
    }
    .header h1,
    .page-header h1,
    .page-header .page-title { font-size: 19px; }
}

/* ── RESPONSIVE: TABLE SCROLL WRAPPER ─────────────────────── */
/* Wrap any wide table in <div class="table-responsive"> so it scrolls
   horizontally on small screens instead of pushing the whole page wider. */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── PAGINATION ───────────────────────────────────────────── */
/* Laravel's own paginator view is written for Tailwind, which this portal does
   not load: its w-5/h-5 on the arrow icons resolve to nothing and the SVGs grow
   to fill the page. Rather than sizing that away, the portal ships its own view
   (vendor/pagination/portal.blade.php) and styles it here, so every page using
   ->links() looks the same and none of them depends on a stylesheet we do not
   have. Any svg inside is still bounded, in case a view slips through. */
.pager {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 13px;
}
.pager a,
.pager span {
    display: inline-block;
    min-width: 32px;
    padding: 5px 10px;
    border-radius: var(--radius-sm, 6px);
    text-align: center;
    text-decoration: none;
    color: var(--neutral-600);
    border: 1px solid transparent;
}
.pager a:hover { background: var(--neutral-100); }
.pager .pager-current {
    background: var(--croco-green, #0F172A);
    color: var(--white, #fff);
    font-weight: 600;
}
.pager .pager-disabled { color: var(--neutral-300); }
.pager .pager-gap { padding-left: 4px; padding-right: 4px; }
.pager-summary { font-size: 12px; color: var(--neutral-500); margin-left: auto; }
.pager svg { width: 14px; height: 14px; }

/* =============================================================
   SHARED COMPONENTS (ticket #245, UI/UX audit 04-10-2026)
   One card, section header, KPI card, button set and filter bar,
   taken from the Settings page (card, section header, buttons) and
   Inventory Overview (KPI card, filter bar). Prefixed `sb-` on purpose:
   26 views define their own .card and 47 their own .btn variants, and an
   unprefixed rule here would leak padding and shadows into every one of
   them. A page moves over when it is touched anyway and drops its local
   copy in the same change; there is no big-bang sweep.
   Colours come from the tokens above only. A channel colour is an accent
   (dot, logo, border), never a button colour.
   ============================================================= */

/* ── CARD ─────────────────────────────────────────────────── */
.sb-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    overflow: hidden;
}
.sb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--neutral-100);
}
.sb-card-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 500;
    color: var(--neutral-800);
}
.sb-card-body { padding: 20px; }
.sb-card-desc {
    margin: 0;
    padding: 14px 20px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--neutral-500);
}

/* ── SECTION HEADER ───────────────────────────────────────── */
.sb-section-header {
    background: var(--white);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--synca-dark);
    box-shadow: var(--shadow-md);
    padding: 20px 24px 18px;
    margin-bottom: 16px;
}
.sb-section-header h2 {
    margin: 0 0 4px;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--neutral-900);
}
.sb-section-header p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--neutral-500);
}

/* ── KPI CARD ─────────────────────────────────────────────── */
/* <div class="sb-kpi-grid">
     <a class="sb-kpi is-warning" href="...">
       <span class="sb-kpi-icon"><x-icon ... /></span>
       <span class="sb-kpi-body"><span class="sb-kpi-value">12</span><span class="sb-kpi-label">Low stock</span></span>
     </a>
   </div>
   Tones: none (navy), is-success, is-warning, is-danger. */
.sb-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.sb-kpi {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}
a.sb-kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sb-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--croco-green-subtle);
    color: var(--synca-dark);
}
.sb-kpi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-kpi-value {
    margin-bottom: 3px;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--synca-dark);
}
.sb-kpi-label {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--neutral-500);
}
.sb-kpi.is-success .sb-kpi-icon  { background: #dcfce7; color: var(--color-success); }
.sb-kpi.is-success .sb-kpi-value { color: var(--color-success); }
.sb-kpi.is-warning .sb-kpi-icon  { background: var(--synca-yellow-subtle); color: #92400e; }
.sb-kpi.is-warning .sb-kpi-value { color: var(--color-warning); }
.sb-kpi.is-danger .sb-kpi-icon   { background: var(--lego-red-light); color: var(--lego-red); }
.sb-kpi.is-danger .sb-kpi-value  { color: var(--lego-red); }

/* ── BUTTONS ──────────────────────────────────────────────── */
/* Four kinds and no more: primary (navy, the one main action of a block),
   secondary (white with a border), ghost (text only) and danger. */
.sb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.sb-btn:focus-visible { outline: 2px solid var(--synca-dark); outline-offset: 2px; }
.sb-btn:disabled, .sb-btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.sb-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }

.sb-btn-primary { background: var(--synca-dark); border-color: var(--synca-dark); color: var(--white); }
.sb-btn-primary:hover { background: var(--synca-dark-800); border-color: var(--synca-dark-800); color: var(--white); }

.sb-btn-secondary { background: var(--white); border-color: var(--neutral-200); color: var(--neutral-700); }
.sb-btn-secondary:hover { background: var(--neutral-50); border-color: var(--synca-dark); color: var(--synca-dark); }

.sb-btn-ghost { background: transparent; color: var(--neutral-700); }
.sb-btn-ghost:hover { background: var(--neutral-100); color: var(--neutral-900); }

.sb-btn-danger { background: var(--lego-red); border-color: var(--lego-red); color: var(--white); }
.sb-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: var(--white); }

/* ── FILTER BAR ───────────────────────────────────────────── */
/* One strip of equal-height controls; a select showing "All types" already
   says what it filters, so no caps label above each control. */
.sb-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.sb-filter-bar input[type="text"],
.sb-filter-bar input[type="search"],
.sb-filter-bar input[type="number"],
.sb-filter-bar input[type="date"],
.sb-filter-bar select {
    height: 36px;
    padding: 0 10px;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.sb-filter-bar .sb-filter-search { flex: 1 1 240px; min-width: 190px; max-width: 340px; }
.sb-filter-bar .sb-filter-end { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 600px) {
    .sb-filter-bar .sb-filter-search { max-width: none; }
    .sb-filter-bar .sb-filter-end { margin-left: 0; }
}

/* ── PAGE TAB STRIP ───────────────────────────────────────── */
/* Rendered by the tab-strip component only (ticket #244); one per page.
   Never wraps: when the tabs do not fit, the strip scrolls sideways and
   the component's script fades whichever edge still hides tabs. */
.sb-tab-strip {
    position: relative;
    display: flex;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    padding: 4px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sb-tab-strip::-webkit-scrollbar { display: none; }
.sb-tab-strip.has-more-end {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
            mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
}
.sb-tab-strip.has-more-start {
    -webkit-mask-image: linear-gradient(to left, black calc(100% - 32px), transparent);
            mask-image: linear-gradient(to left, black calc(100% - 32px), transparent);
}
.sb-tab-strip.has-more-start.has-more-end {
    -webkit-mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
            mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
}
.sb-tab {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: var(--neutral-500);
    transition: background 0.15s, color 0.15s;
}
.sb-tab:hover { background: var(--neutral-100); color: var(--neutral-700); }
.sb-tab.is-active,
.sb-tab.is-active:hover { background: var(--synca-dark); color: var(--white); }
.sb-tab:focus-visible { outline: 2px solid var(--synca-dark); outline-offset: -2px; }
.sb-tab-badge {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #b91c1c;
    color: var(--white);
    font-size: 10px;
    line-height: 1.4;
}
@media (hover: none) and (pointer: coarse) {
    .sb-tab:not(.is-active):hover { background: transparent; color: var(--neutral-500); }
}
@media print {
    .sb-tab-strip { display: none; }
}

/* ── FILTER CHIPS + SEGMENTED CONTROL ─────────────────────── */
/* A control that filters the list in place is a chip row, never a second
   tab strip (ticket #297). Chips are buttons or links; the selected one
   carries .is-active (or aria-pressed="true" / aria-current). On a phone
   the row scrolls sideways instead of stacking into rows of pills.
   .sb-segmented is the two-to-four option switch (view mode, period). */
.sb-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}
.sb-chips-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--neutral-400);
    white-space: nowrap;
}
.sb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 32px;
    box-sizing: border-box;
    padding: 5px 12px;
    border: 1px solid var(--neutral-200);
    border-radius: 999px;
    background: var(--white);
    color: var(--neutral-600);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sb-chip:hover { background: var(--neutral-100); color: var(--neutral-700); }
.sb-chip.is-active,
.sb-chip[aria-pressed="true"],
.sb-chip[aria-current] { background: var(--synca-dark); border-color: var(--synca-dark); color: var(--white); }
.sb-chip:focus-visible { outline: 2px solid var(--synca-dark); outline-offset: 2px; }
.sb-chip-count {
    padding: 0 6px;
    border-radius: 10px;
    background: var(--neutral-100);
    color: var(--neutral-600);
    font-size: 11px;
    line-height: 1.6;
}
.sb-chip.is-active .sb-chip-count,
.sb-chip[aria-pressed="true"] .sb-chip-count,
.sb-chip[aria-current] .sb-chip-count { background: rgba(255, 255, 255, 0.18); color: var(--white); }

.sb-segmented {
    display: inline-flex;
    gap: 2px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 3px;
    border-radius: var(--radius-md);
    background: var(--neutral-100);
    overflow-x: auto;
    scrollbar-width: none;
}
.sb-segmented::-webkit-scrollbar { display: none; }
.sb-segmented > button,
.sb-segmented > a {
    flex-shrink: 0;
    padding: 5px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--neutral-500);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.sb-segmented > .is-active,
.sb-segmented > [aria-pressed="true"] { background: var(--white); color: var(--synca-dark); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.sb-segmented > :focus-visible { outline: 2px solid var(--synca-dark); outline-offset: -2px; }

@media (max-width: 767px) {
    .sb-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sb-chips::-webkit-scrollbar { display: none; }
}
@media (hover: none) and (pointer: coarse) {
    .sb-chip { min-height: 40px; }
    .sb-chip:not(.is-active):not([aria-pressed="true"]):not([aria-current]):hover { background: var(--white); color: var(--neutral-600); }
}

/* ── CHANNEL ACCENT ───────────────────────────────────────── */
/* The page sets --channel-color on the element (or a parent); the colour
   only ever marks, it never fills a button. */
.sb-channel-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--channel-color, var(--neutral-400));
    flex-shrink: 0;
}
.sb-channel-accent { border-left: 3px solid var(--channel-color, var(--neutral-200)); }

/* <span class="sb-channel-dot sb-channel-{{ $slug }}"></span>, slugs as in App\Support\Marketplace. */
.sb-channel-bricklink    { --channel-color: var(--channel-bricklink); }
.sb-channel-shopify      { --channel-color: var(--channel-shopify); }
.sb-channel-vinted       { --channel-color: var(--channel-vinted); }
.sb-channel-bolcom       { --channel-color: var(--channel-bolcom); }
.sb-channel-ebay         { --channel-color: var(--channel-ebay); }
.sb-channel-brickowl     { --channel-color: var(--channel-brickowl); }
.sb-channel-amazon       { --channel-color: var(--channel-amazon); }
.sb-channel-whatnot      { --channel-color: var(--channel-whatnot); }
.sb-channel-brickvillage { --channel-color: var(--channel-brickvillage); }
.sb-channel-marktplaats  { --channel-color: var(--channel-marktplaats); }
.sb-channel-woocommerce  { --channel-color: var(--channel-woocommerce); }
.sb-channel-brickscout   { --channel-color: var(--channel-brickscout); }
.sb-channel-storefront   { --channel-color: var(--channel-storefront); }
.sb-channel-local        { --channel-color: var(--channel-local); }

@media (hover: none) and (pointer: coarse) {
    a.sb-kpi:hover          { box-shadow: var(--shadow-sm); transform: none; }
    .sb-btn-primary:hover   { background: var(--synca-dark); border-color: var(--synca-dark); }
    .sb-btn-secondary:hover { background: var(--white); border-color: var(--neutral-200); color: var(--neutral-700); }
}

/* ── GUEST PAGES ──────────────────────────────────────────── */
/* layouts/guest.blade.php (ticket #246): login, setup, tracking, payment return,
   the phone photo pages and the shared exports. The body defaults sit in :where()
   so they weigh nothing: a page's own `body { … }` rule, loaded after brand.css,
   still wins. */
:where(body.sb-guest) {
    margin: 0;
    background: var(--neutral-50);
    color: var(--neutral-900);
    line-height: 1.6;
}

/* The shop's logo and name on top of a buyer-facing card (components/guest-brand). */
.sb-guest-brand {
    background: var(--synca-dark);
    border-top: 4px solid var(--synca-yellow);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 28px 36px;
    text-align: center;
}
.sb-guest-brand-logo {
    display: block;
    max-height: 48px;
    max-width: 200px;
    margin: 0 auto 8px;
    border-radius: var(--radius-sm);
}
.sb-guest-brand-name {
    display: block;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--white);
    letter-spacing: -0.3px;
}
@media (max-width: 600px) {
    .sb-guest-brand { border-radius: 0; padding: 22px 24px; }
}
/* On its own above a page rather than on top of a card: rounded all round, on phones too. */
.sb-guest-brand.sb-guest-brand-standalone { border-radius: var(--radius-lg); }

/* The platform credit at the foot of a guest page (components/powered-by, `page`). */
.sb-powered-by {
    padding: 16px 16px 24px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.5;
    color: var(--neutral-500);
    letter-spacing: 0.3px;
}
.sb-powered-by a { color: inherit; text-decoration: none; }
.sb-powered-by a:hover { color: var(--neutral-700); text-decoration: underline; }

/* A channel's own logo (components/channel-logo, ticket #247): sized by its width and
   height attributes, never stretched. */
.sb-channel-logo {
    display: inline-block;
    flex-shrink: 0;
    object-fit: contain;
    vertical-align: middle;
}

/* Two KPI cards per row on a phone, so the page's actions show on the first screen
   instead of a column of numbers (ticket #249). */
@media (max-width: 600px) {
    .sb-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .sb-kpi { gap: 10px; padding: 14px; }
    .sb-kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
    .sb-kpi-value { font-size: 20px; }
}
