:root {
  color-scheme: light;
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --ink: #14211d;
  --muted: #65716c;
  --line: #d8dfdb;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-rgb: 15, 118, 110;
  --accent-done: #166534;
  --accent-done-dark: #14532d;
  --accent-done-rgb: 21, 128, 61;
  --accent-fill-rgb: 34, 197, 94;
  --warm: #f4b860;
  --danger: #b42318;
  --success: #20724d;
  --shadow: 0 20px 56px rgba(20, 33, 29, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-color-scheme="blue"] {
  --accent: #1e3a8a;
  --accent-dark: #172554;
  --accent-rgb: 30, 58, 138;
  --accent-done: #1e40af;
  --accent-done-dark: #172554;
  --accent-done-rgb: 30, 64, 175;
  --accent-fill-rgb: 59, 130, 246;
}

body[data-color-scheme="orange"] {
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-rgb: 194, 65, 12;
  --accent-done: #c2410c;
  --accent-done-dark: #7c2d12;
  --accent-done-rgb: 194, 65, 12;
  --accent-fill-rgb: 249, 115, 22;
}

body[data-color-scheme="red"] {
  --accent: #991b1b;
  --accent-dark: #7f1d1d;
  --accent-rgb: 153, 27, 27;
  --accent-done: #991b1b;
  --accent-done-dark: #7f1d1d;
  --accent-done-rgb: 153, 27, 27;
  --accent-fill-rgb: 239, 68, 68;
}

body[data-skin="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #1f2937;
  --surface-soft: #111827;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --line: #374151;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(var(--accent-rgb), 0.1), transparent 34%),
    linear-gradient(310deg, rgba(244, 184, 96, 0.16), transparent 40%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.top-menu,
.time-filter-bar,
.module-section,
.filters,
.metric-card,
.report-panel,
.dictionary-panel,
.super-admin-panel,
.users-panel,
.list-pane,
.detail-pane {
  border: 1px solid rgba(20, 33, 29, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

body[data-skin="dark"] .topbar,
body[data-skin="dark"] .top-menu,
body[data-skin="dark"] .time-filter-bar,
body[data-skin="dark"] .module-section,
body[data-skin="dark"] .filters,
body[data-skin="dark"] .metric-card,
body[data-skin="dark"] .report-panel,
body[data-skin="dark"] .dictionary-panel,
body[data-skin="dark"] .super-admin-panel,
body[data-skin="dark"] .users-panel,
body[data-skin="dark"] .list-pane,
body[data-skin="dark"] .detail-pane,
body[data-skin="dark"] .work-table-wrapper,
body[data-skin="dark"] .dialog-card,
body[data-skin="dark"] .notes-card,
body[data-skin="dark"] .timeline-card,
body[data-skin="dark"] .confirm-card,
body[data-skin="dark"] .period-card,
body[data-skin="dark"] .dropdown-menu {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(31, 41, 55, 0.94);
}

body[data-skin="dark"] input,
body[data-skin="dark"] select,
body[data-skin="dark"] textarea {
  color: var(--ink);
  background: #0f172a;
  border-color: var(--line);
}

body[data-skin="dark"] label,
body[data-skin="dark"] .field-label,
body[data-skin="dark"] .time-filter-label,
body[data-skin="dark"] .work-table th,
body[data-skin="dark"] .timeline-table th,
body[data-skin="dark"] .dialog-heading h2,
body[data-skin="dark"] .dialog-section h3,
body[data-skin="dark"] .pane-heading h2,
body[data-skin="dark"] .timeline-meta-grid span,
body[data-skin="dark"] .kpi-headline,
body[data-skin="dark"] .report-row strong,
body[data-skin="dark"] .timeline-header-icon,
body[data-skin="dark"] .timeline-icon-button,
body[data-skin="dark"] .icon-button {
  color: #ffffff;
}

body[data-skin="dark"] .work-table th,
body[data-skin="dark"] .timeline-table th {
  background: #111827;
}

body[data-skin="dark"] .timeline-form {
  background: #111827;
}

body[data-skin="dark"] .timeline-header-icon img,
body[data-skin="dark"] .timeline-icon-button img {
  filter: invert(1) brightness(1.15);
}

body[data-skin="dark"] .pdca-letter,
body[data-skin="dark"] .pdca-button {
  color: #e5e7eb;
  border-color: rgba(248, 250, 252, 0.2);
  background: rgba(248, 250, 252, 0.08);
}

body[data-skin="dark"] .pdca-letter.is-done,
body[data-skin="dark"] .pdca-button.is-done {
  color: #ffffff;
}

body[data-skin="dark"] .work-table th,
body[data-skin="dark"] .dialog-grid,
body[data-skin="dark"] .note-form,
body[data-skin="dark"] .user-import-form,
body[data-skin="dark"] .empty-panel,
body[data-skin="dark"] .color-option {
  background: var(--surface-soft);
}

.top-menu,
.time-filter-bar,
.subnav,
.department-filter-tabs,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-menu {
  align-items: center;
  margin-top: 18px;
  padding: 10px;
}

.settings-dropdown {
  margin-left: auto;
}

.super-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.super-admin-panel {
  padding: 16px;
}

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

.company-search-input {
  min-width: 220px;
  max-width: 340px;
  margin-left: auto;
}

.company-card {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.company-card.is-inactive {
  opacity: 0.68;
}

.company-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.company-card-main a,
.onboarding-result a {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.company-card-main small {
  color: var(--muted);
}

.company-manager-list {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.3;
}

.company-manager-label {
  color: var(--muted);
  font-weight: 800;
}

.company-manager-line {
  overflow-wrap: anywhere;
}

.company-manager-line.is-empty {
  color: var(--muted);
  font-style: italic;
}

.company-card-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.super-admin-form,
.onboarding-result {
  display: grid;
  gap: 12px;
}

.super-admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.checkbox-field {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 780;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.onboarding-result {
  margin-top: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(var(--accent-rgb), 0.08);
}

.settings-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  justify-content: center;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
}

.time-filter-bar {
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
  padding: 12px;
}

.time-filter-controls,
.time-filter-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.time-filter-controls {
  flex-wrap: wrap;
  gap: 8px;
}

.company-focus-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.company-focus-field select {
  min-width: 190px;
  max-width: 260px;
  min-height: 34px;
  padding: 6px 28px 6px 10px;
}

.time-filter-stepper {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.055);
}

.time-filter-button,
.time-filter-stepper button {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.08);
  font-weight: 850;
}

.time-filter-button {
  border-radius: 8px;
}

.time-filter-stepper .time-filter-button,
.time-filter-stepper button {
  border-radius: 0;
  background: transparent;
}

.time-filter-button.active {
  color: #fff;
  background: var(--accent);
}

.time-filter-button:hover:not(:disabled),
.time-filter-stepper .time-filter-button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent-dark);
}

.time-filter-stepper button:not(.time-filter-button):hover:not(:disabled) {
  color: #fff;
  background: var(--accent-dark);
}

.toggle-button.active {
  color: #fff;
  background: var(--accent);
}

#myIncompleteToggle:hover:not(:disabled) {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

#myIncompleteToggle.active:hover:not(:disabled) {
  color: #fff;
  background: var(--accent);
}

.time-filter-stepper button:not(.time-filter-button) {
  min-width: 30px;
  padding-inline: 8px;
  color: #5c716b;
  background: rgba(255, 255, 255, 0.42);
}

.time-filter-stepper button + button {
  border-left: 1px solid rgba(var(--accent-rgb), 0.14);
}

.time-filter-label {
  white-space: nowrap;
  color: #30413c;
  font-size: 0.9rem;
}

.department-filter-tabs {
  position: relative;
  margin: 8px 0 14px;
}

.department-filter-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 0.86rem;
  font-weight: 850;
}

.department-filter-button.active {
  color: #fff;
  background: var(--accent);
}

.department-filter-button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent-dark);
}

.teams-category-ribbon {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: -10px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.teams-category-ribbon-break {
  flex: 0 0 100%;
  width: 100%;
  height: 0;
}

.teams-category-ribbon-button {
  min-height: 28px;
  border-radius: 0;
  padding: 5px 12px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0;
}

.teams-category-ribbon-button + .teams-category-ribbon-button {
  border-left: 1px solid rgba(255, 255, 255, 0.32);
}

.teams-category-ribbon-button:hover,
.teams-category-ribbon-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.teams-subcategory-ribbon {
  background: rgba(100, 116, 139, 0.82);
}

.teams-subcategory-ribbon-button {
  font-size: 0.72rem;
}

.menu-dropdown {
  display: inline-flex;
  position: relative;
}

.menu-dropdown > .menu-button {
  width: 100%;
}

.dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(280px, calc(100vw - 48px));
  display: grid;
  gap: 4px;
  border: 1px solid rgba(20, 33, 29, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dropdown-menu button {
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.dictionary-menu-group {
  display: grid;
  gap: 4px;
}

.dictionary-menu-group summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  list-style-position: inside;
}

.dictionary-menu-group summary:hover {
  color: #fff;
  background: var(--accent);
}

.dictionary-menu-group-items {
  display: grid;
  gap: 4px;
  padding-left: 12px;
}

.dropdown-menu button:hover,
.dropdown-menu button.active {
  color: #fff;
  background: var(--accent);
}

.settings-menu {
  right: 0;
  left: auto;
  width: min(320px, calc(100vw - 48px));
  gap: 12px;
  padding: 12px;
}

.settings-section {
  display: grid;
  gap: 8px;
}

.settings-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.settings-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 760;
}

.settings-field select {
  min-height: 38px;
}

.color-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-option {
  min-height: 42px;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 0.86rem;
  font-weight: 820;
}

.color-option:hover:not(:disabled),
.color-option.active {
  color: var(--accent-dark);
  border-color: rgba(var(--accent-rgb), 0.44);
  background: rgba(var(--accent-rgb), 0.1);
}

.color-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(20, 33, 29, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.72);
}

.color-swatch-green {
  background: #0f766e;
}

.color-swatch-blue {
  background: #1e3a8a;
}

.color-swatch-orange {
  background: #c2410c;
}

.color-swatch-red {
  background: #991b1b;
}

.menu-button,
.subnav-button,
.category-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.08);
  font-weight: 800;
}

.menu-button:hover:not(:disabled),
.menu-button.active,
.subnav-button:hover:not(:disabled),
.subnav-button.active,
.category-tab:hover:not(:disabled),
.category-tab.active {
  color: #fff;
  background: var(--accent);
}

.module-section {
  margin-top: 18px;
  padding: 18px;
}

#myBrightBoxModule,
#teamsBrightBoxModule {
  padding-top: 12px;
}

#myBrightBoxModule > .pane-heading,
#teamsBrightBoxModule > .pane-heading {
  padding-top: 12px;
}

#myBrightBoxModule > .pane-heading {
  padding-top: 8px;
}

.home-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(320px, 1.35fr);
  gap: 18px;
  align-items: center;
}

.home-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 840;
  text-transform: uppercase;
}

.subnav {
  align-items: center;
  margin-bottom: 16px;
}

.category-tabs {
  margin: 0 0 22px;
  padding: 10px;
  border: 1px solid rgba(20, 33, 29, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.category-tab {
  position: relative;
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  color: #32443e;
  background: #f2f6f4;
}

.tab-count {
  position: absolute;
  right: -7px;
  bottom: -9px;
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(20, 33, 29, 0.18);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
}

.work-panel {
  overflow: hidden;
}

.work-list {
  display: grid;
  gap: 12px;
  padding: 0;
}

.work-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.work-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.work-table th,
.work-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  text-align: left;
  vertical-align: top;
}

.work-table th {
  color: #263631;
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.work-table tbody tr:nth-child(even) {
  background: rgba(20, 33, 29, 0.025);
}

.work-table tr:last-child td {
  border-bottom: 0;
}

.work-table th:nth-child(1),
.work-table td:nth-child(1) {
  width: 96px;
}

.work-table th:nth-child(2),
.work-table td:nth-child(2) {
  width: 42%;
}

.work-table th:nth-child(3),
.work-table td:nth-child(3) {
  width: 118px;
}

.work-table th:nth-child(4),
.work-table td:nth-child(4),
.work-table th:nth-child(5),
.work-table td:nth-child(5) {
  width: 88px;
}

.work-table th:nth-child(6),
.work-table td:nth-child(6) {
  width: 120px;
}

.work-table th:nth-child(7),
.work-table td:nth-child(7) {
  width: 116px;
}

.classified-table th:nth-child(2),
.classified-table td:nth-child(2) {
  width: 50%;
}

.classified-table th:nth-child(6),
.classified-table td:nth-child(6) {
  width: 128px;
}

.teams-table th:nth-child(2),
.teams-table td:nth-child(2) {
  width: 38%;
}

.teams-table th:nth-child(3),
.teams-table td:nth-child(3) {
  width: 96px;
}

.teams-table th:nth-child(4),
.teams-table td:nth-child(4) {
  width: 148px;
  white-space: nowrap;
}

.teams-table th:nth-child(5),
.teams-table td:nth-child(5) {
  width: 92px;
}

.classified-table th.timeline-table-cell,
.classified-table td.timeline-table-cell {
  width: 28px;
  padding: 3px 8px 1px 0;
  text-align: center;
  vertical-align: top;
  line-height: 0;
}

.classified-table th.timeline-table-cell {
  padding-top: 11px;
  vertical-align: middle;
}

.proposal-title-cell {
  color: var(--ink);
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-table td.number-cell {
  text-align: right;
  padding-right: 28px;
  font-variant-numeric: tabular-nums;
}

.work-table td.number-cell::after {
  content: "";
  display: inline-block;
  width: 10px;
}

.work-table th.number-header {
  text-align: right;
  padding-right: 38px;
}

.work-table th.due-header {
  text-align: left;
  padding-right: 12px;
}

.due-header-label {
  display: inline-block;
  width: 66px;
  text-align: right;
  transform: translateX(2ch);
}

.teams-table .due-header-label {
  transform: translateX(0);
}

.work-table th.pdca-header {
  text-align: left;
  padding-right: 12px;
}

#dialogSavings,
#dialogCost {
  width: 9ch;
  margin-right: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.work-table tbody tr {
  cursor: default;
}

.work-table tbody tr.is-clickable {
  cursor: pointer;
}

.work-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.075);
}

.pdca-indicator,
.pdca-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pdca-letter,
.pdca-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(20, 33, 29, 0.14);
  border-radius: 4px;
  color: #5c6965;
  background: rgba(20, 33, 29, 0.035);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
}

.pdca-letter.is-done,
.pdca-button.is-done {
  border-color: rgba(var(--accent-done-rgb), 0.22);
  color: var(--accent-done);
  background: rgba(var(--accent-fill-rgb), 0.2);
}

.pdca-button {
  cursor: pointer;
}

.timeline-header-icon,
.timeline-icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.timeline-header-icon {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: translateY(-2px);
}

.timeline-icon-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.timeline-icon-button-small {
  width: 14px;
  height: 14px;
  padding: 0;
  font-size: 0.94rem;
  transform: translateY(-4px);
}

.timeline-header-icon img,
.timeline-icon-button img {
  width: 18px;
  height: 18px;
  display: block;
}

.timeline-icon-button-small img {
  width: 13px;
  height: 13px;
}

.timeline-icon-button:hover {
  background: transparent;
  opacity: 0.72;
}

.pdca-button:hover {
  border-color: rgba(var(--accent-done-rgb), 0.38);
  background: rgba(var(--accent-fill-rgb), 0.28);
}

.work-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.work-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.04rem;
}

.work-card-body {
  margin: 0;
  color: #30413c;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-meta-item {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 740;
}

.work-empty {
  min-height: 160px;
  display: grid;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.suggestion-dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  left: 50%;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink);
  background: transparent;
}

.notes-dialog,
.timeline-dialog,
.status-list-dialog,
.confirm-dialog {
  width: min(820px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  left: 50%;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink);
  background: transparent;
}

.confirm-dialog {
  width: min(420px, calc(100% - 28px));
}

.status-list-dialog {
  width: min(1180px, calc(100% - 28px));
}

.timeline-dialog {
  width: min(1280px, calc(100% - 28px));
  min-width: min(760px, calc(100% - 28px));
  min-height: 460px;
  overflow: auto;
  resize: both;
}

.notes-dialog::backdrop,
.timeline-dialog::backdrop,
.status-list-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(20, 33, 29, 0.42);
}

.suggestion-dialog::backdrop {
  background: rgba(20, 33, 29, 0.42);
}

.dialog-card,
.notes-card,
.timeline-card,
.status-list-card,
.confirm-card {
  display: grid;
  gap: 0;
  border: 1px solid rgba(20, 33, 29, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-card {
  gap: 12px;
  padding: 18px;
}

.confirm-card h2,
.confirm-card p {
  margin: 0;
}

.danger-confirm-button {
  border-color: #9f1239;
  color: #fff;
  background: #9f1239;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.dialog-heading {
  border-bottom: 1px solid var(--line);
}

.dialog-heading,
.notes-toolbar {
  cursor: grab;
  user-select: none;
}

.timeline-card {
  min-width: 100%;
  min-height: 100%;
  max-height: none;
  overflow: auto;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.copy-icon-button {
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 1.53rem;
  line-height: 1;
}

.dashboard-copy-button {
  margin-left: auto;
}

.timeline-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.timeline-meta-grid div {
  display: grid;
  gap: 5px;
}

.timeline-meta-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.timeline-meta-grid strong {
  overflow-wrap: anywhere;
}

.timeline-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(190px, 0.9fr) minmax(150px, 0.6fr) minmax(150px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.timeline-form[hidden] {
  display: none;
}

.timeline-form-actions {
  display: flex;
  gap: 8px;
}

.timeline-table-wrap {
  overflow: auto;
  padding: 18px;
}

.timeline-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  table-layout: auto;
}

.timeline-table th,
.timeline-table td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  font-size: 0.82rem;
  text-align: left;
  vertical-align: middle;
}

.timeline-table th {
  color: #263631;
  background: var(--surface-soft);
  font-weight: 850;
}

.timeline-week-row th {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  padding: 6px 0;
  text-align: center;
  font-size: 0.68rem;
}

.timeline-order-cell {
  width: 108px;
  min-width: 108px;
  white-space: nowrap;
}

.timeline-completed-cell {
  width: 64px;
  min-width: 64px;
  text-align: center;
}

.timeline-completed-cell input {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  accent-color: var(--accent);
}

.timeline-order-button {
  width: 23px;
  height: 23px;
  margin-right: 1px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.78rem;
}

.timeline-order-button:last-child {
  margin-right: 0;
}

.timeline-delete-button {
  color: #9f1239;
  border-color: rgba(159, 18, 57, 0.22);
  background: rgba(159, 18, 57, 0.06);
}

.timeline-edit-button {
  color: var(--accent-dark);
  border-color: rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.06);
}

.timeline-week-cell {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  box-sizing: border-box;
  padding: 6px 0 !important;
  text-align: center;
  vertical-align: middle;
  line-height: 0;
}

.timeline-week-square-wrap {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}

.timeline-week-square {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0;
  border: 1px solid rgba(20, 33, 29, 0.12);
  border-radius: 3px;
  background: rgba(20, 33, 29, 0.04);
  vertical-align: middle;
}

.timeline-week-square.is-active {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.58);
}

.timeline-overflow-arrow,
.timeline-overflow-count {
  display: inline-block;
  color: var(--accent-done);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

.timeline-overflow-arrow {
  font-size: 0.9rem;
}

.timeline-overflow-count {
  font-size: 0.76rem;
}

.timeline-end-date {
  display: inline-block;
  min-width: 66px;
  border-radius: 6px;
  padding: 4px 4px;
  font-weight: 400;
  text-align: center;
}

.timeline-date-cell {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.timeline-end-date.is-completed {
  color: #14532d;
  background: rgba(34, 197, 94, 0.22);
}

.timeline-end-date.is-overdue {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.16);
}

.timeline-end-date.is-due-soon {
  color: #854d0e;
  background: rgba(234, 179, 8, 0.24);
}

body[data-skin="dark"] .timeline-end-date.is-completed,
body[data-skin="dark"] .timeline-end-date.is-overdue,
body[data-skin="dark"] .timeline-end-date.is-due-soon {
  color: #ffffff;
}

.timeline-empty {
  color: var(--muted);
  text-align: center;
}

.dialog-heading:active,
.notes-toolbar:active {
  cursor: grabbing;
}

.dialog-heading button,
.notes-toolbar button {
  cursor: pointer;
}

.dialog-heading h2 {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.status-list-body {
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 18px;
}

.dialog-section {
  display: grid;
  gap: 8px;
}

.dialog-section h3 {
  margin: 0;
  font-size: 0.92rem;
}

.dialog-section p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.pdca-row,
.notes-toolbar,
.note-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catch-up-button {
  white-space: nowrap;
}

.dialog-grid,
.dialog-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pdca-field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 800;
  color: #2f3d39;
  font-size: 0.9rem;
}

.notes-toolbar {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.note-add-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.45rem;
  line-height: 1;
}

.notes-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.notes-filters .pdca-button {
  width: auto;
  min-width: 28px;
  padding: 0 8px;
}

.pdca-button.is-filter-active {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

.note-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.note-form[hidden] {
  display: none;
}

.notes-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 16px;
}

.note-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.note-header,
.note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-header {
  justify-content: space-between;
}

.note-actions {
  flex-shrink: 0;
}

.danger-button {
  color: #9f1239;
  border-color: rgba(159, 18, 57, 0.24);
  background: rgba(159, 18, 57, 0.06);
}

.note-meta {
  color: #64736e;
  font-size: 0.78rem;
  font-weight: 800;
}

.note-item p,
.notes-empty {
  margin: 0;
  color: #30413c;
  line-height: 1.5;
  white-space: pre-wrap;
}

.notes-empty {
  padding: 18px;
  text-align: center;
}

.dialog-grid {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 18px;
}

.brand {
  min-width: 0;
  display: grid;
  grid-template-columns: 122px minmax(270px, 1fr);
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  transform: translate(56px, -11px);
  overflow: visible;
}

.brand-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 109px;
  height: 109px;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.brand-logo-hover {
  opacity: 0;
}

.brand-mark:hover .brand-logo-primary {
  animation: logo-hide-for-hover 1s ease both;
}

.brand-mark:hover .brand-logo-hover {
  animation: logo-hover-peek 1s ease both;
}

.brand-title {
  min-width: 0;
  justify-self: center;
  padding: 0;
  transform: translateY(5px);
}

.brand-wordmark {
  display: block;
  width: clamp(270px, 36vw, 420px);
  max-width: 100%;
  height: auto;
}

.brand-logo-dark,
.brand-wordmark-dark {
  display: none;
}

body[data-skin="dark"] .brand-logo-light,
body[data-skin="dark"] .brand-wordmark-light {
  display: none;
}

body[data-skin="dark"] .brand-logo-dark,
body[data-skin="dark"] .brand-wordmark-dark {
  display: block;
}

@keyframes logo-hide-for-hover {
  0%,
  100% {
    opacity: 1;
  }

  8%,
  92% {
    opacity: 0;
  }
}

@keyframes logo-hover-peek {
  0%,
  100% {
    opacity: 0;
  }

  8%,
  92% {
    opacity: 1;
  }
}

.brand p,
.meta,
.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1.18rem;
}

.login-form {
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.login-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.link-button {
  grid-column: 3;
  min-height: 0;
  justify-self: center;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 780;
}

.link-button:hover:not(:disabled) {
  color: var(--accent-dark);
  background: transparent;
}

.current-user-line {
  grid-column: 1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user-line strong {
  color: var(--ink);
  font-weight: 780;
}

.login-context-line {
  grid-column: 2;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.1;
  text-align: left;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(180px, 0.9fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: #263631;
  font-size: 0.86rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fbfcfb;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 9px 15px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.pdca-button {
  min-height: 24px;
  padding: 0;
  text-align: center;
}

.secondary-button {
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.08);
}

.secondary-button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent);
}

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

.status-line {
  min-height: 22px;
  margin: 14px 2px;
}

.status-line.error {
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-tab .reports-grid {
  margin-bottom: 0;
}

.empty-panel {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.empty-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.report-panel {
  min-height: 230px;
  overflow: hidden;
}

.report-panel-wide {
  grid-column: 1 / -1;
}

.kpi-stack {
  display: grid;
  gap: 18px;
}

.kpi-period-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 780;
  white-space: nowrap;
}

.kpi-headline {
  justify-self: center;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 860;
  white-space: nowrap;
}

.kpi-summary-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.kpi-summary-heading .kpi-period-label {
  justify-self: end;
}

.kpi-bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.kpi-month-chart {
  grid-template-columns: repeat(12, minmax(64px, 1fr));
  overflow-x: auto;
}

.kpi-bar-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 150px auto auto;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.kpi-bar-wrap {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.kpi-bar {
  width: min(100%, 54px);
  min-height: 8px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

.kpi-bar-column strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.kpi-bar-column span {
  min-height: 32px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.report-list {
  display: grid;
}

.report-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.report-row span {
  overflow-wrap: anywhere;
}

.report-row strong {
  color: var(--accent-dark);
}

.report-row-action {
  cursor: pointer;
}

.report-row-action:hover,
.report-row-action:focus-visible {
  background: rgba(var(--accent-rgb), 0.08);
  outline: none;
}

.report-row-child span {
  padding-left: 18px;
  color: var(--muted);
}

.report-row-child strong {
  padding-right: 5ch;
}

.report-total-row {
  background: var(--surface-soft);
  font-weight: 780;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(420px, 1.25fr);
  gap: 18px;
}

.users-module {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.dictionary-panel {
  overflow: hidden;
}

.dictionary-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.dict-chip-row {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dictionary-body:has(.department-card) .dict-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.dictionary-body:has(.dictionary-actions) .dict-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.dictionary-body:has(.submit-link-card) .dict-chip-row {
  display: block;
}

.dict-chip,
.dict-empty {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  font-weight: 780;
}

.dict-chip {
  width: 100%;
  box-sizing: border-box;
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.12);
}

.dict-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dict-empty {
  border-radius: 999px;
}

.dict-chip small {
  color: var(--muted);
}

.dict-chip > .secondary-button:first-of-type {
  justify-self: end;
}

.dict-chip > .dictionary-actions {
  grid-column: 1 / -1;
}

.dict-empty {
  color: var(--muted);
  background: var(--surface-soft);
}

.department-card {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.dict-chip.is-inactive,
.department-card.is-inactive {
  opacity: 0.68;
  background: #f1f4f2;
}

.dictionary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}


.department-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.department-card-main strong,
.department-card-main small {
  overflow-wrap: anywhere;
}

.department-card-main small {
  color: var(--muted);
}

.submit-link-card {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.submit-link-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.submit-link-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.submit-link-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.submit-link-actions a[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.dictionary-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.department-settings-form {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.department-settings-form[hidden] {
  display: none;
}

.users-panel {
  overflow: hidden;
}

.user-search-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.user-search-row input {
  width: 100%;
}

.user-list {
  display: grid;
}

.user-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.5fr) minmax(130px, 0.55fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.user-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-main strong,
.user-row span {
  overflow-wrap: anywhere;
}

.user-main small {
  color: var(--muted);
}

.user-role-label,
.user-active-label {
  justify-self: start;
  padding-left: 10px;
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 760;
}

.user-actions,
.user-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-actions {
  justify-content: flex-end;
}

.user-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.user-import-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.compact-heading {
  padding: 0;
  border-bottom: 0;
  box-shadow: none;
  background: transparent;
}

.list-pane,
.detail-pane {
  min-height: 620px;
  overflow: hidden;
}

.pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#countBadge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.12);
  font-size: 0.82rem;
  font-weight: 800;
}

.suggestion-list {
  max-height: 560px;
  overflow: auto;
}

.suggestion-row {
  width: 100%;
  min-height: 92px;
  display: grid;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 18px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.suggestion-row:hover,
.suggestion-row.active {
  background: rgba(var(--accent-rgb), 0.08);
}

.row-title {
  overflow-wrap: anywhere;
  font-weight: 820;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-pane {
  padding: 24px;
}

.empty-state {
  min-height: 560px;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.detail-content {
  display: grid;
  gap: 22px;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#detailTitle {
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 1.7rem;
}

.body-text {
  min-height: 150px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.submitter-grid,
.edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

dl {
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 780;
}

dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.edit-form {
  align-items: end;
  padding-top: 6px;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .topbar,
  .workspace,
  .home-section {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard,
  .reports-grid,
  .super-admin-grid,
  .users-module {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
  }

  .filters,
  .dashboard,
  .reports-grid,
  .super-admin-grid,
  .users-module,
  .dictionary-form,
  .dialog-grid,
  .dialog-controls,
  .user-row,
  .submitter-grid,
  .edit-form,
  .login-form,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .link-button {
    grid-column: 1;
  }

  .detail-heading {
    display: grid;
  }

  .work-card-header {
    display: grid;
  }

  .dialog-heading,
  .dialog-actions,
  .notes-toolbar,
  .note-form-footer,
  .pdca-row {
    display: grid;
  }

  .actions,
  .actions button {
    width: 100%;
  }
}
