/* SKU Validator - all styling. No frameworks, no external fonts. */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --border: #dfe3e8;
    --text: #1f2933;
    --muted: #6b7684;
    --accent: #2f6f4e;
    --accent-dark: #245a3f;
    --danger: #b42318;
    --danger-bg: #fdf2f1;
    --success: #067647;
    --success-bg: #eefaf3;
    --warn: #8a5b00;
    --warn-bg: #fdf6e6;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* ---------------------------------------------------------------- brand */

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .5px;
    padding: 5px 8px;
    border-radius: 6px;
}

.brand h1 { font-size: 20px; margin: 0; }

/* ------------------------------------------------------------ auth card */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; }

.auth-card form { margin-top: 18px; }

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin: 14px 0 6px;
}

input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}

/* -------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: #f7f8f9; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn[disabled] { opacity: .55; cursor: default; }

.btn-quiet { background: transparent; }

.btn-small { padding: 6px 12px; font-size: 13px; }

button[type="submit"] {
    width: 100%;
    margin-top: 20px;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button[type="submit"]:hover { background: var(--accent-dark); }

/* --------------------------------------------------------------- layout */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 20px; }

/* ---------------------------------------------------------------- tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tile-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.tile-value { font-size: 26px; font-weight: 700; }
.tile-value.small { font-size: 15px; font-weight: 600; }
.tile-action { justify-content: center; gap: 8px; }
.tile-note { font-size: 12px; color: var(--muted); }

/* ----------------------------------------------------------------- tabs */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.tab {
    border: 0;
    background: transparent;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.sub { font-size: 12px; }

.product-link {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--muted);
}

.product-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- panel */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.toolbar input { max-width: 420px; }

/* --------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }

.right { text-align: right; }

.sku-cell { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; }

/* --------------------------------------------------------------- alerts */

.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin: 0 0 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f3c9c5; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bfe5d1; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dcae; }

.muted { color: var(--muted); }
.pad { padding: 22px 12px; text-align: center; }
.pad-b { margin: 0 0 14px; }

/* ------------------------------------------------------ connect banner */

.connect-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--warn-bg);
    border: 1px solid #f0dcae;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.connect-panel p { margin: 4px 0 0; max-width: 62ch; }

.pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.pill-ok { background: var(--success-bg); color: var(--success); border: 1px solid #bfe5d1; }

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 30, 38, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 460px;
}

.modal h2 { margin: 0 0 4px; font-size: 18px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.check-line { min-height: 20px; margin: 10px 0 0; font-size: 13px; }
.check-line.ok { color: var(--success); }
.check-line.bad { color: var(--danger); }
.check-line.busy { color: var(--muted); }

[hidden] { display: none !important; }

@media (max-width: 600px) {
    .wrap { padding: 14px; }
    .topbar { padding: 12px 14px; }
    .tile-value { font-size: 22px; }
}
