:root {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0; background: #f8fafc; }
h1, h2, h3 { margin: 0; }
.muted { color: #64748b; font-size: 13px; }
.hidden { display: none !important; }

button {
  border: none; border-radius: 7px; padding: 7px 12px;
  background: var(--brand); color: #fff; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
button.secondary { background: #334155; }
button.danger { background: #b91c1c; }
button.ghost-nav { background: none; color: #475569; }
button.link { background: none; color: var(--brand); padding: 2px 4px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { background: none; color: #64748b; padding: 2px 6px; font-size: 13px; line-height: 1; }
.icon-btn:hover { color: #0f172a; }

/* ---------- top nav, shared by board and clients ---------- */
.nav {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 5;
}
.nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.02em; }
.nav .brand .dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--brand), #818cf8);
}
.nav .links { display: flex; gap: 4px; }
.nav .links a {
  text-decoration: none; color: #64748b; font-size: 13px; padding: 7px 12px;
  border-radius: 7px; font-weight: 500;
}
.nav .links a:hover { background: #f1f5f9; color: #0f172a; }
.nav .links a.active { background: #eef2ff; color: var(--brand-dark); }
.nav .spacer { flex: 1; }
.nav .toolbar { display: flex; align-items: center; gap: 8px; }

.nav-burger {
  display: none; background: none; color: #334155; padding: 6px 8px;
  font-size: 19px; line-height: 1; border-radius: 7px; margin-left: auto;
}
.nav-burger:hover { background: #f1f5f9; }

/* ---------- mobile nav: collapse links + toolbar behind a burger ---------- */
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; row-gap: 4px; }
  .nav-burger { display: inline-flex; }
  .nav .spacer { display: none; }
  .nav .links, .nav .toolbar {
    display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 2px;
  }
  .nav .links a { padding: 10px 12px; }
  .nav .toolbar {
    flex-direction: row; flex-wrap: wrap; justify-content: flex-start;
    padding-top: 8px; margin-top: 4px; border-top: 1px solid #e2e8f0;
  }
  .nav.open .links, .nav.open .toolbar { display: flex; }
}

.page { padding: 16px 18px; max-width: 1400px; margin: 0 auto; }
.status { margin-bottom: 8px; font-size: 12px; min-height: 16px; color: #64748b; }
.status.error { color: #b91c1c; }

/* ---------- dialogs ---------- */
dialog {
  border: none; border-radius: 14px; padding: 20px; width: min(520px, 94vw);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25); color: #0f172a;
}
dialog::backdrop { background: rgba(15, 23, 42, 0.4); }
dialog h2 { margin: 0 0 12px; font-size: 18px; padding-right: 30px; }
.dialog-close {
  position: absolute; top: 11px; right: 12px; z-index: 2;
  background: none; color: #94a3b8; border-radius: 6px;
  padding: 1px 6px 3px; font-size: 18px; line-height: 1;
}
.dialog-close:hover { background: #f1f5f9; color: #0f172a; }
label { display: block; font-size: 13px; color: #475569; margin-bottom: 10px; }
.row { display: flex; gap: 10px; }
.row label { flex: 1; }
input, textarea, select {
  width: 100%; margin-top: 4px; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 9px 10px; font-size: 13px; font-family: inherit; background: #f8fafc; color: #0f172a;
}
textarea { min-height: 80px; resize: vertical; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.dialog-actions .danger { margin-right: auto; }
.dialog-error { color: #b91c1c; font-size: 13px; min-height: 18px; margin-bottom: 4px; }

#confirm-dialog { width: min(400px, 92vw); }
.confirm-text { margin: 0 0 16px; font-size: 13px; color: #475569; line-height: 1.5; }
.confirm-text b { color: #0f172a; }

#login-screen { max-width: 340px; margin: 14vh auto 0; }
#login-screen .box {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
#login-screen h1 { font-size: 20px; margin-bottom: 4px; }

.empty { font-size: 12px; color: #c2ccd9; padding: 2px; }
