/* Controls Tools visual identity */
:root {
  --color-bg: #f8fafc;
  --color-surface: #fff;
  --color-border: #e2e8f0;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-aqua: #06b6d4;
  --color-yellow: #fbbf24;
  --color-navy: #071b3a;
  --color-ink: #0f172a;
  --color-muted: #64748b;
  --shadow-card: 0 10px 30px rgb(15 23 42 / 6%);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: Inter, Cairo, Tahoma, Arial, sans-serif;
  line-height: 1.65;
}

:lang(ar) {
  font-family: Cairo, Tahoma, Arial, sans-serif;
  letter-spacing: normal;
}

main { min-width: 0; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

::selection { background: var(--color-primary); color: white; }

.sharp-box, .btn-sharp, .card-sharp, .table-sharp { border-radius: 16px; }

.cyber-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.cyber-card-active { border-color: var(--color-primary); }

main :is(.shadow-sm, .shadow-lg).sharp-box { box-shadow: var(--shadow-card); }

.cyber-card:has(a), .btn-primary, .btn-ghost, .btn-danger {
  transition: background-color 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.cyber-card:has(a):hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgb(37 99 235 / 12%);
}

:is(.btn-primary, .btn-ghost, .btn-danger) {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
}

:is(.btn-primary, .btn-ghost, .btn-danger):not(.block, .flex, .hidden) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgb(37 99 235 / 18%);
}

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

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-primary-hover);
  border-color: #bfdbfe;
}

.btn-ghost:hover { background: var(--color-primary-light); }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
:is(.btn-primary, .btn-ghost, .btn-danger):active { transform: scale(.98); }
:is(.btn-primary, .btn-ghost, .btn-danger):disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="button"], [type="submit"], [type="reset"], [type="image"]),
select, textarea, .cyber-input {
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-ink);
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); }
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 12%);
}
input::placeholder, textarea::placeholder { color: var(--color-muted); }
input:disabled, select:disabled, textarea:disabled { background: #f1f5f9; color: var(--color-muted); }

.site-header { background: rgb(255 255 255 / 96%); }
.site-header [data-purpose="site-brand"] { min-width: 0; }
#mobile-burger-btn, #sidebar-toggle-btn { min-width: 44px; min-height: 44px; }
#main-sidebar { width: min(280px, 90vw); }
#main-sidebar nav a { min-height: 44px; }
@media (max-width: 1023px) { #main-sidebar.translate-x-full { visibility: hidden; } }

.landing-hero {
  color: white;
  background:
    radial-gradient(ellipse at 90% 0%, rgb(6 182 212 / 24%), transparent 46%),
    linear-gradient(135deg, #071b3a 0%, #143885 60%, #0b526e 100%);
}
.landing-hero h1 {
  font-size: clamp(2rem, 5.2vw, 4rem);
  font-weight: 800;
  line-height: 1.3;
}
.landing-hero .hero-highlight { color: #a5f3fc; }
.landing-hero .hero-description { color: #e2e8f0; line-height: 1.85; }
.landing-hero .btn-primary { background: var(--color-yellow); color: var(--color-ink); }
.landing-hero .btn-primary:hover { background: #fcd34d; }
.landing-hero .btn-ghost { background: rgb(255 255 255 / 10%); color: white; border-color: rgb(255 255 255 / 55%); }
.landing-hero .btn-ghost:hover { background: rgb(255 255 255 / 18%); }
.landing-hero :focus-visible { outline-color: #fcd34d; }

.package-heading { background: linear-gradient(180deg, #fff, #eff6ff); }
.package-badge { background: #fef3c7; color: #92400e; }
.package-channels { display: flex; flex-wrap: wrap; gap: .5rem; }
.package-channels li { background: #ecfeff; color: #155e75; padding: .3rem .65rem; border-radius: 999px; font-size: .8rem; }

.report-shell { width: min(100%, 1280px); margin-inline: auto; padding: clamp(1rem, 4vw, 2rem); display: grid; gap: 1.5rem; }
.report-heading, .report-section-heading { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; }
.report-heading h1 { color: var(--color-ink); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.3; }
.report-heading p { color: var(--color-muted); margin-top: .5rem; }
.report-toolbar, .report-panel, .report-metric {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.report-toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; padding: 1.25rem; }
.report-toolbar label { display: grid; gap: .3rem; font-size: .8rem; font-weight: 700; flex: 1 1 8rem; }
.report-toolbar :is(input, select) { padding: .5rem .65rem; width: 100%; font-weight: 500; }
.report-toolbar .report-muted { align-self: center; }
.report-period label { max-width: 14rem; }
.report-period .report-muted { margin-inline-start: auto; }
.report-panel { padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.report-panel h2 { color: var(--color-ink); font-size: 1.125rem; font-weight: 800; }
.report-panel > p { margin-top: .65rem; }
.report-muted { color: var(--color-muted); font-size: .82rem; }
.report-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: .8rem; }
.report-metric { display: grid; align-content: start; gap: .4rem; padding: 1.125rem; }
.report-metric span, .report-metric small { font-size: .8rem; color: var(--color-muted); }
.report-metric strong { color: var(--color-primary-hover); font-size: 2rem; line-height: 1.25; font-weight: 800; font-variant-numeric: tabular-nums; }
.report-metric .report-country { font-size: 1.35rem; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.report-table-wrap { overflow: auto; max-height: 33rem; margin-top: .8rem; }
.report-table { width: 100%; text-align: start; border-collapse: collapse; font-size: .83rem; }
.report-visit-table { min-width: 780px; }
.report-table :is(th, td) { text-align: start; padding: .68rem .6rem; border-bottom: 1px solid var(--color-border); }
.report-table thead th { position: sticky; top: 0; background: var(--color-bg); color: #475569; white-space: nowrap; }
.report-table tbody tr:hover { background: var(--color-primary-light); }
.report-table a { color: var(--color-primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.report-path { display: block; text-align: start; color: var(--color-muted); overflow-wrap: anywhere; }
.report-chart { display: flex; gap: clamp(2px, .65vw, 9px); margin-top: 1rem; }
.report-chart-column { flex: 1 1 0; min-width: 0; position: relative; padding-bottom: 1.25rem; }
.report-chart-track { height: 9rem; display: flex; flex-direction: column; justify-content: end; background: var(--color-bg); border-radius: 6px; overflow: hidden; }
.report-chart-track span { width: 100%; background: linear-gradient(to top, var(--color-primary), var(--color-aqua)); border-start-start-radius: 6px; border-start-end-radius: 6px; }
.report-chart time { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: .68rem; white-space: nowrap; color: var(--color-muted); }
.report-chart-column:first-child time { left: 0; transform: none; }
.report-chart-column:last-child time { right: 0; left: auto; transform: none; }
.report-chart-data { margin-top: 1rem; color: var(--color-muted); font-size: .85rem; }
.report-chart-data summary { cursor: pointer; color: var(--color-primary-hover); }
.report-chart-data dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .5rem; margin-top: .75rem; }
.report-chart-data dl div { display: flex; justify-content: space-between; gap: .5rem; background: var(--color-bg); border-radius: 8px; padding: .3rem .6rem; }
.report-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding-top: 1rem; }

#toast-container { position: fixed; inset: 1rem auto auto 1rem; z-index: 100; display: grid; gap: .75rem; pointer-events: none; }
.cyber-toast {
  pointer-events: auto;
  width: min(400px, calc(100vw - 2rem));
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: .875rem 1.125rem;
  box-shadow: var(--shadow-card);
  transition: opacity 200ms ease-out;
}

@media (max-width: 730px) {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
