/* ═══════════════════════════════════════════════════════════════════════════
   Cloudflare Details — styles
   Palette : CF orange #F38020 + Evoir teal #0F766E + dark slate
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --cf: #F38020;
  --cf-lt: #FFF7ED;
  --teal: #0F766E;
  --dark: #0B1220;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --radius: 12px;
  --green: #16A34A;
  --red: #DC2626;
  --amber: #B45309;
}

/* ── Shell ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.cf-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #050d0a;
  color: #e2e8f0;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cf-bg {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 0 20px 60px;
}

/* star-like dots */
.cf-bg::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 18%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 28% 72%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 55% 10%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 75% 52%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 90% 32%, rgba(255,255,255,.38), transparent),
    radial-gradient(1.5px 1.5px at 42% 85%, rgba(255,255,255,.35), transparent);
}

/* ambient orbs */
.cf-orb {
  position: fixed; border-radius: 50%;
  filter: blur(100px); pointer-events: none; z-index: 0;
}
.cf-orb1 { width:540px;height:540px;top:-130px;left:-150px;
  background:radial-gradient(circle,#064e3b,transparent 70%);opacity:.6; }
.cf-orb2 { width:460px;height:460px;bottom:-110px;right:-110px;
  background:radial-gradient(circle,#7c2d12,transparent 70%);opacity:.55; }
.cf-orb3 { width:340px;height:340px;top:35%;left:50%;
  background:radial-gradient(circle,#0f766e,transparent 70%);opacity:.3; }

/* ── Barre d'outils CF (sous le header standard) ─────────────────────────── */
.cf-toolbar {
  position: sticky; top: 60px; z-index: 190;
  background: rgba(5,13,10,.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(243,128,32,.2);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.cf-toolbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px; min-height: 48px;
  display: flex; align-items: center; gap: 16px;
}
.cf-nav-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #64748b;
}
.cf-nav-user i { color: #10b981; }
.cf-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: all .15s; cursor: pointer; border: none;
  font-family: inherit;
}
.cf-nav-btn.primary {
  background: linear-gradient(135deg, #f38020, #d97706);
  color: #fff; box-shadow: 0 4px 12px rgba(243,128,32,.3);
}
.cf-nav-btn.primary:hover { opacity: .88; }
.cf-nav-btn.secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); color: #94a3b8;
}
.cf-nav-btn.secondary:hover { background: rgba(255,255,255,.1); color: #e2e8f0; }

/* ── Rate limit badge ────────────────────────────────────────────────────── */
.cf-rl-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
  color: #86efac;
  transition: color .3s;
  cursor: default; white-space: nowrap;
  flex-shrink: 0;
}
.cf-rl-badge i { font-size: 10px; }

/* ── Content wrapper ─────────────────────────────────────────────────────── */
.cf-wrap {
  position: relative; z-index: 10;
  max-width: 1400px; margin: 0 auto;
  width: 100%;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.cf-page-header {
  padding: 28px 0 18px;
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
}
.cf-page-header h1 {
  font-size: 22px; font-weight: 800; color: #f0fdf4;
  letter-spacing: -.02em; line-height: 1.2;
  display: flex; align-items: center; gap: 10px;
}
.cf-page-header h1 i { color: #f38020; }
.cf-page-header p { font-size: 13px; color: #64748b; margin-top: 4px; }
.cf-header-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* ── Notice / alert ──────────────────────────────────────────────────────── */
.cf-notice {
  padding: 14px 18px; border-radius: 10px;
  font-size: 13px; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.cf-notice.warning {
  background: rgba(243,128,32,.1); border: 1px solid rgba(243,128,32,.3); color: #fed7aa;
}
.cf-notice.error {
  background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.3); color: #fca5a5;
}
.cf-notice.success {
  background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.3); color: #86efac;
}
.cf-notice.info {
  background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd;
}

/* ── KPI grid ────────────────────────────────────────────────────────────── */
.cf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.cf-kpi {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-top: 3px solid var(--kpi-c, #f38020);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: background .15s;
}
.cf-kpi:hover { background: rgba(255,255,255,.06); }
.cf-kpi-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: #4b7c6a;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px;
}
.cf-kpi-value { font-size: 26px; font-weight: 900; color: #f0fdf4; line-height: 1; }
.cf-kpi-sub   { font-size: 11px; color: #475569; margin-top: 4px; }
.kc-cf { --kpi-c: #F38020; }
.kc-green { --kpi-c: #22c55e; }
.kc-red   { --kpi-c: #ef4444; }
.kc-blue  { --kpi-c: #3b82f6; }
.kc-teal  { --kpi-c: #14b8a6; }
.kc-muted { --kpi-c: #64748b; }
.kc-amber { --kpi-c: #f59e0b; }

/* ── Panel ───────────────────────────────────────────────────────────────── */
.cf-panel {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}
.cf-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
}
.cf-panel-title {
  font-size: 13px; font-weight: 800; color: #e2e8f0;
  display: flex; align-items: center; gap: 8px;
}
.cf-panel-title i { color: #f38020; }
.cf-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.cf-table-wrap { overflow-x: auto; }
.cf-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.cf-table thead th {
  padding: 10px 14px;
  background: #0f172a;
  color: #64748b;
  font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  text-align: left; white-space: nowrap;
  border-bottom: 2px solid #1e293b;
  cursor: pointer; user-select: none;
}
.cf-table thead th:hover { color: #94a3b8; }
.cf-table thead th.sort-asc::after  { content: ' ▲'; opacity: .7; }
.cf-table thead th.sort-desc::after { content: ' ▼'; opacity: .7; }
.cf-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .1s;
  cursor: pointer;
}
.cf-table tbody tr:hover td { background: rgba(243,128,32,.06) !important; }
.cf-table tbody td {
  padding: 10px 14px;
  color: #cbd5e1;
  vertical-align: middle;
}
.cf-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }

/* ── DNS detail drawer ───────────────────────────────────────────────────── */
.cf-zone-detail {
  display: none;
  background: rgba(0,0,0,.25);
  border-top: 1px solid rgba(255,255,255,.06);
}
.cf-zone-detail.open { display: table-row; }
.cf-zone-detail td { padding: 0 !important; }
.cf-detail-inner {
  padding: 18px 22px 22px;
}
.cf-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .cf-detail-grid { grid-template-columns: 1fr; }
}
.cf-detail-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  overflow: hidden;
}
.cf-detail-card-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #f38020;
  padding: 10px 14px;
  background: rgba(243,128,32,.07);
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 6px;
}
.cf-dns-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cf-dns-table th {
  padding: 7px 12px;
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #475569;
  background: rgba(0,0,0,.2);
  text-align: left;
}
.cf-dns-table td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #94a3b8;
}
.cf-dns-table tr:hover td { background: rgba(255,255,255,.03); }
.cf-dns-table .dns-name { color: #e2e8f0; font-weight: 600; }
.cf-dns-table .dns-content { font-family: 'Courier New', monospace; color: #7dd3fc; }

/* ── Settings grid ───────────────────────────────────────────────────────── */
.cf-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 14px;
}
.cf-setting-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #94a3b8;
  padding: 7px 10px;
  background: rgba(0,0,0,.2);
  border-radius: 7px;
}
.cf-setting-item strong { color: #e2e8f0; margin-left: auto; font-size: 11px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.cf-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-active   { background: rgba(22,163,74,.15);  color: #86efac; border: 1px solid rgba(22,163,74,.3); }
.badge-inactive { background: rgba(100,116,139,.15);color: #94a3b8; border: 1px solid rgba(100,116,139,.25); }
.badge-cf       { background: rgba(243,128,32,.15); color: #fed7aa; border: 1px solid rgba(243,128,32,.3); }
.badge-danger   { background: rgba(220,38,38,.15);  color: #fca5a5; border: 1px solid rgba(220,38,38,.3); }
.badge-blue     { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.cf-filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(0,0,0,.15);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.cf-search {
  padding: 8px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: #e2e8f0;
  font-size: 12px; font-family: inherit;
  outline: none; min-width: 200px;
  transition: border-color .15s;
}
.cf-search:focus { border-color: rgba(243,128,32,.5); background: rgba(255,255,255,.08); }
.cf-search::placeholder { color: #475569; }
.cf-filter-select {
  padding: 8px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: #e2e8f0;
  font-size: 12px; font-family: inherit; outline: none;
}
.cf-filter-count {
  margin-left: auto; font-size: 11px; color: #475569;
  display: flex; align-items: center; gap: 5px;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes cf-spin { to { transform: rotate(360deg); } }
.cf-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(243,128,32,.3);
  border-top-color: #f38020;
  border-radius: 50%;
  animation: cf-spin .7s linear infinite;
  display: inline-block; vertical-align: middle;
}
.cf-loading-row td {
  text-align: center;
  padding: 32px !important;
  color: #475569; font-size: 13px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#cf-toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  display: none; z-index: 9999;
  align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
  max-width: 340px;
}
#cf-toast.show { display: flex; }
#cf-toast.ok   { background: rgba(22,163,74,.9);  color: #fff; border: 1px solid #16a34a; }
#cf-toast.err  { background: rgba(220,38,38,.9);  color: #fff; border: 1px solid #dc2626; }
#cf-toast.info { background: rgba(59,130,246,.9); color: #fff; border: 1px solid #2563eb; }

/* ── Scroll horizontal indicator ────────────────────────────────────────── */
.cf-table-scrollable {
  position: relative;
}
.cf-table-scrollable::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 32px; height: 100%;
  background: linear-gradient(to right, transparent, rgba(5,13,10,.7));
  pointer-events: none;
  border-radius: 0 8px 8px 0;
  opacity: 0;
  transition: opacity .2s;
}
.cf-table-scrollable.has-overflow::after { opacity: 1; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.mono { font-family: 'Courier New', monospace; font-size: 12px; }
.small-muted { font-size: 11px; color: #475569; }
.text-green { color: #86efac; }
.text-red   { color: #fca5a5; }
.text-cf    { color: #fed7aa; }
.fw-bold    { font-weight: 700; }

/* expand arrow */
.cf-expand-arrow {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: rgba(243,128,32,.1);
  color: #f38020; font-size: 10px;
  transition: transform .2s;
  flex-shrink: 0;
}
tr.open .cf-expand-arrow { transform: rotate(90deg); }

@media (max-width: 768px) {
  .cf-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cf-page-header { flex-direction: column; align-items: flex-start; }
  .cf-header-actions { margin-left: 0; }
}
