@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/InterVariable.woff2') format('woff2');
}

:root {
  --sidebar-bg: #1a2332;
  --sidebar-hover: rgba(255, 255, 255, 0.04);
  --sidebar-active: rgba(26, 187, 156, 0.08);
  --sidebar-text: #7b8fa3;
  --sidebar-text-hover: #c5d0dc;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-w: 252px;
  --sidebar-w-rail: 64px;

  --primary: #1ABB9C;
  --primary-lt: rgba(26, 187, 156, 0.06);
  --primary-dk: #169f85;

  --body-bg: #f5f7fb;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f9fafb;

  --border-color: #e6e7eb;
  --border-color-light: #eff0f3;
  --border-translucent: rgba(4, 32, 69, 0.08);

  --text: #1e2633;
  --text-secondary: #626d7d;
  --text-muted: #7e8896;
  --text-disabled: #c0c7cf;

  --blue: #066fd1;
  --green: #2fb344;
  --yellow: #f59f00;
  --red: #d63939;
  --purple: #ae3ec9;

  --green-lt: rgba(47, 179, 68, 0.06);
  --red-lt: rgba(214, 57, 57, 0.06);
  --yellow-lt: rgba(245, 159, 0, 0.06);
  --blue-lt: rgba(6, 111, 209, 0.06);
  --purple-lt: rgba(174, 62, 201, 0.06);

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --shadow: rgba(30, 38, 51, 0.04) 0 2px 4px 0;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
  --font-size: 0.875rem;
  --line-height: 1.4286;
}

:root {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --body-bg: #0f1623;
  --bg-surface: #1a2332;
  --bg-surface-secondary: #141d2b;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-light: rgba(255, 255, 255, 0.05);
  --border-translucent: rgba(255, 255, 255, 0.08);

  --text: #e6ebf2;
  --text-secondary: #b3bccb;
  --text-muted: #8a93a3;
  --text-disabled: #5a6473;

  --primary-lt: rgba(26, 187, 156, 0.14);
  --green-lt: rgba(47, 179, 68, 0.16);
  --red-lt: rgba(214, 57, 57, 0.16);
  --yellow-lt: rgba(245, 159, 0, 0.16);
  --blue-lt: rgba(6, 111, 209, 0.18);
  --purple-lt: rgba(174, 62, 201, 0.16);

  --shadow: rgba(0, 0, 0, 0.4) 0 2px 4px 0;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .topbar {
  background: rgba(20, 29, 43, 0.85);
}

[data-theme="dark"] .tb-btn .dot {
  border-color: var(--bg-surface);
}

[data-theme="dark"] .sidebar-user .avatar .online {
  border-color: var(--sidebar-bg);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--text);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
}

:where(svg):not([width]):not([height]) {
  width: 1em;
  height: 1em;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

#main-content:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 150ms ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 220ms cubic-bezier(0.2, 0, 0, 1);
}

.sidebar-brand {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.brand-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.brand-name small {
  font-weight: 400;
  color: var(--sidebar-text);
  font-size: 10px;
  letter-spacing: 0.8px;
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  margin-inline-start: auto;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.sidebar-close:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.nav-group {
  padding: 0 8px;
  margin-bottom: 2px;
}

.nav-label {
  padding: 12px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(123, 143, 163, 0.5);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  margin-bottom: 1px;
  min-height: 32px;
}

.nav-link:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover);
  text-decoration: none;
}

.nav-link.active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-active);
  font-weight: 500;
}

.nav-link .icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  flex-shrink: 0;
}

.nav-link:hover .icon,
.nav-link.active .icon {
  opacity: 0.85;
}

.nav-link .nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 8px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: 0;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
}

.sidebar-user .avatar .online {
  position: absolute;
  bottom: -1px;
  inset-inline-end: -1px;
  width: 8px;
  height: 8px;
  background: var(--green);
  border: 2px solid var(--sidebar-bg);
  border-radius: 50%;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-user-info .name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .role {
  color: var(--sidebar-text);
  font-size: 11px;
  line-height: 1.3;
}

.logout-link {
  margin-top: 4px;
}

.topbar {
  position: fixed;
  top: 0;
  inset-inline-start: var(--sidebar-w);
  inset-inline-end: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 24px;
  z-index: 90;
  transition: left 220ms cubic-bezier(0.2, 0, 0, 1);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.sidebar-toggle {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 120ms, color 120ms;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--body-bg);
  color: var(--text);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb .sep {
  color: var(--text-disabled);
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 100ms;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.topbar-date {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0 10px;
  white-space: nowrap;
}

.tb-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 120ms, color 120ms;
  position: relative;
}

.tb-btn:hover {
  background: var(--body-bg);
  color: var(--text);
}

.tb-btn:disabled {
  cursor: default;
}

.tb-btn:disabled:hover {
  background: transparent;
  color: var(--text-secondary);
}

.tb-btn svg {
  width: 18px;
  height: 18px;
}

.tb-btn .dot {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border: 1.5px solid #fff;
  border-radius: 50%;
}

.tb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  margin-inline-start: 6px;
  cursor: pointer;
  padding: 0;
}

.tb-avatar:disabled {
  cursor: default;
}

.theme-toggle .theme-icon-light {
  display: none;
}

.theme-toggle .theme-icon-dark {
  display: block;
}

[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: block;
}

[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 1;
  transition: opacity 180ms ease;
}

.sidebar-backdrop[hidden] {
  display: none;
}

.main {
  margin-inline-start: var(--sidebar-w);
  padding-top: 56px;
  min-height: 100vh;
  transition: margin-left 220ms cubic-bezier(0.2, 0, 0, 1);
}

.page-wrapper {
  padding: 20px 24px 40px;
}

.page-header {
  margin-bottom: 20px;
}

.page-pretitle {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.row {
  display: grid;
  gap: var(--space-4);
  margin-bottom: 16px;
}

.row:last-child {
  margin-bottom: 0;
}

.col-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.col-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.col-1 {
  grid-template-columns: minmax(0, 1fr);
}

.footer {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dk);
}

.btn-primary:hover {
  background: var(--primary-dk);
  color: #fff;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

.btn-outline:hover {
  background: var(--bg-surface-secondary);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}

.btn-spinner[hidden] {
  display: none;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 150ms;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color-light);
  min-height: 44px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.card-body {
  padding: 16px;
}

.card-body.p-0 {
  padding: 0;
}

.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color-light);
}

.card-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
}

.card-link:hover {
  text-decoration: underline;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.table th {
  text-align: start;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

table.table tr:last-child td {
  border-bottom: none;
}

table.table tbody tr {
  transition: background 80ms;
}

table.table tbody tr:hover {
  background: var(--bg-surface-secondary);
}

.cell-strong {
  color: var(--text);
  font-weight: 500;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.cell-num {
  text-align: right;
  white-space: nowrap;
}

table.table th.cell-num {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill.success {
  background: var(--green-lt);
  color: #177c2d;
}

.status-pill.warning {
  background: var(--yellow-lt);
  color: #b45309;
}

.status-pill.info {
  background: var(--blue-lt);
  color: var(--blue);
}

.status-pill.danger {
  background: var(--red-lt);
  color: #c02f2f;
}

.status-pill.neutral {
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
}

[data-theme="dark"] .status-pill.success {
  color: #4ade80;
}

[data-theme="dark"] .status-pill.warning {
  color: #fbbf24;
}

[data-theme="dark"] .status-pill.info {
  color: #60a5fa;
}

[data-theme="dark"] .status-pill.danger {
  color: #f87171;
}

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--primary-lt);
  border: 1px solid rgba(26, 187, 156, 0.18);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 16px;
}

.banner-info {
  background: var(--blue-lt);
  border-color: rgba(6, 111, 209, 0.22);
}

.banner-icon {
  flex-shrink: 0;
  color: var(--primary);
  display: flex;
}

.banner-info .banner-icon {
  color: var(--blue);
}

.banner-warning {
  background: var(--yellow-lt);
  border-color: rgba(245, 159, 0, 0.22);
}

.banner-warning .banner-icon {
  color: var(--yellow);
}

.banner-body {
  flex: 1;
  min-width: 0;
}

.banner-body strong {
  color: var(--text);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  gap: 6px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.empty-state-text {
  font-size: 13px;
  max-width: 380px;
  line-height: 1.5;
}

.empty-state-actions {
  margin-top: 14px;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  flex-shrink: 0;
  position: relative;
  text-transform: uppercase;
  font-size: 11px;
  line-height: 1;
  width: 32px;
  height: 32px;
}

.request-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.request-id code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-surface-secondary);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-color-light);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}

.form-control::placeholder {
  color: var(--text-disabled);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-lt);
}

[data-theme="dark"] .form-control {
  background: var(--bg-surface-secondary);
}

.form-error,
.validation-summary-errors {
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.validation-summary-errors ul {
  list-style: none;
  padding-left: 0;
}

[data-theme="dark"] .form-error,
[data-theme="dark"] .validation-summary-errors {
  color: #f87171;
}

.sidebar-logout {
  margin-top: 4px;
}

.sidebar-logout .nav-link {
  width: 100%;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: start;
}

.empty-state-sm {
  padding: 26px 16px;
}

.attention-count-soon {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

@media (min-width: 769px) {
  .sidebar-backdrop {
    display: none !important;
  }

  body.sidebar-rail {
    --sidebar-w: var(--sidebar-w-rail);
  }

  body.sidebar-rail .sidebar {
    overflow: visible;
  }

  body.sidebar-rail .sidebar-nav {
    overflow: visible;
  }

  body.sidebar-rail .sidebar-brand {
    padding: 0;
    justify-content: center;
  }

  body.sidebar-rail .brand-name {
    display: none;
  }

  body.sidebar-rail .nav-group {
    padding: 0 8px;
  }

  body.sidebar-rail .nav-label {
    display: none;
  }

  body.sidebar-rail .nav-link {
    justify-content: center;
    gap: 0;
    padding: 8px;
    position: relative;
  }

  body.sidebar-rail .nav-link .nav-text {
    display: none;
  }

  body.sidebar-rail .sidebar-user {
    padding: 8px;
    justify-content: center;
  }

  body.sidebar-rail .sidebar-user-info {
    display: none;
  }

  body.sidebar-rail .nav-link[data-rail-label]::after {
    content: attr(data-rail-label);
    position: absolute;
    inset-inline-start: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: var(--text);
    color: var(--bg-surface);
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms, transform 120ms;
    z-index: 110;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  }

  body.sidebar-rail .nav-link[data-rail-label]:hover::after,
  body.sidebar-rail .nav-link[data-rail-label]:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  body.sidebar-rail .sidebar-toggle svg {
    transform: rotate(180deg);
  }

  .sidebar-toggle svg {
    transition: transform 200ms ease;
  }
}

@media (max-width: 1200px) {
  .col-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .col-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .main {
    margin-inline-start: 0;
  }

  .topbar {
    inset-inline-start: 0;
    padding: 0 12px;
  }

  .topbar .breadcrumb a,
  .topbar .breadcrumb .sep {
    display: none;
  }

  .page-wrapper {
    padding: 14px 12px 32px;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .col-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-title {
    font-size: 17px;
  }

  .empty-state {
    padding: 32px 16px;
  }
}

@media (max-width: 560px) {
  .topbar-date {
    display: none;
  }
}

@media (pointer: coarse) {
  .nav-link {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13.5px;
  }

  .sidebar-user {
    padding: 10px;
  }

  .sidebar-close,
  .sidebar-toggle,
  .tb-btn {
    width: 44px;
    height: 44px;
  }

  .tb-avatar {
    width: 38px;
    height: 38px;
  }

  .btn {
    height: 40px;
  }

  .status-pill {
    padding: 5px 10px 5px 8px;
  }
}

/* Responsive layout and touch controls shared by all Admin features. */
.main, .page-wrapper, .topbar-left, .topbar-right { min-width: 0; }
body .page-header-actions, body .card-header { flex-wrap: wrap; }
body .page-header-row > *, body .card-header > * { min-width: 0; }
body .page-title, body .card-title, body .banner-body { overflow-wrap: anywhere; }
body .table-responsive { max-width: 100%; min-width: 0; overscroll-behavior-inline: contain; }
.table-scroll-hint { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--text-secondary); background: var(--bg-surface-secondary); border-bottom: 1px solid var(--border-color-light); }
.table-scroll-hint[hidden] { display: none; }
.table-responsive:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
body .modal, body .ap-modal { max-height: calc(100dvh - 24px); }
body .modal-body, body .ap-modal-body { min-height: 0; overscroll-behavior-y: contain; }
body .ap-modal-box { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
body .ap-modal-body { max-height: none; overflow-y: auto; }
body .modal-header, body .ap-modal-head, body .ap-modal-foot { flex-shrink: 0; }
body .inv-drawer, body .drawer { height: 100dvh; max-width: 100vw; }
body .sidebar { max-height: 100dvh; }

@media (max-width: 768px) {
  .topbar-left { flex: 1; }
  .topbar-right { flex-shrink: 0; }
  .topbar .breadcrumb { min-width: 0; overflow: hidden; }
  .topbar .breadcrumb .current { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body .sidebar { max-width: calc(100vw - 48px); }
  body .form-actions, body .review-actions, body .filter-actions, body .table-footer { flex-wrap: wrap; }
  body .filter-field { max-width: 100%; min-width: min(160px, 100%); }
  body .modal-root { padding: 12px; }
  body .modal-body, body .modal-header { padding: 16px; }
  body .inv-drawer-footer, body .drawer { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .footer { padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 640px) {
  body .form-control, body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), body select, body textarea { max-width: 100%; min-width: 0; font-size: 16px; }
  body .form-control:not(textarea), body select { min-height: 44px; }
  body .btn, body .page-link, body .tb-btn, body .sidebar-toggle, body .sidebar-close, body .modal-close, body .ap-modal-close, body .inv-drawer-close { min-height: 44px; }
  body .page-link, body .tb-btn, body .sidebar-toggle, body .sidebar-close, body .modal-close, body .ap-modal-close, body .inv-drawer-close { min-width: 44px; justify-content: center; align-items: center; }
  body .filter-bar { align-items: stretch; }
  body .filter-field, body .filter-field-sm { flex: 1 1 100%; max-width: none; min-width: 0; }
  body .filter-actions { width: 100%; }
  body .filter-actions .btn { flex: 1; }
  body .page-header-actions { width: 100%; gap: 8px; }
  body .page-header-actions .btn { flex: 1 1 auto; white-space: normal; height: auto; padding-block: 10px; }
  body .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  body .modal-footer .btn { width: 100%; }
  body .form-actions .btn { flex: 1 1 130px; }
  body .pagination { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .main, .topbar, .del-progress-fill { transition: none; }
}

body .details-list dd, body .inv-drawer-title, body .drawer-title, body .modal-title { min-width: 0; overflow-wrap: anywhere; }
body .inv-drawer-body, body .drawer-body { min-height: 0; overscroll-behavior-y: contain; }
@media (max-width: 640px) {
  body main button, body .link-btn, body .report-mode-tab, body .report-chart-tab, body .del-tab { min-height: 44px; }
  body .link-btn { min-width: 44px; width: auto; padding-inline: 10px; }
}
