/* WhatBox ERP — hand-rolled, no framework. Two rules matter most:
   .est (estimated, amber) and .conf (confirmed, green) — every cost figure
   in the product wears one of them. */
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0;
       color: #1a202c; background: #f7f8fa; font-size: 15px; }
main { max-width: 1080px; margin: 1.5rem auto 4rem; padding: 0 1.25rem; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: 1.5rem; background: #fff;
          border-bottom: 1px solid #e2e8f0; padding: .6rem 1.25rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: #1a202c; }
.brand span { color: #2563eb; }
.topbar nav { display: flex; gap: 1rem; flex: 1; align-items: center; }
.topbar nav a { color: #475569; font-weight: 500; }

/* Nested nav: CSS-only dropdowns (hover + keyboard focus). */
.dd { position: relative; }
.dd-label { cursor: pointer; }
.dd-items { display: none; position: absolute; top: 100%; left: -0.75rem; z-index: 50;
    min-width: 180px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: .4rem 0; }
.dd:hover .dd-items, .dd:focus-within .dd-items { display: block; }
.dd-items a { display: block; padding: .45rem .9rem; }
.dd-items a:hover { background: #f1f5f9; text-decoration: none; }
.logout-form { display: flex; align-items: center; gap: .6rem; margin: 0; }
.user-email { color: #64748b; font-size: .85rem; }

.est  { color: #b45309; }  /* estimated — amber */
.conf { color: #047857; }  /* confirmed — green */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px;
         font-size: .78rem; font-weight: 600; }
.badge.est  { background: #fef3c7; }
.badge.conf { background: #d1fae5; }

.status { display: inline-block; padding: .12rem .55rem; border-radius: 999px;
          font-size: .78rem; font-weight: 600; background: #e2e8f0; color: #334155; }
.status.Draft { background: #e2e8f0; }
.status.Sent { background: #dbeafe; color: #1d4ed8; }
.status.Confirmed { background: #e0e7ff; color: #4338ca; }
.status.PartiallyReceived { background: #fef3c7; color: #b45309; }
.status.Received { background: #d1fae5; color: #047857; }
.status.Closed { background: #f1f5f9; color: #64748b; }
.status.Cancelled { background: #fee2e2; color: #b91c1c; }

table { width: 100%; border-collapse: collapse; background: #fff;
        border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid #eef1f5; }
th { background: #f8fafc; font-size: .78rem; text-transform: uppercase;
     letter-spacing: .03em; color: #64748b; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
        padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
         gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; }
.stat .v { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: #64748b; font-size: .82rem; }

form.stacked { max-width: 460px; }
label { display: block; font-weight: 600; font-size: .85rem; margin: .8rem 0 .25rem; }
label .hint { font-weight: 400; color: #64748b; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
    width: 100%; padding: .45rem .6rem; border: 1px solid #cbd5e1; border-radius: 6px;
    font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.inline { display: inline-flex; align-items: center; gap: .4rem; }
.row { display: flex; gap: 1rem; }
.row > div { flex: 1; }

.btn { display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid #cbd5e1;
       background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: #1a202c; }
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { border-color: transparent; background: transparent; color: #64748b; }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center;
           gap: 1rem; margin-bottom: 1rem; }
.toolbar form { display: flex; gap: .5rem; margin: 0; }
.toolbar input, .toolbar select { width: auto; }

.validation-summary-errors { background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 6px; padding: .6rem .9rem; color: #b91c1c; margin-bottom: 1rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.field-validation-error { color: #b91c1c; font-size: .82rem; }
.ok-banner { background: #d1fae5; border: 1px solid #6ee7b7; color: #047857;
    border-radius: 6px; padding: .6rem .9rem; margin-bottom: 1rem; }
.muted { color: #64748b; }
.mt { margin-top: 1.25rem; }
