: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; }
header.topbar .nav-link.current{ background:rgba(255,255,255,.16); }

.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;
}
.page-head .subtitle{ margin:0; font-size:13.5px; color:var(--text-muted); }

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;
  overflow:hidden;
}
.toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  padding:16px 24px;
  border-bottom:1px solid var(--border);
}
.toolbar label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:var(--text-muted);
  cursor:pointer;
}
.toolbar .selected-count{
  font-size:12.5px;
  color:var(--text-muted);
  background:var(--bg);
  border:1px solid var(--border);
  padding:5px 11px;
  border-radius:999px;
}
.toolbar .spacer{ flex:1; }

button{
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  padding:9px 16px;
  border-radius:9px;
  border:1px solid transparent;
  cursor:pointer;
  transition:transform .05s ease, filter .15s ease, background .15s ease, opacity .15s ease;
}
button:active{ transform:translateY(1px); }
button:disabled{ opacity:.45; cursor:default; }
.btn-danger{ background:var(--danger); color:#fff; }
.btn-danger:hover:not(:disabled){ filter:brightness(1.05); }
.btn-danger-outline{ background:#fff; color:var(--danger); border-color:#f2c9c9; }
.btn-danger-outline:hover:not(:disabled){ background:var(--danger-soft); }

.table-scroll{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:13.5px; }
thead th{
  text-align:left;
  font-size:11.5px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--text-muted);
  font-weight:600;
  padding:10px 24px;
  border-bottom:1px solid var(--border);
  background:#fafbfd;
  white-space:nowrap;
}
thead th.checkbox-col, tbody td.checkbox-col{ width:36px; padding-right:0; }
tbody td{
  padding:13px 24px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  color:var(--text);
}
tbody tr:last-child td{ border-bottom:none; }
tbody tr{ transition:background .12s ease; }
tbody tr:hover{ background:#f8faff; }
tbody tr.is-selected{ background:#eef3ff; }

td.num{ font-variant-numeric:tabular-nums; color:var(--text-muted); white-space:nowrap; }
td.subject{ max-width:360px; font-weight:500; }
td.customer{ color:var(--text-muted); max-width:280px; }
td.deadline{ color:var(--danger); font-weight:600; white-space:nowrap; }
td.link a{ color:var(--accent); text-decoration:none; font-weight:600; font-size:12.5px; }
td.link a:hover{ text-decoration:underline; }

input[type="checkbox"]{ width:16px; height:16px; cursor:pointer; }

.empty-state{
  padding:64px 24px;
  text-align:center;
  color:var(--text-muted);
  font-size:13.5px;
}

[hidden]{ display:none !important; }
