/* d:/CODE/html/css/dashboard.css */

/* SCROLLBARS */
html,
body,
.sidebar-menu,
.payment-history-table-container,
.api-doc-code,
.api-key-list {
  scrollbar-width: thin;
  scrollbar-color: #8f1d2c #07090d;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar,
.payment-history-table-container::-webkit-scrollbar,
.api-doc-code::-webkit-scrollbar,
.api-key-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.sidebar-menu::-webkit-scrollbar-track,
.payment-history-table-container::-webkit-scrollbar-track,
.api-doc-code::-webkit-scrollbar-track,
.api-key-list::-webkit-scrollbar-track {
  background: #07090d;
  border-left: 1px solid #1d2530;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.sidebar-menu::-webkit-scrollbar-thumb,
.payment-history-table-container::-webkit-scrollbar-thumb,
.api-doc-code::-webkit-scrollbar-thumb,
.api-key-list::-webkit-scrollbar-thumb {
  min-height: 46px;
  border: 2px solid #07090d;
  border-radius: 0;
  background: #8f1d2c;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.sidebar-menu::-webkit-scrollbar-thumb:hover,
.payment-history-table-container::-webkit-scrollbar-thumb:hover,
.api-doc-code::-webkit-scrollbar-thumb:hover,
.api-key-list::-webkit-scrollbar-thumb:hover {
  background: #d2223a;
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner { background: #07090d; }

/* LAYOUT */
.dashboard-layout {
  display: flex;
  min-height: 0;
  padding-top: 68px;
  background-color: var(--bg-main);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* An occasional background strike gives the workspace a little electrical life. */
.dashboard-layout::before {
  content: '';
  position: fixed;
  z-index: 0;
  top: 68px;
  right: 0;
  width: min(54vw, 760px);
  height: calc(100vh - 68px);
  pointer-events: none;
  opacity: 0;
  background: url('../assets/dashboard-lightning-v1.png') center / contain no-repeat;
  mix-blend-mode: screen;
  filter: saturate(1.08) contrast(1.08);
  transform-origin: 50% 0;
  animation: workspace-lightning-strike 15s linear infinite;
}

.dashboard-layout::after {
  content: '';
  position: fixed;
  z-index: 2;
  top: 68px;
  right: -3vw;
  width: min(58vw, 820px);
  height: calc(100vh - 68px);
  pointer-events: none;
  opacity: 0;
  background: url('../assets/dashboard-lightning-v1.png') center / contain no-repeat;
  mix-blend-mode: screen;
  filter: blur(22px) saturate(1.2);
  animation: workspace-lightning-flash 15s linear infinite;
}

.main-content,
.dashboard-footer {
  position: relative;
  z-index: 1;
}

@keyframes workspace-lightning-strike {
  0%, 72%, 75.2%, 100% { opacity: 0; transform: translateY(-7px) scaleY(.98); }
  72.25% { opacity: .9; transform: translateY(0) scaleY(1); }
  72.65% { opacity: .14; }
  73.05% { opacity: 1; transform: translateY(0) scaleY(1.015); }
  73.45% { opacity: .18; }
  73.85% { opacity: .76; }
  74.35% { opacity: 0; }
}

@keyframes workspace-lightning-flash {
  0%, 72%, 75.2%, 100% { opacity: 0; }
  72.25% { opacity: .48; }
  72.65% { opacity: .06; }
  73.05% { opacity: .68; }
  73.45% { opacity: .08; }
  73.85% { opacity: .42; }
  74.35% { opacity: 0; }
}

/* Keep private account data out of view until the session is confirmed. */
.auth-pending .dashboard-layout,
.auth-pending .dashboard-footer {
  visibility: hidden;
}

.dashboard-site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(12px);
}

.dashboard-site-brand {
  color: var(--text-primary);
  font-size: 1rem;
  white-space: nowrap;
}

.dashboard-site-brand span { color: var(--color-primary); }
.dashboard-site-nav { display: flex; justify-content: center; gap: 28px; }
.dashboard-site-nav a,
.dashboard-lang-link,
.dashboard-logout {
  color: var(--text-secondary);
  font-size: .78rem;
  text-transform: uppercase;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.dashboard-site-nav a:hover,
.dashboard-lang-link:hover,
.dashboard-logout:hover { color: var(--text-primary); }

.dashboard-site-actions { display: flex; align-items: center; gap: 10px; }
.dashboard-lang-link,
.dashboard-logout { padding: 8px 11px; border: 1px solid var(--border-light); }
.dashboard-logout { background: transparent; }
.auth-message { min-height: 18px; margin: 8px 0 0; color: var(--color-primary); font-size: .75rem; }

/* SIDEBAR */
.sidebar {
  width: 232px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  position: fixed;
  top: 68px;
  bottom: 0;
  left: 0;
  z-index: 10;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--text-primary);
  text-align: center;
}

.sidebar .logo-icon {
  width: 146px;
  height: 146px;
  flex: 0 0 146px;
}

.sidebar .logo-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sidebar .logo-icon path {
  transform-origin: center;
  animation: lightning-flicker 15s linear infinite;
}

.sidebar .logo-text {
  font-size: .78rem;
}

@keyframes lightning-flicker {
  0%, 72%, 75%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255,255,255,.35));
  }
  72.3%, 73.4% {
    opacity: .16;
    filter: drop-shadow(0 0 0 transparent);
  }
  72.7%, 74.1% {
    opacity: 1;
    filter: drop-shadow(0 0 16px rgba(255,255,255,1));
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The customer dashboard has an explicitly requested status effect. */
  .sidebar .logo-icon path { animation: lightning-flicker 15s linear infinite; }
  .dashboard-layout::before { animation: workspace-lightning-strike 15s linear infinite; }
  .dashboard-layout::after { animation: workspace-lightning-flash 15s linear infinite; }
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  transition: all var(--transition-fast);
  width: 100%;
  position: relative;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  transform: translateX(2px);
}

.menu-item.active {
  background-color: var(--color-primary-muted);
  border: 1px solid var(--color-primary);
  color: var(--text-primary);
  font-weight: 700;
}

.menu-num {
  color: var(--color-primary);
  margin-right: 4px;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Download widget */
.client-download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.client-download-box:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.client-info {
  display: flex;
  flex-direction: column;
}

.client-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.client-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.client-download-box .arrow {
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.client-download-box:hover .arrow {
  transform: translateX(3px);
}

/* Profile widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: rgba(255,255,255,0.01);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-profile-widget:hover {
  border-color: var(--color-primary);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-plan {
  font-size: 0.65rem;
}

.profile-action-tag {
  font-size: 0.65rem;
  color: var(--color-primary);
}

/* MAIN CONTENT */
.main-content {
  margin-left: 232px;
  width: calc(100% - 232px);
  flex: 0 0 auto;
  padding: 40px;
  max-width: none;
}

/* CONTENT HEADER */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.header-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 0.85rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.status-indicator {
  color: var(--color-success);
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

.tariff-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

/* VIEW SWITCHING */
.content-view {
  display: none;
}
.content-view.active {
  display: block;
  animation: fade-slide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-slide {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* VIEW 1: DASHBOARD STATS GRID */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--color-primary);
  background-color: var(--bg-card-hover);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-card .stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-card .stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0;
  letter-spacing: -1px;
}

.stat-trend {
  font-size: 0.65rem;
  font-weight: 700;
}
.stat-trend.positive { color: var(--color-success); }
.stat-trend.neutral { color: var(--text-muted); }

.stat-index {
  font-size: 0.7rem;
  color: var(--color-primary);
}

/* DOUBLE COLUMN */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.dashboard-footer {
  position: relative;
  z-index: 5;
  width: calc(100% - 232px);
  margin-left: 232px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dashboard-footer-inner {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  width: min(100% - 64px, 1560px);
  min-height: 88px;
  margin: 0 auto;
  padding: 20px 0;
}

.dashboard-footer-brand {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-footer-brand span {
  color: var(--color-primary);
}

.dashboard-footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dashboard-footer a {
  color: var(--text-secondary);
  font-weight: 700;
  transition: color 160ms ease;
}

.dashboard-footer a:hover,
.dashboard-footer a:focus-visible {
  color: var(--color-primary);
}

.dashboard-footer-copy {
  color: var(--text-muted);
  white-space: nowrap;
}

.dashboard-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.dashboard-card:hover {
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

/* Tariff Details Card */
.tariff-details-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tariff-card-main {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  margin-bottom: 20px;
}

.tariff-name {
  color: var(--color-primary);
}

.card-desc {
  font-size: 0.75rem;
  margin-bottom: 16px;
}

.limits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.limit-row {
  display: flex;
  justify-content: justify;
  align-items: center;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
  padding-bottom: 6px;
}

.limit-row:last-child {
  border: none;
  padding-bottom: 0;
}

.limit-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex: 1;
}

.limit-value {
  font-size: 0.8rem;
  font-weight: 700;
}

/* Circular Dial (Technical progress) */
.circular-progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-box {
  width: 140px;
  height: 140px;
  position: relative;
}

.circle-box svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-dasharray: 6 2;
  stroke-width: 6px;
}

.circle-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  filter: drop-shadow(0 0 4px rgba(239, 35, 60, .55));
  transition: stroke-dashoffset 1.2s cubic-bezier(.22, .75, .22, 1);
}

.circle-box.is-animating .circle-value,
.circle-box.is-animating .circle-percent {
  animation: gauge-value-pulse 1.2s ease-out both;
}

@keyframes gauge-value-pulse {
  0% { opacity: .35; transform: scale(.94); }
  65% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .circle-fill { transition: none; }
  .circle-box.is-animating .circle-value,
  .circle-box.is-animating .circle-percent { animation: none; }
}

.circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.circle-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.circle-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.circle-total {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.circle-percent {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 4px;
}

.tariff-card-footer {
  border-top: 1px dashed var(--border-light);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.expiry-info {
  display: flex;
  flex-direction: column;
}

.expiry-title {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.expiry-date {
  font-size: 0.8rem;
  font-weight: 700;
}

.expiry-days {
  font-size: 0.7rem;
  color: var(--color-primary);
}

.tariff-buttons {
  display: flex;
  gap: 10px;
}

/* Projects Table */
.projects-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.projects-table th {
  padding: 10px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
}

.projects-table td {
  padding: 12px 14px;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.projects-table tr:last-child td {
  border-bottom: none;
}

.project-name-cell {
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-badge.success {
  color: var(--color-success);
}

/* Quick Access */
.quick-links-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.quick-link-item:hover {
  border-color: var(--text-secondary);
  background-color: var(--bg-card-hover);
  transform: translateX(4px);
}

.item-icon-tag {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 700;
}

.item-meta {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 0.8rem;
  font-weight: 700;
}

.item-desc {
  font-size: 0.7rem;
}

/* Activity Chart */
.chart-content {
  display: flex;
  gap: 14px;
  height: 160px;
  padding-top: 10px;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: right;
  width: 28px;
  padding-bottom: 20px;
}

.chart-bars-container {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 10px;
  background-color: var(--color-primary);
  border-radius: 0;
  opacity: 0.8;
  height: 0; /* Animated dynamically or via CSS */
  animation: grow-chart 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom;
  margin-bottom: 8px;
}

@keyframes grow-chart {
  to { height: 100%; } /* uses style's height as max constraints */
}

.chart-bar-wrapper:hover .chart-bar {
  opacity: 1;
  background-color: var(--color-primary-hover);
}

.chart-bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* VIEW 2: BILLING VIEW */
.billing-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.billing-tabs {
  display: flex;
  gap: 10px;
}

.billing-tab-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.billing-tab-btn:hover {
  color: var(--text-primary);
}

.billing-tab-btn.active {
  color: var(--color-primary);
}

.billing-support-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

body[data-billing-mode="payments"] .billing-plan-panel,
body[data-billing-mode="limits"] .billing-payment-panel {
  display: none;
}

body[data-billing-mode="payments"] .billing-grid {
  grid-template-columns: minmax(340px, .9fr) minmax(480px, 1.35fr);
  align-items: start;
}

.billing-payment-summary {
  margin-bottom: 18px;
}

.billing-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.billing-history-count {
  min-width: 42px;
  padding: 7px 10px;
  border: 1px solid var(--border-light);
  color: var(--color-primary);
  text-align: center;
}

.billing-history-table {
  max-height: 430px;
  overflow: auto;
}

.billing-history-table .payment-table {
  min-width: 650px;
}

.billing-history-empty {
  padding: 48px 20px;
  border: 1px dashed var(--border-light);
  color: var(--text-muted);
  text-align: center;
}

.status-badge.pending { color: #f0b44c; border-color: rgba(240, 180, 76, .45); }
.status-badge.failed { color: #ff6375; border-color: rgba(255, 99, 117, .45); }
.js-live-invoice-row { cursor: pointer; }
.js-live-invoice-row:hover td { background: rgba(239, 35, 60, .06); }

.billing-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.billing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.billing-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.billing-card-desc {
  font-size: 0.75rem;
  margin-bottom: 20px;
}

/* Current Tariff Card */
.tariff-badge-large {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.current-tariff-card .price-box {
  display: flex;
  align-items: baseline;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 2rem;
  font-weight: 700;
}

.price-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.tariff-bullets-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.tariff-bullets-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.tariff-bullets-list .bullet {
  color: var(--color-primary);
}

.tariff-status-footer {
  border-top: 1px dashed var(--border-light);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expiry-text {
  font-size: 0.75rem;
}

.expiry-date-str {
  color: var(--text-primary);
}

.expiry-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  border: 1px solid var(--border-primary);
}

/* Billing Form (Renewal) */
.payment-periods-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.period-option {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.period-option:hover {
  border-color: var(--text-secondary);
}

.period-option.active {
  border-color: var(--color-primary);
  background: rgba(179, 30, 43, 0.02);
}

.period-option input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--text-muted);
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
  transition: border-color var(--transition-fast);
}

.period-option.active .radio-custom {
  border-color: var(--color-primary);
}

.period-option.active .radio-custom::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 4px;
  height: 4px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.option-name {
  font-size: 0.75rem;
  font-weight: 700;
  flex: 1;
}

.option-strike {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 6px;
}

.option-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.period-option.active .option-price {
  color: var(--color-primary);
}

.badge-best {
  position: absolute;
  bottom: -6px;
  right: 12px;
  background-color: var(--color-primary);
  color: var(--text-primary);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.btn-checkout-execute {
  width: 100%;
  padding: 12px;
}

/* Payment Methods */
.payment-network-picker {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid rgba(179, 30, 43, .46);
  background: linear-gradient(135deg, rgba(179, 30, 43, .09), rgba(8, 9, 10, .92) 55%);
}

.payment-network-picker label {
  color: var(--text-secondary);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.payment-network-picker select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #08090a;
  color: var(--text-primary);
  font: 700 .8rem var(--font-mono);
}

.payment-network-picker select:focus { border-color: var(--color-primary); }
.payment-network-picker p { margin: 0; color: var(--text-muted); font-size: .66rem; }
.payment-methods-list { display: none !important; }

.payment-methods-card .payment-methods-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.method-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.method-option:hover:not(.disabled) {
  border-color: var(--text-secondary);
}

.method-option.active {
  border-color: var(--color-primary);
  background: rgba(179, 30, 43, 0.02);
}

.method-option.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.method-icon-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.method-option.active .method-icon-tag {
  color: var(--color-primary);
}

.method-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-name {
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-status-green {
  font-size: 0.65rem;
  color: var(--color-success);
}

.badge-status-soon {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.billing-footer-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.billing-selection-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0 14px;
}

.billing-select-field {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: .7rem;
}

.billing-select-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
}

.billing-plan-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 16px;
  padding: 14px;
  border: 1px dashed var(--border-light);
  background: rgba(239, 35, 60, .04);
}

.billing-plan-preview strong { color: var(--text-primary); }
.billing-plan-preview span { color: var(--color-primary); font-weight: 800; }
.billing-plan-preview small { grid-column: 1 / -1; color: var(--text-muted); }
.billing-checkout-message { min-height: 22px; margin: 10px 0 4px; color: var(--color-primary); font-size: .7rem; }

@media (max-width: 600px) {
  .billing-selection-fields { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-site-header {
    height: 60px;
    padding: 0 12px;
  }

  .dashboard-site-brand { font-size: .78rem; }
  .dashboard-site-actions { gap: 5px; }
  .dashboard-lang-link,
  .dashboard-logout { padding: 7px 8px; font-size: .68rem; }

  .dashboard-layout {
    display: block;
    padding-top: 116px;
  }

  .sidebar {
    inset: 60px 0 auto 0;
    width: 100%;
    height: 56px;
    padding: 6px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border-light);
    align-items: stretch;
  }

  .sidebar .logo,
  .sidebar-bottom { display: none; }
  .sidebar-top { display: block; width: 100%; }
  .sidebar-menu {
    width: 100%;
    height: 44px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .menu-item {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .menu-num { display: none; }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 18px 14px 28px;
  }

  .dashboard-footer {
    width: 100%;
    margin-left: 0;
  }

  .header-title { font-size: 1.35rem; }
  .header-status { max-width: 100%; flex-wrap: wrap; }
  .billing-grid,
  body[data-billing-mode="payments"] .billing-grid { grid-template-columns: minmax(0, 1fr); }
  .billing-card { padding: 18px; }
}

@media (max-width: 1180px) {
  body[data-billing-mode="payments"] .billing-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* OTHER VIEWS (Fallback Card) */
.fallback-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  max-width: 500px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.fallback-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.fallback-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.fallback-desc {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* OVERLAY & MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 45px rgba(0,0,0,0.9);
  display: none;
  
  /* Modal Spring animation */
  transform: scale(0.95) translateY(15px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
  opacity: 0;
}

.modal-overlay.active .modal-card.active {
  display: block;
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-card.modal-large {
  max-width: 640px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-header {
  text-align: left;
  margin-bottom: 24px;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 12px;
}

.modal-header.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.modal-header.header-inline {
  text-align: left;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.modal-subtitle {
  font-size: 0.75rem;
  margin-top: 2px;
}

/* Authentication Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.auth-tab {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.auth-tab.active {
  color: var(--color-primary);
  border-bottom: 1.5px solid var(--color-primary);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.forgot-password-link {
  font-size: 0.7rem;
  color: var(--color-primary);
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.input-field:focus {
  border-color: var(--text-secondary);
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.65rem;
}
.password-toggle-btn:hover {
  color: var(--text-primary);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-sm);
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-container input:checked ~ .checkmark {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 3.5px;
  width: 2.5px;
  height: 5px;
  border: solid var(--text-primary);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.btn-submit {
  width: 100%;
  padding: 10px;
  font-size: 0.8rem;
  margin-top: 6px;
}

.social-divider {
  display: flex;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 16px 0;
}

.social-divider::before, .social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-light);
}

.social-divider::before { margin-right: 10px; }
.social-divider::after { margin-left: 10px; }

.social-buttons-row {
  display: flex;
  gap: 8px;
}

.social-btn {
  flex: 1;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: rgba(255,255,255,0.01);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  border-color: var(--text-secondary);
}

.modal-footer {
  text-align: center;
  font-size: 0.75rem;
  margin-top: 20px;
}

.modal-switch-btn {
  font-weight: 700;
  color: var(--color-primary);
}

/* Payments History Modal */
.payment-history-table-container {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.payment-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.payment-table th {
  padding: 8px 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.payment-table td {
  padding: 10px 12px;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.payment-table tr:last-child td {
  border-bottom: none;
}

.clickable-payment-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.clickable-payment-row:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.price-val-cell {
  font-weight: 700;
}

.download-receipt-btn {
  font-size: 0.75rem;
  color: var(--color-primary);
}

.download-receipt-btn:hover {
  text-decoration: underline;
}

.payment-stats-footer {
  border-top: 1px dashed var(--border-light);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
}

.stat-footer-col {
  display: flex;
  flex-direction: column;
}

.footer-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.footer-val {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Invoice Details Modal */
.invoice-amount-section {
  text-align: center;
  padding: 16px 0;
  background-color: rgba(255,255,255,0.01);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.invoice-amount-val {
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
}

.invoice-plan-type {
  font-size: 0.75rem;
}

.invoice-details-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.invoice-row {
  display: flex;
  justify-content: justify;
  font-size: 0.75rem;
  border-bottom: 1px dashed rgba(255,255,255,0.02);
  padding-bottom: 6px;
}

.invoice-row:last-child {
  border: none;
  padding-bottom: 0;
}

.invoice-lbl {
  color: var(--text-muted);
  flex: 1;
}

.invoice-val {
  font-weight: 700;
  color: var(--text-primary);
}

.code-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn {
  color: var(--color-primary);
}

.btn-download-invoice {
  width: 100%;
  padding: 10px;
}

/* RESPONSIVE DESIGN FOR DASHBOARD */
@media (max-width: 1024px) {
  .dashboard-site-header { gap: 16px; padding: 0 18px; }
  .dashboard-site-nav { gap: 14px; }
  .sidebar {
    width: 80px;
    padding: 24px 4px;
    align-items: center;
  }
  
  .sidebar .logo-text,
  .sidebar .client-info,
  .sidebar .client-download-box .arrow,
  .sidebar .user-meta,
  .sidebar .profile-action-tag {
    display: none;
  }
  
  .sidebar-top {
    align-items: center;
  }
  
  .sidebar-menu {
    align-items: center;
  }
  
  .menu-item {
    justify-content: center;
    padding: 10px;
  }
  
  .menu-num {
    margin-right: 0;
  }
  
  .client-download-box {
    padding: 6px;
    justify-content: center;
    border: none;
  }
  
  .user-profile-widget {
    padding: 4px;
    justify-content: center;
    border: none;
  }
  
  .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    padding: 20px;
  }

  .dashboard-footer {
    width: calc(100% - 80px);
    margin-left: 80px;
  }
}

@media (max-width: 900px) {
  .dashboard-site-nav { display: none; }
  .dashboard-site-header { grid-template-columns: 1fr auto; }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  
  .tariff-card-main {
    grid-template-columns: 1fr;
  }

  .dashboard-footer-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 14px;
    width: min(100% - 40px, 1560px);
    padding: 22px 0;
  }
}

@media (max-width: 600px) {
  .dashboard-site-header { height: 60px; padding: 0 12px; }
  .dashboard-layout { padding-top: 60px; }
  .sidebar { top: 60px; }
  .dashboard-site-brand { font-size: .78rem; }
  .dashboard-site-actions { gap: 5px; }
  .dashboard-lang-link,
  .dashboard-logout { padding: 7px 8px; font-size: .68rem; }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .tariff-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tariff-buttons {
    width: 100%;
  }
  .tariff-buttons button {
    flex: 1;
  }
  
  .modal-card {
    padding: 20px;
  }
  
  .payment-stats-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .billing-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-footer-nav {
    gap: 12px 18px;
    flex-wrap: wrap;
  }
}

/* Readability scale requested for compact interface copy. */
.user-name,
.limit-value,
.expiry-date,
.item-icon-tag,
.item-title,
.fallback-desc,
.input-field,
.btn-submit {
  font-size: 1.1rem;
}

/* API key management */
.api-keys-shell {
  border: 1px solid var(--color-border, #252c38);
  background: rgba(8, 10, 14, .82);
  padding: clamp(24px, 3vw, 46px);
  min-height: 620px;
}

.api-keys-intro,
.api-primary-card,
.api-additional-head,
.api-key-row,
.api-secret-reveal {
  display: grid;
  align-items: center;
  gap: 22px;
}

.api-keys-intro {
  grid-template-columns: 1fr auto;
  padding-bottom: 28px;
  border-bottom: 1px dashed var(--color-border, #252c38);
}

.api-keys-intro h2,
.api-additional-head h3,
.api-primary-card h3 { margin: 7px 0 8px; }
.api-keys-intro p,
.api-additional-head p,
.api-primary-card p { margin: 0; max-width: 720px; line-height: 1.65; }
.api-kicker,
.api-key-type { color: var(--color-primary, #ef233c); font-weight: 700; }

.api-key-capacity {
  min-width: 180px;
  padding: 16px 20px;
  border: 1px solid var(--color-border, #252c38);
  background: #0b0f16;
}
.api-key-capacity span { display: block; color: #7f8a9c; font-size: .75rem; }
.api-key-capacity strong { display: block; margin-top: 8px; font-size: 1.5rem; }

.api-primary-card {
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto) auto;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #6d1b27;
  background: linear-gradient(90deg, rgba(239, 35, 60, .08), rgba(11, 15, 22, .9));
}
.api-primary-card code,
.api-key-row code,
.api-secret-reveal code {
  overflow-wrap: anywhere;
  color: #dce4ef;
  font-family: var(--font-mono, monospace);
}

.api-action-button,
.api-copy-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #3b4658;
  background: #111823;
  color: #f6f8fb;
  font-weight: 700;
  cursor: pointer;
}
.api-action-button:hover,
.api-copy-button:hover { border-color: var(--color-primary, #ef233c); color: #fff; }
.api-action-button.is-danger { color: #ff6678; }
.api-action-button:disabled,
.api-copy-button:disabled { opacity: .45; cursor: not-allowed; }

.api-secret-reveal {
  grid-template-columns: minmax(210px, .7fr) minmax(280px, 1fr) auto;
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px solid #1c8b4c;
  background: #07150f;
}
.api-secret-reveal[hidden] { display: none; }
.api-secret-reveal strong { color: #54df91; }
.api-secret-reveal p { margin: 4px 0 0; color: #9eb0a7; font-size: .85rem; }

.api-additional-head {
  grid-template-columns: 1fr auto;
  margin-top: 42px;
}
.api-key-create { display: flex; gap: 10px; }
.api-key-create input {
  width: min(310px, 36vw);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #354052;
  background: #0b1018;
  color: #fff;
}
.api-key-list { display: grid; gap: 10px; margin-top: 18px; }
.api-key-row {
  grid-template-columns: minmax(0, 1fr) 150px auto;
  padding: 18px 20px;
  border: 1px solid var(--color-border, #252c38);
  background: #0c1119;
}
.api-key-row-meta strong,
.api-key-row-meta code { display: block; }
.api-key-row-meta code { margin-top: 7px; color: #8f9caf; }
.api-key-usage strong,
.api-key-usage span { display: block; }
.api-key-usage strong { font-size: 1.2rem; }
.api-key-usage span { margin-top: 3px; color: #778397; font-size: .68rem; }
.api-key-row-actions { display: flex; gap: 8px; }
.api-key-empty {
  padding: 34px;
  border: 1px dashed #344052;
  color: #8995a7;
  text-align: center;
}
.api-key-message { min-height: 20px; margin-top: 14px; color: #57d58b; }
.api-key-message.is-error { color: #ff5b6e; }

.api-docs {
  margin-top: 48px;
  padding-top: 42px;
  border-top: 1px dashed var(--color-border, #252c38);
}

.api-docs-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  align-items: end;
  gap: 28px;
}

.api-docs-heading h2 { margin: 8px 0 10px; }
.api-docs-heading p { max-width: 780px; margin: 0; line-height: 1.7; }
.api-base-url {
  padding: 16px 18px;
  border: 1px solid #344052;
  background: #090d14;
}
.api-base-url span { display: block; margin-bottom: 7px; color: #7f8a9c; font-size: .72rem; }
.api-base-url code { color: #f1f5fa; overflow-wrap: anywhere; }

.api-docs-notice {
  display: grid;
  grid-template-columns: minmax(220px, .55fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 3px solid var(--color-primary, #ef233c);
  background: rgba(239, 35, 60, .07);
}
.api-docs-notice strong { color: #fff; }
.api-docs-notice span { color: #b8c1ce; line-height: 1.6; }

.api-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid #2b3442;
  background: #2b3442;
}
.api-flow article { min-height: 160px; padding: 22px; background: #0b1018; }
.api-flow article > span { color: var(--color-primary, #ef233c); font-weight: 800; }
.api-flow strong { display: block; margin-top: 16px; color: #f5f7fa; font-size: 1.05rem; }
.api-flow p { margin: 8px 0 0; color: #9ca8b8; line-height: 1.55; }

.api-endpoints { margin-top: 36px; }
.api-endpoints h3 { margin: 0 0 14px; }
.api-endpoint-row {
  display: grid;
  grid-template-columns: 72px minmax(260px, .7fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid #242d3a;
}
.api-endpoint-row:last-child { border-bottom: 1px solid #242d3a; }
.api-endpoint-row code { color: #e5eaf1; overflow-wrap: anywhere; }
.api-endpoint-row p { margin: 0; color: #909bad; line-height: 1.5; }
.api-method { font-family: var(--font-mono, monospace); font-size: .75rem; font-weight: 900; }
.api-method.post { color: #ff5267; }
.api-method.get { color: #55d995; }

.api-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}
.api-example-card { min-width: 0; border: 1px solid #2b3544; background: #070b11; }
.api-example-card header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #2b3544;
}
.api-example-card header span { color: var(--color-primary, #ef233c); font-weight: 800; }
.api-example-card header strong { color: #f1f4f8; }
.api-example-card pre {
  max-width: 100%;
  margin: 0;
  padding: 20px;
  overflow: visible;
  color: #d7e1ed;
  font: .8rem/1.7 var(--font-mono, monospace);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.api-example-card code { white-space: inherit; }
.api-example-card.is-wide { grid-column: 1 / -1; }
.api-response-note {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid #202938;
  color: #8f9cad;
  line-height: 1.55;
}

.api-docs-footer {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #304052;
  background: #0a1018;
}
.api-docs-footer strong { color: #fff; }
.api-docs-footer p { margin: 7px 0 0; color: #98a5b6; line-height: 1.6; }

/* SETTINGS */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.settings-panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border-light);
  background: rgba(7, 11, 17, .86);
}
.settings-panel h2 { margin: 8px 0 10px; color: var(--text-primary); font-size: 1.35rem; }
.settings-panel > p { max-width: 620px; margin: 0 0 24px; line-height: 1.65; }
.settings-kicker { color: var(--color-primary); font-weight: 800; }
.settings-form { display: grid; gap: 18px; }
.settings-form label { display: grid; gap: 8px; color: var(--text-secondary); font-weight: 700; }
.settings-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #344052;
  background: #070b11;
  color: var(--text-primary);
  font: inherit;
}
.settings-form input:focus { outline: 1px solid var(--color-primary); border-color: var(--color-primary); }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.settings-message { min-height: 20px; color: var(--color-success); }
.settings-message.is-error { color: var(--color-primary); }
.credentials-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px dashed #344052;
  background: #070b11;
}
.credentials-upload-placeholder div { display: grid; gap: 6px; }
.credentials-upload-placeholder strong { color: var(--text-primary); }
.credentials-upload-placeholder small { color: var(--text-secondary); line-height: 1.5; }
.credentials-upload-placeholder button:disabled { opacity: .55; cursor: not-allowed; }
.settings-link { display: inline-block; margin-top: 20px; color: var(--color-primary); font-weight: 800; }
.settings-panel-compact { align-content: start; }
.language-options { display: flex; gap: 10px; margin-top: 20px; }
.language-options a {
  padding: 11px 16px;
  border: 1px solid #344052;
  color: var(--text-secondary);
}
.language-options a.active,
.language-options a:hover { border-color: var(--color-primary); color: var(--text-primary); background: rgba(239, 35, 60, .09); }
.btn-danger { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-danger:hover { color: #fff; background: var(--color-primary); }

/* SUPPORT */
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 22px;
}
.support-panel,
.support-history-panel {
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--border-light);
  background: rgba(7, 11, 17, .88);
}
.support-panel h2 { margin: 10px 0 12px; color: var(--text-primary); font-size: 1.55rem; }
.support-panel h3 { margin: 10px 0 14px; color: var(--text-primary); font-size: 1.3rem; }
.support-form-panel > p,
.support-info-panel > p { margin: 0 0 24px; color: var(--text-secondary); line-height: 1.7; }
.support-form { display: grid; gap: 18px; }
.support-form label { display: grid; gap: 8px; color: var(--text-secondary); font-weight: 800; }
.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  border: 1px solid #344052;
  border-radius: 0;
  background: #070b11;
  color: var(--text-primary);
  font: inherit;
}
.support-form input,
.support-form select { min-height: 50px; padding: 10px 13px; }
.support-form textarea { min-height: 170px; padding: 13px; resize: vertical; line-height: 1.55; }
.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus { outline: 1px solid var(--color-primary); border-color: var(--color-primary); }
.support-submit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.support-submit-row .btn { min-width: 190px; }
.support-submit-row .btn:disabled { opacity: .62; cursor: wait; }
.support-message { max-width: 620px; color: #55d995; line-height: 1.55; }
.support-message.is-error { color: #ff5b6e; }
.support-info-panel { align-self: start; }
.support-info-panel ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid #27313e; }
.support-info-panel li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 17px 0; border-bottom: 1px solid #27313e; color: #b8c1ce; line-height: 1.55; }
.support-info-panel li span { color: var(--color-primary); font-family: var(--font-mono, monospace); font-weight: 900; }
.support-history-panel { margin-top: 22px; }
.support-history-panel h3 { margin: 8px 0 20px; color: var(--text-primary); font-size: 1.25rem; }
.support-ticket-list { display: grid; }
.support-ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 16px 0; border-top: 1px solid #27313e; }
.support-ticket-row > div { min-width: 0; }
.support-ticket-row strong,
.support-ticket-row span { display: block; }
.support-ticket-row strong { overflow-wrap: anywhere; color: var(--text-primary); }
.support-ticket-row div span { margin-top: 6px; color: #8290a3; font-size: .78rem; }
.support-ticket-status { padding: 7px 10px; border: 1px solid #344052; color: #b7c0ce; font: 800 .72rem var(--font-mono, monospace); text-transform: uppercase; }
.support-ticket-status.is-new { border-color: #315d49; color: #55d995; background: rgba(85, 217, 149, .08); }
.support-ticket-status.is-reviewing { border-color: #725b26; color: #ffc858; background: rgba(255, 200, 88, .08); }
.support-ticket-status.is-resolved { border-color: #285c73; color: #5dcaff; background: rgba(93, 202, 255, .08); }
.support-empty { margin: 0; padding: 28px 0; border-top: 1px solid #27313e; color: #8290a3; }
.support-empty.is-error { color: #ff5b6e; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .support-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .api-primary-card,
  .api-secret-reveal { grid-template-columns: 1fr; }
  .api-additional-head { grid-template-columns: 1fr; }
  .api-key-create { margin-top: 4px; }
  .api-key-create input { width: 100%; }
  .api-key-row { grid-template-columns: 1fr auto; }
  .api-key-row-actions { grid-column: 1 / -1; }
  .api-docs-heading,
  .api-docs-notice,
  .api-examples { grid-template-columns: 1fr; }
  .api-example-card.is-wide { grid-column: auto; }
  .api-flow { grid-template-columns: 1fr; }
  .api-endpoint-row { grid-template-columns: 64px minmax(0, 1fr); }
  .api-endpoint-row p { grid-column: 2; }
}

@media (max-width: 600px) {
  .support-panel,
  .support-history-panel { padding: 20px; }
  .support-ticket-row { grid-template-columns: 1fr; gap: 10px; }
  .support-ticket-status { justify-self: start; }
  .settings-panel { padding: 20px; }
  .credentials-upload-placeholder { align-items: stretch; flex-direction: column; }
  .api-keys-intro { grid-template-columns: 1fr; }
  .api-key-capacity { width: 100%; }
  .api-key-create { flex-direction: column; }
  .api-key-row { grid-template-columns: 1fr; }
  .api-key-row-actions { grid-column: auto; }
  .api-endpoint-row { grid-template-columns: 1fr; gap: 7px; padding: 14px 4px; }
  .api-endpoint-row p { grid-column: auto; }
  .api-example-card pre { font-size: .72rem; }
}
