/* ════════════════════════════════════════════════════════════════════════
   MSINDAHA design system — TOKENS, BASE & MOTION
   Shared by the React dashboards (index.html, audit.html) and the website
   management pages (pages/*.html). Old variable names (--bg-card,
   --text-sub, …) are kept so every page and inline style keeps working.
════════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Surfaces — canvas → panels → overlays → raised controls */
  --bg-primary: #070a12;
  --bg-sidebar: #0a0e17;
  --bg-card: #0e131e;
  --bg-card-alt: #131927;
  --bg-raised: #1a2133;
  --bg-input: #0a0e17;
  --bg-hover: rgba(148, 163, 184, 0.07);
  --bg-active: rgba(148, 163, 184, 0.12);
  --overlay: rgba(2, 4, 10, 0.66);

  /* Lines */
  --border: #1c2433;
  --border-strong: #283246;
  --border-soft: rgba(255, 255, 255, 0.05);

  /* Text */
  --text-primary: #e9edf4;
  --text-sub: #a0aabb;
  --text-muted: #737e93;
  --text-faint: #4f586c;

  /* Brand & semantic colors */
  --accent: #3b82f6;
  --accent-hover: #2f74ea;
  --accent-text: #7cb0ff;
  --accent-dim: rgba(59, 130, 246, 0.14);
  --accent-glow: rgba(59, 130, 246, 0.35);
  --success: #22c55e;
  --success-text: #4ade80;
  --success-dim: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;
  --warning-text: #fbbf24;
  --warning-dim: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-text: #f87171;
  --danger-dim: rgba(239, 68, 68, 0.14);
  --purple: #8b5cf6;
  --purple-text: #b9a5fb;
  --purple-dim: rgba(139, 92, 246, 0.15);

  /* Shape & depth */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 30px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 28px 70px -14px rgba(0, 0, 0, 0.75), 0 6px 18px rgba(0, 0, 0, 0.4);
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.32);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 280ms;

  /* Layout */
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
  --page-max: 1440px;
}

/* ── Reset & base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background:
    radial-gradient(1200px 600px at 8% -12%, rgba(59, 130, 246, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, 0.05), transparent 60%),
    var(--bg-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: none;
  cursor: pointer;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
}
svg {
  flex-shrink: 0;
}
::selection {
  background: rgba(59, 130, 246, 0.38);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Scrollbars ── */
* {
  scrollbar-width: thin;
  scrollbar-color: #283246 transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #262f42;
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #36415a;
}

/* ── Utilities ── */
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--text-muted);
}
.text-danger {
  color: var(--danger-text);
}
.flex-spacer {
  flex: 1;
}

/* ── Color tones — set --tone (solid), --tone-text and --tone-bg so any
   component (badges, icon chips, avatars of state) can take a tone. ── */
.tone-blue {
  --tone: #3b82f6;
  --tone-text: #7cb0ff;
  --tone-bg: rgba(59, 130, 246, 0.15);
}
.tone-indigo {
  --tone: #6366f1;
  --tone-text: #a5b4fc;
  --tone-bg: rgba(99, 102, 241, 0.16);
}
.tone-purple {
  --tone: #8b5cf6;
  --tone-text: #c4b5fd;
  --tone-bg: rgba(139, 92, 246, 0.16);
}
.tone-amber {
  --tone: #f59e0b;
  --tone-text: #fbbf24;
  --tone-bg: rgba(245, 158, 11, 0.15);
}
.tone-orange {
  --tone: #f97316;
  --tone-text: #fb923c;
  --tone-bg: rgba(249, 115, 22, 0.15);
}
.tone-green {
  --tone: #22c55e;
  --tone-text: #4ade80;
  --tone-bg: rgba(34, 197, 94, 0.14);
}
.tone-teal {
  --tone: #14b8a6;
  --tone-text: #5eead4;
  --tone-bg: rgba(20, 184, 166, 0.14);
}
.tone-red {
  --tone: #ef4444;
  --tone-text: #f87171;
  --tone-bg: rgba(239, 68, 68, 0.15);
}
.tone-gray {
  --tone: #94a3b8;
  --tone-text: #aab4c4;
  --tone-bg: rgba(148, 163, 184, 0.13);
}

/* ── Motion ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes tabPaneIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes popOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes modalOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@keyframes drawerIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: none;
  }
}
@keyframes drawerOut {
  from {
    transform: none;
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
}
@keyframes bellRing {
  0%,
  100% {
    transform: rotate(0);
  }
  15% {
    transform: rotate(-16deg);
  }
  30% {
    transform: rotate(12deg);
  }
  45% {
    transform: rotate(-9deg);
  }
  60% {
    transform: rotate(6deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}
@keyframes badgePop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes rowFlash {
  0% {
    background-color: rgba(59, 130, 246, 0.24);
  }
  100% {
    background-color: transparent;
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}
@keyframes checkPop {
  0% {
    transform: scale(0.82);
  }
  60% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes bootPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
@keyframes tabUnderline {
  from {
    transform: scaleX(0.3);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
