:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-strong: #f0f4f1;
  --text: #18211f;
  --muted: #65706b;
  --line: #dce3de;
  --teal: #0f766e;
  --teal-dark: #0b514d;
  --amber: #b97913;
  --green: #257a44;
  --slate: #53616b;
  --shadow: 0 18px 50px rgba(24, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(185, 121, 19, 0.12), transparent 38%),
    var(--bg);
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.login-panel h1 {
  margin: 22px 0 10px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.05;
}

.login-panel p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-btn {
  display: inline-grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
}

.primary-btn:hover {
  background: var(--teal-dark);
}

.primary-btn.full {
  width: 100%;
  margin-top: 18px;
}

.ghost-btn.full {
  width: 100%;
  margin-top: 18px;
}

.ghost-btn {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.form-error,
.fatal-error {
  border-radius: 8px;
  background: #fff4f1;
  color: #9f2f19;
  padding: 12px;
  font-weight: 700;
}

.fatal-error {
  margin: 40px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.group-nav {
  display: grid;
  gap: 8px;
}

.group-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}

.group-nav button:hover,
.group-nav button.active {
  background: var(--surface-strong);
  border-color: var(--line);
}

.group-nav span {
  font-weight: 750;
}

.group-nav small {
  display: grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e4ece8;
  color: var(--teal-dark);
  font-weight: 800;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

.sidebar-note h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.notice-message {
  margin: -6px 0 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #ecf7f3;
  color: var(--teal-dark);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 750;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 170px 170px 170px;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.search-field input {
  min-width: 0;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 16px;
  align-items: start;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-row,
.details-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 33, 31, 0.04);
}

.notice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 18px;
  padding: 16px;
  cursor: pointer;
}

.notice-row:hover,
.notice-row.selected {
  border-color: rgba(15, 118, 110, 0.45);
}

.notice-row.selected {
  box-shadow: inset 3px 0 0 var(--teal), 0 8px 24px rgba(24, 33, 31, 0.05);
}

.row-meta,
.keyword-line,
.detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notice-row h2 {
  margin: 10px 0 7px;
  font-size: 17px;
  line-height: 1.25;
}

.notice-row p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.keyword-line span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.notice-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.notice-side strong {
  font-size: 24px;
}

.notice-side time {
  margin-top: 6px;
  color: var(--text);
  font-weight: 800;
}

.notice-side time.urgent {
  color: #ad3f12;
}

.status {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.status-green {
  background: #e7f5eb;
  color: var(--green);
}

.status-amber {
  background: #fff3d9;
  color: var(--amber);
}

.status-slate {
  background: #edf1f3;
  color: var(--slate);
}

.score-high {
  color: var(--green);
}

.score-mid {
  color: var(--amber);
}

.score-low {
  color: var(--slate);
}

.details-panel {
  position: sticky;
  top: 24px;
  padding: 20px;
}

.detail-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.details-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.detail-summary {
  color: var(--muted);
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}

.requirements {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.requirements h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.requirements ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  padding: 28px;
}

.empty-state.compact {
  box-shadow: none;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .app-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .details-panel {
    position: static;
    height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .group-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .controls,
  .group-nav,
  .notice-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .notice-side {
    justify-items: start;
  }
}
