/* Shared visual tokens match unwater-app-python/admin_base.html. */
:root {
  --primary: #0f172a;
  --secondary: #334155;
  --accent: #2563eb;
  --background: #f1f5f9;
  --surface: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #047857;
  --success-soft: #ecfdf5;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --sidebar-width: 224px;
  --radius: 12px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-family:
    'Plus Jakarta Sans',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}
h2 {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px #dbeafe;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.numeric {
  text-align: right;
}
.block {
  display: block;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 100;
  padding: 12px;
  background: white;
}
.skip-link:focus {
  top: 8px;
}
.layout {
  display: flex;
  height: 100dvh;
  min-height: 0;
}
.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  color: #cbd5e1;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  transition:
    width 0.2s ease,
    transform 0.2s ease;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 20px 16px 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-decoration: none !important;
  border-radius: 8px;
}
.brand-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 16px;
}
.brand-text {
  min-width: 0;
  white-space: nowrap;
}
.brand-sub {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 1.4px;
}
.brand-sub i {
  width: 16px;
  height: 1px;
  background: #475569;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 12px 12px;
}
.nav-item {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none !important;
  white-space: nowrap;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-item svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}
.nav-item:hover {
  background: #1e293b80;
}
.nav-item.selected {
  color: white;
  background: #1e293b;
  box-shadow: inset 0 0 0 1px #334155;
}
.nav-item.selected svg {
  color: #93c5fd;
}
.sidebar.collapsed {
  --sidebar-width: 72px;
}
.sidebar.collapsed .brand {
  margin-right: auto;
  margin-left: auto;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-label {
  display: none;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-right: 8px;
  padding-left: 8px;
}
.workspace {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #334155;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.icon-button:hover {
  background: #f8fafc;
}
.mobile-menu {
  display: none;
}
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.breadcrumb > a {
  color: var(--muted);
}
.breadcrumb > span {
  color: #cbd5e1;
}
.breadcrumb strong {
  font-weight: 500;
}
.user-menu-wrap {
  position: relative;
  margin-left: auto;
}
.user-menu-button {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 36px;
  padding: 0 8px;
  font-size: 14px;
  color: #334155;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.user-menu-button:hover {
  background: #f8fafc;
}
.user-menu-button > svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  transition: transform 0.2s;
}
.user-menu-button[aria-expanded='true'] > svg {
  transform: rotate(180deg);
}
.avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: #0f172a;
  border-radius: 8px;
}
.user-menu {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 40;
  width: 208px;
  padding: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 10px 15px -3px #0f172a1a,
    0 4px 6px -4px #0f172a1a;
}
.user-menu-heading {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.user-menu-heading > span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}
.user-menu-heading > strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
}
.user-menu-action {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: #334155;
  text-align: left;
  background: white;
  border: 0;
  border-radius: 8px;
}
.user-menu-action svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}
.user-menu-action:hover {
  background: #f8fafc;
}
.user-menu-logout {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  color: #e11d48;
  background: white;
  border: 0;
  border-radius: 8px;
}
.user-menu-logout svg {
  width: 16px;
  height: 16px;
}
.user-menu-logout:hover {
  background: #fff1f2;
}
main {
  flex: 1;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
}
.page-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  text-decoration: none !important;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.2s;
}
.primary {
  color: white;
  background: #2563eb;
}
.primary:hover {
  background: #1d4ed8;
}
.secondary {
  color: #334155;
  background: white;
  border-color: #cbd5e1;
}
.secondary:hover {
  background: #f8fafc;
}
.danger-button {
  color: white;
  background: #e11d48;
}
.danger-button:hover {
  background: #be123c;
}
.disabled {
  color: #94a3b8;
  background: white;
  border-color: #cbd5e1;
  opacity: 0.5;
}
.panel {
  margin-bottom: 16px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px #0000000d;
}
.panel-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-heading p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.badge:before {
  width: 6px;
  height: 6px;
  content: '';
  background: #94a3b8;
  border-radius: 50%;
}
.badge.success {
  color: #047857;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}
.badge.success:before {
  background: #10b981;
}
.badge.neutral {
  color: #475569;
  background: #f1f5f9;
}
.badge.danger {
  color: #be123c;
  background: #fff1f2;
  box-shadow: inset 0 0 0 1px #fecdd3;
}
.badge.danger:before {
  background: #f43f5e;
}
.text-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
}
.text-link svg {
  width: 16px;
  height: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px #0000000d;
}
.stat-card > div {
  font-size: 12px;
  color: var(--muted);
}
.stat-card > strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 32px;
}
.stat-card p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 16px;
}
.quick-panel {
  padding: 16px;
}
.workbench {
  display: flex;
  flex-direction: column;
}
.workbench-heading {
  gap: 12px;
}
.workbench-date {
  padding: 3px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  background: #f8fafc;
  border-radius: 6px;
}
.workbench-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.workbench-checkins {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 16px;
  background: linear-gradient(100deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe;
  border-radius: 10px;
}
.workbench-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
.workbench-stat-value {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.workbench-stat-value strong {
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 36px;
  color: #1d4ed8;
}
.workbench-stat-value > span {
  font-size: 12px;
  color: var(--muted);
}
.workbench-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workbench-action {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none !important;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.workbench-action:hover {
  background: #f8fafc;
  border-color: #bfdbfe;
}
.workbench-action-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 8px;
}
.workbench-action-icon svg {
  width: 18px;
  height: 18px;
}
.workbench-action-text {
  min-width: 0;
}
.workbench-action-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.workbench-action-text small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.workbench-action > svg {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: #94a3b8;
  transition:
    transform 0.2s,
    color 0.2s;
}
.workbench-action:hover > svg {
  color: #2563eb;
  transform: translateX(2px);
}
.trend {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  height: 212px;
  padding: 16px 20px;
}
.trend-column {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.trend-column strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
}
.trend-track {
  display: flex;
  align-items: flex-end;
  height: 128px;
  border-bottom: 1px solid var(--border);
}
.trend-bar {
  width: 100%;
  max-width: 38px;
  margin: 0 auto;
  background: #2563eb;
  border-radius: 4px 4px 0 0;
}
.trend-column > span {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.list-page,
.dashboard-page,
.user-detail-page {
  display: flex;
  flex-direction: column;
}
.list-page {
  overflow: hidden;
}
.user-detail-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.user-detail-page > .page-heading,
.user-detail-page > .notice,
.user-detail-page > .form-panel {
  flex-shrink: 0;
}
.list-page > .page-heading,
.list-page > .notice,
.dashboard-page > .page-heading,
.dashboard-page > .notice,
.dashboard-page > .stats-grid,
.dashboard-page > .dashboard-grid {
  flex-shrink: 0;
}
.list-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.list-panel > .filters,
.list-panel > .panel-heading,
.list-panel > .pagination {
  flex-shrink: 0;
}
.list-panel > .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.list-panel th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}
.list-panel .table-wrap:has(.empty) table {
  height: 100%;
}
.list-panel .table-wrap:has(.empty) thead {
  height: 42px;
}
.list-panel .table-wrap:has(.empty) td {
  height: 100%;
}
.list-panel .empty {
  height: 100%;
}
.dashboard-page > .list-panel {
  flex: 1 0 200px;
}
.user-detail-page > .list-panel {
  flex: 1;
}
table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}
th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-align: left;
  white-space: nowrap;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  overflow-wrap: anywhere;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}
td strong {
  font-weight: 500;
}
td small {
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f8fafc;
}
.empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 32px 16px;
  text-align: center;
}
.empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  color: #94a3b8;
}
.empty strong {
  font-size: 14px;
  color: #475569;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.filters > div {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.filters input {
  width: 200px;
  max-width: 300px;
}
.filters select {
  width: 160px;
}
.filters label {
  flex-shrink: 0;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
}
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  color: #475569;
  border-top: 1px solid var(--border);
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.pagination .page-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 32px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
.pagination .button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
input::placeholder {
  color: #94a3b8;
}
input[readonly] {
  color: var(--muted);
  background: #f1f5f9;
}
select {
  padding-right: 40px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
textarea {
  resize: vertical;
}
.form-panel {
  width: 100%;
  max-width: none;
}
.config-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.config-page > .page-heading,
.config-page > .notice {
  flex-shrink: 0;
}
.config-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.config-tabs {
  display: flex;
  flex-shrink: 0;
  padding: 8px 8px 0;
  background: #f8fafccc;
  border-bottom: 1px solid var(--border);
}
.config-tabs button {
  min-height: 42px;
  padding: 10px 16px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
}
.config-tabs button:hover {
  color: #0f172a;
}
.config-tabs button[aria-selected='true'] {
  color: #2563eb;
  background: white;
  border-color: var(--border);
  border-bottom-color: white;
}
.config-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.config-body {
  flex: 1;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
}
.config-field + .config-field {
  margin-top: 20px;
}
.config-label-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.config-label-row label {
  margin-bottom: 0;
}
.config-secret input {
  padding-right: 48px;
}
.config-secret .password-toggle {
  top: 2px;
}
.config-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: #475569;
}
.config-checkbox input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: #2563eb;
}
.config-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  padding: 16px 24px;
  background: white;
  border-top: 1px solid var(--border);
}
.config-footer .button {
  padding-right: 24px;
  padding-left: 24px;
}
.label-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.label-upload-actions .field-help {
  margin-top: 0;
}
.label-upload-actions svg {
  width: 16px;
  height: 16px;
}
.label-upload-status {
  margin-top: 10px;
  font-size: 12px;
  color: #047857;
}
.label-upload-status.error {
  color: #be123c;
}
.label-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.label-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: white;
}
.label-preview span {
  font-size: 12px;
  color: var(--muted);
}
.edit-form {
  padding: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.full-width {
  grid-column: 1/-1;
}
.field-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.form-actions {
  display: flex;
  gap: 8px;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.form-panel .form-actions {
  flex-direction: row-reverse;
  justify-content: flex-start;
  padding-right: 24px;
  padding-left: 24px;
  margin-right: -24px;
  margin-left: -24px;
}
.edit-dialog .form-actions {
  justify-content: flex-end;
  padding-right: 24px;
  padding-left: 24px;
  margin-right: -24px;
  margin-left: -24px;
}
.notice {
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #1d4ed8;
  overflow-wrap: anywhere;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}
.notice.error {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}
.notice.success {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0f172a80;
  border: 0;
}
.confirm-dialog {
  width: calc(100% - 32px);
  max-width: 448px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px #00000040;
}
.confirm-dialog::backdrop {
  background: #0f172a80;
  backdrop-filter: blur(2px);
}
.confirm-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.confirm-heading h2 {
  font-size: 16px;
}
.confirm-heading p {
  margin-top: 8px;
  font-size: 14px;
  color: #475569;
}
.confirm-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #e11d48;
  background: #ffe4e6;
  border-radius: 50%;
}
.confirm-dialog .form-actions {
  justify-content: flex-end;
  padding-top: 0;
  margin-top: 20px;
  border: 0;
}
.edit-dialog {
  width: calc(100% - 32px);
  max-width: 720px;
  max-height: min(86dvh, 800px);
  padding: 0;
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px #00000040;
}
.edit-dialog::backdrop {
  background: #0f172a80;
  backdrop-filter: blur(2px);
}
.edit-dialog-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.edit-dialog-heading p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.edit-dialog .edit-form {
  padding: 20px 24px 24px;
}
.password-dialog {
  width: calc(100% - 32px);
  max-width: 448px;
  max-height: 86dvh;
  padding: 0;
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px #00000040;
}
.password-dialog::backdrop {
  background: #0f172a80;
  backdrop-filter: blur(2px);
}
.password-dialog .edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 24px;
}
.password-dialog .edit-form label {
  margin: 6px 0 -4px;
}
.password-dialog .edit-form .notice {
  margin: 0 0 6px;
}
.login-page {
  background: #f8fafc;
}
.login-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f9ff, #fff, #f5f3ff);
}
.login-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, #0f172a0d 1px, transparent 1px),
    linear-gradient(to bottom, #0f172a0d 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.8;
}
.login-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  pointer-events: none;
  filter: blur(110px);
  border-radius: 50%;
}
.glow-blue {
  top: -48px;
  left: 25%;
  background: #60a5fa26;
}
.glow-purple {
  right: 25%;
  bottom: -64px;
  background: #c084fc26;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 448px;
  padding: 36px;
  background: #ffffffcc;
  backdrop-filter: blur(24px);
  border: 1px solid #ffffffb3;
  border-radius: 24px;
  box-shadow: 0 10px 36px #0f172a14;
}
.login-brand {
  text-align: center;
}
.login-brand img {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 26px -8px #2563eb8c;
}
.login-brand h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.75px;
}
.login-brand p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.login-card form {
  margin-top: 24px;
}
.login-card label {
  margin-top: 20px;
  margin-bottom: 8px;
}
.login-card input {
  min-height: 48px;
  padding: 12px 16px;
  border-color: #e2e8f0;
  border-radius: 12px;
}
.login-card input:focus {
  box-shadow: 0 0 0 4px #3b82f61a;
}
.login-card .notice {
  margin: 24px 0 0;
  font-size: 14px;
  text-align: center;
  border-radius: 12px;
}
.remember-option {
  display: flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  font-size: 13px;
  font-weight: 400 !important;
  color: #475569;
  cursor: pointer;
}
.remember-option input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  accent-color: #2563eb;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 6px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #94a3b8;
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.password-toggle:hover {
  color: #475569;
  background: #f1f5f9;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
}
.password-toggle[aria-pressed='true']:after {
  position: absolute;
  width: 24px;
  height: 1.5px;
  content: '';
  background: currentColor;
  transform: rotate(45deg);
}
.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  font-weight: 600;
  background: linear-gradient(to right, #2563eb, #4f46e5);
  border-radius: 12px;
  box-shadow: 0 4px 6px #3b82f633;
}
.login-submit:hover {
  background: linear-gradient(to right, #1d4ed8, #4338ca);
}
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767px) {
  .layout {
    height: 100dvh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: 224px;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    --sidebar-width: 224px;
  }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .sidebar-label {
    display: initial;
  }
  .sidebar.collapsed .nav-item {
    justify-content: flex-start;
    padding: 10px 12px;
  }
  .sidebar.collapsed .brand {
    margin: 20px 16px 16px;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .desktop-menu {
    display: none;
  }
  .topbar {
    padding: 0 16px;
  }
  .user-menu-name {
    display: none;
  }
  main {
    padding: 16px;
  }
  .list-page,
  .dashboard-page,
  .user-detail-page {
    display: block;
    overflow-y: auto;
  }
  .list-panel {
    display: block;
    margin-bottom: 16px;
  }
  .user-detail-page > .list-panel {
    display: block;
    margin-bottom: 16px;
  }
  .list-panel > .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
  }
  .list-panel th {
    position: static;
    box-shadow: none;
  }
  .list-panel .table-wrap:has(.empty) table,
  .list-panel .table-wrap:has(.empty) td,
  .list-panel .empty {
    height: auto;
  }
  .page-heading {
    flex-direction: column;
    gap: 12px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trend {
    gap: 10px;
    padding: 16px;
  }
  table {
    min-width: 600px;
  }
  .filters > div {
    flex: 1 1 100%;
    min-width: 0;
  }
  .filters input,
  .filters select {
    flex: 1;
    width: 0;
    min-width: 0;
    max-width: none;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .button,
  .nav-item,
  .icon-button {
    min-height: 44px;
  }
  .icon-button {
    width: 44px;
  }
  .pagination {
    flex-wrap: wrap;
    font-size: 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .edit-form {
    padding: 20px;
  }
  .edit-dialog .edit-form {
    padding: 18px 20px 20px;
  }
  .form-panel .form-actions,
  .edit-dialog .form-actions {
    padding-right: 20px;
    padding-left: 20px;
    margin-right: -20px;
    margin-left: -20px;
  }
  .edit-dialog-heading {
    padding: 16px 20px;
  }
  .config-body {
    padding: 20px;
  }
  .config-footer {
    padding: 16px 20px;
  }
  .full-width {
    grid-column: auto;
  }
  .login-card {
    padding: 28px;
  }
  .login-brand h1 {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
