/* ============================================================
   Order Hub — Lights 4 You branded stylesheet
   Primary:  #1565C0  (L4Y blue)
   Accent:   #1E88E5  (lighter blue)
   Dark:     #0D47A1  (dark blue)
   SeqNet:   #F5A623  (amber — footer only)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --l4y-blue:       #1565C0;
    --l4y-blue-light: #1E88E5;
    --l4y-blue-dark:  #0D47A1;
    --l4y-bg:         #F0F4F8;
    --seqnet-amber:   #F5A623;
    --text-primary:   #1A202C;
    --text-secondary: #4A5568;
    --text-muted:     #718096;
    --border:         #E2E8F0;
    --white:          #FFFFFF;
    --success:        #2E7D32;
    --warning:        #E65100;
    --error:          #C62828;
    --info:           #1565C0;
    --radius:         6px;
    --shadow:         0 1px 3px rgba(0,0,0,0.12);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.10);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--l4y-bg);
    line-height: 1.5;
}

/* ── App shell ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top bar ── */
.topbar {
    background: var(--l4y-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    gap: 32px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.brand-lights { color: var(--white); }
.brand-4      { color: var(--seqnet-amber); font-size: 20px; }
.brand-you    { color: var(--white); }
.brand-sub {
    margin-left: 10px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 10px;
}

.topbar-nav { display: flex; gap: 4px; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-name { font-size: 13px; opacity: 0.85; margin-right: 4px; }

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.nav-link.active { background: rgba(255,255,255,0.2); color: var(--white); }
.nav-logout { opacity: 0.7; }
.nav-logout:hover { opacity: 1; }

/* ── Page content ── */
.page-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ── Footer ── */
.app-footer {
    background: #1A202C;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    padding: 12px 24px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.footer-sep { opacity: 0.3; }
.footer-powered a { color: var(--seqnet-amber); text-decoration: none; }
.footer-powered a:hover { text-decoration: underline; }

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-body { padding: 20px; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }

/* ── Filters bar ── */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ── Form controls ── */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color 0.15s;
}
.form-control:focus, .form-select:focus { border-color: var(--l4y-blue); }
.form-control { min-width: 200px; }
.form-select { cursor: pointer; }

.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.form-group { margin-bottom: 16px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--l4y-blue); color: var(--white); }
.btn-primary:hover { background: var(--l4y-blue-dark); }
.btn-secondary { background: var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: #CBD5E0; }
.btn-danger    { background: var(--error); color: var(--white); }
.btn-danger:hover { opacity: 0.85; }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { opacity: 0.85; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-warning { background: var(--seqnet-amber); color: #1A202C; }
.btn-warning:hover { opacity: 0.85; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #F7FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}
tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F7FAFC; }
tbody tr.clickable { cursor: pointer; }

/* ── Status badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-imported   { background: #E3F2FD; color: #1565C0; }
.badge-submitted  { background: #E8F5E9; color: #2E7D32; }
.badge-despatched { background: #F3E5F5; color: #6A1B9A; }
.badge-shipped    { background: #E0F2F1; color: #00695C; }
.badge-invoiced   { background: #FFF8E1; color: #E65100; }
.badge-error      { background: #FFEBEE; color: #C62828; }
.badge-paused     { background: #FFF3E0; color: #E65100; }
.badge-running    { background: #E8F5E9; color: #2E7D32; }
.badge-complete   { background: #E0F2F1; color: #00695C; }
.badge-stuck      { background: #FFEBEE; color: #C62828; }
.badge-costco         { background: #E3F2FD; color: #0D47A1; }
.badge-woocommerce    { background: #F3E5F5; color: #6A1B9A; }
.badge-tesco          { background: #E8F5E9; color: #1B5E20; }

/* ── Pipeline timeline ── */
.pipeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 20px 0;
    overflow-x: auto;
}
.pipeline-step {
    flex: 1;
    min-width: 140px;
    position: relative;
    text-align: center;
}
.pipeline-step::after {
    content: '';
    position: absolute;
    top: 16px;
    right: -1px;
    width: 50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.pipeline-step::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    width: 50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.pipeline-step:first-child::before { display: none; }
.pipeline-step:last-child::after  { display: none; }
.pipeline-step.done::before,
.pipeline-step.done::after { background: var(--l4y-blue); }
.pipeline-step.done + .pipeline-step::before { background: var(--l4y-blue); }

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 14px;
    position: relative;
    z-index: 1;
}
.pipeline-step.done .step-icon    { border-color: var(--l4y-blue); background: var(--l4y-blue); color: white; }
.pipeline-step.stuck .step-icon   { border-color: var(--error); background: var(--error); color: white; }
.pipeline-step.pending .step-icon { border-color: var(--border); background: #F7FAFC; color: var(--text-muted); }

.step-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.step-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Detail sections ── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.detail-field { }
.detail-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.detail-field-value { font-size: 14px; color: var(--text-primary); word-break: break-word; }
.detail-field-value a { color: var(--l4y-blue); text-decoration: none; }
.detail-field-value a:hover { text-decoration: underline; }

/* ── Alert / info boxes ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-info    { background: #E3F2FD; color: #1565C0; border-left: 4px solid var(--l4y-blue); }
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #2E7D32; }
.alert-warning { background: #FFF8E1; color: #E65100; border-left: 4px solid #E65100; }
.alert-error   { background: #FFEBEE; color: #C62828; border-left: 4px solid #C62828; }

/* ── Job status cards ── */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.job-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.job-card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.job-name { font-weight: 600; font-size: 14px; }
.job-card-body { padding: 14px 16px; }
.job-stat { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.job-stat-val { font-weight: 500; color: var(--text-primary); }
.job-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.job-failure-msg { font-size: 11px; color: var(--error); background: #FFEBEE; padding: 6px 10px; border-radius: var(--radius); margin-top: 8px; word-break: break-word; }

/* ── Login page ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--l4y-blue-dark); }
.login-box { background: var(--white); border-radius: 8px; box-shadow: var(--shadow-md); padding: 40px; width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .brand-lights { color: var(--l4y-blue); font-size: 24px; font-weight: 700; }
.login-logo .brand-4      { color: var(--seqnet-amber); font-size: 26px; font-weight: 700; }
.login-logo .brand-you    { color: var(--l4y-blue); font-size: 24px; font-weight: 700; }
.login-logo .brand-sub    { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; }
.login-footer { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); }
.login-footer a { color: var(--seqnet-amber); text-decoration: none; }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 16px; }
.page-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); cursor: pointer; font-size: 13px; }
.page-btn:hover { background: var(--l4y-bg); }
.page-btn.active { background: var(--l4y-blue); color: white; border-color: var(--l4y-blue); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Misc ── */
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: 12px; }
.text-right  { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-8  { margin-top: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; align-items: center; }

#blazor-error-ui {
    background: var(--error);
    color: white;
    padding: 10px 16px;
    position: fixed;
    bottom: 0;
    width: 100%;
    display: none;
    z-index: 999;
    font-size: 13px;
}
#blazor-error-ui a { color: white; }
