/*
 * FXCR Admin UI
 * Isolated premium-style admin skin for plugin settings pages.
 * Scope is strictly limited to `.crtoday-admin`.
 */

.crtoday-admin {
  --crtoday-admin-bg: #f8fafc;
  --crtoday-admin-surface: #ffffff;
  --crtoday-admin-surface-soft: #f9fafb;
  --crtoday-admin-border: #e2e8f0;
  --crtoday-admin-border-strong: #cbd5e1;
  --crtoday-admin-text: #0f172a;
  --crtoday-admin-text-muted: #64748b;
  --crtoday-admin-accent: #6f3ff5;
  --crtoday-admin-accent-strong: #5f33dc;
  --crtoday-admin-accent-soft: rgba(111, 63, 245, 0.16);
  --crtoday-admin-button-accent: #10b981;
  --crtoday-admin-button-accent-strong: #059669;
  --crtoday-admin-button-accent-soft: rgba(16, 185, 129, 0.2);
  --crtoday-admin-warning: #f59e0b;
  --crtoday-admin-warning-strong: #d97706;
  --crtoday-admin-warning-soft: rgba(245, 158, 11, 0.24);
  --crtoday-admin-danger: #dc2626;
  --crtoday-admin-radius-sm: 10px;
  --crtoday-admin-radius-md: 14px;
  --crtoday-admin-radius-lg: 18px;
  --crtoday-admin-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --crtoday-admin-shadow-md: 0 10px 26px rgba(15, 23, 42, 0.08);
  --crtoday-admin-shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.12);
  color: var(--crtoday-admin-text);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 6px;
  line-height: 1.45;
}

.crtoday-admin .crtoday-admin-tab-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

.crtoday-admin > h1,
.crtoday-admin > .notice,
.crtoday-admin > .update-nag,
.crtoday-admin > .error {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  box-sizing: border-box;
}

.crtoday-admin h1 {
  margin-block: 12px 20px;
  color: var(--crtoday-admin-text);
  justify-content: flex-start;
}

.crtoday-admin h1 img {
  border-radius: 14px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.crtoday-admin .nav-tab-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 0;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  margin-bottom: 20px;
  padding: 0;
}

.crtoday-admin .nav-tab {
  border: 1px solid var(--crtoday-admin-border);
  background: var(--crtoday-admin-surface);
  border-radius: 999px;
  padding: 9px 14px;
  margin: 0;
  color: var(--crtoday-admin-text-muted);
  box-shadow: var(--crtoday-admin-shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.crtoday-admin .nav-tab:hover {
  color: var(--crtoday-admin-text);
  border-color: var(--crtoday-admin-border-strong);
  transform: translateY(-1px);
}

.crtoday-admin .nav-tab.nav-tab-active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.crtoday-admin .postbox {
  border: 1px solid var(--crtoday-admin-border);
  border-radius: var(--crtoday-admin-radius-md);
  box-shadow: var(--crtoday-admin-shadow-md);
  overflow: hidden;
  background: var(--crtoday-admin-surface);
}

.crtoday-admin .postbox .postbox-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--crtoday-admin-border);
}

.crtoday-admin .postbox .postbox-header h2,
.crtoday-admin .postbox .postbox-header h3 {
  color: var(--crtoday-admin-text);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crtoday-admin .postbox .postbox-header h2 .dashicons,
.crtoday-admin .postbox .postbox-header h3 .dashicons,
.crtoday-admin .crtoday-admin-shortcode-output h3 .dashicons,
.crtoday-admin #crtoday-shortcode-form > div > h3 .dashicons,
.crtoday-admin #crtoday-conv-shortcode-form > div > h3 .dashicons {
  color: var(--crtoday-admin-text) !important;
}

.crtoday-admin .postbox .inside {
  background: var(--crtoday-admin-surface);
}

.crtoday-admin .notice {
  border-radius: var(--crtoday-admin-radius-sm);
  box-shadow: var(--crtoday-admin-shadow-sm);
}

.crtoday-admin .widefat,
.crtoday-admin .form-table {
  border-color: var(--crtoday-admin-border);
}

.crtoday-admin .widefat th,
.crtoday-admin .widefat td,
.crtoday-admin .form-table th,
.crtoday-admin .form-table td {
  color: var(--crtoday-admin-text);
}

.crtoday-admin .widefat thead th {
  font-weight: 600;
}

.crtoday-admin .form-table th,
.crtoday-admin .form-table td {
  padding-block: 10px !important;
  vertical-align: middle;
}

.crtoday-admin .form-table th {
  width: 180px;
  font-weight: 600;
}

.crtoday-admin .widefat.striped > tbody > :nth-child(odd),
.crtoday-admin .widefat.striped > :nth-child(odd) {
  background-color: var(--crtoday-admin-surface-soft);
}

.crtoday-admin .widefat.striped > tbody > tr:nth-child(odd) > th,
.crtoday-admin .widefat.striped > tbody > tr:nth-child(odd) > td {
  background-color: var(--crtoday-admin-surface-soft);
}

.crtoday-admin .widefat.striped > tbody > tr:nth-child(even) > th,
.crtoday-admin .widefat.striped > tbody > tr:nth-child(even) > td {
  background-color: var(--crtoday-admin-surface);
}

.crtoday-admin .widefat tbody tr {
  border-bottom: 1px solid var(--crtoday-admin-border) !important;
}

.crtoday-admin .widefat tbody td {
  border-bottom: 1px solid var(--crtoday-admin-border) !important;
  border-right: 1px solid var(--crtoday-admin-border) !important;
}

.crtoday-admin .widefat tbody td:last-child {
  border-right: none !important;
}

.crtoday-admin .widefat thead tr {
  border-bottom: 1px solid var(--crtoday-admin-border) !important;
}

.crtoday-admin .widefat thead th {
  border-bottom: 1px solid var(--crtoday-admin-border) !important;
  border-right: 1px solid var(--crtoday-admin-border) !important;
}

.crtoday-admin .widefat thead th:last-child {
  border-right: none !important;
}

.crtoday-admin .description {
  color: var(--crtoday-admin-text-muted);
  font-size: 12.5px;
}

.crtoday-admin input[type='text'],
.crtoday-admin input[type='number'],
.crtoday-admin input[type='search'],
.crtoday-admin input[type='url'],
.crtoday-admin select,
.crtoday-admin textarea,
.crtoday-admin .regular-text {
  border-color: var(--crtoday-admin-border-strong);
  border-radius: 10px;
  min-height: 36px;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crtoday-admin input[type='text']:focus,
.crtoday-admin input[type='number']:focus,
.crtoday-admin input[type='search']:focus,
.crtoday-admin input[type='url']:focus,
.crtoday-admin select:focus,
.crtoday-admin textarea:focus,
.crtoday-admin .regular-text:focus {
  border-color: var(--crtoday-admin-button-accent);
  box-shadow: 0 0 0 3px var(--crtoday-admin-button-accent-soft);
}

.crtoday-admin input[type='checkbox'] {
  border-radius: 5px;
  border-color: var(--crtoday-admin-border-strong);
}

.crtoday-admin input[type='range'] {
  accent-color: var(--crtoday-admin-accent);
}

.crtoday-admin .button {
  border-radius: 10px;
  box-shadow: none;
  min-height: 38px;
  padding-inline: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-width: 1px;
  transition: all 0.2s ease;
}

.crtoday-admin .button:hover {
  transform: translateY(-1px);
}

.crtoday-admin .button-primary {
  background: var(--crtoday-admin-button-accent);
  border-color: var(--crtoday-admin-button-accent);
  color: #fff;
}

.crtoday-admin .button-primary:hover,
.crtoday-admin .button-primary:focus {
  background: var(--crtoday-admin-button-accent-strong);
  border-color: var(--crtoday-admin-button-accent-strong);
  color: #fff;
}

.crtoday-admin .button-primary:active {
  background: #047857;
  border-color: #047857;
  color: #fff;
}

.crtoday-admin .button-primary:focus {
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--crtoday-admin-button-accent-soft);
}

.crtoday-admin .button-secondary {
  background: #fff;
  border-color: var(--crtoday-admin-border-strong);
  color: #334155;
}

.crtoday-admin .button-secondary:hover,
.crtoday-admin .button-secondary:focus {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.crtoday-admin .crtoday-fetch-now-btn.button,
.crtoday-admin .crtoday-fetch-now-btn.button-secondary,
.crtoday-admin .crtoday-fetch-now-btn.button-primary {
  background: var(--crtoday-admin-button-accent);
  border-color: var(--crtoday-admin-button-accent);
  color: #fff;
}

.crtoday-admin .crtoday-fetch-now-btn.button:hover,
.crtoday-admin .crtoday-fetch-now-btn.button:focus,
.crtoday-admin .crtoday-fetch-now-btn.button-secondary:hover,
.crtoday-admin .crtoday-fetch-now-btn.button-secondary:focus,
.crtoday-admin .crtoday-fetch-now-btn.button-primary:hover,
.crtoday-admin .crtoday-fetch-now-btn.button-primary:focus {
  background: var(--crtoday-admin-button-accent-strong);
  border-color: var(--crtoday-admin-button-accent-strong);
  color: #fff;
}

.crtoday-admin .crtoday-save-settings-btn.button,
.crtoday-admin .crtoday-save-settings-btn.button-primary {
  background: var(--crtoday-admin-warning);
  border-color: var(--crtoday-admin-warning);
  color: #fff;
}

.crtoday-admin .crtoday-save-settings-btn.button:hover,
.crtoday-admin .crtoday-save-settings-btn.button:focus,
.crtoday-admin .crtoday-save-settings-btn.button-primary:hover,
.crtoday-admin .crtoday-save-settings-btn.button-primary:focus {
  background: var(--crtoday-admin-warning-strong);
  border-color: var(--crtoday-admin-warning-strong);
  color: #fff;
}

.crtoday-admin .crtoday-save-settings-btn.button:active,
.crtoday-admin .crtoday-save-settings-btn.button-primary:active {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.crtoday-admin .crtoday-save-settings-btn.button:focus,
.crtoday-admin .crtoday-save-settings-btn.button-primary:focus {
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--crtoday-admin-warning-soft);
}

.crtoday-admin .button-link,
.crtoday-admin .button-link:focus,
.crtoday-admin .button-link:hover,
.crtoday-admin .button-link-delete:focus,
.crtoday-admin .button-link-delete:hover,
.crtoday-admin .crtoday-about-links a,
.crtoday-admin .crtoday-about-links a:focus,
.crtoday-admin .crtoday-about-links a:hover {
  color: var(--crtoday-admin-accent) !important;
}

.crtoday-admin code {
  border-radius: 8px;
}

.crtoday-admin .crtoday-panel {
  border-radius: var(--crtoday-admin-radius-sm);
  overflow: hidden;
}

.crtoday-admin .crtoday-panel .postbox-header {
  padding: 0;
}

.crtoday-admin .crtoday-panel .postbox-header:hover {
  background: #f1f5f9 !important;
}

.crtoday-admin .crtoday-panel .inside {
  background: var(--crtoday-admin-surface);
}

.crtoday-admin .crtoday-panel .form-table th {
  width: 150px;
}

.crtoday-admin .crtoday-panel .form-table td {
  width: auto;
}

.crtoday-admin #crtoday-shortcode-form,
.crtoday-admin #crtoday-conv-shortcode-form {
  align-items: start;
  gap: 20px !important;
}

.crtoday-admin #crtoday-shortcode-form > div,
.crtoday-admin #crtoday-conv-shortcode-form > div {
  min-width: 0;
}

.crtoday-admin .crtoday-sc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crtoday-admin .crtoday-sources-wrap {
  width: 100%;
}

.crtoday-admin .crtoday-interval-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  padding: 6px 0;
}

.crtoday-admin .crtoday-interval-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.crtoday-admin .crtoday-interval-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 280px;
}

.crtoday-admin .crtoday-interval-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
}

.crtoday-admin .crtoday-interval-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.crtoday-admin .crtoday-interval-option {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.crtoday-admin .crtoday-interval-option input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.crtoday-admin .crtoday-interval-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #c3c4c7;
  background: #fff;
  color: #1d2327;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: all .14s ease;
}

.crtoday-admin .crtoday-interval-option input[type='radio']:checked + .crtoday-interval-chip {
  background: var(--crtoday-admin-accent);
  border-color: var(--crtoday-admin-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(111, 63, 245, .28);
}

.crtoday-admin .crtoday-interval-option input[type='radio']:focus + .crtoday-interval-chip {
  outline: 2px solid rgba(111, 63, 245, .35);
  outline-offset: 2px;
}

.crtoday-admin .crtoday-panel-closed .crtoday-panel-body {
  display: none;
}

.crtoday-admin .crtoday-panel-closed .crtoday-panel-arrow {
  transform: rotate(-90deg);
}

.crtoday-admin .crtoday-admin-shortcodes .inside {
  padding: 16px;
}

.crtoday-admin .crtoday-sc-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

.crtoday-admin .crtoday-sc-settings-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crtoday-admin .crtoday-sc-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.crtoday-admin .crtoday-sc-tabs .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  font-weight: 500;
}

.crtoday-admin .crtoday-admin-shortcodes .crtoday-panel,
.crtoday-admin .crtoday-admin-shortcodes .postbox[data-crtoday-pane] {
  border-radius: 8px;
  overflow: hidden;
}

.crtoday-admin .crtoday-sc-tabs .button {
  margin: 0;
}

.crtoday-admin .crtoday-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 380px;
}

.crtoday-admin .crtoday-theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d0d2d6;
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  cursor: pointer;
  min-height: 34px;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crtoday-admin .crtoday-theme-swatch:hover {
  border-color: #8c8f94;
}

.crtoday-admin .crtoday-theme-swatch.is-active {
  border-color: var(--crtoday-admin-accent);
  box-shadow: 0 0 0 1px var(--crtoday-admin-accent) inset;
}

.crtoday-admin .crtoday-theme-swatch:is(:focus, :focus-visible) {
  outline: none;
  border-color: var(--crtoday-admin-accent);
  box-shadow: 0 0 0 2px var(--crtoday-admin-accent-soft);
}

.crtoday-admin .crtoday-theme-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  flex: 0 0 14px;
}

.crtoday-admin .crtoday-theme-swatch-name {
  font-size: 12px;
  line-height: 1.2;
  color: #1d2327;
}

.crtoday-admin .crtoday-admin-grid {
  margin-inline: auto;
  width: 100%;
  gap: 20px !important;
}

.crtoday-admin .crtoday-admin-kpis {
  gap: 10px !important;
}

.crtoday-admin .crtoday-admin-kpis > div {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 12px !important;
}

.crtoday-admin #crtoday-shortcode-preview,
.crtoday-admin #crtoday-conv-shortcode-preview {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--crtoday-admin-radius-md);
  border: 1px solid var(--crtoday-admin-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* When fitWidth is off the widget must stretch to fill the flex preview container */
.crtoday-admin #crtoday-shortcode-preview > .crtoday-widget:not(.crtoday-fit-width),
.crtoday-admin #crtoday-conv-shortcode-preview > .crtoday-widget:not(.crtoday-fit-width) {
  width: 100%;
}

.crtoday-admin .crtoday-admin-shortcode-output {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid var(--crtoday-admin-border) !important;
  border-radius: var(--crtoday-admin-radius-md) !important;
}

.crtoday-admin .crtoday-admin-shortcode-output-row {
  gap: 10px !important;
  align-items: stretch !important;
}

.crtoday-admin #crtoday-shortcode-output,
.crtoday-admin #crtoday-conv-shortcode-output {
  min-height: 42px;
  border-color: var(--crtoday-admin-border-strong) !important;
  border-radius: 10px !important;
}

.crtoday-admin #crtoday-copy-shortcode,
.crtoday-admin #crtoday-conv-copy-shortcode {
  min-width: 108px;
  justify-content: center;
}

.crtoday-admin .crtoday-preview-loading {
  opacity: 0.7;
  position: relative;
}

.crtoday-admin .crtoday-preview-loading::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--crtoday-admin-accent) 50%, transparent 100%);
  animation: crtoday-admin-loading 1.1s linear infinite;
}

@keyframes crtoday-admin-loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.crtoday-admin #crtoday-sc-symbols-wrap {
  border-color: var(--crtoday-admin-border-strong) !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
  gap: 6px !important;
}

.crtoday-admin .crtoday-tag {
  background: #e2e8f0 !important;
  color: #1e293b;
  border-radius: 999px !important;
  padding-inline: 10px !important;
}

.crtoday-admin .crtoday-tag-remove {
  margin-inline-start: 2px;
}

.crtoday-admin [style*='margin-left:8px'] {
  margin-left: 0 !important;
  margin-inline-start: 8px !important;
}

.crtoday-admin [style*='margin-right:4px'] {
  margin-right: 0 !important;
  margin-inline-end: 4px !important;
}

.crtoday-admin [style*='text-align:center'] {
  text-align: center;
}

.crtoday-admin [style*='width:160px'] {
  max-width: 100%;
}

.crtoday-admin .dashicons {
  vertical-align: middle;
  margin-inline-end: 4px;
}

.crtoday-admin .button .dashicons,
.crtoday-admin .nav-tab .dashicons,
.crtoday-admin h2 .dashicons,
.crtoday-admin h3 .dashicons {
  margin-right: 0 !important;
  margin-inline-end: 6px !important;
}

.crtoday-admin #crtoday-local-source-dialog {
  backdrop-filter: blur(2px);
}

.crtoday-admin #crtoday-local-source-dialog > div {
  border-radius: var(--crtoday-admin-radius-lg) !important;
  box-shadow: var(--crtoday-admin-shadow-lg) !important;
  border: 1px solid var(--crtoday-admin-border) !important;
  overflow: hidden;
}

.crtoday-admin #crtoday-dialog-title {
  letter-spacing: 0.01em;
}

.crtoday-admin #crtoday-rates-table input[type='text'] {
  width: 100%;
}

.crtoday-admin .dashicons {
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 1220px) {
  .crtoday-admin .crtoday-admin-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  .crtoday-admin .crtoday-admin-kpis {
    grid-template-columns: 1fr 1fr !important;
  }

  .crtoday-admin #crtoday-shortcode-form,
  .crtoday-admin #crtoday-conv-shortcode-form {
    grid-template-columns: 1fr !important;
  }

  .crtoday-admin .crtoday-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 782px) {
  .crtoday-admin {
    padding-inline: 12px;
    box-sizing: border-box;
  }

  .crtoday-admin h1 {
    align-items: center;
    gap: 10px;
  }

  .crtoday-admin .nav-tab-wrapper {
    gap: 6px;
  }

  .crtoday-admin .nav-tab {
    padding: 7px 12px;
  }

  .crtoday-admin .crtoday-admin-kpis {
    grid-template-columns: 1fr !important;
  }

  .crtoday-admin .crtoday-interval-row {
    align-items: flex-start;
  }

  .crtoday-admin .crtoday-sources-wrap .widefat th,
  .crtoday-admin .crtoday-sources-wrap .widefat td {
    font-size: 12px;
    padding: 6px 4px;
  }

  .crtoday-admin .crtoday-sources-wrap .widefat .crtoday-col-hide-mobile {
    display: none;
  }

  .crtoday-admin .crtoday-theme-grid {
    grid-template-columns: 1fr;
  }

  .crtoday-admin .crtoday-admin-shortcode-output-row {
    flex-direction: column;
  }

  .crtoday-admin #crtoday-copy-shortcode,
  .crtoday-admin #crtoday-conv-copy-shortcode {
    width: 100%;
  }
}

/* RTL support */
body.rtl .crtoday-admin,
.crtoday-admin:dir(rtl) {
  text-align: right;
}

body.rtl .crtoday-admin .nav-tab,
.crtoday-admin:dir(rtl) .nav-tab {
  flex-direction: row-reverse;
}

body.rtl .crtoday-admin h1,
.crtoday-admin:dir(rtl) h1 {
  justify-content: flex-start;
}

body.rtl .crtoday-admin .dashicons,
.crtoday-admin:dir(rtl) .dashicons {
  margin-inline: 0 4px;
}

body.rtl .crtoday-admin .description,
.crtoday-admin:dir(rtl) .description {
  margin-inline: 0;
}

body.rtl .crtoday-admin #crtoday-shortcode-form,
body.rtl .crtoday-admin #crtoday-conv-shortcode-form,
.crtoday-admin:dir(rtl) #crtoday-shortcode-form,
.crtoday-admin:dir(rtl) #crtoday-conv-shortcode-form {
  direction: rtl;
}

/* ================================================================
 * Currency Picker
 * ================================================================ */

.crtoday-currency-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 120px;
}

.crtoday-currency-picker-btn:hover {
  border-color: #10b981;
}

.crtoday-currency-picker-btn:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.crtoday-currency-picker-btn .crtoday-picker-flag {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
}

.crtoday-currency-picker-btn .crtoday-picker-code {
  flex: 1;
  text-align: left;
}

.crtoday-currency-picker-btn .crtoday-picker-chevron {
  font-size: 18px;
  color: #64748b;
  line-height: 1;
}

/* Dropdown */
.crtoday-picker-dropdown {
  z-index: 100010;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crtoday-picker-search-wrap {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.crtoday-picker-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
}

.crtoday-picker-search:focus {
  outline: none;
  border-color: #10b981;
}

.crtoday-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  background: #ffffff;
}

.crtoday-picker-group {
  padding: 4px 0;
}

.crtoday-picker-group-label {
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.crtoday-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.crtoday-picker-option:hover,
.crtoday-picker-option-focused {
  background: #f8fafc;
}

.crtoday-picker-option-selected {
  background: rgba(111, 63, 245, 0.08);
}

.crtoday-picker-flag-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crtoday-picker-flag-wrap img {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
}

.crtoday-picker-opt-code {
  font-weight: 600;
  font-size: 12px;
  color: #1e293b;
  min-width: 36px;
}

.crtoday-picker-opt-name {
  flex: 1;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crtoday-picker-check {
  color: #10b981;
  font-weight: 700;
  font-size: 12px;
}

/* ── Multi-picker ── */

.crtoday-multi-picker-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #8c8f94;
  border-radius: 6px;
  background: #fff;
  min-height: 38px;
}

.crtoday-multi-picker-tags {
  display: contents;
}

.crtoday-multi-picker-wrap .crtoday-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f0f0f1;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.crtoday-multi-picker-wrap .crtoday-tag-flag {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
}

.crtoday-multi-picker-wrap .crtoday-tag-remove {
  background: none;
  border: none;
  padding: 0;
  margin-left: 2px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #787c82;
  font-weight: 400;
}

.crtoday-multi-picker-wrap .crtoday-tag-remove:hover {
  color: #d63638;
}

.crtoday-multi-picker-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px dashed #c3c4c7;
  border-radius: 4px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #50575e;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.crtoday-multi-picker-add:hover {
  border-color: #10b981;
  color: #10b981;
}

.crtoday-multi-picker-add:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.crtoday-picker-checkbox {
  font-size: 14px;
  color: #64748b;
  line-height: 1;
  width: 16px;
  text-align: center;
}

.crtoday-picker-option-selected .crtoday-picker-checkbox {
  color: #10b981;
}

/* ═══════════════════════════════════════════════════════════════════
   Currencies Tab
   ═══════════════════════════════════════════════════════════════════ */

.crtoday-currencies-tab {
  max-width: 100%;
}

.crtoday-currencies-tab .postbox {
  max-width: 100%;
  overflow: hidden;
}

.crtoday-currencies-tab table {
  table-layout: auto;
  width: 100%;
  min-width: 600px;
}

.crtoday-currencies-tab th,
.crtoday-currencies-tab td {
  padding: 8px 10px;
  white-space: nowrap;
}

.crtoday-currencies-tab th:nth-child(4),
.crtoday-currencies-tab td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
}
