:root{--pico-font-size:100%;}
:root:not([data-theme=dark]),[data-theme=light]{--sb-accent:#d9480f;--pico-primary:#c2410c;--pico-primary-background:#c2410c;--pico-primary-border:#c2410c;--pico-primary-hover:#9a3412;--pico-primary-hover-background:#9a3412;--pico-primary-hover-border:#9a3412;}
body{background:#f6f7f9}
.topbar{background:#1f2937;margin-bottom:1rem}
.topbar nav{padding:0 1rem}.topbar a,.topbar summary{color:#f9fafb!important}.topbar .brand strong{color:#fb923c}
.topbar .mainnav{flex-wrap:wrap}.topbar .mainnav li{padding:.35rem .5rem}
.topbar details.dropdown ul a,.topbar details.dropdown ul button{color:#111827!important}
main.container{background:#fff;border-radius:10px;padding:1.25rem 1.5rem;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.head{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:.75rem}.head h2,.head h3{margin:0}
.flash{padding:.6rem 1rem;border-radius:6px;margin-bottom:1rem}.flash.ok{background:#dcfce7;color:#14532d}.flash.error{background:#fee2e2;color:#7f1d1d}
.test-banner{background:#fef3c7;border:2px solid #f59e0b;color:#78350f;font-weight:700;text-align:center;padding:.6rem;border-radius:8px;margin-bottom:1rem}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem;margin-bottom:1rem}
.card{display:flex;flex-direction:column;background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:1rem;text-decoration:none;color:#431407}
.card .big{font-size:1.9rem;font-weight:700;color:#c2410c}.card small{color:#7c2d12}.card.neg .big{color:#b91c1c}
.small-cards .card .big{font-size:1.3rem}
.quick{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.filters{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}.filters>*{width:auto;flex:1 1 160px;margin-bottom:.5rem}.filters button{flex:0 0 auto}
form.inline{display:inline;margin:0}form.inline button{margin:0}
.small-btn{padding:.25rem .6rem!important;font-size:.85rem!important;width:auto!important;margin:0 .2rem .2rem 0}
.danger{color:#b91c1c!important;border-color:#b91c1c!important}
.linkbtn{background:none;border:none;padding:0;color:inherit;text-align:left}
.num{text-align:right;white-space:nowrap}.muted{color:#6b7280}.small{font-size:.85rem}.warn{color:#b45309;font-size:.9rem}
.notice{background:#eff6ff;border-left:4px solid #3b82f6;padding:.6rem 1rem;border-radius:4px}
.status-bar{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.paid-form{display:inline-flex;gap:.4rem;align-items:center}.paid-form input{margin:0;width:auto}
.badge{display:inline-block;padding:.1rem .5rem;border-radius:999px;font-size:.78rem;font-weight:600;background:#e5e7eb;color:#374151;vertical-align:middle}
.b-new,.b-draft,.b-booked{background:#dbeafe;color:#1e40af}.b-visit-booked,.b-sent,.b-in-progress{background:#fef3c7;color:#92400e}
.b-quoted{background:#ede9fe;color:#5b21b6}.b-won,.b-accepted,.b-paid,.b-completed{background:#dcfce7;color:#166534}
.b-lost,.b-declined,.b-cancelled,.b-unpaid{background:#fee2e2;color:#991b1b}.b-no-reply,.b-on-hold{background:#f3f4f6;color:#4b5563}
tr.overdue td{background:#fff1f2}.neg{color:#b91c1c}
table.lines input,table.lines select{margin:0;padding:.35rem .5rem;font-size:.9rem;min-width:70px}table.lines td{padding:.25rem}
table.lines td:first-child select{min-width:170px}table.lines td:nth-child(2) input{min-width:220px}
.totals{max-width:320px;margin-left:auto}.totals .grand td,.grand th{font-weight:700;border-top:2px solid #111}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.5rem}.gallery img{width:100%;height:120px;object-fit:cover;border-radius:6px}
.gallery figure{margin:0}.gallery figcaption{font-size:.8rem}
.tabs{display:flex;gap:.25rem;flex-wrap:wrap;margin-bottom:.75rem}.tabs a{padding:.3rem .7rem;border-radius:6px;background:#f3f4f6;text-decoration:none;font-size:.9rem}.tabs a[aria-current]{background:#c2410c;color:#fff}
.login-card{max-width:380px;margin:3rem auto}
.inline-form{border:1px solid #e5e7eb;border-radius:8px;padding:.75rem}
footer{padding:1rem 0;text-align:center}
@media (max-width:600px){main.container{padding:1rem .75rem;border-radius:0}.topbar nav{flex-direction:column;align-items:flex-start}}
.topbar details.dropdown>summary{background:transparent!important;border:0!important;color:#f9fafb!important;padding:.25rem .5rem;height:auto}
.topbar details.dropdown>summary::after{filter:invert(1)}
