:root{
  --bg:#f4f6f9;
  --surface:#ffffff;
  --border:#e4e8ef;
  --text:#1a2233;
  --text-muted:#6b7688;
  --accent:#1d4ed8;
  --accent-dark:#173fb0;
  --accent-soft:#e8eefd;
  --ok:#0f9d58;
  --ok-soft:#e5f7ee;
  --danger:#dc2626;
  --danger-soft:#fdecec;
  --radius:14px;
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:
    radial-gradient(1100px 420px at 12% -10%, #eef3ff 0%, rgba(238,243,255,0) 60%),
    var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

header.topbar{
  background:linear-gradient(135deg,#0f1b3d,#16234f 55%,#1d4ed8);
  color:#fff;
  padding:18px clamp(16px,4vw,48px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
header.topbar .brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:#fff;
}
header.topbar .brand-mark{
  width:32px;height:32px;
  border-radius:9px;
  background:rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;
  font-weight:700;
  font-size:13px;
  border:1px solid rgba(255,255,255,.25);
  flex-shrink:0;
}
header.topbar .brand-name{
  font-size:14.5px;
  font-weight:600;
  letter-spacing:.2px;
}
header.topbar .nav-links{ display:flex; gap:8px; }
header.topbar .nav-link{
  font-size:13px;
  font-weight:600;
  letter-spacing:.2px;
  color:rgba(255,255,255,.85);
  text-decoration:none;
  padding:7px 14px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  transition:background .15s ease, color .15s ease;
}
header.topbar .nav-link:hover{ background:rgba(255,255,255,.12); color:#fff; }

.page-head{
  max-width:1180px;
  margin:0 auto;
  padding:28px clamp(16px,4vw,48px) 0;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.page-head h1{
  font-size:22px;
  margin:0 0 4px;
  font-weight:700;
  letter-spacing:-.2px;
}
main{ max-width:1180px; margin:0 auto; padding:20px clamp(16px,4vw,48px) 64px; }

section.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-bottom:24px;
  padding:20px 24px;
}
.filters{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:center;
}
.field{ min-width:190px; }
.field label{
  display:block;
  font-size:12px;
  font-weight:600;
  color:var(--text-muted);
  margin-bottom:6px;
}
.field select, .field input{
  width:100%;
  padding:9px 11px;
  border-radius:9px;
  border:1px solid var(--border);
  background:#fbfcfe;
  font-size:13.5px;
  font-family:inherit;
  color:var(--text);
}
.field select:focus, .field input:focus{
  outline:none;
  border-color:var(--accent);
  background:#fff;
  box-shadow:0 0 0 3px var(--accent-soft);
}
.field.grow{ flex:1; }
.count-pill{
  font-size:12.5px;
  color:var(--text-muted);
  background:var(--bg);
  border:1px solid var(--border);
  padding:6px 12px;
  border-radius:999px;
  white-space:nowrap;
  margin-left:auto;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(340px, 1fr));
  gap:16px;
}

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px 22px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.card .num{ font-size:12px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.card h3{ margin:0; font-size:15.5px; font-weight:650; line-height:1.35; }
.card .customer{ margin:0; font-size:13px; color:var(--text-muted); }
.card .meta{ font-size:12.5px; color:var(--text-muted); display:flex; flex-direction:column; gap:4px; }
.card .meta b{ color:var(--text); font-weight:600; }
.card a.detail-link{
  font-size:12.5px;
  color:var(--accent);
  text-decoration:none;
  font-weight:600;
}
.card a.detail-link:hover{ text-decoration:underline; }

.status-box{
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:10px 13px;
  border-radius:9px;
  background:#f7f9fc;
  border:1px solid var(--border);
  font-size:12.5px;
  color:var(--text-muted);
}
.status-box.taken, .status-box.won{ background:var(--ok-soft); border-color:#c9f0da; color:#0a7a44; }
.status-box.declined, .status-box.lost{ background:var(--danger-soft); border-color:#f6cfcf; color:#a91e1e; }
.status-box .dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--text-muted);
  margin-top:5px;
  flex-shrink:0;
}
.status-box.taken .dot, .status-box.won .dot{ background:var(--ok); }
.status-box.declined .dot, .status-box.lost .dot{ background:var(--danger); }

.actions{ display:flex; gap:8px; margin-top:auto; }
button, .actions a{
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  padding:9px 14px;
  border-radius:9px;
  border:1px solid transparent;
  cursor:pointer;
  transition:transform .05s ease, filter .15s ease, background .15s ease;
  flex:1;
  text-decoration:none;
  text-align:center;
}
button:active{ transform:translateY(1px); }
.btn-primary{
  background:linear-gradient(135deg,var(--accent),var(--accent-dark));
  color:#fff;
  box-shadow:0 6px 16px rgba(29,78,216,.22);
}
.btn-primary:hover{ filter:brightness(1.05); }

.empty-state{
  padding:48px 24px;
  text-align:center;
  color:var(--text-muted);
  font-size:13.5px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
}

[hidden]{ display:none !important; }
