@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800;900&display=swap");

:root {
  color-scheme: light;
  --bg: #edf8ff;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --text: #0c1228;
  --muted: #66738f;
  --line: rgba(37, 99, 255, 0.18);
  --line-strong: rgba(39, 92, 255, 0.32);
  --blue: #2458ff;
  --violet: #795cff;
  --cyan: #00bde7;
  --magenta: #b64dff;
  --green: #18a66a;
  --amber: #c9860a;
  --rose: #e54866;
  --shadow: 0 18px 54px rgba(22, 38, 112, 0.14), 0 0 0 1px rgba(0, 189, 231, 0.04);
  --soft-shadow: 0 12px 28px rgba(22, 38, 112, 0.09);
  --chrome: #070b1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(120deg, rgba(7, 11, 28, 0.08), rgba(255, 255, 255, 0) 26%),
    linear-gradient(135deg, rgba(0, 189, 231, 0.16), rgba(255, 255, 255, 0) 32%),
    linear-gradient(225deg, rgba(182, 77, 255, 0.12), rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(135deg, rgba(182, 77, 255, 0.028) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(36, 88, 255, 0.04) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(0, 189, 231, 0.035) 0 1px, transparent 1px 72px),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

.layout,
.page {
  max-width: 100%;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box,
.panel,
.kpi,
.modal,
.table-wrap,
.master-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
}

.login-box::before,
.panel::before,
.kpi::before,
.table-wrap::before,
.master-editor::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet), var(--magenta));
}

.login-box {
  width: min(430px, 100%);
  padding: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--blue);
  white-space: nowrap;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #0cc7ff, #2458ff 48%, #b64dff);
  box-shadow: inset 0 1px 10px rgba(255, 255, 255, 0.34), 0 12px 24px rgba(36, 88, 255, 0.28);
}

.login-box h1 {
  margin: 28px 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

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

.login-box p {
  margin: 0 0 22px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 800;
  color: #344054;
}

.field input,
.field select,
.field textarea,
.select,
.table-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  min-height: 42px;
  color: var(--text);
  outline: none;
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.select:focus {
  border-color: rgba(49, 87, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(49, 87, 255, 0.1);
}

.error {
  color: var(--rose);
  min-height: 20px;
  font-size: 13px;
}

.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 189, 231, 0.24);
  border-radius: 8px;
  color: #0c5d75;
  background: rgba(0, 189, 231, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(37, 99, 255, 0.18);
  border-radius: 8px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 900;
}

.passkey-login {
  width: 100%;
  margin-top: 10px;
}

.login-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.primary,
.secondary,
.ghost,
.danger,
.chip {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 48%, var(--violet));
  box-shadow: 0 12px 28px rgba(36, 88, 255, 0.28), 0 0 18px rgba(0, 189, 231, 0.16);
}

.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: #27324f;
  border-color: var(--line-strong);
}

.ghost {
  background: transparent;
  color: #344054;
}

.danger {
  background: #fff1f5;
  color: var(--rose);
  border-color: rgba(229, 72, 102, 0.28);
}

.chip {
  min-height: 34px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: #4f5a78;
  border-color: var(--line);
}

.chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 8px 20px rgba(36, 88, 255, 0.18);
}

.layout {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 66px;
  background:
    linear-gradient(90deg, rgba(7, 13, 36, 0.94), rgba(17, 27, 64, 0.88)),
    rgba(7, 13, 36, 0.92);
  border-bottom: 1px solid rgba(0, 189, 231, 0.24);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 36px rgba(7, 13, 36, 0.18);
}

.topbar .brand {
  color: #f7fbff;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.nav button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 40px;
  padding: 8px 9px;
  color: #cbd7f7;
  font-size: 14px;
  white-space: nowrap;
}

.nav button.active {
  background: rgba(0, 189, 231, 0.13);
  border-color: rgba(0, 189, 231, 0.28);
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 0 18px rgba(0, 189, 231, 0.12);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d9e4ff;
  white-space: nowrap;
}

.topbar .ghost {
  color: #eef5ff;
}

.mobile-menu-toggle {
  display: none;
}

.user-pill {
  border: 1px solid rgba(0, 189, 231, 0.24);
  border-radius: 8px;
  min-height: 40px;
  padding: 6px 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 0;
  text-align: left;
  line-height: 1.15;
}

.user-pill small {
  color: #9fb4e8;
  font-size: 11px;
  font-weight: 800;
}

.fab-add-project {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 45;
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid rgba(0, 189, 231, 0.34);
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 46%, var(--magenta));
  box-shadow: 0 18px 42px rgba(36, 88, 255, 0.32), 0 0 28px rgba(0, 189, 231, 0.28);
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 11, 28, 0.68);
  backdrop-filter: blur(18px);
}

.mobile-menu-panel {
  width: min(520px, 100%);
  border: 1px solid rgba(0, 189, 231, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 255, 0.9)),
    var(--panel-solid);
  box-shadow: 0 24px 72px rgba(7, 11, 28, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(0, 189, 231, 0.08), rgba(182, 77, 255, 0.08));
}

.mobile-menu-header h2 {
  margin: 0;
  font-size: 22px;
}

.mobile-menu-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.mobile-menu-grid button {
  min-height: 82px;
  border: 1px solid rgba(37, 99, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 6px;
  text-align: left;
  padding: 12px;
}

.mobile-menu-grid button span {
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.mobile-menu-grid button strong {
  font-size: 14px;
}

.mobile-menu-grid button.active {
  color: #fff;
  border-color: rgba(0, 189, 231, 0.35);
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 14px 26px rgba(36, 88, 255, 0.24);
}

.mobile-menu-grid button.active span {
  color: #fff;
}

.mobile-menu-actions {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.page {
  padding: 30px 32px 48px;
}

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

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

.page-kicker {
  margin-top: 6px;
  color: #7884a3;
  font-size: 13px;
  font-weight: 700;
}

.toolbar,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.select {
  width: auto;
  min-width: 118px;
  padding: 8px 34px 8px 12px;
}

.table-select {
  min-width: 140px;
  min-height: 36px;
  padding: 6px 30px 6px 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--cyan));
}

.kpi span {
  color: #5e6b8a;
  font-size: 13px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.18;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.3;
}

.chart {
  width: 100%;
  height: 260px;
  display: block;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  font-size: 12px;
  color: #586682;
  background: rgba(244, 247, 255, 0.78);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(49, 87, 255, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.badge-secure {
  background: rgba(0, 189, 231, 0.12);
  color: #086f87;
}

.badge-muted {
  background: rgba(102, 115, 143, 0.12);
  color: #66738f;
}

.badge-warn {
  background: rgba(201, 134, 10, 0.13);
  color: #8a5a04;
}

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

.profile-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}

.profile-card h2 {
  margin: 0 0 4px;
}

.profile-card p {
  margin: 0 0 10px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--magenta));
  box-shadow: inset 0 1px 16px rgba(255, 255, 255, 0.26), 0 16px 30px rgba(36, 88, 255, 0.18);
}

.profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.profile-grid .wide {
  grid-column: span 2;
}

.profile-actions {
  margin-top: 4px;
}

.passkey-panel {
  grid-column: 2;
}

.passkey-panel p {
  margin: 0 0 14px;
}

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

.auth-status-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 247, 255, 0.72);
}

.auth-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-status-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.staff-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.staff-card {
  border: 1px solid rgba(37, 99, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(242, 248, 255, 0.86)),
    var(--panel-solid);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.staff-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(0, 189, 231, 0.08), rgba(182, 77, 255, 0.08));
}

.staff-card-head h2 {
  margin: 0;
  font-size: 18px;
}

.staff-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.staff-metric {
  border: 1px solid rgba(37, 99, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.staff-metric.accent {
  border-color: rgba(0, 189, 231, 0.26);
  background: rgba(0, 189, 231, 0.06);
}

.staff-metric.wide {
  grid-column: 1 / -1;
}

.staff-metric span {
  display: block;
  color: #5e6b8a;
  font-size: 12px;
  font-weight: 900;
}

.staff-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.2;
}

.staff-metric small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.staff-detail-table {
  margin-top: 16px;
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}

.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tabs .chip {
  flex: 0 0 auto;
}

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

.master-editor {
  padding: 18px;
  position: sticky;
  top: 86px;
}

.master-editor h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-block;
  border: 1px solid rgba(16, 23, 47, 0.12);
  vertical-align: middle;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.switch-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 23, 47, 0.34);
}

.modal {
  width: min(980px, 100%);
  max-height: min(94vh, 920px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.94);
}

.modal-sm {
  width: min(760px, 100%);
}

.modal-sm .modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.modal-sm .modal-body > .error,
.modal-sm .modal-body > .notice,
.modal-sm .modal-body > .inline-actions,
.modal-sm .field.wide {
  grid-column: 1 / -1;
}

.modal-sm .field {
  margin-bottom: 0;
}

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

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.96);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 20px;
}

.modal-note {
  margin: 16px 20px 0;
  padding: 10px 12px;
  border: 1px solid rgba(24, 166, 106, 0.22);
  border-radius: 8px;
  color: #087a4b;
  background: rgba(24, 166, 106, 0.08);
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  padding: 16px 20px 12px;
}

.modal .field {
  margin-bottom: 8px;
}

.form-grid .wide {
  grid-column: span 3;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 20px 14px;
}

.summary-strip div {
  background: rgba(245, 247, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

@media (max-width: 1080px) {
  .kpi-grid,
  .grid-2,
  .settings-layout,
  .profile-layout,
  .staff-card-list,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .master-editor {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(7, 11, 28, 0.14), rgba(255, 255, 255, 0) 220px),
      repeating-linear-gradient(90deg, rgba(0, 189, 231, 0.055) 0 1px, transparent 1px 42px),
      repeating-linear-gradient(0deg, rgba(36, 88, 255, 0.045) 0 1px, transparent 1px 42px),
      var(--bg);
  }

  .topbar {
    align-items: center;
    min-height: auto;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .topbar .brand {
    min-width: 0;
    flex: 1;
  }

  .topbar .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
  }

  .nav {
    display: none;
  }

  .mobile-menu-toggle {
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 189, 231, 0.28);
    border-radius: 8px;
    color: #fff;
    background: rgba(0, 189, 231, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
  }

  .user-area {
    width: auto;
    gap: 6px;
    justify-content: flex-end;
  }

  .user-pill {
    display: none;
  }

  .topbar .ghost {
    display: none;
  }

  .page {
    padding: 18px 12px 92px;
  }

  .fab-add-project {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 58px;
    padding: 0 18px;
    font-size: 15px;
  }

  .mobile-menu-backdrop {
    align-items: end;
    padding: 0;
  }

  .mobile-menu-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 8px 8px 0 0;
  }

  .mobile-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 56dvh;
    overflow: auto;
  }

  .mobile-menu-grid button {
    min-height: 78px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .toolbar,
  .inline-actions {
    width: 100%;
    gap: 8px;
  }

  .toolbar .select,
  .inline-actions > .primary,
  .inline-actions > .secondary,
  .inline-actions > .danger,
  .page-header .primary,
  .page-header .secondary {
    width: 100%;
  }

  .select,
  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .kpi {
    padding: 12px;
  }

  .kpi strong {
    font-size: 19px;
  }

  .panel {
    padding: 14px;
  }

  .chart {
    height: 210px;
  }

  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .table-wrap::before {
    display: none;
  }

  .responsive-table {
    min-width: 0;
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: grid;
    gap: 10px;
  }

  .responsive-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(37, 99, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--soft-shadow);
  }

  .responsive-table.master-table tr,
  .responsive-table.analysis-table tr {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.88)),
      #fff;
    border-color: rgba(0, 189, 231, 0.24);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .responsive-table.master-table td:first-child,
  .responsive-table.analysis-table td:first-child {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    color: var(--blue);
    font-weight: 900;
  }

  .responsive-table .inline-actions {
    justify-content: stretch;
  }

  .responsive-table button,
  .responsive-table .table-select {
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 8px 8px 0 0;
  }

  .modal-sm,
  .modal-sm .modal-body,
  .form-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .modal-sm .modal-body > .error,
  .modal-sm .modal-body > .notice,
  .modal-sm .modal-body > .inline-actions,
  .modal-sm .field.wide,
  .form-grid .wide,
  .profile-grid .wide {
    grid-column: span 1;
  }

  .modal-header,
  .modal-footer,
  .modal-body {
    padding: 14px;
  }

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

  .modal-footer .inline-actions,
  .modal .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .form-grid .wide {
    grid-column: span 1;
  }

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

  .profile-grid .wide {
    grid-column: span 1;
  }

  .passkey-panel {
    grid-column: auto;
  }

  .auth-status-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: 58px 1fr;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 24px;
  }

  .staff-card-list {
    gap: 10px;
  }

  .staff-card-head {
    padding: 12px;
  }

  .staff-card-head h2 {
    font-size: 17px;
  }

  .staff-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .staff-metric {
    padding: 11px;
  }

  .staff-metric.wide {
    grid-column: span 1;
  }

  .staff-metric strong {
    font-size: 21px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .tabs .chip {
    min-height: 44px;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .responsive-table td {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}
