/* ==========================================================================
   Danh sách dự án — giao diện
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f5;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --primary-text: #1e40af;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fee2e2;
  --info-soft: #e0f2fe;
  --info-text: #075985;

  --ring: 0 0 0 3px rgba(37, 99, 235, .25);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 1px 3px rgba(17, 24, 39, .08), 0 6px 16px -4px rgba(17, 24, 39, .12);
  --shadow-lg: 0 24px 48px -12px rgba(17, 24, 39, .28);
  --radius: 12px;
  --radius-sm: 8px;

  --st-active: #15803d;      --st-active-bg: #dcfce7;
  --st-completed: #1d4ed8;   --st-completed-bg: #dbeafe;
  --st-maintenance: #b45309; --st-maintenance-bg: #fef3c7;
  --st-paused: #4b5563;      --st-paused-bg: #e5e7eb;
  --year: #4338ca;           --year-bg: #e0e7ff;

  --topbar-bg: rgba(255, 255, 255, .85);
  --backdrop: rgba(10, 12, 18, .55);
  --toast-bg: #111827;
  --toast-text: #ffffff;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f1218;
  --surface: #161a22;
  --surface-2: #1b202a;
  --surface-3: #222836;
  --border: #262c38;
  --border-strong: #353d4c;
  --text: #e7eaf0;
  --text-2: #c3c8d3;
  --muted: #8b93a3;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: #1e2f55;
  --primary-text: #93c5fd;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --danger-soft: #3b1a1a;
  --info-soft: #0c2a3a;
  --info-text: #7dd3fc;

  --ring: 0 0 0 3px rgba(59, 130, 246, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 6px 16px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);

  --st-active: #4ade80;      --st-active-bg: #14301f;
  --st-completed: #93c5fd;   --st-completed-bg: #172554;
  --st-maintenance: #fcd34d; --st-maintenance-bg: #3a2a08;
  --st-paused: #cbd5e1;      --st-paused-bg: #2a3040;
  --year: #c7d2fe;           --year-bg: #26295a;

  --topbar-bg: rgba(22, 26, 34, .85);
  --backdrop: rgba(0, 0, 0, .65);
  --toast-bg: #f3f4f6;
  --toast-text: #111827;
  color-scheme: dark;
}

html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-modal { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.ico { flex-shrink: 0; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.brand__sub { font-size: 12px; color: var(--muted); white-space: nowrap; }

.search {
  flex: 1; display: flex; align-items: center; gap: 10px;
  max-width: 640px; margin: 0 auto; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--primary); box-shadow: var(--ring); color: var(--text); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--text); font-size: 14.5px;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--surface-2);
}

.topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.inline-form { display: contents; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn--danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); }
.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; height: 42px; font-size: 15px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 24px 0 16px;
}
.stat {
  --stat-color: var(--primary);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); text-align: left; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--stat-color); opacity: .9;
}
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat:focus-visible { outline: 0; box-shadow: var(--ring); }
.stat.is-active { border-color: var(--stat-color); box-shadow: inset 0 0 0 1px var(--stat-color); }
.stat--static { cursor: default; --stat-color: var(--border-strong); }
.stat--static:hover { border-color: var(--border); box-shadow: none; }
.stat--active { --stat-color: var(--st-active); }
.stat--completed { --stat-color: var(--st-completed); }
.stat--maintenance { --stat-color: var(--st-maintenance); }
.stat--paused { --stat-color: var(--st-paused); }
.stat__value { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat__hint { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Toolbar (filters)
   -------------------------------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
.toolbar__filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.select {
  height: 36px; padding: 0 32px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.select:hover { border-color: var(--border-strong); }
.select:focus-visible, .select:focus { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }

.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.segmented button {
  display: grid; place-items: center; width: 32px; height: 28px;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface-3); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--primary);
  background: var(--primary-soft); color: var(--primary-text);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--mono);
}
.chip:hover { filter: brightness(.97); }

/* --------------------------------------------------------------------------
   Groups & grid
   -------------------------------------------------------------------------- */
.results { padding-bottom: 64px; }
.group { margin-bottom: 36px; }
.group__title {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px;
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
}
.group__title::after { content: ""; flex: 1; height: 1px; background: var(--border); align-self: center; }
.group__count { font-size: 13px; font-weight: 500; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.card {
  display: flex; flex-direction: column; gap: 10px; min-height: 200px;
  padding: 18px 20px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card:focus-visible { outline: 0; box-shadow: var(--ring); }
.card__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card__title { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.card__metas { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.card__meta { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13.5px; min-width: 0; }
.card__meta .ico { color: var(--muted); }
.card__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; min-width: 0;
}
.owner-btn:hover { color: var(--primary); }
.owner-btn:hover .ico { color: var(--primary); }
.owner-btn:focus-visible { outline: 0; box-shadow: var(--ring); border-radius: 4px; }
.card__foot-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.card__lock { display: inline-flex; color: var(--muted); }
.card__desc {
  margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__desc--empty { font-style: italic; opacity: .7; }
.card__foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.card__updated { flex-shrink: 0; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1;
}
.badge--year { background: var(--year-bg); color: var(--year); font-family: var(--mono); }
.badge--status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.badge--active { background: var(--st-active-bg); color: var(--st-active); }
.badge--completed { background: var(--st-completed-bg); color: var(--st-completed); }
.badge--maintenance { background: var(--st-maintenance-bg); color: var(--st-maintenance); }
.badge--paused { background: var(--st-paused-bg); color: var(--st-paused); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--mono);
  transition: border-color .15s, background .15s, color .15s;
}
.tag:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }

.links { display: flex; gap: 14px; flex-wrap: wrap; min-width: 0; }
.links--col { flex-direction: column; gap: 4px; }
.link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); max-width: 220px; min-width: 0; }
.link .ico { color: var(--muted); }
.link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link:hover { color: var(--primary); text-decoration: none; }
.link:hover .ico { color: var(--primary); }
.link--long { max-width: 100%; }
.link--long span { white-space: normal; word-break: break-all; }

/* --------------------------------------------------------------------------
   Table view
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 14px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:focus-visible { outline: 0; }
.table tbody tr:focus-visible td { background: var(--primary-soft); }
.table__name { font-weight: 600; }
.table__desc {
  color: var(--muted); font-size: 13px; margin-top: 2px; max-width: 420px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.table__actions { display: flex; gap: 2px; }
.table .tags { gap: 4px; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal__backdrop {
  position: absolute; inset: 0; background: var(--backdrop);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .15s;
}
.modal__dialog {
  position: relative; width: min(760px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.modal__dialog--sm { width: min(460px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 12px; }
.modal__head-main { min-width: 0; flex: 1; }
.modal__head .badges { justify-content: flex-start; margin-bottom: 8px; }
.modal__title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.modal__subtitle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal__subtitle:empty { display: none; }
.modal__body { padding: 8px 24px 20px; overflow: auto; }
.modal__foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 24px;
  border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* detail */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin: 0 0 22px; }
.prop { min-width: 0; }
.prop dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.prop dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.copyable { display: flex; align-items: center; gap: 6px; }
.desc-block h3 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.desc { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.desc-block + .desc-block { margin-top: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.block-head h3 { margin: 0; }
.accounts {
  margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2);
}
.tag--static { cursor: default; }
.tag--static:hover { border-color: var(--border); background: var(--surface-2); color: var(--text-2); }
.confirm-text { margin: 0; font-size: 15px; line-height: 1.6; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.label-hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.field-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.req { color: var(--danger); }
.input, .textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .textarea:focus { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }
.input:disabled { opacity: .6; }
.input.select { height: 40px; }
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.textarea--mono { font-family: var(--mono); font-size: 13px; min-height: 90px; }
.is-invalid { border-color: var(--danger) !important; }
.field__error { font-size: 12.5px; color: var(--danger); }
.field__error:empty { display: none; }
.form-error { font-size: 13.5px; color: var(--danger); font-weight: 500; }
.form-error:empty { display: none; }
.tags-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-preview:empty { display: none; }
.tags-preview .tag { cursor: default; }
.tags-preview .tag:hover { border-color: var(--border); background: var(--surface-2); color: var(--text-2); }

/* --------------------------------------------------------------------------
   Empty states, toast, alerts
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 64px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted);
}
.empty__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 6px; }
.empty h3 { margin: 0; color: var(--text); font-size: 17px; }
.empty p { margin: 0 0 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  padding: 11px 18px; border-radius: 999px;
  background: var(--toast-bg); color: var(--toast-text);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: calc(100vw - 40px);
}
.toast--error { background: var(--danger); color: #fff; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.alert--info { background: var(--info-soft); color: var(--info-text); }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert__hint { display: block; opacity: .8; font-size: 13px; }

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(37, 99, 235, .18), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(124, 58, 237, .16), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%); padding: 32px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand__name { font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.login-brand__sub { font-size: 12.5px; color: var(--muted); }
.login-title { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .input { padding: 11px 12px; font-size: 15px; }
.login-form .btn--block { margin-top: 4px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .container { padding: 0 16px; }
  .topbar__inner { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .search kbd { display: none; }
  .brand__sub { display: none; }
  #btn-add span { display: none; }
  #btn-add { width: 38px; padding: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
  .stat__value { font-size: 22px; }
  .toolbar__right { margin-left: 0; width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal__dialog { width: 100%; max-height: 100vh; border-radius: 0; border: 0; }
  .modal__foot { border-radius: 0; }
  .props { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
