:root {
  --navy: #0b1f3a;
  --navy-2: #123457;
  --navy-3: #0a3971;
  --red: #c92535;
  --red-soft: #fde8eb;
  --ink: #16202f;
  --muted: #637083;
  --line: #d8dee8;
  --panel: #ffffff;
  --surface: #f3f6fa;
  --surface-2: #e9eef5;
  --row: #f3f6fa;
  --field: #ffffff;
  --button-bg: #ffffff;
  --button-text: #16202f;
  --topbar-bg: rgba(243, 246, 250, 0.92);
  --grid-line: rgba(11, 31, 58, 0.08);
  --hero-grid: rgba(255, 255, 255, 0.08);
  --code-bg: #0f223b;
  --green: #0f8f66;
  --yellow: #a96d00;
  --blue: #1f5ea8;
  --shadow: 0 18px 45px rgba(16, 31, 54, 0.12);
  --radius: 8px;
  --page-pad: 24px;
  --gap: 16px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --navy: #071427;
  --navy-2: #1b4f83;
  --navy-3: #2c72b4;
  --red: #f05261;
  --red-soft: rgba(240, 82, 97, 0.16);
  --ink: #edf4ff;
  --muted: #9fb0c7;
  --line: rgba(164, 184, 214, 0.22);
  --panel: #101b2c;
  --surface: #07111f;
  --surface-2: #0c1828;
  --row: #142237;
  --field: #0b1626;
  --button-bg: #12233a;
  --button-text: #edf4ff;
  --topbar-bg: rgba(7, 17, 31, 0.9);
  --grid-line: rgba(145, 169, 204, 0.12);
  --hero-grid: rgba(255, 255, 255, 0.1);
  --green: #42d99a;
  --yellow: #f2bd58;
  --blue: #75aff2;
  --code-bg: #07111f;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(226, 234, 244, 0.95)),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  color: var(--ink);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(31, 94, 168, 0.28), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(240, 82, 97, 0.16), transparent 32%),
    linear-gradient(135deg, #050c17, #07111f 52%, #0e1d31),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, auto, 42px 42px, 42px 42px;
}

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

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 520px);
  gap: clamp(24px, 6vw, 96px);
  align-items: center;
  padding: clamp(24px, 6vw, 72px);
  background:
    linear-gradient(125deg, rgba(8, 26, 49, 0.96) 0%, rgba(10, 57, 113, 0.92) 58%, rgba(201, 37, 53, 0.86) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
  color: #fff;
}

.login-screen.hidden {
  display: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 620px;
}

.login-brand img {
  width: clamp(92px, 14vw, 164px);
  height: clamp(92px, 14vw, 164px);
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.login-brand strong {
  display: block;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 0.95;
  max-width: 720px;
}

.login-brand span {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.12rem;
}

.login-card {
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .login-card {
  background: rgba(16, 27, 44, 0.96);
  color: var(--ink);
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.login-card p {
  color: var(--muted);
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-field button,
.link-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--button-bg);
  color: var(--button-text);
  padding: 0 12px;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.check-row {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.check-row input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.link-button {
  min-height: 34px;
  color: var(--navy-2);
}

.login-submit {
  min-height: 46px;
}

.login-hint {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--row);
  color: var(--muted);
}

.login-hint strong {
  color: var(--ink);
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

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

.app-shell.locked {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, #081a31 0%, #0d2441 62%, #132f52 100%);
  color: #f8fbff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand,
.profile-chip,
.sidebar-status,
.topbar,
.panel-heading,
.page-heading,
.row-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-height: 48px;
}

.brand-mark,
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-mark {
  background: #fff;
  overflow: hidden;
  padding: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28), inset 0 -3px 0 var(--red);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand span,
.sidebar-status span,
.profile-chip span,
.compact-list span,
.task-row span,
.task-card span,
.calendar-card span {
  display: block;
  color: inherit;
  opacity: 0.72;
  font-size: 0.86rem;
}

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

.nav-item {
  border: 0;
  background: transparent;
  color: #dbe7f6;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--red);
}

.sidebar-status {
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #35d188;
  box-shadow: 0 0 0 6px rgba(53, 209, 136, 0.15);
}

.main {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
    transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  gap: var(--gap);
  min-height: 76px;
  padding: 14px var(--page-pad);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  min-width: 260px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 12px 0;
  background: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.profile-chip {
  gap: 10px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px 6px 6px;
  min-height: 42px;
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--navy);
  color: #fff;
  font-size: 0.84rem;
}

.icon-button,
.quiet-button,
.primary-button,
.theme-toggle,
.danger-link,
.row-actions button,
.exam-card button,
.category-panel button {
  border-radius: var(--radius);
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--button-text);
  padding: 0 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.theme-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--navy) 0 50%, #f8fbff 50% 100%);
  box-shadow: inset 0 0 0 2px rgba(99, 112, 131, 0.28);
}

[data-theme="dark"] .theme-icon {
  background:
    radial-gradient(circle at 62% 38%, #f8fbff 0 22%, transparent 24%),
    linear-gradient(135deg, #244e7f, #081524);
}

.icon-button {
  width: 40px;
  padding: 0;
}

.quiet-button {
  color: var(--navy-2);
}

.primary-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.danger-link {
  color: var(--red);
  border-color: transparent;
  background: transparent;
}

.view {
  display: none;
  padding: var(--page-pad);
}

.view.active {
  display: block;
}

.hero-panel {
  min-height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  background:
    linear-gradient(125deg, rgba(8, 26, 49, 0.98) 0%, rgba(10, 57, 113, 0.95) 50%, rgba(201, 37, 53, 0.86) 100%),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px),
    linear-gradient(0deg, var(--hero-grid) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 17, 33, 0.72), rgba(5, 17, 33, 0.24), rgba(255, 255, 255, 0.06)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
}

.hero-brand-lockup {
  position: absolute;
  right: clamp(18px, 5vw, 64px);
  top: 50%;
  z-index: 1;
  width: min(34vw, 260px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.2);
}

.hero-brand-lockup img {
  width: 74%;
  height: 74%;
  object-fit: contain;
}

.hero-brand-lockup span {
  position: absolute;
  bottom: 20px;
  right: 26px;
  color: rgba(11, 31, 58, 0.1);
  font-size: 3rem;
  font-weight: 900;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  max-width: 580px;
  padding: 38px;
  color: #fff;
}

.hero-overlay h1,
.page-heading h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1;
}

.hero-overlay p {
  max-width: 480px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.eyebrow {
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.74rem;
}

.metric-grid,
.content-grid,
.calendar-grid,
.kanban,
.admin-grid {
  display: grid;
  gap: var(--gap);
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--gap);
}

.metric-card,
.panel,
.calendar-card,
.kanban section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(23, 43, 77, 0.06);
}

[data-theme="dark"] .metric-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .calendar-card,
[data-theme="dark"] .kanban section {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.metric-card {
  padding: 18px;
  border-top: 4px solid var(--navy-2);
  min-height: 116px;
}

.metric-card.warn {
  border-top-color: var(--yellow);
}

.metric-card.accent {
  border-top-color: var(--red);
}

.metric-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 2rem;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  margin-bottom: var(--gap);
}

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

.login-log-panel {
  margin-top: var(--gap);
}

#loginLogRows .success {
  color: var(--green);
  font-weight: 800;
}

#loginLogRows .failed {
  color: var(--red);
  font-weight: 800;
}

.panel,
.kanban section {
  padding: 18px;
}

.panel {
  min-width: 0;
}

.large-panel {
  min-width: 0;
}

.panel-heading,
.page-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-heading {
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin-top: 0;
}

h2 {
  font-size: 1.08rem;
  margin-bottom: 14px;
}

.task-stack,
.compact-list,
.idea-list,
.timeline,
.detail-list,
.security-list {
  display: grid;
  gap: 10px;
}

.task-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--row);
  border-left: 4px solid var(--blue);
  min-height: 62px;
}

.task-row.critical {
  border-left-color: var(--red);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.red {
  color: #9c1422;
  background: var(--red-soft);
}

[data-theme="dark"] .pill.red {
  color: #ffb8c0;
}

.pill.yellow {
  color: #7b4f00;
  background: #fff2cc;
}

[data-theme="dark"] .pill.yellow {
  color: #ffd889;
  background: rgba(242, 189, 88, 0.16);
}

.pill.blue {
  color: #164c87;
  background: #e4effc;
}

[data-theme="dark"] .pill.blue {
  color: #b9d9ff;
  background: rgba(117, 175, 242, 0.16);
}

.pill.green {
  color: #0b6f4e;
  background: #dff7ee;
}

[data-theme="dark"] .pill.green {
  color: #b7f6d8;
  background: rgba(66, 217, 154, 0.15);
}

.pill.gray {
  color: #465160;
  background: #e9eef5;
}

[data-theme="dark"] .pill.gray {
  color: #d0d9e6;
  background: rgba(159, 176, 199, 0.16);
}

.pill.purple {
  color: #6540a7;
  background: #eee7ff;
}

[data-theme="dark"] .pill.purple {
  color: #d9c7ff;
  background: rgba(146, 111, 216, 0.18);
}

.security-list,
.detail-list {
  margin: 0;
}

.security-list div,
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.compact-list li,
.idea-list article,
.timeline article {
  padding: 12px;
  background: var(--row);
  border-radius: var(--radius);
}

[data-view-jump],
[data-action],
[data-regulation],
[data-admin-panel],
.profile-chip,
tbody tr,
.calendar-card,
.task-card,
.metric-card,
.status-chart span,
.command-grid code,
.admin-grid .panel,
.exam-card {
  cursor: pointer;
}

[data-view-jump],
[data-action],
[data-regulation],
[data-admin-panel],
tbody tr,
.calendar-card,
.task-card,
.metric-card,
.status-chart span,
.command-grid code,
.admin-grid .panel,
.exam-card,
.profile-chip {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

[data-view-jump]:hover,
[data-action]:hover,
[data-regulation]:hover,
[data-admin-panel]:hover,
tbody tr:hover,
.calendar-card:hover,
.task-card:hover,
.metric-card:hover,
.status-chart span:hover,
.command-grid code:hover,
.admin-grid .panel:hover,
.exam-card:hover,
.profile-chip:hover {
  border-color: rgba(80, 143, 214, 0.62);
  box-shadow: 0 14px 34px rgba(17, 49, 92, 0.16);
  transform: translateY(-1px);
}

[data-theme="dark"] [data-view-jump]:hover,
[data-theme="dark"] [data-action]:hover,
[data-theme="dark"] [data-regulation]:hover,
[data-theme="dark"] [data-admin-panel]:hover,
[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] .calendar-card:hover,
[data-theme="dark"] .task-card:hover,
[data-theme="dark"] .metric-card:hover,
[data-theme="dark"] .status-chart span:hover,
[data-theme="dark"] .command-grid code:hover,
[data-theme="dark"] .admin-grid .panel:hover,
[data-theme="dark"] .exam-card:hover,
[data-theme="dark"] .profile-chip:hover {
  border-color: rgba(117, 175, 242, 0.62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

[data-view-jump]:focus-visible,
[data-action]:focus-visible,
[data-regulation]:focus-visible,
[data-admin-panel]:focus-visible,
tbody tr:focus-visible,
.calendar-card:focus-visible,
.task-card:focus-visible,
.metric-card:focus-visible,
.status-chart span:focus-visible,
.command-grid code:focus-visible,
.admin-grid .panel:focus-visible,
.exam-card:focus-visible,
.profile-chip:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(80, 143, 214, 0.42);
  outline-offset: 3px;
}

.status-chart {
  display: grid;
  gap: 10px;
}

.status-chart span {
  display: block;
  padding: 9px 10px;
  width: var(--value);
  min-width: 96px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--navy-2), #2f7d9d);
  color: #fff;
  font-weight: 700;
}

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

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

tbody tr {
  border-radius: var(--radius);
}

th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed #9eacbd;
  border-radius: var(--radius);
  background: var(--field);
}

.upload-box label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

#fileList {
  padding-left: 18px;
  color: var(--muted);
}

.form-panel {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--field);
  color: var(--ink);
}

.timeline article {
  display: grid;
  gap: 6px;
}

.timeline time {
  color: var(--blue);
  font-weight: 800;
  font-size: 0.84rem;
}

.row-actions {
  gap: 8px;
  margin-top: 4px;
}

.calendar-grid {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.calendar-card {
  padding: 16px;
  min-height: 138px;
  border-top: 4px solid var(--green);
}

.calendar-card.red {
  border-top-color: var(--red);
}

.calendar-card.blue {
  border-top-color: var(--blue);
}

.calendar-card.gray {
  border-top-color: #6b7584;
}

.kanban {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.kanban section {
  min-height: 260px;
}

.task-card {
  padding: 13px;
  border-radius: var(--radius);
  background: var(--row);
  border-left: 4px solid var(--blue);
  margin-bottom: 10px;
  min-height: 68px;
}

.task-card.done {
  border-left-color: var(--green);
}

.task-card.danger {
  border-left-color: var(--red);
}

.exam-card p,
.admin-grid p,
.document-panel p,
.idea-list p {
  color: var(--muted);
}

.regulation-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.category-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.category-panel button {
  text-align: left;
}

.category-panel .selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

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

code {
  display: block;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: #f7fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 10, 19, 0.66);
  backdrop-filter: blur(10px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  width: min(960px, 100%);
  max-height: min(780px, calc(100vh - 44px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-body {
  overflow: auto;
  padding: 20px;
}

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

.admin-detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--row);
}

.admin-detail-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--field);
  border: 1px solid var(--line);
}

.admin-list small {
  color: var(--muted);
}

.admin-form {
  display: grid;
  gap: 12px;
}

#menuToggle {
  display: none;
}

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

  .sidebar {
    padding: 18px 12px;
  }

  .brand div:not(.brand-mark),
  .nav-item span,
  .sidebar-status div {
    display: none;
  }

  .nav-item {
    text-align: center;
    min-height: 44px;
  }

  .metric-grid,
  .content-grid.three,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .regulation-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .password-field {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  .brand div:not(.brand-mark),
  .nav-item span,
  .sidebar-status div {
    display: block;
  }

  .nav-item {
    text-align: left;
  }

  #menuToggle {
    display: inline-grid;
  }

  .topbar {
    padding: 12px;
    flex-wrap: wrap;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .profile-chip div,
  .danger-link {
    display: none;
  }

  .theme-text,
  .quiet-button {
    display: none;
  }

  .view {
    padding: 16px;
  }

  .hero-panel {
    min-height: 360px;
  }

  .hero-overlay {
    padding: 24px;
    max-width: 100%;
  }

  .hero-brand-lockup {
    width: 156px;
    right: 18px;
    top: auto;
    bottom: 20px;
    transform: none;
    opacity: 0.9;
  }

  .metric-grid,
  .content-grid,
  .content-grid.three,
  .calendar-grid,
  .kanban,
  .admin-grid,
  .admin-detail-grid,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
