/* ==========================================
   Design Tokens
   Utilink branding (navy/blue, from utilinkconsulting.co.uk) applied to the same layout
   conventions as the iRevolution onboarding system: Roboto, rounded corners, soft shadows,
   pastel traffic-light buttons (green=safe/submit/approve, amber=live-action/sourcing,
   red=destructive/deny) - that convention is about the action, not the brand, so it stays.
========================================== */

:root {
    --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    --color-ink: #141c2c;
    --color-ink-soft: #46506a;
    --color-ink-muted: #7c859c;

    --color-bg: #f2f4f9;
    --color-surface: #ffffff;
    --color-surface-alt: #f7f8fc;
    --color-border: #e2e6f0;
    --color-border-strong: #ccd3e3;

    --color-accent: #116dff;
    --color-accent-hover: #0d57cc;
    --color-accent-soft: #e8f0ff;

    --color-success: #15803d;
    --color-success-bg: #e7f6ec;
    --color-success-border: #bfe6cd;

    --color-error: #b91c1c;
    --color-error-bg: #fdecea;
    --color-error-border: #f6c6c1;

    --color-info: #1d4ed8;
    --color-info-bg: #eaf1fd;
    --color-info-border: #c7dafc;

    /* Utilink's real primary-button gradient, pulled from the computed style of the "Get a
       Quote" button on utilinkconsulting.co.uk (2026-10-07) - #4e96fe -> #d7c2eb at 135deg,
       exact values untouched. A white wash is layered on top (not blended into the hex values
       themselves) to soften it for everyday admin/catalog use - less opaque on hover so it
       reads a touch more vivid as feedback, same as the other buttons darkening on hover. */
    --gradient-brand: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), linear-gradient(135deg, #4e96fe 0%, #d7c2eb 100%);
    --gradient-brand-hover: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)), linear-gradient(135deg, #4e96fe 0%, #d7c2eb 100%);

    --color-pastel-green: #d3f0dc;
    --color-pastel-green-hover: #bce4cb;
    --color-pastel-green-text: #1a5c34;

    --color-pastel-amber: #fbe7bd;
    --color-pastel-amber-hover: #f6d795;
    --color-pastel-amber-text: #7a5210;

    --color-pastel-red: #f6d4d1;
    --color-pastel-red-hover: #f0bcb7;
    --color-pastel-red-text: #8a2c26;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(20, 28, 44, 0.07);
    --shadow-md: 0 6px 18px rgba(20, 28, 44, 0.08);
    --shadow-lg: 0 16px 40px rgba(20, 28, 44, 0.16);

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
}

/* ==========================================
   Base / Reset
========================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    background: var(--color-bg);
    color: var(--color-ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--color-ink);
    margin: 0 0 12px;
}

h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

a {
    color: var(--color-accent);
}

.container {
    padding: 28px;
    max-width: 1600px;
    margin: auto;
}

/* ==========================================
   Buttons - pastel traffic-light convention
========================================== */

button, .btn {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 11px 22px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    display: inline-block;
    text-decoration: none;
    background: var(--color-surface-alt);
    color: var(--color-ink-soft);
    border: 1px solid var(--color-border-strong);
}

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

.btn-primary, button[type="submit"] {
    background: var(--gradient-brand);
    color: var(--color-ink);
}

.btn-primary:hover, button[type="submit"]:hover {
    background: var(--gradient-brand-hover);
}

.btn-amber {
    background: var(--color-pastel-amber);
    color: var(--color-pastel-amber-text);
}

.btn-amber:hover {
    background: var(--color-pastel-amber-hover);
}

.btn-danger {
    background: var(--color-pastel-red);
    color: var(--color-pastel-red-text);
}

.btn-danger:hover {
    background: var(--color-pastel-red-hover);
}

/* ==========================================
   Forms
========================================== */

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink-soft);
    margin: 14px 0 6px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.error {
    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    color: var(--color-error);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ==========================================
   Cards
========================================== */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

/* ==========================================
   Top nav - Utilink navy
========================================== */

.topnav {
    background: #0a1930;
    color: #ffffff;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 16px;
}

.topnav-mark {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a5cff, var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.topnav-links {
    display: flex;
    gap: 22px;
    font-size: 14px;
}

.topnav-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.topnav-links a:hover, .topnav-links a.active {
    color: #ffffff;
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.topnav-user a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

/* ==========================================
   Login page
========================================== */

body.login-page {
    background: #0a1930;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

.login-box {
    flex: 0 0 420px;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
}

.login-box h1 {
    font-size: 24px;
}

.login-box p {
    color: var(--color-ink-muted);
    font-size: 14px;
}

.login-intro {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 64px;
    color: #ffffff;
}

/* Anchored near the top independent of the centered text block below it, rather than
   being swept into that centering and landing somewhere around mid-panel. */
.login-intro-logo {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    text-align: center;
}

.login-intro-eyebrow {
    color: #8fb3ff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-intro h2 {
    color: #ffffff;
    font-size: 34px;
    max-width: 520px;
}

.login-intro p {
    color: rgba(255, 255, 255, 0.72);
    max-width: 480px;
}

.login-intro-features {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}

.login-intro-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 10px;
}

.login-feature-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.login-intro-steps {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
}

.login-intro-steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.login-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #4e96fe;
    color: #9cc4ff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-intro-steps strong {
    display: block;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

.login-intro-steps div span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.login-intro-chips {
    margin-top: 12px;
    max-width: 520px;
}

.login-intro-chips span {
    display: inline-block;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.09);
    color: #cfe0ff;
    margin: 0 6px 8px 0;
}

@media (max-width: 860px) {
    .login-split { flex-direction: column; }
    .login-box { flex: none; }
}

/* ==========================================
   Logo upload - live preview mockups + crop stage
========================================== */

.logo-upload-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.logo-upload-col {
    flex: 1;
    min-width: 220px;
}

.logo-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-ink-muted);
    margin-bottom: 6px;
}

.logo-mockup-header {
    background: var(--color-nav-preview, #0a1930);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
}

.logo-mockup-header img {
    height: 24px;
    display: none;
}

.logo-mockup-login {
    background: var(--color-nav-preview, #0a1930);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.logo-mockup-login img {
    max-height: 110px;
    max-width: 100%;
    display: none;
}

.crop-stage {
    display: none;
    margin-top: 10px;
}

.crop-stage canvas {
    cursor: move;
    border-radius: var(--radius-sm);
    display: block;
}

.crop-stage-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

/* ==========================================
   Catalog - sidebar, product cards, modals
========================================== */

.catalog-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.catalog-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 10px;
}

.catalog-sidebar a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-ink-soft);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 2px;
}

.catalog-sidebar a:hover {
    background: var(--color-surface-alt);
}

.catalog-sidebar a.active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-weight: 600;
}

.catalog-main {
    flex: 1;
    min-width: 0;
}

.catalog-banner {
    background: var(--color-accent-soft);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    font-size: 15px;
    color: var(--color-ink-soft);
    margin-bottom: 24px;
}

.catalog-banner a {
    font-weight: 600;
    color: var(--color-accent);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.product-card {
    display: flex;
    flex-direction: column;
}

.product-card-image {
    width: 100%;
    height: 170px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-image-placeholder {
    color: var(--color-ink-muted);
    font-size: 12px;
}

.product-card-desc {
    font-size: 13px;
    color: var(--color-ink-muted);
    margin: 2px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Keeps the price block anchored just above its button regardless of how tall the grid row
   stretches this card - the flexible gap collects above the price (next to the description)
   instead of as dead space between the price and the button. */
.product-card-bottom {
    margin-top: auto;
}

.product-card-footer {
    padding-top: 10px;
}

/* Modals - shared by "request something else" and per-item "choose options" */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 48, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 4px 8px;
}

.modal-close:hover {
    color: var(--color-ink);
}

/* ==========================================
   Director dashboard - stat cards, charts, ranked bars
========================================== */

.dash-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.dash-grid-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .dash-grid-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .dash-grid-stats { grid-template-columns: 1fr; } }
.dash-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.dash-grid-wide { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .dash-grid-wide { grid-template-columns: 1fr; } }

.stat-card { display: block; text-decoration: none; color: inherit; padding: 20px 22px; position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 8px 24px rgba(20,28,44,.10)); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stat-color, var(--color-accent)); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--color-ink-muted); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--stat-color, var(--color-accent)); background: color-mix(in srgb, var(--stat-color, var(--color-accent)) 12%, white); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--color-ink); }
.stat-sub { margin-top: 6px; font-size: 12.5px; color: var(--color-ink-muted); }
.stat-delta-up { color: var(--color-error); font-weight: 600; }
.stat-delta-down { color: var(--color-success); font-weight: 600; }

.dash-card h2 { margin: 0 0 4px; font-size: 17px; }
.dash-card .dash-sub { margin: 0 0 16px; color: var(--color-ink-muted); font-size: 13px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font-sans); font-size: 11px; fill: var(--color-ink-muted); }
.chart-svg .chart-val { fill: var(--color-ink-soft); font-weight: 600; }
.chart-svg .chart-grid { stroke: var(--color-border); stroke-width: 1; }

.rank-row { margin-bottom: 12px; }
.rank-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 4px; }
.rank-head span:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-head span:last-child { color: var(--color-ink-soft); font-weight: 600; white-space: nowrap; }
.rank-track { height: 8px; border-radius: 99px; background: var(--color-surface-alt); overflow: hidden; }
.rank-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4e96fe, #116dff); }
.rank-fill.green { background: linear-gradient(90deg, #4ade80, #15803d); }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.donut-legend b { margin-left: auto; padding-left: 18px; }

.quick-links { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-empty { color: var(--color-ink-muted); font-size: 13.5px; padding: 8px 0; }
.dash-export-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.dash-export-form label { margin: 0 0 4px; }
.dash-export-form select, .dash-export-form input[type=date] { min-width: 170px; }
