:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --border: #d9e0e7;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --success-bg: #eaf7ef;
  --success-text: #146c43;
  --warning-bg: #fff3cd;
  --warning-text: #997404;
  --danger-bg: #f8d7da;
  --danger-text: #b02a37;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius-lg: 18px;
  --radius-md: 14px;
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

a {
  text-decoration: none;
}

.topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brandmark:hover,
.brandmark:focus {
  color: #ffffff;
}

.brandmark__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0.18rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brandmark__logo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  background: #0c2340;
  object-fit: contain;
  object-position: center;
}

.brandmark__label {
  color: #ffffff;
  line-height: 1;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar .nav-link {
  color: rgba(255, 255, 255, 0.78);
}

.topbar .nav-link:hover,
.topbar .nav-link:focus {
  color: #ffffff;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.user-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  color: #ffffff;
  line-height: 1.2;
}

.user-pill__name {
  font-size: 0.9rem;
}

.user-pill__role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
}

.page-host {
  padding: 1.5rem 0 2rem;
}

.app-notification-center {
  position: fixed;
  top: 6.2rem;
  inset-inline-end: 1.25rem;
  z-index: 1100;
  display: grid;
  gap: 0.85rem;
  width: min(26rem, calc(100vw - 2rem));
}

.app-notification {
  position: relative;
  display: grid;
  grid-template-columns: 0.32rem minmax(0, 1fr) auto;
  align-items: start;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.app-notification--closing {
  transform: translateY(-8px);
  opacity: 0;
}

.app-notification__accent {
  align-self: stretch;
}

.app-notification__body {
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 0.95rem 1rem;
}

.app-notification__title {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
}

.app-notification__message {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.app-notification__close {
  align-self: center;
  margin: 0.55rem 0.55rem 0 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
}

.app-notification__close:hover,
.app-notification__close:focus {
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
}

.app-notification--success .app-notification__accent {
  background: linear-gradient(180deg, #10b981 0%, #047857 100%);
}

.app-notification--warning .app-notification__accent {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.app-notification--danger .app-notification__accent {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}

.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(4px);
}

.app-confirm__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  width: min(30rem, 100%);
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 34px 70px rgba(15, 23, 42, 0.28);
}

.app-confirm__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 16px 32px rgba(217, 119, 6, 0.26);
}

.app-confirm__content {
  display: grid;
  gap: 0.35rem;
}

.app-confirm__title {
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
}

.app-confirm__message {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.app-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.app-confirm-open {
  overflow: hidden;
}

.page-shell {
  display: grid;
  gap: 1rem;
}

.page-shell--compact {
  padding-top: 0;
  margin-top: -0.5rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.page-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel,
.stat-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.25rem;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.panel__subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 1rem 1.1rem;
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.stat-card__value {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card__note {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.content-grid {
  display: grid;
  gap: 1rem;
}

.content-grid--sidebar {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.form-grid,
.filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.form-control,
.form-select {
  min-height: 2.9rem;
  border: 1px solid #ced4da;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(13, 110, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.rate-entry-form {
  display: grid;
  gap: 1rem;
}

.rate-entry-date-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #13314d 52%, #0f766e 100%);
  box-shadow: 0 22px 36px rgba(15, 23, 42, 0.16);
  color: #ffffff;
}

.rate-entry-date-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  inset-inline-end: -70px;
  inset-block-end: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 72%);
}

.rate-entry-date-card > * {
  position: relative;
  z-index: 1;
}

.rate-entry-date-card__calendar {
  min-width: 5.75rem;
  display: grid;
  justify-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rate-entry-date-card__month {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.rate-entry-date-card__day {
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.rate-entry-date-card__content {
  display: grid;
  gap: 0.2rem;
}

.rate-entry-date-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.rate-entry-date-card__title {
  font-size: 1.18rem;
  font-weight: 700;
}

.rate-entry-date-card__meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.rate-entry-date-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.rates-page {
  gap: 1.25rem;
}

.rates-missing-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.missing-rate-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.missing-rate-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.missing-rate-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 24px 42px rgba(15, 23, 42, 0.1);
}

.missing-rate-card--selected {
  border-color: rgba(16, 185, 129, 0.34);
  box-shadow:
    0 24px 42px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(16, 185, 129, 0.2);
}

.missing-rate-card__head,
.missing-rate-card__identity,
.missing-rate-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.missing-rate-card__identity {
  justify-content: flex-start;
  min-width: 0;
}

.missing-rate-card__copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.missing-rate-card__copy strong {
  font-size: 1.05rem;
  line-height: 1;
}

.missing-rate-card__copy span {
  color: #64748b;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.missing-rate-card__metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.missing-rate-card__metric {
  display: grid;
  gap: 0.28rem;
  padding: 0.85rem 0.9rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.88);
}

.missing-rate-card__metric span,
.missing-rate-card__history span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.missing-rate-card__metric strong,
.missing-rate-card__history strong {
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.missing-rate-card__history {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.25rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.24);
}

.missing-rate-card__actions {
  flex-wrap: wrap;
}

.missing-rate-card__actions form {
  margin: 0;
}

.table-responsive {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.data-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.cell-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cell-title strong {
  font-size: 0.96rem;
}

.cell-title small {
  color: var(--muted);
}

.data-table__row--inactive td {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.data-table__row--disabled td {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  opacity: 0.92;
}

.empty-state {
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: var(--panel-muted);
  text-align: center;
}

.empty-state--success {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #166534;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: #eef2ff;
  color: #4338ca;
}

.badge-soft--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-soft--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-soft--muted {
  background: #eef2f7;
  color: #475569;
}

.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.country-pill__flag {
  font-size: 1.05rem;
  line-height: 1;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.helper-text,
.muted-inline {
  color: var(--muted);
  font-size: 0.88rem;
}

.live-shell {
  display: grid;
  gap: 1rem;
}

.live-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  background: var(--success-bg);
  color: var(--success-text);
}

.live-status[data-state="warning"] {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.live-board {
  transition: opacity 0.2s ease;
}

.live-board.is-syncing {
  opacity: 0.7;
}

/* ================================================================
   RATE BOARD — compact, scannable, single-source-of-truth styles
   ================================================================ */

.rate-board-shell {
  display: grid;
  gap: 1rem;
}

.rate-board-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.1rem 1.35rem;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f172a 0%, #12253f 55%, #15304a 100%);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.rate-board-hero__main {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.rate-board-hero__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.rate-board-hero__title {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.rate-board-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #d1fae5;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rate-board-pulse__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: rate-board-pulse 1.8s ease-out infinite;
}

.rate-board-pulse[data-state="warning"] {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fef3c7;
}

.rate-board-pulse[data-state="warning"] .rate-board-pulse__dot {
  background: #fbbf24;
  animation: none;
}

@keyframes rate-board-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.rate-board-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: 0;
}

.rate-board-hero__stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.rate-board-hero__stat dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rate-board-hero__stat dd {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rate-board-hero__converter {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.rate-board-hero__converter:hover,
.rate-board-hero__converter:focus,
.rate-board-hero__converter:focus-visible,
.rate-board-hero__converter:active {
  background: #f8fafc;
  color: #0f172a;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22);
}

.rate-board-hero__converter:disabled {
  opacity: 0.55;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* -------- Filter bar -------- */
.rate-board-filters {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.rate-board-filters__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.rate-board-filters__field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  margin: 0;
}

.rate-board-filters__label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rate-board-filters__select {
  min-height: 2.55rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.rate-board-filters__select:hover {
  border-color: rgba(96, 165, 250, 0.55);
  background-color: #ffffff;
}

.rate-board-filters__select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.2);
  background-color: #ffffff;
}

.rate-board-filters__active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.rate-board-filters__active[hidden] {
  display: none !important;
}

.rate-board-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}

.rate-board-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.4rem 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.38);
  background: rgba(219, 234, 254, 0.55);
  color: #1e3a8a;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rate-board-filter-chip:hover,
.rate-board-filter-chip:focus-visible {
  background: rgba(191, 219, 254, 0.75);
  border-color: #60a5fa;
  color: #1d4ed8;
  outline: none;
}

.rate-board-filter-chip:active {
  transform: scale(0.97);
}

.rate-board-filter-chip__label {
  color: #64748b;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rate-board-filter-chip__value {
  color: inherit;
  font-weight: 700;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-board-filter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.22);
  color: #1e3a8a;
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.rate-board-filter-chip:hover .rate-board-filter-chip__remove,
.rate-board-filter-chip:focus-visible .rate-board-filter-chip__remove {
  background: #60a5fa;
  color: #ffffff;
}

.rate-board-filters__reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  margin-inline-start: auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.rate-board-filters__reset::before {
  content: "×";
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.rate-board-filters__reset:hover,
.rate-board-filters__reset:focus-visible {
  background: rgba(148, 163, 184, 0.15);
  color: #0f172a;
  outline: none;
}

.rate-board-filters__reset:hover::before,
.rate-board-filters__reset:focus-visible::before {
  color: #0f172a;
}

.rate-board-filters__reset[hidden] {
  display: none !important;
}

/* -------- Live board + toolbar -------- */
.rate-board-live {
  display: block;
}

.rate-board-live.is-syncing .rate-board-content {
  opacity: 0.82;
}

.rate-board-content {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
  transition: opacity 0.2s ease;
}

.rate-board-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.35rem 0.35rem 0.1rem;
}

.rate-board-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 280px;
  min-width: 0;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rate-board-search:focus-within {
  background: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.18);
}

.rate-board-search svg {
  flex: 0 0 auto;
}

.rate-board-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 500;
}

.rate-board-search__input::placeholder {
  color: #94a3b8;
}

.rate-board-search__input:focus {
  outline: none;
  box-shadow: none;
}

.rate-board-toolbar__meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-inline-start: auto;
}

.rate-board-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rate-board-badge--warning {
  background: #fff7ed;
  color: #9a3412;
}

.rate-board-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.rate-board-updated::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #64748b;
}

.rate-board-empty {
  margin: 0.25rem 0;
  padding: 1.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
}

.rate-board-empty--search {
  margin-top: 0.5rem;
}

/* -------- Table -------- */
.rate-board-table-shell {
  position: relative;
}

.rate-board-table-responsive {
  border-radius: 14px;
  overflow: hidden;
}

.viewer-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
}

.viewer-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.65rem 0.9rem;
  background: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: start;
}

.viewer-table thead th.text-end {
  text-align: end;
}

.viewer-table tbody tr {
  transition: background-color 0.15s ease;
}

.viewer-table tbody tr[data-rate-row]:hover {
  background: #f8fafc;
}

.viewer-table tbody td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  vertical-align: middle;
}

.viewer-table tbody tr:last-child td {
  border-bottom: none;
}

/* -------- Cell content (shared with mobile card layout) -------- */
.viewer-currency {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.viewer-currency__headline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
}

.viewer-flag-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 1.75rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  overflow: hidden;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.viewer-flag-badge--placeholder {
  color: #94a3b8;
  background: #f1f5f9;
}

.viewer-flag-badge__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewer-flag-badge__fallback {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 700;
}

.viewer-currency__identity {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.viewer-currency__code {
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0f172a;
}

.viewer-currency__country {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-currency__subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-currency__name-inline {
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-currency__separator {
  color: #cbd5e1;
  font-weight: 600;
}

.viewer-currency__country-inline {
  color: #475569;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-currency__name {
  color: #64748b;
  font-size: 0.78rem;
  padding-inline-start: 3.05rem;
}

.viewer-company-stack {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  min-width: 0;
}

.viewer-company {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.92rem;
}

.viewer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef6ff;
  color: #174ea6;
  font-weight: 700;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.viewer-chip--commission {
  background: #eff6ff;
}

.viewer-rate {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 9rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.55);
  border-inline-start: 2px solid #10b981;
  color: #047857;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.viewer-updated-time {
  display: inline-block;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.viewer-updated-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.viewer-updated-user {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Hidden by inline search */
.viewer-table tbody tr[data-rate-row][hidden],
.viewer-table tbody tr[data-rate-row-note][hidden] {
  display: none !important;
}

/* -------- Responsive tweaks -------- */
@media (max-width: 991.98px) {
  .rate-board-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.1rem;
  }

  .rate-board-hero__converter {
    width: 100%;
  }

  .rate-board-filters__controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .rate-board-hero__stats {
    gap: 1rem;
  }

  .rate-board-filters {
    padding: 0.8rem;
  }

  .rate-board-filters__controls {
    grid-template-columns: 1fr;
  }

  .rate-board-filters__reset {
    margin-inline-start: 0;
  }

  .rate-board-toolbar {
    gap: 0.6rem;
  }

  .rate-board-toolbar__meta {
    margin-inline-start: 0;
    width: 100%;
  }
}

.viewer-converter-modal .modal-dialog {
  max-width: 640px;
}

.viewer-converter {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 52px rgba(15, 23, 42, 0.16);
}

.viewer-converter__header {
  align-items: flex-start;
  padding: 1.25rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
}

.viewer-converter__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.viewer-converter__subtitle {
  margin: 0.3rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.viewer-converter .modal-body {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.25rem 1rem;
}

.viewer-converter__summary {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewer-converter__grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewer-converter__swap-slot {
  display: flex;
  align-items: flex-end;
}

.viewer-converter__swap {
  width: 100%;
  min-height: 2.9rem;
  border-radius: 14px;
  font-weight: 700;
}

.viewer-converter__result-card {
  display: grid;
  gap: 0.28rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #12304b 100%);
  color: #ffffff;
}

.viewer-converter__result-card--payable {
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 36%),
    linear-gradient(135deg, #14532d 0%, #0f766e 100%);
  box-shadow: 0 22px 38px rgba(15, 118, 110, 0.18);
}

.viewer-converter__result-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-converter__result-value {
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.05;
}

.viewer-converter__result-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
}

.viewer-converter__details {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
}

.viewer-converter__detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #475569;
  font-size: 0.88rem;
}

.viewer-converter__detail-row strong {
  color: #0f172a;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.viewer-converter__note {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 18px;
  background: #f8fbff;
  color: #475569;
  font-size: 0.86rem;
}

.viewer-converter__footer {
  padding: 0.85rem 1.25rem 1.2rem;
  border-top: none;
}

.login-card {
  max-width: 440px;
  margin: 3.75rem auto 0;
  padding: 1.75rem;
}

.login-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.login-brand__badge {
  flex: 0 0 auto;
  width: 5.4rem;
  height: 5.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  border: 1px solid rgba(12, 35, 64, 0.1);
  box-shadow:
    0 22px 40px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.login-brand__logo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  background: #0c2340;
  object-fit: contain;
  object-position: center;
}

.login-brand__copy {
  display: grid;
  gap: 0.32rem;
}

.login-brand__name {
  color: #526073;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-credentials {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.credential-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: var(--panel-muted);
}

.credential-item code {
  direction: ltr;
  unicode-bidi: plaintext;
}

.app-body {
  position: relative;
  background:
    linear-gradient(180deg, #eef3f7 0%, #f8fafc 42%, #eef4f8 100%);
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
}

html[dir="rtl"] .app-body {
  font-family: Tahoma, "Segoe UI", sans-serif;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 26%),
    radial-gradient(circle at bottom center, rgba(15, 23, 42, 0.06), transparent 34%);
}

.topbar,
.page-host {
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 1rem 0 0;
  background: transparent;
  border-bottom: none;
}

.topbar__nav {
  padding: 0.9rem 1rem !important;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px);
}

.topbar__toggler {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 0.55rem 0.75rem;
  box-shadow: none;
}

.brandmark {
  gap: 0.95rem;
  min-width: 0;
}

.brandmark__badge {
  width: 3.35rem;
  height: 3.35rem;
  padding: 0.2rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 55%),
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 16px 28px rgba(2, 6, 23, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brandmark__copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.brandmark__title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.brandmark__meta {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar__menu {
  gap: 0.3rem;
  margin-inline-start: 1.4rem;
}

.topbar__link {
  padding: 0.72rem 1rem !important;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.72) !important;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.topbar__link:hover,
.topbar__link:focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
}

.topbar__link--active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.topbar__actions {
  margin-top: 0;
  margin-inline-start: auto;
  gap: 1rem;
}

.lang-switch {
  gap: 0.35rem;
  padding: 0.24rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-switch__form {
  margin: 0;
}

.lang-switch__button {
  min-height: 2.45rem;
  padding: 0.55rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-switch__button:hover,
.lang-switch__button:focus {
  color: #ffffff;
}

.lang-switch__button--active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.16);
}

.topbar__user-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-pill {
  min-height: 2.8rem;
  padding: 0.5rem 0.95rem;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.user-pill__name {
  font-size: 0.86rem;
  font-weight: 700;
}

.topbar__logout {
  min-height: 2.8rem;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: transparent;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar__logout:hover,
.topbar__logout:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.page-host {
  padding: 1.7rem 0 2.6rem;
}

.page-host__inner {
  position: relative;
}

.flash-alert {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: center;
  max-width: 860px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}

.login-showcase {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1rem;
  padding: 1.65rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.22), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(16, 185, 129, 0.15), transparent 35%),
    linear-gradient(145deg, #0f172a 0%, #122244 55%, #163050 100%);
  color: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 80%);
  opacity: 0.3;
}

.login-showcase::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  inset-inline-end: -50px;
  inset-block-end: -60px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 65%);
}

.login-showcase > * {
  position: relative;
  z-index: 1;
}

.login-showcase__badge {
  display: inline-flex;
  align-items: center;
  justify-self: flex-start;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-showcase__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-brand__badge--showcase {
  width: 3.75rem;
  height: 3.75rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-showcase__brand-copy {
  display: grid;
  gap: 0.2rem;
}

.login-showcase .login-brand__name {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
}

.login-showcase__title {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
}

.login-showcase__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  line-height: 1.6;
}

.login-showcase__points {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.login-showcase__point {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-showcase__point-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgba(125, 211, 252, 0.9);
}

.login-card {
  max-width: none;
  margin: 0;
  padding: 1.85rem;
  display: grid;
  align-content: center;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-card__head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.login-card__head--returning {
  justify-items: center;
  text-align: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.login-returning-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.login-returning-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-returning-avatar__fallback {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.login-returning-name {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
}

.login-switch-user {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  margin-top: 0.25rem;
}

.login-switch-user:hover {
  text-decoration: underline;
}

.login-card__eyebrow {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.45rem;
}

.login-card__subtitle {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form__field {
  margin: 0;
}

.login-form__field .form-control {
  min-height: 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.login-form__field .form-control::placeholder {
  color: #94a3b8;
}

.login-submit {
  min-height: 2.75rem;
  margin-top: 0.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover {
  opacity: 0.92;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.user-pill--link {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: #ffffff;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.user-pill--link:hover,
.user-pill--link:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.user-pill__avatar,
.profile-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4e89 100%);
}

.user-pill__avatar {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.profile-avatar--large {
  width: 5.75rem;
  height: 5.75rem;
  border: 4px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 24px 42px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(148, 163, 184, 0.18);
}

.user-pill__avatar-image,
.profile-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-pill__avatar-fallback,
.profile-avatar__fallback {
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
}

.user-pill__avatar-fallback {
  font-size: 0.92rem;
}

.profile-avatar__fallback {
  font-size: 1.6rem;
}

.user-pill__content {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.user-pill__meta {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge-soft--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.missing-rate-card__metric strong,
.missing-rate-card__history strong {
  word-break: break-word;
}

.profile-panel {
  position: relative;
  overflow: hidden;
}

.profile-panel::after {
  content: "";
  position: absolute;
  inset-inline-end: -72px;
  inset-block-start: -72px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1), transparent 70%);
  pointer-events: none;
}

.profile-panel > * {
  position: relative;
  z-index: 1;
}

.profile-panel--security::after {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 70%);
}

.profile-panel--totp::after {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
}

.profile-notice {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 42%),
    linear-gradient(180deg, #fff9eb 0%, #fff7d6 100%);
  color: #7c5700;
  box-shadow: 0 18px 32px rgba(245, 158, 11, 0.1);
}

.profile-notice__eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(124, 87, 0, 0.78);
}

.profile-form {
  display: grid;
  gap: 1rem;
}

.profile-form--security {
  align-content: start;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 36%),
    linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.profile-identity__copy {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.profile-identity__copy strong {
  font-size: 1.05rem;
}

.profile-identity__meta,
.profile-identity__role {
  color: #64748b;
  font-size: 0.86rem;
}

.profile-identity__role {
  font-weight: 700;
}

.validation-summary-errors ul,
.validation-summary-valid ul {
  margin: 0;
  padding-left: 1rem;
}

[dir="rtl"] .user-pill {
  align-items: flex-end;
}

[dir="rtl"] .rate-board-hero__stat dt,
[dir="rtl"] .rate-board-filters__label,
[dir="rtl"] .viewer-table thead th,
[dir="rtl"] .rate-entry-date-card__label,
[dir="rtl"] .rate-entry-date-card__month {
  letter-spacing: 0;
}

[dir="rtl"] .validation-summary-errors ul,
[dir="rtl"] .validation-summary-valid ul {
  padding-left: 0;
  padding-right: 1rem;
}

.text-danger {
  font-size: 0.84rem;
}

.validation-summary-errors,
.validation-summary-valid {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(239, 68, 68, 0.14);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: #991b1b;
  box-shadow: 0 16px 32px rgba(248, 113, 113, 0.08);
}

.validation-summary-valid:empty,
.validation-summary-errors:empty {
  display: none;
}

@media (max-width: 991.98px) {
  .topbar {
    padding-top: 0.75rem;
  }

  .topbar__nav {
    border-radius: 24px;
  }

  .topbar__menu {
    margin-inline-start: 0;
    margin-top: 0.9rem;
  }

  .topbar__actions {
    margin-top: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .content-grid--sidebar {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: 0;
    padding: 1rem;
    max-width: 440px;
  }

  .viewer-converter__grid {
    grid-template-columns: 1fr;
  }

  .viewer-converter__summary {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .missing-rate-card__metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .brandmark {
    gap: 0.65rem;
  }

  .brandmark__badge {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 999px;
  }

  .brandmark__label {
    max-width: 11rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brandmark__meta {
    letter-spacing: 0.04em;
  }

  .login-card {
    padding: 1.5rem;
  }

  .rate-entry-date-card {
    grid-template-columns: 1fr;
    justify-items: flex-start;
  }

  .rate-entry-date-card__calendar {
    min-width: 0;
  }

  .viewer-table {
    min-width: 700px;
  }

  .viewer-rate {
    min-width: 7.5rem;
    font-size: 1rem;
    padding: 0.4rem 0.55rem;
  }

  .viewer-chip {
    min-width: 4.75rem;
  }

  .viewer-converter .modal-body,
  .viewer-converter__header,
  .viewer-converter__footer {
    padding-inline: 1rem;
  }

  .missing-rate-card__head,
  .missing-rate-card__identity,
  .missing-rate-card__actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .topbar__user-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .user-pill--link {
    flex: 1 1 auto;
  }

  .profile-identity {
    flex-direction: column;
    align-items: flex-start;
  }
}

.badge-soft--warning {
  background: #fff7ed;
  color: #9a3412;
}

.rates-status-panel {
  margin-bottom: 1.2rem;
}

.inactive-pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.inactive-pair-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: 24px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 251, 235, 0.94) 100%);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.inactive-pair-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.1);
}

.inactive-pair-card--selected {
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow:
    0 24px 44px rgba(59, 130, 246, 0.14),
    inset 0 0 0 1px rgba(59, 130, 246, 0.14);
}

.inactive-pair-card__head,
.inactive-pair-card__identity,
.inactive-pair-card__actions {
  display: flex;
  align-items: center;
}

.inactive-pair-card__head {
  justify-content: space-between;
  gap: 1rem;
}

.inactive-pair-card__identity {
  gap: 0.85rem;
}

.inactive-pair-card__copy,
.inactive-pair-card__company,
.inactive-pair-card__history,
.inactive-pair-card__meta {
  display: grid;
  gap: 0.25rem;
}

.inactive-pair-card__copy strong,
.inactive-pair-card__company strong,
.inactive-pair-card__metric strong,
.inactive-pair-card__meta strong {
  color: #0f172a;
}

.inactive-pair-card__copy span,
.inactive-pair-card__company span,
.inactive-pair-card__history span,
.inactive-pair-card__metric span,
.inactive-pair-card__meta span,
.inactive-pair-card__meta small {
  color: #64748b;
}

.inactive-pair-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.inactive-pair-card__metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.inactive-pair-card__history {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  background: rgba(255, 255, 255, 0.7);
}

.inactive-pair-card__actions {
  flex-wrap: wrap;
  gap: 0.65rem;
}

.inactive-pair-card__actions form {
  margin: 0;
}

.rate-entry-availability {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.rate-entry-availability--active {
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.rate-entry-availability--inactive {
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
  border-color: rgba(245, 158, 11, 0.24);
}

.rate-entry-availability__copy {
  display: grid;
  gap: 0.25rem;
}

.rate-entry-availability__copy strong {
  color: #0f172a;
  font-size: 1rem;
}

.rate-entry-availability__copy span:last-child {
  color: #64748b;
}

.rate-entry-availability__eyebrow {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rate-entry-availability__form {
  margin: 0;
}

.rate-entry-banner {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.rate-entry-banner strong {
  color: #9a3412;
}

.rate-entry-banner span {
  color: #7c2d12;
}

.rate-entry-banner--warning {
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
}

.viewer-table__row--inactive td {
  background:
    linear-gradient(90deg, rgba(190, 24, 93, 0.06) 0, rgba(190, 24, 93, 0.06) 4px, rgba(255, 241, 242, 0.6) 4px),
    rgba(255, 247, 247, 0.7);
  border-bottom-color: rgba(244, 114, 182, 0.22);
}

.viewer-table__row--inactive td:first-child {
  box-shadow: inset 3px 0 0 #be185d;
}

.viewer-table__row--inactive:hover td {
  background:
    linear-gradient(90deg, rgba(190, 24, 93, 0.1) 0, rgba(190, 24, 93, 0.1) 4px, rgba(255, 228, 230, 0.8) 4px),
    rgba(255, 241, 242, 0.9);
}

.viewer-company-stack {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.viewer-company--inactive {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: rgba(244, 114, 182, 0.24);
  color: #9f1239;
}

.viewer-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.viewer-status-pill--inactive {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid rgba(244, 114, 182, 0.22);
  color: #9f1239;
  box-shadow: 0 10px 18px rgba(244, 114, 182, 0.12);
}

.viewer-chip--inactive {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  color: #9f1239;
  border: 1px solid rgba(244, 114, 182, 0.18);
  box-shadow:
    0 12px 24px rgba(244, 114, 182, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.viewer-rate--inactive {
  background: rgba(255, 237, 237, 0.6);
  border-inline-start-color: #f87171;
  color: #9f1239;
  opacity: 0.82;
}

@media (max-width: 991.98px) {
  .rate-entry-availability {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 767.98px) {
  .inactive-pair-grid,
  .inactive-pair-card__metrics {
    grid-template-columns: 1fr;
  }
}

/* ── Rate note bar (rate board) ─────────────────────────── */
.viewer-table__row--has-note > td {
  border-bottom: none !important;
  background: rgba(255, 251, 235, 0.55) !important;
}

.viewer-table__row--has-note > td:first-child {
  box-shadow: inset 3px 0 0 #f59e0b;
}

html[dir="rtl"] .viewer-table__row--has-note > td:first-child {
  box-shadow: inset -3px 0 0 #f59e0b;
}

.viewer-table__row--has-note.viewer-table__row--inactive > td {
  background: rgba(255, 241, 242, 0.6) !important;
}

.viewer-table__row--has-note.viewer-table__row--inactive > td:first-child {
  box-shadow: inset 3px 0 0 #be185d;
}

html[dir="rtl"] .viewer-table__row--has-note.viewer-table__row--inactive > td:first-child {
  box-shadow: inset -3px 0 0 #be185d;
}

.viewer-table__note-row > td {
  padding: 0 !important;
  border-top: none !important;
}

.viewer-note-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.65rem 2.2rem;
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b;
  color: #78350f;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  position: relative;
}

html[dir="rtl"] .viewer-note-bar {
  padding: 0.5rem 2.2rem 0.65rem 1rem;
  box-shadow: inset -3px 0 0 #f59e0b;
}

.viewer-note-bar::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 0;
  width: 0.85rem;
  height: 0.85rem;
  border-left: 2px solid #f59e0b;
  border-bottom: 2px solid #f59e0b;
  border-bottom-left-radius: 6px;
  opacity: 0.65;
}

html[dir="rtl"] .viewer-note-bar::before {
  left: auto;
  right: 0.95rem;
  border-left: none;
  border-right: 2px solid #f59e0b;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 6px;
}

.viewer-note-bar--inactive {
  background: linear-gradient(180deg, #fff1f2 0%, #fff5f6 100%);
  box-shadow: inset 3px 0 0 #be185d, inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: #9f1239;
}

html[dir="rtl"] .viewer-note-bar--inactive {
  box-shadow: inset -3px 0 0 #be185d, inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.viewer-note-bar--inactive::before {
  border-left-color: #be185d;
  border-bottom-color: #be185d;
}

html[dir="rtl"] .viewer-note-bar--inactive::before {
  border-right-color: #be185d;
  border-bottom-color: #be185d;
}

.viewer-note-bar__icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: #d97706;
  opacity: 0.85;
}

.viewer-note-bar--inactive .viewer-note-bar__icon {
  color: #be185d;
}

/* Rate note inline (rate management list) */
.rate-note-inline {
  display: inline-block;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  color: #78350f;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  cursor: default;
}

/* Notes textarea full-width in form grid */
.form-field--full {
  grid-column: 1 / -1;
}

/* ================================================================
   RESPONSIVE REFINEMENTS
   Covers modern devices: wide desktop → small phone (360px+)
   Breakpoints: 1199 / 991 / 767 / 575 / 400
   ================================================================ */

/* Prevent accidental horizontal page overflow */
.container-xxl {
  max-width: 100%;
}

/* ---- Wide desktop → laptop (≤ 1199.98px) ---- */
@media (max-width: 1199.98px) {
  .page-host__inner {
    padding-inline: 1rem;
  }
}

/* ---- Tablet landscape and below (≤ 991.98px) ---- */
@media (max-width: 991.98px) {
  .page-host__inner {
    padding-inline: 0.85rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  /* Topbar actions stack cleanly in collapsed state */
  .topbar__actions {
    width: 100%;
    gap: 0.6rem;
  }

  .topbar__menu {
    width: 100%;
  }

  .topbar__link {
    display: inline-flex;
    padding-block: 0.55rem;
  }

  /* Management tables: horizontal scroll with comfortable min-width */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive .data-table {
    min-width: 680px;
  }
}

/* ---- Tablet portrait / phone landscape (≤ 767.98px) ---- */
@media (max-width: 767.98px) {
  .page-host__inner {
    padding-inline: 0.65rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title {
    font-size: 1.3rem;
  }

  /* Stat grid: 2 columns */
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.9rem 1rem;
  }

  .stat-card__value {
    font-size: 1.6rem;
  }

  /* Rate entry date card: cleaner vertical layout */
  .rate-entry-date-card {
    padding: 0.9rem 1rem;
  }

  .rate-entry-date-card__day {
    font-size: 1.75rem;
  }

  /* Topbar user-cluster full-width */
  .topbar__user-cluster {
    width: 100%;
    gap: 0.5rem;
  }

  .user-pill--link {
    min-width: 0;
    flex: 1 1 0;
  }

  .user-pill__content {
    min-width: 0;
  }

  .user-pill__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ========== Rate board: transform table into cards ========== */
  .viewer-table-shell {
    padding: 0 0.55rem 0.8rem;
  }

  .viewer-table-responsive {
    overflow: visible;
  }

  .viewer-table,
  .viewer-table thead,
  .viewer-table tbody,
  .viewer-table tr,
  .viewer-table td {
    display: block;
  }

  .viewer-table {
    min-width: 0;
    border-spacing: 0;
  }

  .viewer-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .viewer-table tbody tr:not(.viewer-table__note-row) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.9rem;
    row-gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.95rem 0.95rem 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  }

  .viewer-table tbody tr.viewer-table__row--has-note {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 14px 22px rgba(15, 23, 42, 0.05);
  }

  .viewer-table tbody td {
    padding: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    min-height: 0;
  }

  .viewer-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
  }

  .viewer-table tbody td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed rgba(226, 232, 240, 0.92) !important;
  }

  .viewer-table tbody td:first-child::before {
    display: none;
  }

  .viewer-table tbody td.text-end {
    text-align: start !important;
  }

  /* Inactive row: keep pink left-accent but re-scope to the card */
  .viewer-table tbody tr.viewer-table__row--inactive {
    background:
      linear-gradient(180deg, rgba(255, 241, 242, 0.98) 0%, rgba(255, 247, 237, 0.98) 100%);
    border-color: rgba(244, 114, 182, 0.32);
    box-shadow:
      inset 4px 0 0 #be185d,
      0 14px 30px rgba(244, 114, 182, 0.1);
  }

  html[dir="rtl"] .viewer-table tbody tr.viewer-table__row--inactive {
    box-shadow:
      inset -4px 0 0 #be185d,
      0 14px 30px rgba(244, 114, 182, 0.1);
  }

  .viewer-table__row--inactive td {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Note row stuck beneath its card */
  .viewer-table__note-row {
    margin-bottom: 0.85rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-top: none;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    background: #fffbeb;
  }

  .viewer-table tbody tr.viewer-table__row--inactive + .viewer-table__note-row {
    background: #fff1f2;
    border-color: rgba(244, 114, 182, 0.3);
  }

  .viewer-table__note-row td {
    padding: 0 !important;
  }

  .viewer-note-bar {
    padding: 0.55rem 0.95rem 0.65rem;
    background: transparent;
    border-left-width: 0;
  }

  /* Compact chip/rate on cards */
  .viewer-rate {
    min-width: 0;
    padding: 0.55rem 0.85rem;
    font-size: 1.05rem;
  }

  .viewer-chip {
    min-width: 0;
    padding: 0.55rem 0.8rem;
  }

  .viewer-currency__name {
    padding-inline-start: 3.65rem;
  }

  .viewer-updated {
    min-height: 0;
  }

  /* Modals become fullscreen below md */
  .viewer-converter-modal .modal-dialog,
  .app-confirm-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
  }

  .viewer-converter-modal .modal-content,
  .app-confirm-modal .modal-content {
    border-radius: 0;
    min-height: 100vh;
  }
}

/* ---- Small phones (≤ 575.98px) ---- */
@media (max-width: 575.98px) {
  .page-title {
    font-size: 1.2rem;
  }

  .page-subtitle {
    font-size: 0.86rem;
  }

  .panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .panel__header {
    margin-bottom: 0.75rem;
  }

  .panel__title {
    font-size: 1rem;
  }

  .panel__subtitle {
    font-size: 0.82rem;
  }

  .stat-card__value {
    font-size: 1.45rem;
  }

  .stat-card__label {
    font-size: 0.78rem;
  }

  .form-control,
  .form-select {
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
  }

  .btn {
    padding: 0.55rem 0.95rem;
  }

  /* Rate entry date card → column layout */
  .rate-entry-date-card {
    grid-template-columns: 1fr;
    text-align: start;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
  }

  .rate-entry-date-card__badge {
    justify-self: start;
  }

  /* Management tables: more compact */
  .data-table thead th,
  .data-table tbody td {
    padding: 0.7rem 0.55rem;
    font-size: 0.86rem;
  }

  .cell-title strong {
    font-size: 0.9rem;
  }

  .cell-title small {
    font-size: 0.76rem;
  }

  .data-table thead th {
    font-size: 0.74rem;
  }

  /* Topbar user-meta too chatty on tiny screens */
  .user-pill__meta {
    display: none;
  }

  /* Brandmark compact */
  .brandmark__badge {
    width: 2.4rem;
    height: 2.4rem;
  }

  .brandmark__title {
    font-size: 0.94rem;
  }

  .brandmark__meta {
    font-size: 0.68rem;
  }
}

/* ---- Very small phones (≤ 400px) ---- */
@media (max-width: 400px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .viewer-table tbody tr:not(.viewer-table__note-row) {
    grid-template-columns: 1fr;
  }

  .viewer-table tbody td.text-end {
    align-items: flex-start;
  }

  .topbar__user-cluster {
    flex-direction: column;
    align-items: stretch;
  }

  .user-pill--link {
    width: 100%;
  }

  .topbar__logout {
    width: 100%;
  }

  .lang-switch {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---- Touch device affordances (hover fixes) ---- */
@media (hover: none) {
  .viewer-table tbody tr:hover,
  .data-table tbody tr:hover,
  .inactive-pair-card:hover,
  .missing-rate-card:hover {
    transform: none;
  }
}

/* ================================================================
   TIERED RATE STYLES
   ================================================================ */

/* --- Tier table in viewer board (rate display) --- */
.rate-tier-table {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  width: 100%;
  min-width: 9rem;
  font-family: "Bahnschrift", "Segoe UI", Tahoma, sans-serif;
  font-variant-numeric: tabular-nums;
}

.rate-tier-table__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.32rem 0.6rem;
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.45);
  border-inline-start: 2px solid #10b981;
  transition: background 0.15s;
}

.rate-tier-table__row--last {
  background: rgba(209, 250, 229, 0.6);
}

.rate-tier-table--inactive .rate-tier-table__row {
  background: rgba(255, 237, 237, 0.6);
  border-inline-start-color: #f87171;
  opacity: 0.82;
}

.rate-tier-table__range {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.rate-tier-table__rate {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: #047857;
  white-space: nowrap;
}

.rate-tier-table--inactive .rate-tier-table__rate {
  color: #9f1239;
}

/* Compact variant for the management rate list table */
.rate-tier-table--compact {
  min-width: 100px;
  gap: 0.12rem;
}

.rate-tier-table--compact .rate-tier-table__row {
  padding: 0.15rem 0.4rem;
}

.rate-tier-table--compact .rate-tier-table__rate {
  font-size: 0.82rem;
}

/* --- Tier toggle button --- */
.tier-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: none;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #64748b;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  margin-top: 0.25rem;
}

.tier-toggle:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.03);
}

.tier-toggle--active {
  border-style: solid;
  border-color: #6366f1;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.05);
}

.tier-toggle__badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #f1f5f9;
  color: #94a3b8;
  flex-shrink: 0;
}

.tier-toggle--active .tier-toggle__badge {
  background: #ede9fe;
  color: #6366f1;
}

/* --- Tier section (collapsible) --- */
.tier-section {
  margin-top: 0.55rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfc;
}

.tier-section__head {
  display: grid;
  grid-template-columns: 1fr 1fr 2rem;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* --- Individual tier row --- */
.tier-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2rem;
  gap: 0.5rem;
  align-items: end;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.tier-row__cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tier-row__cell--action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.1rem;
}

.tier-row__label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tier-row__to-display {
  padding: 0.38rem 0.6rem;
  font-size: 0.875rem;
  color: #4f46e5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(99, 102, 241, 0.07);
  border-radius: 8px;
  text-align: center;
}

/* Remove button */
.tier-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: none;
  border: 1.5px solid #fecaca;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  color: #f87171;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.tier-remove-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* Add tier button */
.tier-add-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: none;
  border: none;
  border-top: 1px solid #e2e8f0;
  color: #6366f1;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: start;
}

.tier-add-btn:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* --- Converter tier note row --- */
.viewer-converter__tier-row {
  border-top: 1px dashed rgba(226, 232, 240, 0.8);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* RTL adjustments */
html[dir="rtl"] .tier-section__head,
html[dir="rtl"] .tier-row {
  direction: rtl;
}

html[dir="rtl"] .tier-toggle {
  flex-direction: row-reverse;
}

/* Viewer board mobile: tiers in card layout */
@media (max-width: 767.98px) {
  .rate-tier-table {
    min-width: unset;
    width: 100%;
  }

  .rate-tier-table__row {
    padding: 0.28rem 0.6rem;
  }
}

/* ================================================================
   BACK-OFFICE SHELL — shared admin pages (dashboard/users/etc)
   ================================================================ */

.admin-shell {
  display: grid;
  gap: 1rem;
}

.admin-hero__subtitle {
  margin: 0.2rem 0 0.4rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 52ch;
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.admin-grid--two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}

@media (max-width: 991.98px) {
  .admin-grid--two {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-panel {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.admin-panel--narrow {
  max-width: 720px;
}

.admin-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.28);
}

.admin-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.admin-panel__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.admin-panel__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-panel__footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.4rem;
}

/* -------- Online indicator + user list -------- */
.online-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.online-user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 26rem;
  overflow-y: auto;
}

.online-user-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.online-user-list__avatar {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.online-user-list__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.online-user-list__name {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-list__meta {
  font-size: 0.72rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-list__time {
  flex: 0 0 auto;
  font-size: 0.76rem;
  color: #475569;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* -------- Locked pill -------- */
.locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.locked-pill svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* -------- Currency chips (Companies table) -------- */
.currency-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 18rem;
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* -------- Supported currencies modal grid -------- */
.currency-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.55rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.currency-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.currency-checkbox:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: #ffffff;
}

.currency-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  accent-color: #1d4ed8;
}

.currency-checkbox__code {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.82rem;
}

.currency-checkbox__name {
  color: #64748b;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.currency-chip--default {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.42);
  color: #065f46;
}

.country-currency-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 24rem;
}

.country-currency-summary__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.country-currency-summary__country {
  font-weight: 700;
  font-size: 0.72rem;
  color: #0f172a;
  min-width: 3.2rem;
}

.country-currency-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.country-currency-editor__toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.country-currency-editor__toolbar select {
  flex: 1 1 auto;
  min-width: 0;
}

.country-currency-editor__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 24rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.country-currency-editor__country {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
}

.country-currency-editor__country-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.country-currency-editor__country-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex: 1 1 auto;
  min-width: 0;
}

.country-currency-editor__country-meta strong {
  font-size: 0.88rem;
  color: #0f172a;
}

.country-currency-editor__flag {
  font-size: 1.35rem;
}

.country-currency-editor__remove-country {
  margin-inline-start: auto;
}

.country-currency-editor__currency-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.country-currency-editor__currency-list:empty {
  display: none;
}

.country-currency-editor__currency-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #ffffff;
  font-size: 0.78rem;
}

.country-currency-editor__code {
  font-weight: 700;
  color: #0f172a;
}

.country-currency-editor__name {
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.country-currency-editor__default {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #475569;
  font-size: 0.72rem;
  margin: 0;
}

.country-currency-editor__default input[type="radio"] {
  accent-color: #10b981;
}

.country-currency-editor__remove-currency {
  padding: 0.1rem 0.45rem;
  line-height: 1;
}

.country-currency-editor__add-currency {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.country-currency-editor__add-currency select {
  flex: 1 1 auto;
  min-width: 0;
}

.empty-state--inline {
  padding: 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
  background: #f8fafc;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 10px;
}

.data-table--tight th,
.data-table--tight td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

[dir="rtl"] .online-user-list__time {
  font-variant-numeric: tabular-nums;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.pagination-bar__info {
  color: var(--muted);
  font-size: 0.88rem;
}

.pagination-bar__info strong {
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.pagination-bar__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  text-decoration: none;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  font-variant-numeric: tabular-nums;
}

.pagination-bar__btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pagination-bar__btn--current {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
  cursor: default;
}

.pagination-bar__btn--disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-bar__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  color: var(--muted);
}

.pagination-bar__size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.pagination-bar__size label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.pagination-bar__size select {
  width: auto;
  min-width: 4.5rem;
}

@media (max-width: 640px) {
  .pagination-bar {
    justify-content: center;
  }
  .pagination-bar__info {
    order: 3;
    width: 100%;
    text-align: center;
  }
}

.searchable-select {
  position: relative;
  display: block;
  width: 100%;
}

.searchable-select__native {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
  pointer-events: none;
}

.searchable-select__input {
  width: 100%;
  cursor: text;
}

.searchable-select__panel {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 50;
  max-height: 18rem;
  overflow-y: auto;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 0.25rem;
}

.searchable-select__panel[hidden] {
  display: none;
}

.searchable-select__option {
  display: block;
  width: 100%;
  text-align: inherit;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font: inherit;
  color: #0f172a;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchable-select__option:hover,
.searchable-select__option--active {
  background-color: #eef2ff;
  color: #1e3a8a;
}

.searchable-select__empty {
  padding: 0.75rem;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

[dir="rtl"] .searchable-select__option {
  text-align: right;
}

/* TOTP setup centered layout */
.totp-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.totp-setup__verify-form {
  width: 100%;
  max-width: 280px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* 2FA badge */
.badge-soft--info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.totp-pill svg,
.locked-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.totp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* TOTP / 2FA */
.totp-input {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-align: center;
}

.totp-status {
  padding: 1rem 0;
}

.totp-status__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
}

.totp-status--active .totp-status__badge {
  background: #dcfce7;
  color: #166534;
}

.totp-setup__qr {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.totp-setup__qr img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.5rem;
  background: #fff;
}

.totp-setup__secret {
  text-align: center;
  margin-bottom: 1rem;
}

.totp-setup__secret label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.totp-secret-key {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  word-break: break-all;
  user-select: all;
  background: var(--panel-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
}

.totp-setup__instruction {
  font-size: 0.9rem;
  color: #475569;
  text-align: center;
}

.totp-disable-form {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ── Messaging ─────────────────────────────────────────── */

.msg-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .msg-layout {
    grid-template-columns: 1fr;
  }
}

.msg-contacts {
  overflow: hidden;
}

.msg-contacts__header,
.msg-conversations__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.msg-contacts__title,
.msg-conversations__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.msg-contacts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow-y: auto;
}

.msg-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.msg-contact-item:hover {
  background: var(--surface-hover, #f1f5f9);
}

.msg-contact-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.msg-contact-item__name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-contact-item__role {
  font-size: 0.76rem;
  color: #64748b;
}

.msg-contact-item__badge {
  margin-inline-start: auto;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Avatar */
.msg-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #6366f1);
}

.msg-avatar--sm {
  width: 34px;
  height: 34px;
}

.msg-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-avatar__fallback {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.msg-avatar--sm .msg-avatar__fallback {
  font-size: 0.78rem;
}

/* Conversations list */
.msg-conversations {
  overflow: hidden;
}

.msg-conversation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.msg-conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.msg-conv-item:hover {
  background: var(--surface-hover, #f1f5f9);
}

.msg-conv-item--unread {
  background: #eff6ff;
}

.msg-conv-item--unread:hover {
  background: #dbeafe;
}

.msg-conv-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.msg-conv-item__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.msg-conv-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-item__time {
  font-size: 0.72rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.msg-conv-item__preview {
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-item__you {
  font-weight: 600;
  color: #475569;
}

.msg-conv-item__badge {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.msg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  text-align: center;
  gap: 0.75rem;
}

.msg-empty svg {
  opacity: 0.4;
}

.msg-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* Chat view */
.msg-chat-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 110px);
  min-height: 400px;
  overflow: hidden;
}

.page-host:has(.msg-chat-shell) {
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
}

.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.msg-chat-header__back {
  color: #64748b;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.15s;
}

[dir="rtl"] .msg-chat-header__back svg {
  transform: scaleX(-1);
}

.msg-chat-header__back:hover {
  color: var(--primary);
}

.msg-chat-header__info {
  display: flex;
  flex-direction: column;
}

.msg-chat-header__info strong {
  font-size: 0.95rem;
}

.msg-chat-header__role {
  font-size: 0.76rem;
  color: #64748b;
}

.msg-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #f8fafc;
}

.msg-bubble {
  max-width: 70%;
  display: flex;
  flex-direction: column;
}

.msg-bubble--sent {
  align-self: flex-end;
}

.msg-bubble--received {
  align-self: flex-start;
}

.msg-bubble__text {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg-bubble--sent .msg-bubble__text {
  background: var(--primary);
  color: #fff;
  border-bottom-inline-end-radius: 0.25rem;
}

.msg-bubble--received .msg-bubble__text {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-inline-start-radius: 0.25rem;
}

.msg-bubble__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  padding: 0 0.25rem;
}

.msg-bubble--sent .msg-bubble__meta {
  justify-content: flex-end;
}

.msg-bubble__read-icon {
  color: var(--primary);
}

.msg-bubble__attachment {
  margin-top: 0.25rem;
}

.msg-bubble__image {
  max-width: 240px;
  max-height: 200px;
  border-radius: 0.75rem;
  object-fit: cover;
  cursor: pointer;
}

.msg-bubble__file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.04);
  color: var(--primary);
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid var(--border);
}

.msg-bubble__file-link:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Compose bar */
.msg-compose {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  flex-shrink: 0;
}

.msg-compose__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.msg-compose__input {
  flex: 1;
}

.msg-compose__attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.msg-compose__attach-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.msg-compose__file-input {
  display: none;
}

.msg-compose__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-compose__hint {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

.msg-compose__file-name {
  display: block;
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 0.25rem;
  font-weight: 500;
}

.msg-empty--chat {
  flex: 1;
}

/* Unread badge in navbar */
.topbar__msg-badge {
  position: relative;
  display: flex;
  align-items: center;
  color: #64748b;
  text-decoration: none;
  padding: 0.25rem;
  transition: color 0.15s;
}

.topbar__msg-badge:hover {
  color: var(--primary);
}

.topbar__msg-count {
  position: absolute;
  top: -4px;
  inset-inline-end: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Online dot */
.msg-avatar {
  position: relative;
}

.msg-avatar__online-dot {
  position: absolute;
  bottom: 1px;
  inset-inline-end: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  transition: opacity 0.2s;
}

.msg-avatar__online-dot--off {
  background: #cbd5e1;
}

/* Typing indicator */
.msg-typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.25rem;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.msg-typing__dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.msg-typing__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: msgTypingDot 1.2s infinite ease-in-out;
}

.msg-typing__dots span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes msgTypingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

.msg-typing__text {
  font-style: italic;
}

/* Chat header status */
.msg-chat-header__status {
  font-size: 0.76rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.msg-chat-header__status--online {
  color: #22c55e;
}

/* WhatsApp-style ticks */
.msg-tick {
  color: #94a3b8;
}

.msg-tick--read {
  color: #3b82f6;
}

/* Contact search */
.msg-contacts__search {
  padding-top: 0.5rem;
}

.form-control--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

/* Compose disabled state */
.msg-compose__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* d-none utility */
.d-none { display: none !important; }

/* ================================================================
   RESPONSIVE FORMS — comprehensive audit fixes
   Targets: 320px (iPhone SE) → 4K+
   ================================================================ */

/* ---- Touch targets: ensure 44px minimum on touch devices ---- */
@media (pointer: coarse) {
  .form-control,
  .form-select {
    min-height: 2.95rem;
  }

  .btn-sm {
    min-height: 2.75rem;
    padding: 0.5rem 0.85rem;
  }

  .btn {
    min-height: 2.95rem;
  }

  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }

  .country-currency-editor__default input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ---- Login shell: compact below 480px ---- */
@media (max-width: 479.98px) {
  .login-shell {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .login-showcase {
    padding: 1.15rem;
    border-radius: 16px;
    gap: 0.75rem;
  }

  .login-card {
    padding: 1.15rem;
    border-radius: 16px;
  }

  .login-showcase__title {
    font-size: 1.2rem;
  }

  .login-brand__badge--showcase {
    width: 2.75rem;
    height: 2.75rem;
  }

  .login-title {
    font-size: 1.25rem;
  }

  .login-showcase__point {
    padding: 0.35rem 0.55rem;
    font-size: 0.76rem;
  }

  .login-showcase__point-icon {
    width: 0.85rem;
    height: 0.85rem;
  }
}

/* ---- Form grid: prevent overflow on very small screens ---- */
@media (max-width: 479.98px) {
  .form-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Content grid sidebar: better stacked layout ---- */
@media (max-width: 991.98px) {
  .content-grid--sidebar > .admin-panel:first-child,
  .content-grid--sidebar > .panel:first-child {
    max-width: 100%;
  }
}

/* ---- Table actions: wrap gracefully on mobile ---- */
.table-actions {
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .table-actions {
    gap: 0.4rem;
  }

  .table-actions .btn-sm {
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/* ---- TOTP input: prevent overflow on small screens ---- */
@media (max-width: 479.98px) {
  .totp-input {
    font-size: 1.25rem;
    letter-spacing: 0.35em;
    padding-inline: 0.5rem;
  }
}

/* ---- Profile form: consistent spacing ---- */
@media (max-width: 575.98px) {
  .profile-form .form-grid {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-identity__copy {
    text-align: center;
  }
}

/* ---- TOTP disable form: responsive instead of inline max-width ---- */
.totp-disable-form .form-control {
  max-width: min(320px, 100%);
}

/* ---- Country-currency editor toolbar: wrap on narrow modals ---- */
.country-currency-editor__toolbar {
  flex-wrap: wrap;
}

@media (max-width: 575.98px) {
  .country-currency-editor__toolbar {
    gap: 0.5rem;
  }

  .country-currency-editor__toolbar > select {
    min-width: 0;
    flex: 1 1 100%;
  }

  .country-currency-editor__toolbar > button {
    width: 100%;
  }

  .country-currency-editor__currency-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .country-currency-editor__country-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ---- Rate entry form: ensure date card + fields don't overflow ---- */
@media (max-width: 479.98px) {
  .rate-entry-date-card {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
  }

  .rate-entry-date-card__calendar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .rate-entry-date-card__badge {
    justify-self: start;
  }
}

/* ---- Pagination bar: better wrapping on mid-size screens ---- */
@media (max-width: 767.98px) {
  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .pagination-bar__pages {
    order: 1;
  }

  .pagination-bar__info {
    order: 2;
    text-align: center;
  }

  .pagination-bar__size {
    order: 3;
  }
}

/* ---- Modals: fullscreen earlier on phones ---- */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .modal-content {
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .modal-dialog-centered {
    align-items: stretch;
  }

  .modal-body {
    overflow-y: auto;
  }
}

/* ---- Filter grid in Rates page: optimized breakpoints ---- */
@media (min-width: 480px) and (max-width: 767.98px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Admin panel: padding adjustments on small phones ---- */
@media (max-width: 479.98px) {
  .admin-panel {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
  }

  .admin-panel__header {
    flex-direction: column;
    gap: 0.6rem;
  }

  .rate-board-hero__stats {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .rate-board-hero__stat {
    min-width: 0;
  }
}

/* ---- Viewer converter modal: responsive grid ---- */
@media (max-width: 479.98px) {
  .viewer-converter__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .viewer-converter__swap-slot {
    order: 3;
  }

  .viewer-converter__summary {
    grid-template-columns: 1fr;
  }
}

/* ---- Large desktop (1921px+): wider form max-widths ---- */
@media (min-width: 1921px) {
  .content-grid--sidebar {
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  }

  .login-shell {
    max-width: 960px;
    gap: 1.5rem;
  }

  .admin-panel--narrow {
    max-width: 860px;
  }

  .form-control,
  .form-select {
    font-size: 1rem;
  }
}

/* ---- Rate board search: full width on small screens ---- */
@media (max-width: 575.98px) {
  .rate-board-search {
    width: 100%;
  }

  .rate-board-search__input {
    width: 100%;
  }
}

/* ---- Tier section: responsive on narrow screens ---- */
@media (max-width: 479.98px) {
  .tier-section__head {
    font-size: 0.75rem;
    gap: 0.35rem;
  }

  .tier-row {
    gap: 0.35rem;
  }

  .tier-row input {
    min-width: 0;
  }
}

/* ---- Message layout: earlier collapse ---- */
@media (max-width: 575.98px) {
  .msg-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
}

/* ---- Prevent any horizontal overflow globally ---- */
.rate-board-shell,
.admin-shell,
.login-shell,
.page-shell {
  max-width: 100%;
  overflow-x: hidden;
}
