:root {
  --bg: #0f1b1c;
  --bg-soft: #162628;
  --paper: #f6f3ee;
  --ink: #0f1416;
  --accent: #e67a2e;
  --accent-2: #2db7a3;
  --accent-3: #f0c94b;
  --muted: #6f7c81;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(7, 12, 13, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #1d3639 0%, #0f1b1c 60%, #0b1314 100%);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body.sandbox-page {
  --bg: #0f1321;
  --bg-soft: #121a2b;
  --paper: #f3f6ff;
  --ink: #0b0f1c;
  --accent: #4b7bff;
  --accent-2: #29c2d9;
  --accent-3: #ffd166;
  background: radial-gradient(circle at top left, #1a2a4a 0%, #0f1321 60%, #0b0e18 100%);
}

body.sandbox-page header {
  background: rgba(15, 19, 33, 0.75);
  border-bottom: 1px solid rgba(75, 123, 255, 0.18);
}

body.sandbox-page .nav-links a.active,
body.sandbox-page .nav-drawer-links a.active {
  background: rgba(75, 123, 255, 0.18);
  border: 1px solid rgba(75, 123, 255, 0.35);
}

body.sandbox-page .panel {
  border: 1px solid rgba(75, 123, 255, 0.12);
  box-shadow: 0 20px 44px rgba(9, 12, 26, 0.35);
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(15, 27, 28, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  row-gap: 10px;
  column-gap: 24px;
  padding: 18px 24px;
  color: #f6f3ee;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  min-width: 180px;
}

.brand small {
  display: block;
  margin-top: 2px;
  opacity: 0.75;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 10px 16px;
  font-size: 14px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  justify-content: flex-start;
}

.nav-links a {
  color: #f6f3ee;
  opacity: 0.75;
  padding: 6px 10px;
  border-radius: 999px;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.nav-links a.active,
.nav-drawer-links a.active {
  opacity: 1;
  background: rgba(45, 183, 163, 0.2);
  border: 1px solid rgba(45, 183, 163, 0.35);
}

.nav-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(10, 18, 22, 0.2);
}

.nav-pill-sandbox {
  background: linear-gradient(135deg, #4b7bff, #29c2d9);
  color: #f6f3ee;
  border-color: rgba(75, 123, 255, 0.45);
}

.nav-pill-production {
  background: linear-gradient(135deg, #e67a2e, #f0c94b);
  color: #0f1416;
  border-color: rgba(240, 201, 75, 0.55);
}

.nav-links .nav-pill,
.nav-drawer-links .nav-pill {
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(246, 243, 238, 0.3);
  color: #f6f3ee;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  margin-left: auto;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 10, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 90vw);
  height: 100%;
  background: #0f1b1c;
  color: #f6f3ee;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 40;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-drawer-links a {
  color: #f6f3ee;
  font-size: 15px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  grid-column: 2 / -1;
  grid-row: 1;
}

.nav-actions .btn {
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 25px rgba(230, 122, 46, 0.35);
}

.nav-actions .btn-secondary {
  padding: 9px 14px;
  font-size: 13px;
}

.nav-actions .btn:hover {
  transform: translateY(-2px);
}

.btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(230, 122, 46, 0.28);
}

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

.language-switch {
  display: inline-flex;
  gap: 6px;
  background: rgba(246, 243, 238, 0.08);
  padding: 6px;
  border-radius: 999px;
}

.language-switch button {
  border: none;
  background: transparent;
  color: #f6f3ee;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.language-switch button.active {
  background: #f6f3ee;
  color: #162628;
  font-weight: 700;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: stretch;
}

.hero-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 16px;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-cta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-cta a {
  display: inline-flex;
  align-items: center;
}

.hero-cta .btn,
.hero-cta .btn-secondary {
  letter-spacing: 0.2px;
}

.hero-cta .btn {
  border: 1px solid rgba(230, 122, 46, 0.35);
  background: linear-gradient(135deg, #f28a3c, #e26722);
  box-shadow: 0 10px 24px rgba(230, 122, 46, 0.28);
}

.hero-cta .btn-secondary {
  box-shadow: 0 10px 20px rgba(45, 183, 163, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-card .hero-cta {
  margin-top: auto;
  padding-top: 16px;
}

.btn-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  background: var(--accent-2);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px;
}

.section-title {
  font-family: "Fraunces", serif;
  font-size: 24px;
  margin-bottom: 12px;
  color: #f6f3ee;
}

.section-card {
  background: #f6f3ee;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.badge {
  background: rgba(15, 27, 28, 0.08);
  color: #1d2f31;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.code-tabs {
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: #101718;
}

.tab-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px;
  background: #0f1416;
}

.tab-buttons button {
  border: none;
  background: transparent;
  color: #f6f3ee;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.tab-buttons button.active {
  background: var(--accent);
  color: #fff;
}

.tab-buttons .copy-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f6f3ee;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.tab-buttons .copy-btn svg {
  width: 14px;
  height: 14px;
}

.code-tabs pre {
  margin: 0;
  padding: 18px;
  color: #d7e3e5;
  overflow-x: auto;
  font-size: 13px;
}

.notice {
  background: rgba(45, 183, 163, 0.12);
  border-left: 4px solid var(--accent-2);
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  color: #1d2f31;
}

.notice.warn {
  background: rgba(240, 128, 64, 0.12);
  border-left-color: #e37c3c;
  color: #6b3c1b;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(45, 183, 163, 0.08);
}

.card-group {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-grid strong {
  font-size: 18px;
}

.tag {
  padding: 4px 8px;
  background: #eef2f3;
  border-radius: 999px;
  font-size: 12px;
}

.account-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  color: #f6f3ee;
}

.page-overview #account-panel,
.page-overview #security-panel,
.page-overview #access-panel,
.page-overview #pricing-panel {
  display: none;
}

.page-recharges #overview,
.page-recharges #planning,
.page-recharges #transactions,
.page-recharges #webhooks,
.page-recharges #webhook-calls,
.page-recharges #account-panel,
.page-recharges #security-panel,
.page-recharges #access-panel,
.page-recharges #pricing-panel {
  display: none;
}

.page-transactions #overview,
.page-transactions #planning,
.page-transactions #recharges,
.page-transactions #webhooks,
.page-transactions #webhook-calls,
.page-transactions #account-panel,
.page-transactions #security-panel,
.page-transactions #access-panel,
.page-transactions #pricing-panel {
  display: none;
}

.page-planning #overview,
.page-planning #transactions,
.page-planning #recharges,
.page-planning #webhooks,
.page-planning #webhook-calls,
.page-planning #account-panel,
.page-planning #security-panel,
.page-planning #access-panel,
.page-planning #pricing-panel {
  display: none;
}

.page-webhooks #overview,
.page-webhooks #planning,
.page-webhooks #transactions,
.page-webhooks #recharges,
.page-webhooks #account-panel,
.page-webhooks #security-panel,
.page-webhooks #access-panel,
.page-webhooks #pricing-panel {
  display: none;
}

.page-webhooks .account-grid {
  grid-template-columns: 1fr;
}

.page-account #overview,
.page-account #planning,
.page-account #transactions,
.page-account #recharges,
.page-account #webhooks,
.page-account #webhook-calls {
  display: none;
}

.page-access #overview,
.page-access #planning,
.page-access #transactions,
.page-access #recharges,
.page-access #webhooks,
.page-access #webhook-calls,
.page-access #account-panel,
.page-access #security-panel,
.page-access #pricing-panel {
  display: none;
}

.page-access .account-grid {
  grid-template-columns: 1fr;
}

.account-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
  background: #f6f3ee;
  color: #0f1416;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel.full-span {
  grid-column: 1 / -1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.chart-panel {
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
  border-radius: 16px;
}

.chart-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(20px, 1fr);
  gap: 6px;
  align-items: end;
  height: 140px;
  margin-top: 10px;
}

.chart-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  gap: 6px;
  height: 100%;
}

.chart-fill {
  width: 100%;
  background: linear-gradient(180deg, #35c1a9, #1d8c7b);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  align-self: end;
}

.chart-fill-alt {
  background: linear-gradient(180deg, #ff8f3a, #d56a24);
}

.chart-label {
  font-size: 10px;
  color: #4b565a;
  text-align: center;
  width: 100%;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.secret-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.secret-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  font-size: 12px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.secret-copy {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 10px;
}

.secret-inline .form-control {
  padding: 6px 10px;
  font-size: 12px;
}

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

@media (max-width: 520px) {
  .secret-value {
    max-width: 140px;
    font-size: 11px;
    letter-spacing: 0.1px;
  }
}

.stat-card strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.panel strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(15, 27, 28, 0.08);
}

.status-active {
  background: rgba(45, 183, 163, 0.16);
  color: #136c60;
}

.status-suspended {
  background: rgba(230, 80, 80, 0.16);
  color: #a43030;
}

.status-unknown {
  background: rgba(120, 130, 135, 0.16);
  color: #4b565a;
}

.muted-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.history-filters .form-control {
  min-width: 160px;
}

.view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.view-chip {
  border: none;
  background: rgba(15, 27, 28, 0.08);
  color: #0f1416;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-remove {
  font-weight: 700;
  opacity: 0.6;
}

.view-empty {
  font-size: 12px;
  color: #6c777a;
}

.compact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #0f1416;
}

.compact .table th,
.compact .table td {
  padding: 6px 8px;
  font-size: 12px;
}

.compact .panel {
  padding: 16px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.webhook-log-scroll {
  max-height: 200px;
  overflow-y: auto;
}

.access-history-scroll {
  max-height: 220px;
  overflow-y: auto;
  position: relative;
  box-shadow: inset 0 -14px 14px -14px rgba(0, 0, 0, 0.25);
}

.access-modal {
  max-width: 980px;
}

.access-modal .table-scroll .table {
  min-width: 100%;
}

.access-modal .table th,
.access-modal .table td {
  color: var(--ink);
}

.table-scroll .table {
  min-width: 980px;
}

.table thead th {
  position: sticky;
  top: 0;
  background: #f6f3ee;
  z-index: 2;
}

.pagination {
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  border: none;
  background: rgba(45, 183, 163, 0.12);
  color: #136c60;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-btn:hover {
  background: rgba(45, 183, 163, 0.18);
}

.skeleton {
  display: inline-block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 25, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #f6f3ee;
  color: var(--ink);
  border-radius: 20px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.detail-inline {
  background: #f6f3ee;
  color: var(--ink);
  border-radius: 20px;
  padding: 0;
}

.detail-inline .modal-content {
  max-width: none;
  max-height: none;
  box-shadow: none;
}

.detail-inline .modal-body {
  max-height: none;
}

.detail-inline .detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}

.schedule-detail {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.detail-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  grid-column: 1 / -1;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}

.btn-reset {
  background: #e37c3c;
  color: #fff;
}

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.notice-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(230, 122, 46, 0.14);
  color: #9b4b1a;
  font-size: 12px;
  font-weight: 600;
}

.notice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e67a2e;
}

.planning-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.planning-grid > * {
  min-width: 0;
}

.planning-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.planning-form .form-control {
  max-width: 100%;
}

.planning-list {
  min-width: 0;
}

.planning-list .table-scroll {
  max-width: 100%;
}

.planning-form .form-row > * {
  min-width: 0;
}

.planning-form .form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.planning-list .table-actions {
  display: flex;
  gap: 8px;
}

.link-btn.danger {
  color: #b94545;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(45, 183, 163, 0.14);
  color: #1b6b5e;
  border: 1px solid rgba(45, 183, 163, 0.3);
}

.filter-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.inline-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(45, 183, 163, 0.16);
  color: #1b6b5e;
}

.access-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .access-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

.detail-code {
  background: #111a1c;
  color: #e8f0f2;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  font-size: 12px;
  overflow: auto;
  max-height: 240px;
}

.export-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.export-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.timeline-container {
  margin-top: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
  width: 100%;
  overflow-x: auto;
  grid-column: 1 / -1;
}

.timeline-container .table {
  width: 100%;
  min-width: 100%;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 170px 1.2fr 80px 1fr;
  gap: 10px;
  font-size: 12px;
  color: #2b3336;
  align-items: center;
}

.timeline-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  color: #2b3336;
}

.timeline-status.ok {
  background: rgba(37, 162, 126, 0.18);
  color: #1e6e57;
}

.timeline-status.warn {
  background: rgba(240, 128, 64, 0.18);
  color: #9b4b1a;
}

.timeline-error {
  color: #7a5454;
}

@media (max-width: 720px) {
  .timeline-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #historyTable th:nth-child(5),
  #historyTable td:nth-child(5),
  #historyTable th:nth-child(9),
  #historyTable td:nth-child(9) {
    display: none;
  }

  #transactionsTable th:nth-child(7),
  #transactionsTable td:nth-child(7) {
    display: none;
  }
}

@media (max-width: 720px) {
  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination-controls {
    justify-content: flex-start;
  }

  .btn,
  .btn-secondary {
    padding: 8px 12px;
  }

  .table-scroll .table {
    min-width: 100%;
  }
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  margin-top: 6px;
  margin-bottom: 12px;
}

.alert {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert.error {
  background: rgba(230, 80, 80, 0.12);
  color: #a43030;
}

.alert.success {
  background: rgba(45, 183, 163, 0.12);
  color: #136c60;
}

.fade-up {
  opacity: 0;
  transform: translateY(14px);
  transition: all 0.6s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rtl {
  direction: rtl;
}

@media (max-width: 780px) {
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
  }

  .brand {
    gap: 10px;
    font-size: 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .nav-links {
    order: 2;
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    order: 1;
  }

  .nav-actions {
    order: 2;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }

  .nav-actions .btn,
  .nav-actions .btn-secondary {
    padding: 8px 14px;
    font-size: 12px;
  }

  .language-switch {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding-top: 40px;
    gap: 24px;
  }

  .hero-card {
    padding: 22px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn,
  .hero-cta .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .section {
    padding: 24px 18px;
  }

  .section-title {
    font-size: 22px;
  }

  .code-tabs pre {
    font-size: 12px;
  }

  .table {
    display: block;
    overflow-x: auto;
  }

  .section-card code,
  .section-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}


@media (max-width: 960px) {
  .planning-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .planning-form .form-row {
    grid-template-columns: 1fr;
  }
}


.detail-summary {
  margin-bottom: 14px;
}

.detail-summary-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.detail-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.detail-summary-row span {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 6px;
}

.badge-warn {
  background: rgba(230, 122, 46, 0.18);
  color: #a54c12;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}
