@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-Light.ttf') format('truetype');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-LightItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-MediumItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-SemiBoldItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/static/fonts/InterTight-BoldItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Fontello';
  src: url('/static/fonts/fontello.woff2') format('woff2'),
       url('/static/fonts/fontello.woff') format('woff');
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  --logo-w-url: url('/static/img/tooco_w.png');
  --logo-b-url: url('/static/img/tooco_b.png');
  --font-primary: 'Inter Tight', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 14px;
  --font-weight-base: 600;
  --font-lineHeight-base: 28px;
  --font-size-xs: 13px;
  --font-size-sm: 13.3px;
  --font-size-md: 14px;
  --font-size-lg: 15px;
  --font-size-xl: 16px;
  --font-size-2xl: 18px;
  --font-size-3xl: 20px;
  --font-size-4xl: 22px;

  --color-text-primary: #222222;
  --color-text-secondary: #ffffff;
  --color-text-tertiary: #dedede;
  --color-surface-base: #000000;
  --color-surface-muted: #f8f8f8;
  --color-surface-strong: #e9e9e9;
  --color-border-strong: #4e4e4e;

  --space-1: 6px;
  --space-2: 8px;
  --space-3: 9.6px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 14px;
  --space-7: 15px;
  --space-8: 15.6px;
  --space-10: 24px;
  --space-12: 32px;

  --radius-xs: 8px;
  --motion-instant: 300ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base);
  line-height: var(--font-lineHeight-base);
  color: var(--color-text-primary);
  background: var(--color-surface-muted);
  -webkit-font-smoothing: antialiased;
  scrollbar-gutter: stable;
}

body { min-height: 100vh; }

#app-root {
  min-height: 100vh;
}

.integration-page {
  min-height: auto;
  background: transparent;
}

.integration-header {
  margin-bottom: 0;
}

.integration-shell {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.integration-content {
  display: grid;
  gap: 16px;
}

.integration-summary {
  padding: 0;
}

.integration-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.integration-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--color-surface-strong);
  display: grid;
  gap: 6px;
}

.integration-stat:last-child {
  border-right: none;
}

.integration-label {
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(34, 34, 34, 0.48);
}

.integration-stat strong,
.integration-stat code {
  font-size: var(--font-size-sm);
  line-height: 22px;
  color: var(--color-text-primary);
}

.integration-stat code {
  overflow-wrap: anywhere;
}

.integration-section .card-body {
  display: grid;
  gap: 14px;
}

.integration-section--compact .card-body {
  gap: 10px;
}

.integration-prose p {
  font-weight: 400;
  line-height: 24px;
  color: rgba(34, 34, 34, 0.76);
}

.integration-list,
.integration-steps {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.integration-list li,
.integration-steps li {
  font-weight: 400;
  line-height: 22px;
  color: rgba(34, 34, 34, 0.8);
}

.integration-section pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--color-surface-strong);
  border-radius: 10px;
  background: #f7f7f7;
  color: #1b1b1b;
  font-size: 12px;
  line-height: 20px;
}

.integration-section code,
.integration-summary code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.integration-prose > code,
.integration-list code,
.integration-steps code,
.integration-section td code {
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f1f1;
  font-size: 12px;
}

.auth-panel-fade-in {
  animation: auth-panel-fade-in 220ms ease;
}

.auth-panel-slide-left {
  animation: auth-panel-slide-left 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-panel-slide-right {
  animation: auth-panel-slide-right 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auth-panel-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes auth-panel-slide-left {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes auth-panel-slide-right {
  from {
    opacity: 0;
    transform: translateX(-22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

a { color: var(--color-text-primary); text-decoration: none; }
a:hover { opacity: 0.7; }

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--color-surface-base);
  color: var(--color-text-secondary);
  padding: var(--space-7) var(--space-6);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  overflow-y: auto;
}

.sidebar-brand {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  line-height: 32px;
  color: var(--color-text-secondary);
  letter-spacing: -0.02em;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-strong);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: var(--font-lineHeight-base);
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: background var(--motion-instant) ease, color var(--motion-instant) ease;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--color-text-secondary);
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--color-text-secondary);
  outline-offset: -2px;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.1);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.sidebar-section-title {
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.4;
  padding: var(--space-6) 0 var(--space-2) var(--space-6);
}

/* Main Content */
.main {
  padding: var(--space-7) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

/* Page Header */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-surface-strong);
}

.page-title {
  font-size: var(--font-size-4xl);
  font-weight: 600;
  line-height: 32px;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--font-size-xs);
  font-weight: 300;
  color: var(--color-text-primary);
  opacity: 0.5;
  margin-top: var(--space-2);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--color-surface-strong);
  border-radius: var(--radius-xs);
  padding: var(--space-7) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform var(--motion-instant) ease;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-label {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-primary);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: var(--font-size-4xl);
  font-weight: 600;
  line-height: 32px;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
  overflow: hidden;
  padding: var(--space-6);
  width: 100%;
  margin-bottom: var(--space-6);
}

/* Last card in panel-main doesn't need bottom margin — gap handles it */
.panel-main > .card:last-child,
.panel-main > form > .card:last-child {
  margin-bottom: 0;
}

.card-header {
  padding: var(--space-6) var(--space-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-surface-strong);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text-primary);
  margin: 0;
}

.card-body {
  padding: var(--space-5) var(--space-7);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
}

.logs-toolbar {
  width: 100%;
}

.logs-toolbar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(320px, 1.2fr);
  gap: var(--space-5);
  align-items: stretch;
}

.logs-filter-card {
  padding: var(--space-6);
}

.logs-filter-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.logs-stream-head {
  border-bottom: 1px solid var(--color-surface-strong);
}

.logs-filter {
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  box-shadow: none;
}

.logs-filter-search {
  grid-column: auto;
}

.logs-filter-range {
  min-width: 320px;
}

.logs-filter-label {
  display: block;
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  opacity: 0.5;
}

.logs-filter-input,
.logs-filter-select,
.logs-date-range .logs-filter-input {
  width: 100%;
  background: #ffffff;
  border-color: #dcdcdc;
}

.logs-filter-select {
  height: 40px;
  padding: 0 var(--space-7) 0 var(--space-5);
  border-radius: var(--radius-xs);
  border: 1px solid #dcdcdc;
  background-color: #ffffff;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 300;
  line-height: 20px;
  color: var(--color-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.logs-filter-input:focus,
.logs-filter-select:focus,
.logs-filter-input:focus-visible,
.logs-filter-select:focus-visible {
  outline: none;
  border-color: #8b8b8b;
}

.logs-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.logs-date-separator {
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: var(--color-text-primary);
  opacity: 0.38;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.logs-table-wrap {
  width: 100%;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
}

.logs-table-wrap table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.logs-table-wrap thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  opacity: 1;
  z-index: 3;
  box-shadow: inset 0 -1px 0 var(--color-surface-strong);
}

.logs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  border-top: 1px solid var(--color-surface-strong);
  background: #ffffff;
}

.logs-footer-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-load-more-row {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-7);
  border-top: 1px solid var(--color-surface-strong);
  background: #ffffff;
  flex-direction: column;
}

.table-load-more-row .btn {
  width: 100%;
  min-width: 0;
}

.logs-table-wrap th:nth-child(1),
.logs-table-wrap td:nth-child(1) {
  width: 19%;
}

.logs-table-wrap th:nth-child(2),
.logs-table-wrap td:nth-child(2) {
  width: 17%;
}

.logs-table-wrap th:nth-child(3),
.logs-table-wrap td:nth-child(3) {
  width: 42%;
}

.logs-table-wrap th:nth-child(4),
.logs-table-wrap td:nth-child(4) {
  width: 22%;
}

.logs-detail-cell {
  max-width: 380px;
}

.logs-detail-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.logs-detail-text {
  display: block;
  font-size: var(--font-size-xs);
  line-height: 20px;
  color: var(--color-text-primary);
  opacity: 0.6;
  white-space: normal;
  word-break: break-word;
}

.logs-detail-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.logs-detail-toggle {
  padding: 0;
  min-height: auto;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: var(--color-text-primary);
  opacity: 0.65;
  cursor: pointer;
}

.logs-detail-toggle:hover {
  opacity: 1;
  text-decoration: underline;
}

.admin-table-actions {
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  font-weight: 300;
  line-height: 24px;
}

thead th {
  padding: var(--space-5) var(--space-7);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-align: left;
  color: var(--color-text-primary);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-surface-strong);
  white-space: nowrap;
}

tbody td {
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--color-surface-strong);
  color: var(--color-text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--color-surface-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 40px;
    min-width: 96px;
    padding: 0 var(--space-6);
    border-radius: var(--radius-xs);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  border: none;
  transition: background var(--motion-instant) ease, opacity var(--motion-instant) ease, transform var(--motion-instant) ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-surface-base);
  color: var(--color-text-secondary);
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-surface-strong);
  color: var(--color-text-primary);
}

.btn-secondary:hover { background: #ddd; }
.btn-secondary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-surface-strong);
}

.btn-ghost:hover { background: var(--color-surface-muted); }

.dropdown-toggle.btn-ghost {
  border: none;
  box-shadow: none;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

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

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: var(--font-size-xs);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  text-transform: capitalize;
}

.badge-online, .badge-active { background: #e6f9ed; color: #00a83e; }
.badge-pending, .badge-unverified { background: #fff5e6; color: #c27800; }
.badge-offline, .badge-inactive { background: var(--color-surface-strong); color: var(--color-text-primary); opacity: 0.6; }
.badge-superadmin { background: #ede9fe; color: #7c3aed; }
.badge-admin { background: #e0f2fe; color: #0284c7; }

/* Inputs */
.input, .form-input {
  height: 40px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
  background: #ffffff;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 300;
  line-height: 20px;
  color: var(--color-text-primary);
  transition: border-color var(--motion-instant) ease;
  width: 100%;
}

.input:focus, .form-input:focus {
  outline: none;
  border-color: #999;
}

.input:focus-visible, .form-input:focus-visible {
  outline: none;
  border-color: #999;
}

.input::placeholder, .form-input::placeholder { color: var(--color-text-primary); opacity: 0.35; }

/* Select */
.select {
  height: 40px;
  padding: 0 var(--space-7) 0 var(--space-5);
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
  background: #ffffff;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 300;
  line-height: 20px;
  color: var(--color-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  min-width: 140px;
}

.select:focus-visible {
  outline: none;
  border-color: #999;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-error {
  font-size: var(--font-size-xs);
  color: #dc2626;
  margin-top: var(--space-1);
}

.form-help {
  font-size: var(--font-size-xs);
  opacity: 0.5;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-surface-strong);
  margin: var(--space-7) 0;
}

/* Text Toggle — from temp design */
.text-toggle {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.text-toggle:hover { background: var(--color-surface-strong); }
.text-toggle.off { color: var(--color-text-primary); opacity: 0.5; }
.text-toggle.on { color: var(--color-success); }

/* Alert */
.alert {
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-6);
}

.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* Filters Row */
.filters {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-6);
  color: var(--color-text-primary);
  opacity: 0.45;
  font-size: var(--font-size-sm);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface-strong) 25%, #f0f0f0 50%, var(--color-surface-strong) 75%);
    background-size: 200% 100%;
    animation: skeleton-shine 1.0s infinite linear;
    border-radius: 4px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
  }
.skeleton * { visibility: hidden; }

  :root {
    --skeleton-line-xs: 64px;
    --skeleton-line-sm: 96px;
    --skeleton-line-md: 144px;
    --skeleton-line-lg: 220px;
    --skeleton-line-xl: 320px;
    --skeleton-line-2xl: 520px;
    --skeleton-text-sm: 12px;
    --skeleton-text-md: 14px;
    --skeleton-text-lg: 16px;
    --skeleton-text-xl: 24px;
  }

@keyframes skeleton-shine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Skeleton element shapes — mirror real components exactly */
.skel-text { height: var(--skeleton-text-md); width: var(--skeleton-line-lg); max-width: 100%; display: inline-block; }
  
  /* Mirrors .btn: 40px high, 8px radius, same padding */
.skeleton.skel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 var(--space-6);
    border-radius: var(--radius-xs);
    width: auto;
    min-width: 112px;
    border: none;
  }

  .skeleton.skel-btn.skel-btn-sm {
    height: 32px;
    min-width: 76px;
    padding: 0 12px;
  }

  .skeleton.skel-btn.skel-btn-icon {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .skeleton.skel-badge {
    min-width: 78px;
    height: 32px;
    justify-content: center;
    text-align: center;
  }

  .skeleton.skel-line-xs { width: var(--skeleton-line-xs); max-width: 100%; }
  .skeleton.skel-line-sm { width: var(--skeleton-line-sm); max-width: 100%; }
  .skeleton.skel-line-md { width: var(--skeleton-line-md); max-width: 100%; }
  .skeleton.skel-line-lg { width: var(--skeleton-line-lg); max-width: 100%; }
  .skeleton.skel-line-xl { width: var(--skeleton-line-xl); max-width: 100%; }
  .skeleton.skel-line-2xl { width: var(--skeleton-line-2xl); max-width: 100%; }
  .skeleton.skel-text-sm { height: var(--skeleton-text-sm); }
  .skeleton.skel-text-md { height: var(--skeleton-text-md); }
  .skeleton.skel-text-lg { height: var(--skeleton-text-lg); }
  .skeleton.skel-text-xl { height: var(--skeleton-text-xl); }

/* Mirrors .input: 40px high, 8px radius, 1px border */
.skeleton.skel-input {
  height: 40px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
  width: 100%;
}

/* Mirrors .select: 40px high, 8px radius, right padding for chevron */
.skeleton.skel-select {
  height: 40px;
  padding: 0 var(--space-7) 0 var(--space-6);
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-surface-strong);
  width: 100%;
}

.skel-label { height: 12px; width: 80px; border-radius: 4px; display: block; margin-bottom: 4px; }
.skel-form-row { display: flex; gap: var(--space-md); align-items: center; }
.skel-form-col { display: flex; flex-direction: column; gap: var(--space-sm); flex: 1; }

/* Form Skeleton Overlay */
.form-skeleton-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-radius: var(--radius-xs);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.form-skeleton-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.skeleton-pending > :not(.form-skeleton-overlay) {
  visibility: hidden;
}

/* Table specific skeleton enhancements */
.td-actions { display: flex; gap: var(--space-sm); align-items: center; }
.tr-skeleton td { padding: var(--space-5) var(--space-7); }

/* Responsive */
@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .stats-row { grid-template-columns: 1fr; }
  .main { padding: var(--space-6) var(--space-5); }
  .filters { flex-direction: column; align-items: stretch; }
  .input, .select { width: 100%; min-width: auto; }
}

/* User Panel Header — matches temp design system */
.top-header {
  background: var(--color-surface-base);
  color: var(--color-text-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-header-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.nav-brand {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 24px;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-brand:hover { opacity: 1; }

.account-menu {
  position: relative;
  min-width: 0;
}

.account-menu[open] {
  z-index: 30;
}

.account-menu-trigger {
  list-style: none;
  cursor: pointer;
}

.account-menu-trigger::-webkit-details-marker {
  display: none;
}

.account-menu-trigger .avatar-chip {
  display: inline-flex;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 196px;
  padding: 8px;
  border: 1px solid var(--color-surface-strong);
  border-radius: var(--radius-xs);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.account-menu-copy {
  display: grid;
  gap: 2px;
  padding: 1px 6px 6px;
}

.account-menu-copy strong,
.account-menu-copy span {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-copy strong {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-text-primary);
}

.account-menu-copy span {
  font-size: 11px;
  line-height: 14px;
  color: rgba(34, 34, 34, 0.56);
  text-transform: capitalize;
}

.account-menu-divider {
  height: 1px;
  margin: 0 6px 4px;
  background: var(--color-surface-strong);
}

.account-menu-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 34px;
  padding: 8px 12px !important;
  line-height: 16px;
}

.account-menu-action svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  opacity: 0.72;
}

.account-menu-action span {
  display: block;
  font-weight: 500;
}

.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.top-header .avatar-face {
  border: none;
}

.avatar-chip--sm .avatar-face {
  width: 30px;
  height: 30px;
}

.avatar-chip--lg .avatar-face {
  width: 54px;
  height: 54px;
  border-color: rgba(34, 34, 34, 0.08);
}

.avatar-chip--xl .avatar-face {
  width: 72px;
  height: 72px;
  border-color: rgba(34, 34, 34, 0.08);
}

.avatar-icon {
  font-family: 'Fontello';
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  speak: never;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-icon::before {
  display: block;
}

.avatar-chip--sm .avatar-icon {
  font-size: 14px;
}

.avatar-chip--lg .avatar-icon {
  font-size: 24px;
}

.avatar-chip--xl .avatar-icon {
  font-size: 31px;
}

.icon-emo-happy::before { content: '\e801'; }
.icon-emo-wink::before { content: '\e802'; }
.icon-emo-unhappy::before { content: '\e803'; }
.icon-emo-sleep::before { content: '\e804'; }
.icon-emo-devil::before { content: '\e805'; }
.icon-emo-surprised::before { content: '\e806'; }
.icon-emo-tongue::before { content: '\e807'; }
.icon-emo-coffee::before { content: '\e808'; }
.icon-emo-sunglasses::before { content: '\e809'; }
.icon-emo-displeased::before { content: '\e80a'; }
.icon-emo-thumbsup::before { content: '\e80b'; }
.icon-emo-grin::before { content: '\e80c'; }
.icon-emo-angry::before { content: '\e80d'; }
.icon-emo-saint::before { content: '\e80e'; }
.icon-emo-cry::before { content: '\e80f'; }
.icon-emo-squint::before { content: '\e811'; }
.icon-emo-laugh::before { content: '\e812'; }
.icon-emo-wink2::before { content: '\e813'; }

.avatar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.avatar-primary,
.avatar-secondary {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-primary {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.avatar-secondary {
  font-size: 11px;
  line-height: 14px;
  opacity: 0.58;
  text-transform: capitalize;
}

.top-header .avatar-primary,
.top-header .avatar-secondary {
  color: var(--color-text-secondary);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.profile-identity-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.profile-identity--hero {
  align-items: center;
  justify-content: flex-start;
  padding: 4px 0 2px;
}

.profile-identity--hero .avatar-chip {
  align-items: center;
  gap: 18px;
}

.profile-identity--hero .avatar-primary {
  font-size: 22px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.03em;
}

.profile-identity--hero .avatar-secondary {
  font-size: var(--font-size-sm);
  line-height: 22px;
  color: rgba(34, 34, 34, 0.6);
  text-transform: none;
}

.profile-hero-card .profile-identity--hero {
  justify-content: center;
  padding: 28px 32px 24px;
}

.profile-hero-card .profile-identity--hero .avatar-chip {
  justify-content: center;
}

.profile-hero-card .profile-identity-copy {
  text-align: center;
}

.profile-avatar-skeleton {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 999px;
  border: none;
}

.profile-hero-skeleton-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.profile-hero-skeleton-title {
  width: 168px;
  height: 24px;
  border-radius: 6px;
}

.profile-hero-skeleton-subtitle {
  width: 220px;
  max-width: 100%;
  height: 14px;
  border-radius: 4px;
}

.profile-settings-skeleton-grid {
  display: grid;
  gap: var(--space-5);
}

.profile-settings-skeleton-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}

.profile-settings-skeleton-label {
  width: 88px;
  height: 12px;
  border-radius: 4px;
}

.profile-settings-skeleton-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-xs);
}

.settings-card-popover > .settings-header {
  margin-bottom: 0;
}

.avatar-tone-soft-teal { background: #8eb8b5; }
.avatar-tone-soft-sky { background: #96afc4; }
.avatar-tone-mist-lavender { background: #a8a8c8; }
.avatar-tone-soft-rose { background: #c69aa2; }
.avatar-tone-brick-dust { background: #7a5d52; }
.avatar-tone-moss { background: #55624d; }

.sub-header {
  --nav-arrow-size: 32px;
  --nav-edge-fade: 44px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-surface-strong);
  position: sticky;
  top: 48px;
  z-index: 99;
  height: 48px;
}
.sub-header-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-7);
  display: flex;
  align-items: stretch;
  height: 100%;
}
.header-nav-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.header-nav-shell::before,
.header-nav-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--nav-edge-fade);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 2;
}
.header-nav-shell::before {
  left: var(--nav-arrow-size);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.52) 52%, rgba(255, 255, 255, 0) 100%);
}
.header-nav-shell::after {
  right: var(--nav-arrow-size);
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.52) 52%, rgba(255, 255, 255, 0) 100%);
}
.header-nav-shell.has-overflow:not(.is-at-start)::before,
.header-nav-shell.has-overflow:not(.is-at-end)::after {
  opacity: 1;
}
.header-nav-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.header-nav-viewport::-webkit-scrollbar {
  display: none;
}
.header-nav-arrow {
  width: var(--nav-arrow-size);
  flex: 0 0 var(--nav-arrow-size);
  border: none;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(34, 34, 34, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease;
  opacity: 0;
  pointer-events: none;
  position: relative;
  z-index: 3;
}
.header-nav-shell.has-overflow .header-nav-arrow {
  opacity: 1;
  pointer-events: auto;
}
.header-nav-arrow:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.96);
}
.header-nav-arrow:disabled {
  opacity: 0.22 !important;
  cursor: default;
}
.sub-header .header-nav {
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  height: 100%;
  min-width: max-content;
}
.sub-header .header-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-instant) ease, border-color var(--motion-instant) ease;
  white-space: nowrap;
}
.sub-header .header-link:hover {
  color: var(--color-text-primary);
}
.sub-header .header-link.active {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-text-primary);
  margin-bottom: -1px;
}

/* User Panel Main */
.user-main {
  min-height: calc(100vh - 96px);
  background: var(--color-surface-muted);
}

.user-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Auth pages (login/register etc) — centered card */
.auth-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-7);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7);
  background: var(--color-surface-muted);
}

.error-content {
  width: 100%;
  max-width: 420px;
  padding: 12px 0;
}

.error-code {
  font-size: var(--font-size-xs);
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  opacity: 0.45;
}

.error-title {
  margin-top: var(--space-5);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

.error-copy {
  margin-top: var(--space-5);
  font-size: var(--font-size-sm);
  line-height: 24px;
  color: rgba(34, 34, 34, 0.68);
}

.error-actions {
  margin-top: var(--space-10);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.auth-main--split {
  max-width: 100%;
  padding: 0;
  min-height: 100vh;
}

.auth-split-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
}

.auth-hero-panel {
  background: linear-gradient(135deg, #050505 0%, #151515 100%);
  color: var(--color-text-secondary);
  padding: 48px;
  display: flex;
  align-items: center;
}

.auth-hero-content {
  max-width: 520px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}

.auth-hero-title {
  margin-top: var(--space-10);
  max-width: 7ch;
  font-size: 56px;
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.auth-hero-copy {
  margin-top: var(--space-7);
  max-width: 22ch;
  font-size: var(--font-size-lg);
  line-height: 28px;
  color: var(--color-text-tertiary);
}

.auth-hero-lines {
  margin-top: var(--space-12);
  display: grid;
  gap: var(--space-5);
  width: min(320px, 100%);
}

.auth-hero-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-hero-line-lg { width: 220px; }
.auth-hero-line-md { width: 160px; }
.auth-hero-line-sm { width: 110px; }

.auth-form-panel {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.auth-form-shell {
  width: 100%;
  max-width: 332px;
  padding: var(--space-6);
  position: relative;
  transform-origin: center center;
  will-change: transform, opacity;
}

.auth-form-title {
  font-size: 30px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

.auth-form-copy {
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  line-height: 24px;
  color: rgba(34, 34, 34, 0.6);
}

.auth-form-stack {
  margin-top: var(--space-10);
  display: grid;
  gap: var(--space-6);
}

.auth-form-stack .form-group {
  margin-bottom: 0;
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-5);
  font-size: var(--font-size-sm);
  line-height: 22px;
  color: rgba(34, 34, 34, 0.72);
}

.auth-submit {
  width: 100%;
}

.remember-me-submit-proxy {
  display: none;
}

.auth-step-copy {
  display: none;
  transform-origin: center center;
  will-change: transform, opacity;
}

.auth-step-copy--active {
  display: block;
}

.remember-step {
  display: none;
  gap: var(--space-6);
  transform-origin: center center;
  will-change: transform, opacity;
}

.remember-step--active {
  display: grid;
}

.remember-step__actions {
  display: grid;
  gap: var(--space-3);
}

.remember-step__actions .btn {
  width: 100%;
}

.auth-code-label {
  display: block;
  margin-bottom: 8px;
  text-align: center;
}

.auth-code-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.auth-code-char {
  width: 40px;
  height: 50px;
  padding: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.auth-form-footer {
  text-align: center;
  font-size: var(--font-size-sm);
  line-height: 24px;
  color: rgba(34, 34, 34, 0.68);
}

.auth-form-footer strong {
  font-weight: 500;
  color: var(--color-text-primary);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.settings-header > :first-child,
.settings-section-head > :first-child,
.settings-inline-row > :first-child {
  min-width: 0;
}

.settings-header > :first-child,
.settings-section-head > :first-child {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-header .page-subtitle,
.settings-section-head .form-help,
.settings-inline-row .settings-status-copy {
  margin-top: 0;
  margin-bottom: 0;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-form > .settings-section:first-child {
  padding-top: var(--space-5);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-4);
}

.settings-section-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 26px;
  color: var(--color-text-primary);
  margin: 0;
}

.settings-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.settings-badges-status {
  align-self: center;
  justify-content: flex-end;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.settings-password-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.settings-password-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.settings-input {
  max-width: 100%;
}

.settings-form-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-5);
  margin-bottom: 0;
  width: 100%;
}

.settings-form-row .form-label {
  margin: 0;
  width: 180px;
}

.settings-form-row .settings-input {
  width: 100%;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: var(--space-2);
}

.settings-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.settings-inline-row .btn {
  flex: 0 0 auto;
}

.settings-popover-anchor {
  position: relative;
  flex: 0 0 auto;
}

.settings-status-copy {
    margin: 0;
    color: rgba(34, 34, 34, 0.72);
  }

  .badge-skeleton-fixed {
    min-width: 78px;
    justify-content: center;
    text-align: center;
  }

  .settings-header-skeleton-title {
    display: inline-block;
    width: 168px;
    height: 24px;
    border-radius: 6px;
    vertical-align: top;
  }

  .settings-header-skeleton-copy {
    display: inline-block;
    width: 392px;
    max-width: 100%;
    height: 14px;
    border-radius: 4px;
    vertical-align: top;
  }

  .profile-security-skeleton-head {
    width: 100%;
    max-width: 420px;
  }

  .profile-security-skeleton-title {
    width: 244px;
    height: 26px;
    border-radius: 6px;
  }

  .profile-security-skeleton-help {
    width: 320px;
    max-width: 100%;
    height: 13px;
    border-radius: 4px;
    margin-top: 10px;
  }

  .profile-security-skeleton-status {
    width: 520px;
    max-width: calc(100% - 148px);
    height: 14px;
    border-radius: 4px;
    flex: 1 1 auto;
  }

  .profile-security-skeleton-action {
    width: 132px;
    flex: 0 0 132px;
  }

.collapsible-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.985);
  transition:
    visibility 0s linear 180ms,
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.collapsible-panel__inner {
  min-height: 0;
}

.collapsible-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    visibility 0s linear 0s,
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-toggle-panel {
  width: 100%;
}

.settings-toggle-panel__inner {
  width: 100%;
  padding: var(--space-6);
  border: 1px solid var(--color-surface-strong);
  border-radius: var(--radius-xs);
  background: #ffffff;
}

.settings-toggle-form {
  width: 100%;
}

.settings-auth-code-label {
  text-align: center;
}

.settings-auth-code-inputs {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  justify-content: center;
  width: 100%;
}

.settings-toggle-form .btn {
  width: 100%;
}

.settings-card-popover {
  overflow: visible;
}

.settings-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  width: 320px;
  overflow: visible;
}

.settings-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid var(--color-surface-strong);
  border-left: 1px solid var(--color-surface-strong);
  transform: rotate(45deg);
}

/* Authed user/admin pages — content area */
.panel-main {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (max-width: 767px) {
  .integration-shell {
    grid-template-columns: 1fr;
  }
  .integration-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .integration-actions {
    width: 100%;
  }
  .integration-actions .btn {
    flex: 1 1 auto;
  }
  .integration-summary-grid {
    grid-template-columns: 1fr;
  }
  .integration-stat {
    border-right: none;
    border-bottom: 1px solid var(--color-surface-strong);
  }
  .integration-stat:last-child {
    border-bottom: none;
  }
  .top-header-inner { padding: 0 var(--space-5); }
  .sub-header {
    --nav-arrow-size: 28px;
    overflow: hidden;
  }
  .sub-header-inner {
    padding: 0 var(--space-5);
    overflow: hidden;
  }
  .sub-header .header-link {
    padding: 0 var(--space-4);
  }
  .profile-identity {
    align-items: flex-start;
  }
  .profile-identity--hero .avatar-chip {
    gap: 14px;
  }
  .profile-identity--hero .avatar-primary {
    font-size: 20px;
  }
  .account-menu-panel {
    right: 0;
    min-width: 170px;
  }
  .user-main, .panel-main, .auth-main { padding: var(--space-5); }
  .panel-main {
    gap: var(--space-5);
    padding-top: calc(var(--space-6) + 2px);
  }
  .page-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    gap: var(--space-4);
    align-items: flex-start;
    flex-direction: column;
  }
  .page-header h2,
  .page-header .card-title {
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.03em;
  }
  .page-subtitle,
  .form-help,
  .settings-status-copy {
    font-size: var(--font-size-sm);
    line-height: 22px;
    margin-bottom: var(--space-4);
  }
  .page-header .page-subtitle,
  .settings-header .page-subtitle,
  .settings-section-head .form-help,
  .settings-inline-row .settings-status-copy {
    margin-bottom: 0;
  }
  .card { padding: var(--space-5); }
  .logs-card-header,
  .logs-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .logs-filter-card-head {
    margin-bottom: var(--space-4);
  }
  .logs-footer-copy {
    order: 2;
  }
  .logs-toolbar {
    width: 100%;
  }
  .logs-toolbar-shell {
    grid-template-columns: 1fr;
  }
  .logs-filter-range {
    min-width: 0;
  }
  .logs-date-range {
    grid-template-columns: 1fr;
  }
  .logs-date-separator {
    display: none;
  }
  .logs-table-wrap {
    max-height: 440px;
  }
  .logs-table-wrap table {
    table-layout: auto;
  }
  .admin-mobile-table {
    overflow: visible;
    border: none;
    background: transparent;
  }
  .admin-mobile-table table,
  .admin-mobile-table thead,
  .admin-mobile-table tbody,
  .admin-mobile-table tr,
  .admin-mobile-table th,
  .admin-mobile-table td {
    display: block;
    width: 100%;
  }
  .admin-mobile-table thead {
    display: none;
  }
  .admin-mobile-table tbody {
    display: block;
    padding: 0 var(--space-4) 0;
  }
  .admin-mobile-table tbody tr {
    display: block;
    position: relative;
    border-bottom: 1px solid var(--color-surface-strong);
    background: transparent;
    padding: 8px 0;
  }
  .admin-mobile-table tbody tr:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .admin-mobile-table tbody td {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 0;
    white-space: nowrap !important;
    text-align: left !important;
    border-bottom: none;
    min-width: 0;
  }
  .admin-mobile-table tbody td:first-child {
    padding-top: 0;
    padding-right: 40px;
  }
  .admin-mobile-table tbody td::before {
    content: attr(data-label);
    display: inline-block;
    flex: 0 0 74px;
    font-size: 10px;
    line-height: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    opacity: 0.34;
    text-align: left;
  }
  .admin-mobile-table tbody td > * {
    min-width: 0;
  }
  .admin-mobile-table tbody td > div,
  .admin-mobile-table tbody td > span,
  .admin-mobile-table tbody td > code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-mobile-table tbody td:first-child > div {
    display: block;
    font-size: 12px;
    line-height: 16px;
  }
  .admin-mobile-table tbody td:first-child > div:first-child {
    font-weight: 600;
  }
  .admin-mobile-table tbody td:first-child > div:not(:first-child) {
    margin-top: 1px;
    opacity: 0.6;
  }
  .admin-mobile-table tbody td:not(:first-child) {
    font-size: 11px;
    line-height: 14px;
    color: var(--color-text-primary);
    opacity: 0.76;
    white-space: nowrap !important;
  }
  .admin-mobile-table tbody td:not(:first-child) > div,
  .admin-mobile-table tbody td:not(:first-child) > span,
  .admin-mobile-table tbody td:not(:first-child) > code,
  .admin-mobile-table tbody td:not(:first-child) .logs-detail-text {
    display: block;
    font-size: 11px;
    line-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-mobile-table .logs-detail-cell {
    max-width: none;
    width: 100%;
    display: flex;
  }
  .admin-mobile-table .logs-detail-cell::before {
    display: inline-block;
  }
  .admin-mobile-table .logs-detail-wrap {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-mobile-table .logs-detail-toggle {
    display: inline-block;
    margin-left: 0;
    font-size: 10px;
    line-height: 14px;
    vertical-align: baseline;
  }
  .admin-mobile-table .logs-detail-text,
  .admin-mobile-table tbody td > div,
  .admin-mobile-table tbody td > span,
  .admin-mobile-table tbody td > code {
    text-align: left;
    margin-left: 0;
  }
  .admin-mobile-table .admin-table-actions {
    position: absolute;
    top: 8px;
    right: 0;
    width: auto;
    padding: 0;
    justify-content: flex-end;
  }
  .admin-mobile-table .admin-table-actions::before {
    display: none;
  }
  .admin-mobile-table .admin-table-actions .dropdown {
    margin-left: 0;
  }
  .admin-mobile-table .admin-table-actions .btn {
    min-width: 30px;
    height: 30px;
  }
  .admin-mobile-table tbody tr:hover td {
    background: transparent;
  }
  .admin-mobile-table .badge {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 12px;
    border-radius: 4px;
  }
  .table-load-more-row {
    padding: var(--space-4);
  }
  .auth-main--split {
    padding: 0;
  }
  .error-page {
    padding: var(--space-5);
  }
  .error-content {
    padding: 8px 0;
  }
  .error-title {
    font-size: 26px;
  }
  .error-actions {
    flex-direction: column;
  }
  .error-actions .btn {
    width: 100%;
  }
  .auth-split-shell {
    grid-template-columns: 1fr;
  }
  .auth-hero-panel {
    order: 2;
    padding: 24px 20px 28px;
    min-height: auto;
  }
  .auth-hero-panel,
  .auth-form-panel {
    padding: 20px;
  }
  .auth-form-panel {
    order: 1;
    align-items: flex-start;
    min-height: auto;
  }
  .auth-form-shell {
    max-width: none;
    padding: 8px 0 0;
  }
  .auth-hero-title {
    font-size: 38px;
  }
  .auth-hero-copy {
    margin-top: var(--space-5);
    font-size: var(--font-size-sm);
    line-height: 24px;
  }
  .auth-hero-lines {
    margin-top: var(--space-8);
    width: min(220px, 100%);
    gap: var(--space-4);
  }
  .auth-hero-line-lg { width: 160px; }
  .auth-hero-line-md { width: 112px; }
  .auth-hero-line-sm { width: 72px; }
  .auth-form-title {
    font-size: 26px;
  }
  .auth-form-copy {
    line-height: 22px;
  }
  .auth-form-stack {
    margin-top: var(--space-7);
    gap: var(--space-5);
  }
  .auth-form-row {
    justify-content: flex-start;
  }
  .auth-code-inputs {
    gap: 6px;
  }
  .auth-code-char {
    width: 38px;
  }
  .auth-form-footer {
    text-align: left;
  }
  .settings-field-grid {
    grid-template-columns: 1fr;
  }
  .settings-form-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
  }
  .settings-form-row .form-label {
    width: auto;
  }
  .settings-password-pair {
    grid-template-columns: 1fr;
  }
  .settings-section-head,
  .settings-inline-row,
  .settings-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-header {
    gap: var(--space-5);
    margin-bottom: var(--space-5);
  }
  .settings-form > .settings-section:first-child {
    padding-top: var(--space-7);
  }
  .settings-header > :first-child,
  .settings-section-head > :first-child,
  .settings-inline-row > :first-child,
  .settings-badges-status {
    width: 100%;
  }
  .settings-header > :first-child,
  .settings-section-head > :first-child {
    gap: var(--space-4);
  }
  .settings-section-head {
    gap: var(--space-4);
    padding-bottom: var(--space-3);
  }
  .settings-badges-status {
    align-self: flex-start;
    justify-content: flex-start;
    margin-top: 0;
  }
  .settings-section-title {
    font-size: 22px;
    line-height: 1.12;
    padding-bottom: var(--space-2);
  }
  .profile-identity {
    flex-direction: column;
    gap: var(--space-5);
  }
  .profile-hero-card .profile-identity--hero {
    padding: 22px 18px 20px;
  }
  .profile-settings-skeleton-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .profile-identity--hero .avatar-chip {
    align-items: flex-start;
  }
  .profile-hero-card .profile-identity--hero .avatar-chip {
    align-items: center;
  }
  .settings-inline-row {
    gap: var(--space-4);
  }
  .settings-header .page-subtitle,
  .settings-section-head .form-help,
  .settings-inline-row .settings-status-copy {
    margin-bottom: 0;
  }
  .settings-popover {
    position: static;
    width: 100%;
    margin-top: var(--space-4);
  }
  .settings-popover::before {
    display: none;
  }
  .profile-security-skeleton-status {
    width: 100%;
    max-width: 100%;
  }
  .profile-security-skeleton-action {
    width: 132px;
    flex-basis: 132px;
  }
  .settings-header-skeleton-copy {
    width: 100%;
    max-width: 392px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .integration-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-split-shell {
    grid-template-columns: 1fr;
  }
  .auth-hero-panel,
  .auth-form-panel {
    min-height: auto;
  }
  .auth-form-shell {
    max-width: 380px;
  }
  .auth-hero-title {
    font-size: 48px;
  }
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid var(--color-surface-strong);
  border-radius: var(--radius-xs);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  z-index: 10;
  min-width: 140px;
  text-align: left;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.dropdown-item.account-menu-action {
  display: flex;
  align-items: center;
}
.dropdown-item:hover {
  background: var(--color-surface-muted);
}
.dropdown-item-danger {
  color: #dc2626;
}
.dropdown-item-danger:hover {
  background: #fef2f2;
}
.dropdown-item-warning {
  color: #d97706;
}
.dropdown-item-warning:hover {
  background: #fffbeb;
}

/* Auth Hero Panel Logo Positioning */
.auth-hero-logo {
  position: absolute;
  top: 48px;
  left: 48px;
}

@media (max-width: 767px) {
  .auth-hero-logo {
    top: 24px;
    left: 20px;
  }
}

/* Account Header Menu Styles */
.account-menu-trigger .avatar-chip .avatar-face {
  width: 26px !important;
  height: 26px !important;
}
.account-menu-trigger .avatar-chip .avatar-icon {
  font-size: 11px !important;
}

.account-menu-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.account-menu-header {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.account-menu-email {
  font-size: 11px;
  font-weight: 400;
  color: rgba(34, 34, 34, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-link, 
.dropdown-item-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  border-radius: 6px;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item-link:hover, 
.dropdown-item-btn:hover {
  background: var(--color-surface-muted) !important;
  color: var(--color-text-primary) !important;
}

.dropdown-item-danger .dropdown-item-link,
.dropdown-item-danger .dropdown-item-btn {
  color: #dc2626 !important;
}

.dropdown-item-danger .dropdown-item-link:hover,
.dropdown-item-danger .dropdown-item-btn:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
