:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #1a1a2e;
  --muted: #64748b;
  --accent: #4361ee;
  --accent-strong: #3730a3;
  --brand-title: #4361ee;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --sidebar: #1a1a2e;
  --sidebar-hover: #2d2d4e;
  --sidebar-text: #c8cfe8;
  --sidebar-muted: #6f7696;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  --radius: 10px;
}

[data-bs-theme="dark"] {
  --bg: #0f172a;
  --panel: #111827;
  --panel-muted: #172033;
  --border: #263247;
  --border-soft: #1f2937;
  --text: #e5edf9;
  --muted: #9fb0ca;
  --accent: #7aa2ff;
  --accent-strong: #a5bffb;
  --brand-title: #4361ee;
  --success-bg: #10301f;
  --success-text: #86efac;
  --danger-bg: #3a1517;
  --danger-text: #fca5a5;
  --sidebar: #0b1220;
  --sidebar-hover: #172033;
  --sidebar-text: #d6def2;
  --sidebar-muted: #7b87a5;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.sidebar {
  width: 245px;
  min-height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: width 0.22s ease;
}

.sidebar.collapsed { width: 64px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sidebar-brand:hover { background: rgba(255,255,255,0.05); }

.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-family: 'Titillium Web', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand-title);
  letter-spacing: 0.01em;
}

.brand-title-light {
  color: #ffffff;
}

.sidebar-brand-subtitle {
  font-size: 10px;
  color: #ffffff;
  margin-top: 3px;
  text-align: right;
  opacity: 0.75;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 14px 16px 8px;
}

.nav-subsection-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 8px 16px 4px;
  opacity: 0.7;
}

.sidebar-nav > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 0 2px;
}

.sidebar-nav > a:hover,
.sidebar-nav > a.active {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-icon .icon {
  font-size: 17px;
}

.nav-label {
  white-space: nowrap;
}

/* ── Sidebar collapsed state ──────────────────────────────── */
.sidebar.collapsed .sidebar-brand-copy { display: none; }
.sidebar.collapsed .sidebar-brand { padding: 16px 0 14px; justify-content: center; gap: 0; }
.sidebar.collapsed .brand-mark { width: 45px; height: 45px; border-radius: 14px; }
.sidebar.collapsed .nav-section-label {
  padding: 14px 16px 8px;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  font-size: 0;  /* hide full name */
}
.sidebar.collapsed .nav-section-label::before {
  content: attr(data-short);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: block;
}
.sidebar.collapsed .nav-subsection-label {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 10px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  pointer-events: none;
}
.sidebar.collapsed .nav-label { display: none; }

/* Floating tooltip shown on hover when collapsed */
#nav-tooltip {
  display: none;
  position: fixed;
  background: var(--sidebar);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  height: 56px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 20;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 13px;
}

.breadcrumb-link {
  color: var(--muted);
}

.breadcrumb-link:hover {
  color: var(--text);
}

.breadcrumb-sep {
  color: #cbd5e1;
  font-size: 11px;
  margin: 0 5px;
  user-select: none;
}

.breadcrumb-current {
  color: var(--muted);
}

.header-user {
  display: flex;
  align-items: center;
}

.user-menu-wrap {
  position: relative;
}

.user-avatar-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 50%;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 200;
}

.user-dropdown.open {
  display: block;
}

.user-menu-action {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s;
}

.user-menu-action:hover {
  background: var(--bg);
  color: var(--text);
}

.content {
  padding: 24px 28px 32px;
}

.flashes {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.flash {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #dbeafe;
  color: #1e40af;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash.error,
.flash.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.page-header,
.ds-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

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

.ds-page-header .card-body {
  padding: 0;
}

.ds-page-header-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 0;
}

.page-title,
.ds-page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-title {
  margin: 0 0 16px;
  font-size: 27px;
  font-weight: 700;
  color: var(--text);
  font-family: "Titillium Web", sans-serif;
}

.page-pretitle,
.ds-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.ds-page-description,
.text-secondary,
.muted,
.user-meta,
.ds-stat-note,
.login-copy,
.login-footer {
  color: var(--muted) !important;
}

.tax-tabs,
.ds-tab-strip,
.ds-subtabs,
.help-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tax-tab,
.ds-tab-strip .nav-link,
.ds-subtabs .nav-link,
.help-tabs .nav-link,
.nav-tabs .nav-link,
.nav-pills .nav-link {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 6px 22px;
  margin: 0 0 -2px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  text-decoration: none;
}

.tax-tab:hover,
.ds-tab-strip .nav-link:hover,
.ds-subtabs .nav-link:hover,
.help-tabs .nav-link:hover,
.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.tax-tab.active,
.ds-tab-strip .nav-link.active,
.ds-subtabs .nav-link.active,
.help-tabs .nav-link.active,
.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.card-title,
.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.table-responsive {
  width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: var(--panel-muted);
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--panel-muted);
}

.ds-table-shell {
  padding: 0;
}

.ds-table-shell .table-responsive {
  border-radius: 0 0 var(--radius) var(--radius);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.text-bg-primary-lt,
.text-bg-azure-lt {
  background: #e0e7ff;
  color: #3730a3;
}

.text-bg-green-lt {
  background: var(--success-bg);
  color: var(--success-text);
}

.text-bg-secondary-lt {
  background: #e5e7eb;
  color: #6b7280;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: #e2e8f0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary {
  background: var(--panel);
  border-color: var(--border);
  color: var(--muted);
}

.btn-danger,
.btn-outline-danger {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.btn-block,
.w-100 {
  width: 100%;
}

.btn-list {
  display: flex;
  gap: 8px;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-track {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: #d7deea;
  transition: background 0.15s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(22px);
}

[data-bs-theme="dark"] .toggle-track {
  background: #334155;
}

[data-bs-theme="dark"] .toggle-track::after {
  background: #cbd5e1;
  box-shadow: none;
}

[data-bs-theme="dark"] .toggle-switch input:checked + .toggle-track {
  background: #4f6fbf;
}

.btn-icon i,
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.stack,
.stack-sm {
  display: grid;
  gap: 12px;
}

label,
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea,
.form-control,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.form-hint,
.small {
  font-size: 12px;
  color: var(--muted);
}

.row-cards {
  row-gap: 20px;
}

.ds-stat-card {
  min-height: 160px;
}

.ds-stat-card-body {
  height: 100%;
}

.ds-stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.ds-stat-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--panel-muted);
  color: var(--accent);
}

.ds-stat-card .icon-lg {
  font-size: 18px;
}

.ds-stat-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.ds-stat-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ds-feature-card,
.ds-feature-card-alt,
.ds-empty-state {
  background: var(--panel);
}

.ds-empty-state {
  text-align: center;
}

.ds-empty-state-body {
  padding: 48px 24px;
}

.ds-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--panel-muted);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-xl {
  font-size: 28px;
}

.ds-permission-tile {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  min-height: 100%;
}

.perm-card {
  display: flex;
  align-items: stretch;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.permissions-tab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.permissions-tab-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.permissions-tab-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.permissions-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perm-card-skunk {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: none;
}

.perm-card-name {
  flex: 0 0 180px;
  width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.perm-role-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.perm-system-pill {
  display: inline-block;
  width: max-content;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.perm-role-count {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.perm-boxes {
  flex: 1;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.perm-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}

.perm-box-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  color: #fff;
}

.perm-box-edit { background: #16a34a; }
.perm-box-view { background: #2563eb; }
.perm-box-none { background: #94a3b8; }

.perm-box-body {
  flex: 1;
  overflow-y: auto;
  max-height: 260px;
  background: var(--panel);
}

.perm-item {
  font-size: 12px;
  color: var(--text);
  padding: 8px 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perm-item-alt {
  background: var(--panel-muted);
}

.perm-item-empty {
  color: var(--muted);
  font-style: italic;
}

.perm-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 128px;
  width: 128px;
  justify-content: flex-end;
  align-self: center;
}

.overflow-menu {
  position: relative;
  display: inline-block;
}

.overflow-btn {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
}

.overflow-btn:hover {
  background: var(--panel-muted);
  color: var(--text);
}

.overflow-dropdown {
  display: none;
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  min-width: 168px;
  z-index: 200;
}

.overflow-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.overflow-item:hover {
  background: var(--panel-muted);
}

.overflow-item-danger {
  color: #f87171;
}

.overflow-item-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.overflow-item-disabled {
  color: #64748b !important;
  cursor: not-allowed;
}

.overflow-item-disabled:hover {
  background: none;
}

/* ── Reporting ────────────────────────────────────────────────────── */
.reporting-stat-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.reporting-stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.reporting-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.reporting-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .permissions-tab-header,
  .perm-card,
  .perm-boxes {
    flex-direction: column;
  }

  .permissions-tab-actions {
    width: 100%;
    justify-content: space-between;
  }

  .perm-card-name {
    width: auto;
    flex-basis: auto;
  }

  .perm-card-actions {
    width: auto;
    flex-basis: auto;
    align-self: flex-end;
  }
}

.perm-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.perm-modal-row:last-child {
  border-bottom: none;
}

.perm-modal-page {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 140px;
}

.perm-toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.perm-toggle-btn {
  border: none;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-right: 1px solid var(--border);
}

.perm-toggle-btn:last-child {
  border-right: none;
}

.perm-toggle-btn:hover:not(.active) {
  background: #f1f5f9;
}

.perm-toggle-none.active { background: #94a3b8; color: #fff; }
.perm-toggle-view.active { background: #2563eb; color: #fff; }
.perm-toggle-edit.active { background: #16a34a; color: #fff; }

.prose {
  max-width: 900px;
  line-height: 1.7;
}

.prose pre,
.release-markdown {
  white-space: pre-wrap;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
}

.container-tight {
  width: min(100%, 1240px);
  max-width: 1240px;
  flex: 1;
}

/* Two-panel login layout */
.login-panels {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.login-card {
  flex: 0 0 515px;
  background: var(--panel);
}

.login-illustration-card {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
}

.login-illustration-img {
  width: 100%;
  height: 100%;
  min-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.login-logo {
  text-align: center;
  margin-bottom: 0px;
}
.login-logo img {
  width: 156px;
  height: 156px;
  border-radius: 36px;
}

.login-kicker {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 30px;
  text-align: center;
}

.login-title,
.login-copy,
.login-footer {
  text-align: center;
}

.login-copy {
  margin: 0 0 24px;
}

.ds-login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.55);
}

/* ── Status badges ─────────────────────────────────────────── */
.badge-active   { display:inline-block;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:600;background:#dcfce7;color:#166534; }
.badge-inactive { display:inline-block;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:600;background:#fee2e2;color:#991b1b; }
.badge-default  { display:inline-block;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:600;background:#e0e7ff;color:#3730a3; }

/* ── Release Notes ─────────────────────────────────────────── */
.release-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  border-left-width: 4px;
  border-left-style: solid;
}
.release-card-major { border-left-color: #10B981; }
.release-card-minor { border-left-color: #3B82F6; padding: 20px 24px; }
.release-card-patch { border-left-color: #94a3b8; padding: 16px 20px; }

.release-banner {
  padding: 20px 24px;
}
.release-card-major .release-content,
.release-card-major > div:last-child {
  padding: 0 24px 20px;
}

.release-version {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.release-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.release-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.release-type-major { background: #d1fae5; color: #065f46; }
.release-type-minor { background: #dbeafe; color: #1e40af; }
.release-type-patch { background: #f1f5f9; color: #475569; }

.release-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.release-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
}
.release-content ul { margin: 6px 0 10px 18px; padding: 0; }
.release-content li { margin-bottom: 4px; }
.release-content p  { margin: 0 0 10px; }

@media (max-width: 1100px) {
  .sidebar {
    width: 240px;
  }

  .sidebar-brand-title {
    font-size: 22px;
  }
}

@media (max-width: 840px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }

  .sidebar-nav {
    padding-top: 12px;
  }

  .content,
  .header {
    padding-left: 18px;
    padding-right: 18px;
  }


  .page-header,
  .ds-page-header-body,
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════
   Chat / AI Conversations
═══════════════════════════════════════════════════════ */

.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 80%;
}

.chat-bubble-wrap--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-wrap--agent {
  align-self: flex-start;
}

.chat-bubble-avatar {
  flex-shrink: 0;
  margin-bottom: 2px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 100%;
  word-break: break-word;
}

.chat-bubble--user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble--agent {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble-content p:last-child { margin-bottom: 0; }
.chat-bubble-content pre {
  background: rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 13px;
}
.chat-bubble--user .chat-bubble-content pre {
  background: rgba(255,255,255,0.18);
}
.chat-bubble-content code {
  font-size: 13px;
}
.chat-bubble-content ul,
.chat-bubble-content ol {
  padding-left: 20px;
  margin: 4px 0;
}

.chat-bubble-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.chat-bubble--user .chat-bubble-time {
  color: rgba(255,255,255,0.7);
  text-align: right;
}

/* Typing indicator dots */
.chat-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
}
.chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-dot-bounce 1.2s infinite ease-in-out;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-dot-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1;   }
}

/* ── Agent tiles (Conversations page) ──────────────────────────────────── */
.agent-tile {
  position: relative;
  width: 268px;
  height: 303px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.agent-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.agent-tile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.agent-tile-initial {
  width: 100%;
  height: 100%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 72px;
  color: #fff;
}
.agent-tile-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 8px 9px;
  background: rgba(0,0,0,0.68);
}
.agent-tile-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.agent-tile-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
