:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #17202a;
    --muted: #64748b;
    --border: #d9e2ec;
    --primary: #1455d9;
    --primary-dark: #0f3f9e;
    --danger: #b42318;
    --success: #027a48;
    --warning: #b54708;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 22px; background: #0b1220; color: white; }
.topbar a { color: white; text-decoration: none; font-weight: 700; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 12px; }
.brand a { font-size: 20px; }
.container { max-width: 1200px; margin: 0 auto; padding: 22px; }
h1 { margin: 0 0 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.stat .num { font-size: 32px; font-weight: 800; }
.stat .label { color: var(--muted); margin-top: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.btn, button, input[type="submit"] { display: inline-block; border: 0; background: var(--primary); color: white; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; text-decoration: none; }
.btn:hover, button:hover, input[type="submit"]:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary, button.secondary { background: #475569; }
.btn.danger { background: var(--danger); }
.btn.light { background: #e2e8f0; color: #0f172a; }
form label { display: block; font-weight: 700; margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: white; }
textarea { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkbox-row input { width: auto; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 14px; overflow: hidden; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #eef2f7; font-size: 13px; text-transform: uppercase; color: #334155; }
tr:last-child td { border-bottom: 0; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 700; }
.flash.success { background: #dcfce7; color: #14532d; }
.flash.error { background: #fee2e2; color: #7f1d1d; }
.flash.warning { background: #ffedd5; color: #7c2d12; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #e2e8f0; font-size: 12px; font-weight: 800; color: #0f172a; }
.badge-ready-for-pickup { background: #dcfce7; color: #14532d; }
.badge-in-progress, .badge-diagnosing { background: #dbeafe; color: #1e3a8a; }
.badge-waiting-for-approval, .badge-waiting-for-parts-material { background: #ffedd5; color: #7c2d12; }
.badge-cancelled { background: #fee2e2; color: #7f1d1d; }
.badge-completed-picked-up { background: #e2e8f0; color: #334155; }
.badge-open { background: #dcfce7; color: #14532d; }
.badge-closed { background: #334155; color: #ffffff; }
.muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; }
.kv div:nth-child(odd) { font-weight: 800; color: #334155; }
.login-box { max-width: 420px; margin: 60px auto; }
.note { white-space: pre-wrap; }
@media print {
    body { background: white; }
    .topbar, .no-print, h1 { display: none !important; }
    .container { max-width: none; padding: 0; }
    .card { box-shadow: none; border: 0; margin: 0; padding: 0; }
}

.brand a { display: flex; align-items: center; gap: 10px; }
.topbar-logo { width: 34px; height: 34px; object-fit: contain; background: white; border-radius: 8px; padding: 3px; }
.logo-preview { min-height: 70px; display: flex; align-items: center; border: 1px dashed var(--border); border-radius: 12px; padding: 12px; background: #f8fafc; }
.settings-logo { max-width: 260px; max-height: 90px; object-fit: contain; }
.login-logo { text-align: center; margin-bottom: 15px; }
.login-business-logo { max-width: 260px; max-height: 120px; object-fit: contain; }

.login-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 420px)); gap: 18px; justify-content: center; align-items: start; margin-top: 40px; }
.login-layout .login-box { margin: 0; width: 100%; }
.public-status-box { max-width: 520px; }
.public-status-result { max-width: 860px; margin-left: auto; margin-right: auto; }
.public-note { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
