:root {
  --ink: #1b1c1f;
  --muted: #667085;
  --line: #d8dde6;
  --paper: #f5f6f8;
  --panel: #ffffff;
  --burgundy: #8f2824;
  --burgundy-dark: #671916;
  --charcoal: #101214;
  --steel: #39414f;
  --sage: #52745f;
  --amber: #a8661f;
  --danger: #b42318;
  --ok: #21805f;
  --shadow: 0 12px 30px rgba(16, 18, 20, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--steel);
  font-size: 0.9rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--steel);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #252a31;
  background: var(--charcoal);
  color: #fff;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 104px;
  padding: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand img {
  width: 100%;
  max-height: 72px;
  height: auto;
  display: block;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #d9dee7;
  font-weight: 700;
}

.nav-list a:hover,
.nav-list a.active {
  background: #23282f;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--burgundy);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px;
}

.system-pill,
.tag,
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.system-pill.ok,
.status-banner.ok {
  color: #dff6ec;
  background: #153d2e;
}

.system-pill.danger,
.status-banner.danger {
  color: #ffe5e2;
  background: #561512;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  z-index: 10;
}

.topbar-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--burgundy);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h1,
.login-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1.2;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: end;
}

.account-box strong,
.account-box span {
  display: block;
  text-align: right;
}

.account-box span {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: capitalize;
}

.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.icon-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.content {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.schedule-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  color: var(--burgundy-dark);
  font-size: 2rem;
  line-height: 1;
}

.metric-card.alert strong {
  color: var(--danger);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2,
.schedule-card h2,
.notice-card h2,
.report-card h2,
.task-hero h2,
.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

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

.form-actions,
.page-actions,
.segmented,
.inline-form,
.upload-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-form select,
.inline-form input {
  width: auto;
  min-width: 0;
  flex: 1 1 150px;
}

.page-actions {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.button.primary {
  background: var(--burgundy);
  color: #fff;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--burgundy-dark);
}

.button.ghost {
  background: transparent;
  color: var(--steel);
}

.button.warning {
  background: var(--amber);
  color: #fff;
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.button.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.button.wide {
  width: 100%;
}

.flash {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 800;
}

.flash.success {
  color: #15543e;
  background: #e6f4ed;
  border: 1px solid #bfe2cf;
}

.flash.error {
  color: #8a1f16;
  background: #fde8e4;
  border: 1px solid #f4c2bb;
}

.muted {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

.tag {
  color: var(--steel);
  background: #eef1f5;
}

.tag.active,
.tag.sent,
.priority.normal {
  color: #15543e;
  background: #e4f2ea;
}

.tag.suspended,
.tag.pending,
.priority.low {
  color: #62420d;
  background: #fbefd8;
}

.tag.deleted,
.tag.failed,
.priority.urgent {
  color: #8a1f16;
  background: #fde8e4;
}

.row-alert td {
  background: #fff6f5;
}

.status-banner {
  display: grid;
  gap: 6px;
  border-radius: 8px;
  padding: 18px;
}

.panel-subsection {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.panel-subsection h3 {
  margin: 0;
  color: var(--steel);
  font-size: 0.95rem;
}

.activity-list,
.timeline,
.task-list,
.notice-list,
.document-list,
.assignee-list,
.comment-list,
.category-list,
.record-list,
.notice-strip {
  display: grid;
  gap: 10px;
}

.activity-list > div,
.timeline a,
.task-row,
.document-list a,
.assignee-list > div,
.category-item,
.record-list article,
.notice-strip article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.timeline span,
.task-row span:last-child,
.document-list span,
.assignee-list span,
.activity-list span,
.record-list span,
.notice-strip span,
.comment-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.task-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, auto);
  align-items: center;
}

.task-list.compact .task-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(160px, auto);
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.check-card input,
.checkbox-row input {
  width: auto;
}

.check-card span,
.checkbox-row span {
  margin: 0;
}

.check-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.hidden {
  display: none !important;
}

.task-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 20px;
}

.task-hero p,
.notice-card p,
.schedule-card p,
.comment-list p {
  color: var(--steel);
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

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

.detail-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-list article,
.notice-list article {
  border-left: 3px solid var(--line);
  padding: 10px 0 10px 12px;
}

.notice-list article.unread,
.notice-card.unread {
  border-color: #c9933d;
}

.notice-grid,
.report-grid,
.schedule-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.notice-card,
.report-card,
.schedule-card {
  min-width: 0;
  margin: 0;
}

.report-card > div {
  min-width: 0;
}

.report-intro {
  display: flex;
  align-items: center;
  gap: 18px;
}

.report-intro img {
  width: min(260px, 42vw);
  height: auto;
  object-fit: contain;
}

.report-intro h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.schedule-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.schedule-card.overdue {
  border-color: #e3a29a;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 580px;
  margin: 80px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #eef0f4;
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(360px, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  gap: 20px;
  align-content: center;
  padding: 42px;
}

.login-logo {
  width: 320px;
  max-width: 100%;
  display: block;
}

.login-visual {
  display: grid;
  place-items: center;
  background: var(--charcoal);
  min-height: 620px;
}

.login-visual img {
  width: min(430px, 78%);
  height: auto;
  object-fit: contain;
}

.maintenance-shell {
  width: min(760px, 100%);
}

.maintenance-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 42px;
  text-align: center;
  box-shadow: var(--shadow);
}

.maintenance-card .login-logo {
  width: 340px;
}

.maintenance-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.maintenance-card p {
  max-width: 580px;
}

.support-note,
.field-help {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-help {
  display: block;
  border-top: 0;
  padding-top: 7px;
  line-height: 1.4;
}

.field-note {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 12px;
}

.field-note strong {
  color: var(--steel);
}

.field-note span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.narrow-panel {
  max-width: 640px;
}

.prose p,
.record-list p {
  color: var(--steel);
  line-height: 1.6;
}

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

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    transition: transform 160ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .icon-button {
    display: block;
  }

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

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding: 16px;
    gap: 12px;
  }

  .topbar-mark {
    width: 36px;
    height: 36px;
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .account-box strong,
  .account-box span {
    text-align: left;
  }

  .content {
    padding: 16px;
  }

  .metric-grid,
  .split-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .selection-grid,
  .task-hero,
  .notice-grid,
  .report-grid,
  .schedule-board,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .task-row,
  .task-list.compact .task-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 220px;
    order: -1;
  }

  .login-panel {
    padding: 24px;
  }

  .report-intro {
    display: grid;
  }

  .segmented,
  .inline-form,
  .upload-row {
    align-items: stretch;
  }

  .inline-form,
  .inline-form select,
  .inline-form input,
  .inline-form .button,
  .upload-row input,
  .upload-row .button {
    width: 100%;
    flex-basis: 100%;
  }

  .segmented .button {
    white-space: normal;
  }

  .report-intro img {
    width: min(240px, 100%);
  }
}

/* Premium client-ready UI layer */
:root {
  --ink: #17181b;
  --muted: #697386;
  --line: #e1e5ec;
  --paper: #f3f4f7;
  --panel: #ffffff;
  --burgundy: #8d2421;
  --burgundy-dark: #5d1513;
  --charcoal: #0c0f12;
  --charcoal-2: #161a20;
  --steel: #384250;
  --gold: #b08a45;
  --sage: #45715f;
  --amber: #a45c17;
  --danger: #b42318;
  --ok: #157357;
  --shadow: 0 16px 44px rgba(16, 18, 20, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 18, 20, 0.06);
  --radius: 8px;
}

html {
  background:
    radial-gradient(circle at top left, rgba(141, 36, 33, 0.08), transparent 32rem),
    linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
  font-size: 16px;
}

body {
  color: var(--ink);
  letter-spacing: 0;
}

a,
button,
.button,
input,
select,
textarea {
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

input,
select,
textarea {
  min-height: 44px;
  border-color: #d8dee8;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(16, 18, 20, 0.02);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: rgba(141, 36, 33, 0.72);
  box-shadow: 0 0 0 4px rgba(141, 36, 33, 0.12);
  outline: none;
}

label span {
  color: #303846;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #dfe4ed;
  background: #f8fafc;
  color: #5d6678;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

td {
  background: #fff;
}

tbody tr:hover td {
  background: #fbfcfd;
}

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

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(141, 36, 33, 0.12), transparent 18rem),
    var(--charcoal);
  box-shadow: 12px 0 30px rgba(16, 18, 20, 0.14);
}

.brand {
  min-height: 116px;
  padding: 24px 20px 22px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.brand img {
  max-height: 78px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.nav-list {
  gap: 16px;
  padding: 18px 14px 10px;
  overflow-y: auto;
}

.nav-section {
  display: grid;
  gap: 5px;
}

.nav-section p {
  margin: 12px 10px 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-list a {
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  font-weight: 760;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  line-height: 1;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-list a.active {
  border-color: rgba(176, 138, 69, 0.32);
  background: linear-gradient(90deg, rgba(141, 36, 33, 0.58), rgba(255, 255, 255, 0.06));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold), 0 8px 22px rgba(0, 0, 0, 0.16);
}

.nav-list a.active .nav-icon {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  padding: 18px 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-footer small {
  color: rgba(255, 255, 255, 0.54);
  font-weight: 700;
}

.workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 22rem),
    transparent;
}

.topbar {
  min-height: 104px;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 16px;
  border-bottom-color: rgba(216, 222, 232, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(16, 18, 20, 0.04);
  backdrop-filter: blur(18px);
}

.topbar-mark {
  width: 48px;
  height: 48px;
  border: 1px solid #e5e8ef;
  border-radius: 50%;
  background: #fff;
  padding: 6px;
  box-shadow: var(--shadow-soft);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  max-width: 980px;
  font-size: clamp(1.32rem, 1.8vw, 1.72rem);
}

.topbar-title span {
  display: block;
  max-width: 820px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.topbar-status {
  display: flex;
  justify-content: end;
}

.eyebrow {
  color: var(--burgundy);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.account-box {
  min-width: 220px;
  border-left: 1px solid #e5e8ef;
  padding-left: 16px;
}

.account-box strong {
  color: #20242c;
  font-size: 0.94rem;
}

.account-box span {
  color: var(--muted);
  font-size: 0.78rem;
}

.content {
  width: min(1500px, 100%);
  padding: 34px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.metric-card,
.panel,
.schedule-card,
.empty-state {
  border-color: rgba(216, 222, 232, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 22px;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--burgundy), var(--gold));
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -50px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(141, 36, 33, 0.1);
  border-radius: 50%;
}

.metric-card span {
  max-width: 88%;
  color: #5c6676;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(1.7rem, 2.2vw, 2.25rem);
}

.metric-card.alert::before {
  background: linear-gradient(180deg, var(--danger), #e0a29b);
}

.panel {
  padding: 22px;
  margin-bottom: 22px;
}

.panel-header {
  align-items: flex-start;
  padding-bottom: 13px;
  border-bottom: 1px solid #eef1f5;
}

.panel-header h2,
.schedule-card h2,
.notice-card h2,
.report-card h2,
.task-hero h2,
.empty-state h2 {
  color: #1c2028;
  font-size: 1.05rem;
  line-height: 1.25;
}

.panel-header .button {
  margin-top: -2px;
}

.split-grid {
  gap: 22px;
}

.grid,
.stack,
.form-grid {
  gap: 18px;
}

.page-actions {
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 22px;
}

.button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 10px 15px;
  font-size: 0.9rem;
  font-weight: 850;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 18, 20, 0.08);
}

.button.primary {
  background: linear-gradient(180deg, #9d2b27, var(--burgundy-dark));
  box-shadow: 0 10px 22px rgba(141, 36, 33, 0.18);
}

.button.secondary {
  border-color: #dfe4ec;
  background: linear-gradient(180deg, #fff, #f8fafc);
  color: var(--burgundy-dark);
}

.button.ghost {
  color: var(--steel);
}

.button.small {
  min-height: 34px;
  padding: 7px 11px;
}

.flash {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-wrap table {
  min-width: 820px;
}

.system-pill,
.tag,
.priority {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.system-pill.ok,
.status-banner.ok {
  color: #dff7ed;
  background: linear-gradient(180deg, #184b39, #113528);
}

.system-pill.danger,
.status-banner.danger {
  color: #ffe8e5;
  background: linear-gradient(180deg, #6e1714, #4b100e);
}

.tag.open,
.tag.upcoming,
.tag.due_soon,
.tag.active,
.tag.sent,
.tag.ok,
.priority.normal {
  color: #135b45;
  border-color: #cbe6da;
  background: #e8f5ef;
}

.tag.closed,
.tag.completed {
  color: #244a77;
  border-color: #cfe0f4;
  background: #edf5ff;
}

.tag.pending,
.tag.scheduled,
.priority.low {
  color: #705017;
  border-color: #f0ddb5;
  background: #fff7e6;
}

.tag.archived,
.tag.cancelled {
  color: #555f70;
  border-color: #d9dee8;
  background: #f1f3f7;
}

.tag.deleted,
.tag.failed,
.tag.missed,
.priority.urgent {
  color: #8d1f17;
  border-color: #f0c3bd;
  background: #fff0ee;
}

.tag.demo,
.system-pill.demo,
.status-banner.demo {
  color: #5d1513;
  border-color: #e5cfa0;
  background: #fff8e8;
}

.demo-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 22px;
  border: 1px solid #e5cfa0;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff8e8, #fffdf7);
  color: #5d1513;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}

.demo-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.demo-banner span {
  color: #6b4a16;
  font-weight: 760;
}

.row-demo td {
  background: #fffdf7;
}

.demo-permissions {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.status-banner {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 20px;
}

.status-banner.demo {
  border-color: #e5cfa0;
}

.activity-list > div,
.timeline a,
.task-row,
.document-list a,
.assignee-list > div,
.category-item,
.record-list article,
.notice-strip article,
.notice-list article,
.comment-list article {
  border-color: #e5e9f0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 18, 20, 0.02);
}

.timeline a:hover,
.task-row:hover,
.document-list a:hover {
  border-color: rgba(141, 36, 33, 0.25);
  box-shadow: 0 10px 24px rgba(16, 18, 20, 0.07);
}

.task-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, auto);
}

.selection-grid {
  gap: 12px;
}

.check-card {
  border-color: #e3e8f0;
  border-radius: var(--radius);
}

.check-card:hover {
  border-color: rgba(141, 36, 33, 0.25);
  background: #fffdfd;
}

.task-hero {
  border-top: 4px solid var(--burgundy);
}

.task-hero p,
.notice-card p,
.schedule-card p,
.comment-list p,
.prose p,
.record-list p {
  line-height: 1.65;
}

.detail-grid div {
  border-color: #e5e9f0;
  background: #fbfcfd;
}

.detail-grid dt {
  color: #697386;
  letter-spacing: 0.05em;
}

.notice-grid,
.report-grid,
.schedule-board {
  gap: 20px;
}

.notice-card,
.report-card,
.schedule-card {
  border-radius: var(--radius);
}

.report-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.report-intro {
  border-left: 4px solid var(--burgundy);
  background: linear-gradient(90deg, #fff, #fbfcfd);
}

.schedule-card {
  position: relative;
  overflow: hidden;
}

.schedule-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #ccd4df;
}

.schedule-card.overdue::before,
.schedule-card:has(.tag.missed)::before,
.schedule-card:has(.priority.urgent)::before {
  background: var(--danger);
}

.schedule-card:has(.tag.completed)::before {
  background: #2d6ea8;
}

.empty-state {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    #fff;
}

.login-page {
  background:
    radial-gradient(circle at 15% 10%, rgba(141, 36, 33, 0.16), transparent 28rem),
    linear-gradient(135deg, #f6f7f9, #e9edf3);
}

.login-shell {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  border-radius: 10px;
  border-color: rgba(216, 222, 232, 0.92);
  box-shadow: 0 26px 70px rgba(16, 18, 20, 0.16);
}

.login-panel {
  padding: clamp(28px, 5vw, 58px);
}

.login-panel h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: 0;
}

.login-lede {
  max-width: 430px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-logo {
  width: min(360px, 100%);
}

.login-visual {
  position: relative;
  min-height: 640px;
  background:
    linear-gradient(180deg, rgba(141, 36, 33, 0.18), transparent 34%),
    var(--charcoal);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  pointer-events: none;
}

.login-visual > div {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 28px;
  text-align: center;
}

.login-visual img {
  width: min(440px, 80%);
}

.login-visual p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}

.support-note,
.field-help {
  line-height: 1.55;
}

.field-note {
  border-color: #e3e8f0;
  background: #fbfcfd;
}

.maintenance-card {
  border-top: 4px solid var(--burgundy);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(16, 18, 20, 0.16);
}

.maintenance-card h1 {
  color: var(--ink);
}

.narrow-panel {
  max-width: 700px;
}

.prose {
  max-width: 980px;
}

.prose p {
  max-width: 860px;
}

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

  .sidebar {
    width: min(320px, 86vw);
  }

  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .topbar-status {
    display: none;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 15px;
  }

  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr);
    min-height: auto;
    padding: 14px;
  }

  .topbar-title span {
    display: none;
  }

  .topbar-mark {
    width: 40px;
    height: 40px;
  }

  .account-box {
    min-width: 0;
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #edf0f5;
    padding: 12px 0 0;
  }

  .content {
    padding: 18px 14px 28px;
  }

  .metric-card {
    min-height: 112px;
  }

  .page-actions {
    align-items: stretch;
  }

  .page-actions .button,
  .form-actions .button {
    flex: 1 1 100%;
  }

  .panel {
    padding: 18px;
  }

  .panel-header {
    display: grid;
  }

  .task-row,
  .task-list.compact .task-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 14px;
  }

  .login-shell {
    min-height: auto;
  }

  .login-visual {
    min-height: 250px;
  }

  .login-visual::after {
    inset: 14px;
  }
}

/* Final launch polish: dark surfaces always use a fully light logo treatment. */
.brand img,
.login-visual img {
  filter: brightness(0) invert(1) grayscale(1) contrast(12);
}

/* Keep the executive header neat at every width. */
.topbar {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px 18px;
}

.topbar-title {
  min-width: 0;
  max-width: 100%;
}

.topbar-title h1,
.topbar-title span {
  overflow-wrap: anywhere;
}

.topbar-title span {
  max-width: 760px;
}

.topbar-status {
  min-width: max-content;
  justify-self: end;
}

.account-box {
  min-width: 0;
  max-width: 280px;
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: start;
  }

  .topbar-status {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    align-self: start;
    margin-top: 2px;
  }

  .account-box {
    grid-column: 3 / 5;
    width: 100%;
    max-width: none;
    justify-content: end;
    border-left: 0;
    border-top: 1px solid #edf0f5;
    padding: 10px 0 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .topbar-status {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
    margin-top: 0;
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .topbar-title h1 {
    font-size: 1.2rem;
  }

  .topbar-title span {
    display: none;
  }
}
