:root {
  --brand-dark: #121417;
  --brand-accent: #d4af37;
  --bg-soft: #f8f9fa;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --line: rgba(0, 0, 0, 0.08);
  --text: #121417;
  --muted: #707885;
  --ok: #93c5fd;
  --warn: #f59e0b;
  --paused: #a3a3a3;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  letter-spacing: 0;
}

.brand-serif {
  font-family: "Cormorant Garamond", serif;
}

.kicker {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  margin: 8px 0 16px;
}

.muted-side {
  color: rgba(255, 255, 255, 0.4);
}

.sub {
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 15% 10%, #fff0d6 0, transparent 45%),
    linear-gradient(130deg, #f9fafb 0%, #edf2f7 100%);
}

.login-card {
  width: min(100%, 460px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(18, 20, 23, 0.08);
  padding: 28px;
  animation: fade-up 0.45s ease-out;
}

.login-card h1 {
  margin: 8px 0 6px;
  font-size: 44px;
  line-height: 0.9;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 40px;
}

.check-inline input {
  width: auto;
  margin: 0;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2f3440;
  box-shadow: 0 0 0 3px rgba(18, 20, 23, 0.08);
}

.btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.22s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-ghost {
  background: #fff;
  color: #202734;
}

.btn-ghost:hover {
  background: #f5f7fa;
}

.btn-danger {
  border-color: #761814;
  background: #9f201a;
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 260px;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 40px;
  line-height: 0.9;
}

.sidebar-header p {
  margin-top: 8px;
}

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

.tab-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

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

.sidebar-user {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.main-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  height: 80px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.inline-metrics {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: #808893;
}

.inline-metrics strong {
  color: #161c26;
}

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

.clock {
  min-width: 90px;
  text-align: right;
  font-size: 13px;
  color: #707885;
  font-variant-numeric: tabular-nums;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 26px 30px 34px;
  background: linear-gradient(180deg, #fafafa 0%, #f7f8fb 100%);
}

.tab-panel {
  animation: fade-up 0.25s ease-out;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--card-shadow);
  border-radius: 12px;
  padding: 14px 14px 13px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(18, 20, 23, 0.18);
}

.stat-card-feature {
  min-height: 132px;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.22), transparent 45%),
    linear-gradient(135deg, #121417 0%, #252a32 100%);
}

.stat-card-feature::before {
  width: 4px;
  background: var(--brand-accent);
}

.stat-card-running {
  background:
    linear-gradient(135deg, rgba(147, 197, 253, 0.18), transparent 48%),
    linear-gradient(135deg, #182333 0%, #26364a 100%);
}

.stat-card-rate {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.20), transparent 48%),
    linear-gradient(135deg, #111827 0%, #273449 100%);
}

.stat-card-paused::before {
  background: var(--warn);
}

.stat-card-idle::before {
  background: #94a3b8;
}

.stat-card h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa1ac;
}

.stat-card-feature h4 {
  color: rgba(255, 255, 255, 0.68);
}

.stat-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.stat-card-feature .stat-value {
  font-size: 52px;
  font-weight: 300;
}

.stat-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.section-head {
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 30px;
}

.inline-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-table-wrap {
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-table-wrap .grid-table {
  border: 0;
}

.new-table,
.filter-row {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.new-table h3 {
  margin-bottom: 10px;
  font-size: 28px;
}

.row-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.chart-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 14px;
}

.chart-panel-wide {
  grid-column: span 1;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

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

.area-form {
  margin-bottom: 12px;
}

.area-group {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.area-group:last-child {
  border-bottom: 0;
}

.area-group-title {
  margin: 8px 0 12px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-group-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-accent), rgba(212, 175, 55, 0.35));
}

.area-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.area-list .card {
  margin-bottom: 0;
}

.table-grid {
  display: block;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  position: relative;
  max-width: 520px;
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 18px;
  z-index: 1;
}

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

.modal-body {
  display: grid;
  gap: 14px;
}
.modal-card-danger {
  max-width: 640px;
}

.delete-modal-copy {
  display: grid;
  gap: 8px;
}

.delete-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.delete-choice-list {
  display: grid;
  gap: 12px;
}

.delete-choice-btn {
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  border-radius: 14px;
}

.delete-choice-btn strong {
  font-size: 14px;
}

.delete-choice-btn span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.delete-choice-btn.btn-danger span {
  color: rgba(255, 255, 255, 0.86);
}

.delete-no-history-box {
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fafafa;
}

.delete-modal-actions {
  gap: 10px;
}

.transfer-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.transfer-summary span {
  color: #7a828f;
  font-size: 11px;
  font-weight: 800;
}

.transfer-summary strong {
  color: #202734;
  font-size: 15px;
}

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


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

.start-time-field {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(248, 250, 252, 0.9));
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.start-time-hint {
  margin: 0;
}

/* 桌台详情弹窗 */
.modal-card-detail {
  max-width: 560px;
}

.detail-head-text {
  display: grid;
  gap: 2px;
}

.detail-head-text h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

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

.detail-timer-block {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(18, 20, 23, 0.04), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #fafbfd 0%, #f4f6f9 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.detail-timer-block.running {
  background:
    linear-gradient(135deg, rgba(147, 197, 253, 0.10), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  border-color: rgba(147, 197, 253, 0.18);
}

.detail-timer-block.paused {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #fffdf9 0%, #fdf6ea 100%);
  border-color: rgba(245, 158, 11, 0.22);
}

.detail-timer-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8b93a0;
}

.detail-timer {
  font-size: 46px;
  line-height: 0.95;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.detail-timer.warn {
  color: #c07a03;
}

.detail-timer.critical {
  color: #b91c1c;
}

.detail-timer.paused {
  color: #9aa1ab;
}

.detail-timer.forward {
  color: #2563eb;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.detail-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
}

.detail-info-row span {
  color: #8b93a0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.detail-info-row strong {
  color: #202734;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5b6472;
  margin-top: -2px;
}

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

.detail-actions .btn {
  letter-spacing: 0.04em;
  padding: 11px 8px;
  text-transform: none;
  font-size: 12px;
}

@media (max-width: 560px) {
  .detail-info-grid {
    grid-template-columns: 1fr;
  }
  .detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--card-shadow);
  padding: 14px 14px 13px;
  display: grid;
  gap: 8px;
  transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.35s ease, border-color 0.3s ease;
}

/* 卡片现在是 role="button" 的可点击区域。 */
.card-button {
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

/* 顶部状态色细条，营造层次。 */
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(18, 20, 23, 0.28), rgba(18, 20, 23, 0.04));
  opacity: 0.9;
}

.card.running {
  background:
    linear-gradient(180deg, rgba(147, 197, 253, 0.08) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: rgba(147, 197, 253, 0.20);
}

.card.running::after {
  background: linear-gradient(90deg, var(--ok), rgba(147, 197, 253, 0.16));
}

.card.paused {
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
  border-color: rgba(245, 158, 11, 0.24);
}

.card.paused::after {
  background: linear-gradient(90deg, var(--warn), rgba(245, 158, 11, 0.15));
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(18, 20, 23, 0.10);
}

.card:focus-visible {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(18, 20, 23, 0.10), var(--card-shadow);
}

.card.idle {
  border-style: dashed;
  border-color: rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, #fdfdfe 0%, #f7f8fb 100%);
}

.card.idle::after {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.5), rgba(148, 163, 184, 0.08));
}

.table-grid-hint {
  margin: 0 0 12px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.table-meta {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9da4af;
}

.card-name {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.dot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.dot-running {
  background: var(--ok);
}

.dot-paused {
  background: var(--warn);
}

.dot-idle {
  background: #d1d5db;
}

.timer-display {
  font-size: 34px;
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.timer-display.warn {
  color: #c07a03;
}

.timer-display.critical {
  color: #b91c1c;
  animation: timer-alert-pulse 1.2s ease-in-out infinite;
}

.timer-display.paused {
  color: #9aa1ab;
}

.compact-card-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.compact-status {
  max-width: 45%;
  text-align: right;
  line-height: 1.35;
}

.timer-display.forward {
  color: #2563eb;
}

.timer-alert {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  width: fit-content;
}

.timer-alert.warn {
  color: #9a6700;
  background: #fef3c7;
}

.timer-alert.critical {
  color: #991b1b;
  background: #fee2e2;
}

.progress-container {
  height: 2px;
  width: 100%;
  overflow: hidden;
  background: #eceff3;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--brand-dark);
  transition: width 0.45s ease;
}

.progress-bar.warn {
  background: var(--warn);
}

.progress-bar.critical {
  background: var(--danger);
}

.progress-bar.paused {
  background: #c6cbd3;
}

.progress-bar.forward {
  width: 100% !important;
  background: linear-gradient(90deg, #bfdbfe, #93c5fd);
}

.table-note {
  min-height: 16px;
  white-space: normal;
}

.table-note-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  line-height: 1.45;
}

.table-note-strip span {
  color: #7a828f;
  font-size: 11px;
  font-weight: 800;
}

.table-note-strip strong {
  min-width: 0;
  color: #202734;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table-note-strip.empty strong {
  color: #9aa1ac;
  font-weight: 500;
}

.table-actions-toggle {
  width: 100%;
  padding: 8px 10px;
}

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

.compact-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.actions-collapsed {
  display: none;
}

.actions .btn {
  letter-spacing: 0.04em;
  padding: 9px 8px;
  text-transform: none;
  font-size: 11px;
}

.timer-mode-block {
  display: grid;
  gap: 10px;
}

.timer-mode-title {
  margin: 0;
  color: #5b6472;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timer-mode-divider {
  border-top: 1px dashed rgba(0, 0, 0, 0.18);
}

.table-wrap {
  overflow: auto;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  overflow: hidden;
}

.grid-table th,
.grid-table td {
  font-size: 12px;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #eef1f5;
}

.grid-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7a828f;
  background: #f6f8fb;
}

.grid-table tr:nth-child(even) td {
  background: #fcfdff;
}

.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(18, 20, 23, 0.95);
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timer-alert-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.58;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 1120px) {
  .sidebar {
    width: 220px;
  }
  .content {
    padding: 20px;
  }
  .dashboard-hero {
    grid-template-columns: 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
  .chart-panel-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    padding: 16px;
    gap: 10px;
  }

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

  .sidebar-footer {
    margin-top: 6px;
  }

  .main-shell {
    height: auto;
    min-height: calc(100vh - 250px);
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

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

  .chart-panel-wide {
    grid-column: auto;
  }

  .chart-panel canvas {
    height: 220px;
  }
}


.user-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.user-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


.super-panel {
  display: grid;
  gap: 14px;
}

.super-panel-head {
  align-items: flex-start;
  margin-bottom: 8px;
}

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

.super-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.super-badge-soft {
  background: #eef2f7;
  color: #334155;
}

.super-hint-card {
  display: grid;
  gap: 6px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafc;
  color: #334155;
  font-size: 13px;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.user-status-pill.enabled {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.user-status-pill.disabled {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

.audit-action-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.audit-detail-cell {
  max-width: 280px;
  white-space: normal;
  line-height: 1.55;
}

.password-reset-hint {
  margin-top: 0;
}

.password-reset-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.password-reset-tip {
  margin: 0;
}
