.login-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 28px;
}

.login-shell {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 420px;
  margin: 0 auto;
  max-width: 1120px;
  width: 100%;
}

.login-copy {
  align-self: center;
  max-width: 620px;
}

.login-copy h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  margin: 0 0 18px;
}

.login-copy p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  margin: 0;
}

.login-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 28px;
}

.login-card h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 22px;
}

.login-note {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
  padding: 12px;
}

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

.sidebar {
  background: #111922;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}

.brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius);
  color: #111922;
  display: grid;
  font-weight: 900;
  height: 38px;
  place-items: center;
  width: 38px;
}

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

.brand span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-link {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: auto;
  padding-top: 16px;
}

.user-chip {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.user-chip strong {
  font-size: 14px;
}

.user-chip span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.main-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(244, 246, 243, 0.86);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar-title strong {
  font-size: 16px;
}

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

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

.notification-button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 900;
  min-height: 40px;
  min-width: 44px;
  position: relative;
}

.notification-count {
  background: var(--red);
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  min-width: 18px;
  padding: 2px 5px;
  position: absolute;
  right: -6px;
  top: -6px;
}

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

.page-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-header h1 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 6px;
}

.page-header p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}

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

.placeholder-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 140px;
  padding: 18px;
}

.placeholder-card strong {
  display: block;
  margin-bottom: 8px;
}

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

.dashboard-loading {
  min-height: 220px;
}

.dashboard-counters {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-counter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 96px;
  padding: 16px;
}

.dashboard-counter span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.dashboard-counter strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.dashboard-counter.danger {
  background: #fff4f4;
  border-color: #e9c0c0;
}

.dashboard-counter.warning {
  background: #fff8e9;
  border-color: #ecd8a9;
}

.dashboard-counter.success {
  background: var(--green-soft);
  border-color: rgba(18, 135, 103, 0.22);
}

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

.dashboard-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
}

.dashboard-panel.priority {
  border-color: #e0c0c0;
}

.dashboard-panel-head {
  align-items: flex-start;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 16px;
}

.dashboard-panel-head h2 {
  font-size: 18px;
  margin: 0 0 5px;
}

.dashboard-panel-head p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.dashboard-panel-head > span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
}

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

.work-list .empty-state {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.work-item {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}

.work-item:hover {
  background: #f7faf8;
}

.work-item:last-child {
  border-bottom: 0;
}

.work-item strong,
.work-item small {
  display: block;
}

.work-item strong {
  line-height: 1.35;
  margin-bottom: 4px;
}

.work-item small {
  color: var(--muted);
  line-height: 1.35;
}

.work-item b {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.danger-text {
  color: var(--red) !important;
}

.dashboard-analytics {
  grid-column: 1 / -1;
}

.analytics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
}

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

.analytics-focus-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analytics-focus-card {
  padding: 16px;
}

.analytics-focus-card span,
.analytics-focus-card p {
  color: var(--muted);
  display: block;
  font-weight: 800;
  margin: 0;
}

.analytics-focus-card span {
  font-size: 12px;
  text-transform: uppercase;
}

.analytics-focus-card strong {
  display: block;
  font-size: 30px;
  margin: 8px 0 6px;
}

.metric-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.metric-row {
  display: grid;
  gap: 7px;
}

.metric-row-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.metric-row-head strong {
  line-height: 1.35;
}

.metric-row-head span {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.metric-bar {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.metric-bar span {
  background: var(--green);
  display: block;
  height: 100%;
}

.materials-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 420px minmax(0, 1fr);
}

.materials-list-panel,
.material-detail {
  padding: 16px;
}

.materials-list {
  display: grid;
  gap: 8px;
}

.material-list-item {
  align-items: flex-start;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.material-list-item:hover,
.material-list-item.active {
  background: var(--green-soft);
  border-color: rgba(18, 135, 103, 0.28);
}

.material-list-item strong,
.material-list-item small {
  display: block;
}

.material-list-item small {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}

.material-list-item b {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.material-body {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 18px;
  line-height: 1.65;
  min-height: 220px;
  padding: 16px;
  white-space: pre-wrap;
}

.material-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
}

.team-workload-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.team-workload-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.team-workload-card.danger {
  background: #fff8f8;
  border-color: #e9c0c0;
}

.team-workload-card strong,
.team-workload-card span,
.team-workload-card small {
  display: block;
}

.team-workload-card span,
.team-workload-card small {
  color: var(--muted);
  line-height: 1.4;
}

.team-workload-metrics {
  display: grid;
  gap: 4px 8px;
  grid-template-columns: repeat(4, auto);
}

.team-workload-metrics b {
  font-size: 20px;
  line-height: 1;
}

.team-workload-metrics span {
  font-size: 12px;
}

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

.audit-json {
  background: #111922;
  border-radius: var(--radius);
  color: #ffffff;
  line-height: 1.55;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.settings-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.settings-meta-card {
  padding: 16px;
}

.settings-meta-card h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.settings-dictionaries {
  display: grid;
  gap: 16px;
}

.settings-dictionary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.settings-dictionary .table-panel {
  box-shadow: none;
}

.detail-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.detail-card,
.detail-section {
  padding: 16px;
}

.detail-card-head,
.detail-section-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-card-head h2,
.detail-section-head h2 {
  font-size: 20px;
  margin: 0;
}

.detail-section-head span {
  color: var(--muted);
  font-weight: 900;
}

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

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

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

.info-item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.info-item span,
.pain-box span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.info-item strong {
  display: block;
  line-height: 1.35;
}

.pain-box {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.pain-box p {
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

.detail-list,
.timeline-list {
  display: grid;
  gap: 10px;
}

.detail-list-row,
.timeline-row {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.detail-list-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.detail-list-row strong,
.detail-list-row small,
.timeline-row strong,
.timeline-row small {
  display: block;
}

.detail-list-row small,
.timeline-row small {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 4px;
}

.timeline-row p {
  color: var(--text);
  line-height: 1.55;
  margin: 6px 0;
}

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

.finance-stack h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.finance-toolbar {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px;
}

.tab-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 800;
  min-height: 38px;
  padding: 8px 12px;
}

.tab-button.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.checklist-stack {
  display: grid;
  gap: 10px;
}

.checklist-item {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px) auto;
  padding: 12px;
}

.checklist-item.done {
  background: var(--green-soft);
  border-color: rgba(18, 135, 103, 0.2);
}

.checklist-item label {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.checklist-item input[type="checkbox"] {
  accent-color: var(--green);
  height: 18px;
  margin-top: 2px;
  width: 18px;
}

.checklist-item strong,
.checklist-item small {
  display: block;
}

.checklist-item small {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}

.checklist-item > input {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-height: 38px;
  padding: 8px 10px;
}

.full-width {
  width: 100%;
}

.diagnostics-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

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

.diagnostics-section {
  display: grid;
  gap: 10px;
}

.diagnostics-section h3 {
  font-size: 16px;
  margin: 0;
}

.section-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.money-preview {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 30px;
  font-weight: 900;
  padding: 16px;
}

.info-grid.single {
  grid-template-columns: 1fr;
}

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

  .sidebar {
    min-height: auto;
  }

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

  .dashboard-counters,
  .dashboard-grid,
  .analytics-grid,
  .materials-layout,
  .team-workload-grid,
  .detail-layout,
  .diagnostics-layout,
  .info-grid,
  .checklist-item {
    grid-template-columns: 1fr;
  }

  .analytics-counters,
  .analytics-focus-grid {
    grid-template-columns: 1fr;
  }

  .settings-meta-grid {
    grid-template-columns: 1fr;
  }

  .audit-detail-grid {
    grid-template-columns: 1fr;
  }

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