:root {
  color-scheme: light;
  --background: #f5f5f2;
  --surface: #ffffff;
  --text: #181815;
  --muted: #72726c;
  --line: #e5e5df;
  --accent: #1677ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 42px; border-radius: 28px; background: var(--surface); box-shadow: 0 18px 60px #2221; }
.login-card h1 { margin: 5px 0 12px; font-size: 38px; letter-spacing: -0.04em; }
.login-card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.primary-button { display: inline-flex; margin-top: 20px; padding: 13px 18px; border-radius: 13px; background: var(--text); color: white; text-decoration: none; font-weight: 650; }

#application { max-width: 1600px; margin: auto; padding: 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: 40px; letter-spacing: -0.045em; }
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.text-button { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 9px 12px; cursor: pointer; }

.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(170px, auto); gap: 12px; position: sticky; top: 0; z-index: 5; padding: 12px; margin: 0 -12px; background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(14px); }
.toolbar input, .toolbar select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 0 14px; color: var(--text); }
.segmented { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.segmented button { border: 0; border-radius: 9px; padding: 8px 12px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.selected { background: var(--text); color: white; }

.summary { display: flex; justify-content: space-between; gap: 20px; padding: 18px 2px 12px; color: var(--muted); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.column { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #ecece7; }
.column h2 { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; font-size: 14px; }
.column h2 b { min-width: 24px; padding: 3px 7px; border-radius: 99px; background: #0001; text-align: center; font-size: 12px; }
.task-card { display: flex; width: 100%; flex-direction: column; gap: 8px; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; box-shadow: 0 1px 2px #0000000a; }
.task-card:hover { border-color: #c6c6bf; transform: translateY(-1px); }
.task-card strong { font-size: 15px; line-height: 1.35; }
.task-card span, .task-card em { color: var(--muted); font-size: 12px; font-style: normal; }
.task-card em { color: #a65a00; }
.empty, .error { margin: 60px auto; text-align: center; color: var(--muted); }
.error { color: #a32424; }

dialog { width: min(620px, calc(100% - 28px)); border: 0; border-radius: 24px; padding: 0; color: var(--text); box-shadow: 0 30px 100px #0004; }
dialog::backdrop { background: #1118; backdrop-filter: blur(4px); }
.dialog-card { padding: 26px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; }
.close-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eee; font-size: 24px; cursor: pointer; }
.dialog-card h2 { margin: 22px 0 28px; font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
.dialog-card dl { display: grid; gap: 14px; margin: 0; }
.dialog-card dl div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.dialog-card dt { color: var(--muted); }
.dialog-card dd { margin: 0; }
.status-pill { display: inline-flex; border-radius: 99px; padding: 7px 10px; background: #eee; font-size: 12px; font-weight: 700; }
.status-pill.done { color: #087a3c; background: #e1f8eb; }
.status-pill.expired { color: #a32424; background: #ffe8e8; }
.status-pill.in-progress { color: #075fbf; background: #e4f1ff; }
.status-pill.waiting { color: #795600; background: #fff3d0; }

@media (max-width: 960px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

@media (max-width: 620px) {
  #application { padding: 18px 14px; }
  .topbar { align-items: flex-end; }
  .topbar h1 { font-size: 32px; }
  .account span { display: none; }
  .toolbar { grid-template-columns: 1fr; margin: 0 -4px; }
  .search-field { grid-column: auto; }
  .segmented { overflow-x: auto; }
  .segmented button { flex: 1 0 auto; }
  .board { grid-template-columns: 1fr; }
  .summary { flex-direction: column; gap: 4px; }
  .dialog-card dl div { grid-template-columns: 1fr; gap: 4px; }
}
