:root {
    --brand: #2a6df4;
    --brand-dark: #1f55c4;
    --text: #1b1f24;
    --muted: #5b6472;
    --bg: #f7f8fb;
    --card: #ffffff;
    --border: #e3e6ec;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.brand:hover { text-decoration: none; }

/* ---- PIKKLIO logo (header small + homepage hero) ---- */
.logo {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55rem;
    color: #0A0A0A;
    text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-wordmark {
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #0A0A0A;
}
.logo-wordmark-accent {
    color: #1E6FCE;
}
.logo-sep {
    color: #c1c6d0;
    font-weight: 400;
    margin: 0 0.1rem;
}
.logo-tenant {
    color: #5b6472;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.logo--sm .logo-wordmark { font-size: 1.15rem; }

.logo--hero .logo-wordmark { font-size: 4rem; line-height: 1; }

.logo-tagline {
    margin: 0.75rem 0 2rem;
    color: #1E6FCE;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
}

.hero-actions {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.nav-link {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}
.nav-link:hover { color: var(--brand); text-decoration: none; }

.info-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 0;
}
.info-page h1 { margin-top: 0; }
.info-page h2 {
    margin-top: 2rem;
    font-size: 1.35rem;
}
.info-list { padding-left: 1.25rem; }
.info-list li { margin-bottom: 0.75rem; }
.info-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary {
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover {
    background: var(--brand-dark);
    text-decoration: none;
}
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.hero h1 { font-size: 2.5rem; margin: 0 0 0.5rem; }
.lede {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 1.5rem;
}

.features {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 2rem;
}
.feature {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.feature h2 { margin-top: 0; font-size: 1.15rem; }
.feature p { color: var(--muted); margin-bottom: 0; }

.auth-card {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 0.25rem; }
.muted { color: var(--muted); }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.auth-form label {
    font-weight: 600;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.auth-form input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(42, 109, 244, 0.15);
}
.auth-form button { margin-top: 1rem; }

.auth-foot {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); text-decoration: none; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.message {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    background: #eef4ff;
    border: 1px solid #c8daf9;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.message-error, .message-warning {
    background: #fff1f0;
    border-color: #f7c3bf;
}
.message-success { background: #eefcf3; border-color: #b9e6c9; }

.form-error {
    background: #fff1f0;
    border: 1px solid #f7c3bf;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: #8a1e15;
    margin-bottom: 1rem;
}
.form-error ul { margin: 0; padding-left: 1.25rem; }

.pin-card {
    max-width: 340px;
    margin: 4rem auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}
.pin-card h1 { margin: 0 0 0.25rem; }
.pin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}
.pin-input {
    font-size: 2rem;
    letter-spacing: 0.5rem;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.pin-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(42, 109, 244, 0.15);
}
.pin-error {
    color: #8a1e15;
    background: #fff1f0;
    border: 1px solid #f7c3bf;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.order-page { max-width: 960px; }
.order-page h1 { margin-bottom: 0.25rem; }

.order-form { margin-top: 1.5rem; }

.order-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.order-grid th, .order-grid td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.order-grid th { background: var(--bg); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.order-grid__group td {
    background: #f2f5fb;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.col-item { width: 55%; }
.col-uom { width: 25%; color: var(--muted); }
.col-qty { width: 20%; }

.col-qty input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: #fff;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.col-qty input:focus { outline: none; border-color: var(--brand); }
.col-qty input.touched {
    border-left: 4px solid var(--brand);
    background: #f0f6ff;
    padding-left: 0.4rem;
}

.col-min, .col-max {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    width: 6ch;
}
.col-to-order {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    width: 8ch;
    color: var(--muted);
}

.order-grid .col-qty {
    width: 10ch;
}
.order-grid .col-qty input {
    min-width: 8ch;
}
.col-to-order.to-order--positive {
    color: var(--brand);
    background: #f0f6ff;
}

.comments-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.order-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
    margin-bottom: 1.5rem;
}

.confirmation-banner {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.confirmation-banner h1 {
    font-size: 4rem;
    letter-spacing: 0.1em;
    color: var(--brand);
    margin: 0 0 1rem;
}

.clerk-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.clerk-header h1 { margin-bottom: 0.25rem; }
.clerk-toolbar { display: flex; gap: 0.5rem; }

.tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.tile-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1;
}
.tile-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.filter-bar label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--muted);
    gap: 0.25rem;
}
.filter-bar select, .filter-bar input {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: #fff;
}

.order-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.order-table th, .order-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.order-table th {
    background: var(--bg);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.order-table tr:last-child td { border-bottom: none; }

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: #eef4ff;
    color: #1f55c4;
}
.status-pending { background: #fff4d6; color: #8a5e00; }
.status-validated { background: #d8f3e4; color: #19663d; }
.status-exported { background: #e1e8f4; color: #2a4580; }

.export-queued   { background: #fff4d6; color: #8a5e00; }
.export-sent     { background: #d8f3e4; color: #19663d; }
.export-failed   { background: #ffd6d6; color: #8a1a1a; }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.85rem; }

.clerk-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.comment-box {
    background: #fff8e6;
    border: 1px solid #f3e0a1;
    color: #7a5800;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.print-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1rem;
}
.print-sheet header h1 { margin: 0 0 0.5rem; }
