:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #dde1e6;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2563eb;
  --urgent: #b42318;
  --urgent-bg: #fef2f1;
  --ok-bg: #ecfdf3;
  --ok-text: #027a48;
  --blocked-bg: #fffaeb;
  --blocked-text: #92400e;
  --sample-bg: #eef2ff;
  --sample-text: #3730a3;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  padding: 20px 24px 4px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.banner {
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.banner-ok { background: var(--ok-bg); color: var(--ok-text); }
.banner-blocked { background: var(--blocked-bg); color: var(--blocked-text); }
.banner-sample { background: var(--sample-bg); color: var(--sample-text); font-weight: 600; }
.banner-loading { background: #f1f2f4; color: var(--muted); }
.banner-signin-required { background: #eef4ff; color: #1d4ed8; font-weight: 600; }

main { padding: 16px 24px 24px; }

.summary {
  display: flex;
  gap: 12px;
  margin: 12px 0 20px;
}

.summary-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.summary-number { font-size: 24px; font-weight: 700; }
.summary-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.summary-urgent .summary-number { color: var(--urgent); }
.summary-overdue .summary-number { color: #b45309; }

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}

.column-header.collapsible { cursor: pointer; }

.column-count {
  background: var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
}

.column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.column-body.collapsed { display: none; }

.empty-hint {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 2px;
}

.loading-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
  grid-column: 1 / -1;
  text-align: center;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.card-urgent { border-left: 3px solid var(--urgent); }
.card-overdue { background: var(--urgent-bg); }

.card-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.card-client { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.card-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  font-size: 11px;
  background: #f1f2f4;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
}

.badge-urgent { background: var(--urgent-bg); color: var(--urgent); font-weight: 600; }

.unavailable-section {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #fafafa;
}

.unavailable-section h2 { font-size: 14px; margin: 0 0 6px; }
.unavailable-section p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }
.unavailable-section code { background: #eef0f2; padding: 1px 5px; border-radius: 4px; }

.footer {
  padding: 14px 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.footer button:hover { opacity: 0.9; }

.footer-note { font-size: 12px; color: var(--muted); }

.auth-panel {
  margin: 12px 24px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.auth-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 4px;
}

.auth-field input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  min-width: 180px;
}

/* .auth-form / .auth-status both set display:flex, which (author-stylesheet
   vs. the browser's default [hidden]{display:none} UA rule) would otherwise
   silently win over the `hidden` attribute at equal specificity. Restoring
   it explicitly here is what lets index.html's/app.js's `el.hidden = true`
   actually hide these elements instead of leaving them visibly flexed. */
.auth-form[hidden],
.auth-status[hidden] {
  display: none;
}

.auth-form button,
.auth-status button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.auth-form button:hover,
.auth-status button:hover { opacity: 0.9; }

.auth-form button:disabled,
.auth-status button:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.auth-error {
  color: var(--urgent);
  font-size: 12px;
  width: 100%;
}
