/* ============================================ */
/* ============ LOCAL FONTS ================== */
/* ============================================ */
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-ExtraLight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('./fonts/Vazirmatn-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-ExtraLight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('./fonts/Estedad-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Russo One';
  src: url('./fonts/RussoOne-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================ */
/* ============== DESIGN TOKENS =============== */
/* ============================================ */
:root {
  /* === Brand Colors === */
  --atramall-yellow: #ffe31d;
  --atramall-teal:   #1d5a5f;
  --atramall-glow:   rgba(255, 227, 29, 0.35);

  --chipsel-blue:    #1472e3;
  --chipsel-blue-d:  #0e56b3;
  --chipsel-blue-l:  #5aa3ff;
  --chipsel-glow:    rgba(20, 114, 227, 0.22);

  --tapsi-orange:    #ff5b35;
  --tapsi-orange-d:  #d63a1a;
  --tapsi-orange-l:  #ff8a68;
  --tapsi-glow:      rgba(255, 91, 53, 0.25);

  /* === Core Colors === */
  --bg-base: #f5f9ff;
  --bg-blue-glow: #dceeff;
  --bg-purple-glow: #ede5ff;
  --bg-green-glow: #e3faef;

  --navy: #142744;
  --text-primary: #142744;
  --text-secondary: #667892;
  --text-muted: #8a9ab0;

  --primary: #1677ff;
  --primary-soft: #eef6ff;
  --primary-glow: rgba(22, 119, 255, 0.10);

  --green: #16b364;
  --green-soft: #e3faef;
  --green-glow: rgba(22, 179, 100, 0.10);

  --purple: #7c3aed;
  --purple-soft: #ede5ff;
  --purple-glow: rgba(124, 58, 237, 0.10);

  --orange: #f59e0b;
  --orange-soft: #fff5e0;
  --orange-glow: rgba(245, 158, 11, 0.10);

  --red: #ef4444;
  --red-soft: #fef0f0;
  --red-glow: rgba(239, 68, 68, 0.10);

  --gold: #f4b500;

  /* === Glass === */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.80);
  --glass-blur: blur(20px) saturate(140%);

  /* === Shadows === */
  --shadow-xs: 0 2px 8px rgba(40, 80, 130, 0.04);
  --shadow-sm: 0 4px 16px rgba(40, 80, 130, 0.05);
  --shadow-md: 0 8px 30px rgba(40, 80, 130, 0.06);
  --shadow-lg: 0 12px 40px rgba(40, 80, 130, 0.08);

  /* === Radius === */
  --radius-xl: clamp(16px, 2vh, 22px);
  --radius-lg: clamp(14px, 1.8vh, 20px);
  --radius-md: clamp(12px, 1.4vh, 16px);
  --radius-sm: clamp(10px, 1.2vh, 14px);
  --radius-pill: 999px;

  /* === Layout === */
  --page-pad: clamp(8px, 1vh, 16px);
  --gap: clamp(8px, 1.2vh, 18px);
  --side: clamp(180px, 18vw, 270px);

  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  font-size: clamp(11px, 0.7vw + 0.4vh, 15px);
  line-height: 1.65;
  overflow-x: hidden;
  overflow-y: hidden;
}

button, a { font: inherit; }

/* ============================================ */
/* ============== APP SHELL =================== */
/* ============================================ */
.app-shell {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  padding: var(--page-pad);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================ */
/* ============ BACKGROUND LAYERS ============= */
/* ============================================ */

.bg-base {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  pointer-events: none;
  z-index: 0;
}

.bg-top-light {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  height: 60vh;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.60) 30%,
    transparent 70%
  );
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

.bg-blue-glow {
  position: fixed;
  top: 15vh;
  left: 5vw;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(
    ellipse at center,
    rgba(220, 238, 255, 0.55) 0%,
    rgba(220, 238, 255, 0.25) 40%,
    transparent 70%
  );
  filter: blur(90px);
  pointer-events: none;
  z-index: 1;
}

.bg-purple-glow {
  position: fixed;
  top: 25vh;
  right: 35vw;
  width: 30vw;
  height: 35vh;
  background: radial-gradient(
    ellipse at center,
    rgba(237, 229, 255, 0.50) 0%,
    rgba(237, 229, 255, 0.20) 40%,
    transparent 70%
  );
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}

.bg-green-glow {
  position: fixed;
  top: 30vh;
  right: 8vw;
  width: 25vw;
  height: 30vh;
  background: radial-gradient(
    ellipse at center,
    rgba(227, 250, 239, 0.55) 0%,
    rgba(227, 250, 239, 0.22) 40%,
    transparent 70%
  );
  filter: blur(75px);
  pointer-events: none;
  z-index: 1;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 1;
}

.bg-shape-1 {
  width: 28vw;
  height: 40vh;
  left: 18vw;
  top: 10vh;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.70), rgba(196, 220, 252, 0.08));
  clip-path: polygon(30% 0, 65% 5%, 100% 50%, 60% 100%, 0 48%);
  opacity: 0.35;
  filter: blur(3px);
}

.bg-shape-2 {
  width: 22vw;
  height: 35vh;
  left: 25vw;
  bottom: 10vh;
  background: linear-gradient(140deg, transparent 35%, rgba(255, 213, 74, 0.10));
  clip-path: polygon(58% 0, 100% 52%, 58% 100%, 0 52%);
  opacity: 0.45;
  filter: blur(4px);
}

.bg-bottom-wave {
  position: fixed;
  bottom: -15vh;
  left: -10vw;
  width: 80vw;
  height: 55vh;
  background: linear-gradient(
    135deg,
    rgba(220, 238, 255, 0.40) 0%,
    rgba(240, 248, 255, 0.20) 40%,
    transparent 70%
  );
  border-radius: 50% 60% 40% 70% / 60% 40% 60% 40%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

/* ============================================ */
/* ============== GLASS BASE ================== */
/* ============================================ */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  z-index: 2;
}

/* ============================================ */
/* ============== WORKSPACE =================== */
/* ============================================ */
.workspace {
  margin-right: calc(var(--side) + var(--gap));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* ============================================ */
/* ============== HEADER ====================== */
/* ============================================ */
.topbar {
  min-height: clamp(56px, 7vh, 80px);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 1.4vh, 18px) clamp(14px, 1.6vw, 28px);
  flex: 0 0 auto;
  gap: clamp(10px, 1.2vw, 20px);
  transition: box-shadow var(--transition-smooth);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(250, 253, 255, 0.75) 50%,
    rgba(245, 250, 255, 0.80) 100%
  );
}

.topbar:hover {
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.user-area {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
}

.user-avatar {
  width: clamp(38px, 5vh, 52px);
  height: clamp(38px, 5vh, 52px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.98);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(228, 238, 255, 0.65));
  box-shadow: 0 4px 16px rgba(40, 80, 130, 0.10), inset 0 1px 0 rgba(255, 255, 255, 1);
  position: relative;
  flex: 0 0 auto;
}

.user-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: clamp(9px, 1.4vh, 13px);
  height: clamp(9px, 1.4vh, 13px);
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px var(--green-glow);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.user-greeting {
  font-size: clamp(9px, 0.7vw + 0.3vh, 12px);
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.user-name {
  font-size: clamp(12px, 0.9vw + 0.5vh, 16px);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
}

.datetime-box {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 12px);
  padding: clamp(6px, 0.9vh, 10px) clamp(10px, 1.2vw, 18px);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(240, 246, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 2px 12px rgba(40, 80, 130, 0.04);
}

.clock,
.date {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2b426a;
  font-weight: 600;
  font-size: clamp(10px, 0.8vw + 0.4vh, 14px);
  white-space: nowrap;
}

.clock {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.clock-icon,
.calendar-icon {
  width: clamp(13px, 1.6vh, 17px);
  height: clamp(13px, 1.6vh, 17px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  opacity: 0.85;
}

.datetime-divider {
  width: 1px;
  height: clamp(16px, 2.2vh, 22px);
  background: linear-gradient(to bottom, transparent, rgba(127, 153, 185, 0.25), transparent);
}

.header-divider {
  height: clamp(22px, 3.6vh, 38px);
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(107, 133, 166, 0.18), transparent);
}

.bell-button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.98);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(240, 246, 255, 0.55));
  border-radius: 50%;
  width: clamp(38px, 5vh, 50px);
  height: clamp(38px, 5vh, 50px);
  display: grid;
  place-items: center;
  color: #5b7091;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 2px 12px rgba(40, 80, 130, 0.05);
  transition: transform var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  flex: 0 0 auto;
}

.bell-button:hover {
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.bell-button svg {
  width: 50%;
  height: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: clamp(16px, 2vh, 20px);
  height: clamp(16px, 2vh, 20px);
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ffc93c, #ffab00);
  color: #2a1c00;
  display: grid;
  place-items: center;
  font-size: clamp(8px, 0.9vh, 10px);
  font-weight: 700;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(255, 171, 0, 0.35);
  line-height: 1;
}

/* ============================================ */
/* ============== PAGE CONTENT ================ */
/* ============================================ */
.page-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow: hidden;
}

/* ============================================ */
/* ============== HERO GRID =================== */
/* ============================================ */
.hero-grid {
  display: grid;
  grid-template-columns: clamp(240px, 20vw, 340px) minmax(0, 1fr);
  gap: var(--gap);
  direction: ltr;
  align-items: stretch;
  min-height: 0;
  flex: 0 0 auto;
  max-height: 42vh;
}

/* ============================================ */
/* ============ CONTROL CARD ================== */
/* ============================================ */
.control-card {
  direction: rtl;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(248, 252, 255, 0.72) 50%,
    rgba(242, 249, 255, 0.68) 100%
  );
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: box-shadow var(--transition-smooth);
}

.control-card:hover {
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.cc-blob-blue {
  position: absolute;
  bottom: -25%;
  left: -15%;
  width: 75%;
  height: 65%;
  background: radial-gradient(
    ellipse at 40% 60%,
    rgba(160, 215, 240, 0.35) 0%,
    rgba(180, 225, 240, 0.18) 40%,
    transparent 70%
  );
  border-radius: 50% 60% 40% 70% / 60% 40% 60% 40%;
  filter: blur(28px);
  pointer-events: none;
  z-index: 1;
}

.cc-glow-green {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  height: 40%;
  background: radial-gradient(
    circle at center,
    rgba(227, 250, 239, 0.45) 0%,
    rgba(227, 250, 239, 0.18) 40%,
    transparent 70%
  );
  filter: blur(35px);
  pointer-events: none;
  z-index: 1;
}

.cc-bottom-wave {
  position: absolute;
  bottom: -35%;
  left: -20%;
  width: 110%;
  height: 70%;
  background: linear-gradient(
    135deg,
    rgba(190, 225, 245, 0.30) 0%,
    rgba(200, 240, 230, 0.22) 40%,
    rgba(220, 245, 255, 0.12) 70%,
    transparent 100%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(22px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

.cc-white-curve {
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 70%;
  height: 55%;
  background: radial-gradient(
    ellipse at 70% 50%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.20) 50%,
    transparent 75%
  );
  border-radius: 50%;
  filter: blur(30px);
  pointer-events: none;
  z-index: 1;
}

.cc-gold-corner {
  position: absolute;
  width: clamp(100px, 12vw, 160px);
  height: clamp(80px, 10vh, 130px);
  bottom: -40px;
  right: -10px;
  opacity: 0.28;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 227, 29, 0.55));
  clip-path: polygon(70% 0, 100% 100%, 0 100%);
  pointer-events: none;
  z-index: 1;
  filter: blur(2px);
}

.panel-head {
  min-height: clamp(42px, 5.5vh, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(14px, 1.2vw, 22px);
  border-bottom: 1px solid rgba(127, 153, 185, 0.10);
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(12px, 0.9vw + 0.4vh, 17px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head svg {
  width: clamp(16px, 2.2vh, 22px);
  height: clamp(16px, 2.2vh, 22px);
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-content {
  text-align: center;
  padding: clamp(12px, 1.6vh, 22px) clamp(14px, 1.2vw, 22px);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 3;
}

.control-label {
  font-size: clamp(10px, 0.75vw + 0.35vh, 13px);
  color: var(--text-secondary);
  margin-bottom: clamp(8px, 1.2vh, 16px);
  font-weight: 500;
}

.switch {
  width: clamp(52px, 6.5vw, 76px);
  height: clamp(28px, 3.6vh, 42px);
  display: block;
  margin: 0 auto clamp(8px, 1vh, 14px);
  position: relative;
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #34d27b, #16b364);
  box-shadow: inset 0 2px 6px rgba(20, 120, 70, 0.18), 0 3px 10px rgba(22, 179, 100, 0.22);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.switch span:after {
  content: "";
  position: absolute;
  width: clamp(22px, 3vh, 34px);
  height: clamp(22px, 3vh, 34px);
  top: 50%;
  transform: translateY(-50%);
  right: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(66, 79, 100, 0.20), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: right var(--transition-smooth), box-shadow var(--transition-base);
}

.switch input:not(:checked) + span {
  background: linear-gradient(135deg, #b8c4d4, #9aa9bc);
  box-shadow: inset 0 2px 6px rgba(80, 100, 130, 0.14);
}

.switch input:not(:checked) + span:after {
  right: calc(100% - clamp(22px, 3vh, 34px) - 3px);
}

.switch input:checked + span:after {
  box-shadow: 0 3px 12px rgba(22, 179, 100, 0.28), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.control-content strong {
  display: block;
  font-size: clamp(13px, 1vw + 0.5vh, 17px);
  color: var(--green);
  font-weight: 700;
  transition: color var(--transition-base);
}

.control-content strong.off {
  color: var(--red);
}

.running-status {
  margin-top: clamp(8px, 1.1vh, 14px);
  color: var(--text-secondary);
  font-size: clamp(9px, 0.68vw + 0.3vh, 12px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-weight: 400;
}

.running-status i {
  width: clamp(6px, 0.9vh, 8px);
  height: clamp(6px, 0.9vh, 8px);
  border-radius: 50%;
  background: var(--green);
  display: block;
  box-shadow: 0 0 0 3px var(--green-glow);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-glow); }
  50% { box-shadow: 0 0 0 6px rgba(22, 179, 100, 0.05); }
}

/* ============================================ */
/* ============= STATS CARD =================== */
/* ============================================ */
.stats-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  direction: ltr;
  min-height: 0;
  padding: clamp(14px, 2vh, 32px) clamp(12px, 1.2vw, 22px) clamp(12px, 1.6vh, 20px);
  gap: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(248, 252, 255, 0.72) 50%,
    rgba(242, 249, 255, 0.68) 100%
  );
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-smooth);
}

.stats-card:hover {
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.stats-card::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(220, 238, 255, 0.30) 0%,
    transparent 65%
  );
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.stats-card::after {
  content: "";
  position: absolute;
  bottom: -30%;
  right: -5%;
  width: 50%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.55) 0%,
    transparent 65%
  );
  filter: blur(35px);
  pointer-events: none;
  z-index: 0;
}

.stat-item {
  direction: rtl;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 18px);
  min-width: 0;
  min-height: 0;
  padding: clamp(6px, 1vh, 14px) clamp(5px, 0.7vw, 12px);
  position: relative;
  z-index: 2;
  transition: background var(--transition-fast);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.45);
}

.stat-item + .stat-item {
  border-right: 1px solid rgba(127, 153, 185, 0.10);
}

.stat-wave-purple {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 80%;
  height: 70%;
  background: linear-gradient(
    135deg,
    rgba(237, 229, 255, 0.50) 0%,
    rgba(237, 229, 255, 0.20) 50%,
    transparent 100%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
}

.stat-blob-purple {
  position: absolute;
  bottom: -25%;
  right: -15%;
  width: 65%;
  height: 60%;
  background: radial-gradient(
    circle at 60% 60%,
    rgba(124, 58, 237, 0.18) 0%,
    transparent 65%
  );
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.stat-wave-blue {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 80%;
  height: 70%;
  background: linear-gradient(
    135deg,
    rgba(220, 238, 255, 0.55) 0%,
    rgba(220, 238, 255, 0.20) 50%,
    transparent 100%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
}

.stat-blob-blue {
  position: absolute;
  bottom: -25%;
  right: -15%;
  width: 65%;
  height: 60%;
  background: radial-gradient(
    circle at 60% 60%,
    rgba(22, 119, 255, 0.15) 0%,
    transparent 65%
  );
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.stat-wave-green {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 80%;
  height: 70%;
  background: linear-gradient(
    135deg,
    rgba(227, 250, 239, 0.55) 0%,
    rgba(227, 250, 239, 0.20) 50%,
    transparent 100%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
}

.stat-blob-green {
  position: absolute;
  bottom: -25%;
  right: -15%;
  width: 65%;
  height: 60%;
  background: radial-gradient(
    circle at 60% 60%,
    rgba(22, 179, 100, 0.15) 0%,
    transparent 65%
  );
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.stat-icon {
  flex: 0 0 clamp(44px, 6vh, 76px);
  height: clamp(44px, 6vh, 76px);
  border-radius: clamp(10px, 1.4vh, 16px);
  display: grid;
  place-items: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  z-index: 3;
}

.stat-item:hover .stat-icon {
  transform: translateY(-3px) scale(1.02);
}

.stat-icon svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.purple-box {
  background: linear-gradient(145deg, #ede5ff, rgba(240, 234, 255, 0.65));
  border: 1px solid rgba(124, 58, 237, 0.14);
  color: var(--purple);
  box-shadow: 0 4px 14px var(--purple-glow);
}

.blue-box {
  background: linear-gradient(145deg, #eef6ff, rgba(232, 241, 255, 0.65));
  border: 1px solid rgba(22, 119, 255, 0.12);
  color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.green-box {
  background: linear-gradient(145deg, #e3faef, rgba(230, 249, 239, 0.65));
  border: 1px solid rgba(22, 179, 100, 0.14);
  color: var(--green);
  box-shadow: 0 4px 14px var(--green-glow);
}

.stat-info {
  min-width: 0;
  position: relative;
  z-index: 3;
}

.stat-info strong {
  display: block;
  font-size: clamp(18px, 1.8vw + 0.7vh, 28px);
  line-height: 1.1;
  margin-bottom: clamp(3px, 0.6vh, 8px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-info span {
  display: block;
  font-size: clamp(9px, 0.68vw + 0.3vh, 13px);
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-rule {
  display: block;
  width: clamp(24px, 2.8vw, 38px);
  height: 2.5px;
  margin: clamp(6px, 1vh, 12px) 0 clamp(6px, 1.1vh, 14px);
  border-radius: var(--radius-pill);
  opacity: 0.75;
}

.stat-rule.purple { background: var(--purple); }
.stat-rule.blue { background: var(--primary); }
.stat-rule.green { background: var(--green); }

.stat-info small {
  font-size: clamp(8px, 0.65vw + 0.3vh, 12px);
  color: #4a5f7d;
  font-weight: 500;
}

/* ============================================ */
/* ============ REPORTS PANEL ================= */
/* ============================================ */
.reports-panel {
  padding: clamp(12px, 1.4vw, 22px);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vh, 14px);
  border-radius: var(--radius-xl);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(248, 252, 255, 0.68) 50%,
    rgba(244, 249, 255, 0.72) 100%
  );
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-smooth);
}

.reports-panel:hover {
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.reports-bg-glow {
  position: absolute;
  top: -25%;
  left: -8%;
  width: 50%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(220, 238, 255, 0.30) 0%,
    transparent 65%
  );
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.reports-bg-wave {
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: linear-gradient(
    135deg,
    rgba(220, 238, 255, 0.25) 0%,
    rgba(240, 248, 255, 0.12) 40%,
    transparent 70%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(35px);
  pointer-events: none;
  z-index: 0;
}

.reports-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.reports-heading h2 {
  margin: 0;
  font-size: clamp(13px, 0.9vw + 0.4vh, 18px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.reports-heading svg {
  width: clamp(16px, 2.2vh, 22px);
  height: clamp(16px, 2.2vh, 22px);
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 22px);
  direction: ltr;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.report-card {
  direction: rtl;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(245, 250, 255, 0.65));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  position: relative;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.report-bg-glow {
  position: absolute;
  top: -20%;
  right: -15%;
  width: 60%;
  height: 50%;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.report-bg-blob {
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 70%;
  height: 55%;
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ============================================ */
/* ===== ATRAMALL CARD ======================= */
/* ============================================ */
.atramall-card .report-bg-glow {
  background: radial-gradient(circle, rgba(255, 227, 29, 0.25), transparent 70%);
}
.atramall-card .report-bg-blob {
  background: radial-gradient(circle, rgba(29, 90, 95, 0.15), transparent 70%);
}

.atramall-card .report-title {
  background: linear-gradient(90deg,
    rgba(255, 227, 29, 0.22) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(29, 90, 95, 0.10) 100%);
  color: var(--atramall-teal);
}
.atramall-card .report-title h3 { color: var(--atramall-teal); }

.atramall-card li::before {
  background: var(--atramall-teal);
  box-shadow: 0 0 0 3px rgba(29, 90, 95, 0.14);
}

.atramall-card .report-footer {
  background: rgba(255, 227, 29, 0.14);
  color: var(--atramall-teal);
}
.atramall-card .report-footer:hover {
  background: rgba(255, 227, 29, 0.24);
}

/* ============================================ */
/* ===== CHIPSEL CARD ========================= */
/* ============================================ */
.chipsel-card .report-bg-glow {
  background: radial-gradient(circle, rgba(20, 114, 227, 0.20), transparent 70%);
}
.chipsel-card .report-bg-blob {
  background: radial-gradient(circle, rgba(90, 163, 255, 0.18), transparent 70%);
}

.chipsel-card .report-title {
  background: linear-gradient(90deg,
    rgba(20, 114, 227, 0.12) 0%,
    rgba(255, 255, 255, 0.15) 100%);
  color: var(--chipsel-blue);
}
.chipsel-card .report-title h3 { color: var(--chipsel-blue); }

.chipsel-card li::before {
  background: var(--chipsel-blue);
  box-shadow: 0 0 0 3px rgba(20, 114, 227, 0.16);
}

.chipsel-card .report-footer {
  background: rgba(20, 114, 227, 0.07);
  color: var(--chipsel-blue);
}
.chipsel-card .report-footer:hover {
  background: rgba(20, 114, 227, 0.13);
}

/* ============================================ */
/* ===== TAPSI CARD =========================== */
/* ============================================ */
.tapsi-card .report-bg-glow {
  background: radial-gradient(circle, rgba(255, 91, 53, 0.20), transparent 70%);
}
.tapsi-card .report-bg-blob {
  background: radial-gradient(circle, rgba(255, 138, 104, 0.18), transparent 70%);
}

.tapsi-card .report-title {
  background: linear-gradient(90deg,
    rgba(255, 91, 53, 0.12) 0%,
    rgba(255, 255, 255, 0.15) 100%);
  color: var(--tapsi-orange);
}
.tapsi-card .report-title h3 { color: var(--tapsi-orange); }

.tapsi-card li::before {
  background: var(--tapsi-orange);
  box-shadow: 0 0 0 3px rgba(255, 91, 53, 0.16);
}

.tapsi-card .report-footer {
  background: rgba(255, 91, 53, 0.07);
  color: var(--tapsi-orange);
}
.tapsi-card .report-footer:hover {
  background: rgba(255, 91, 53, 0.13);
}

/* ---------- عنوان و ساختار کارت گزارش ---------- */
.report-title {
  min-height: clamp(46px, 5.6vh, 62px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(8px, 0.9vw, 12px);
  padding-inline: clamp(12px, 1.2vw, 20px);
  border-bottom: 1px solid rgba(127, 153, 185, 0.10);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

/* لوگو داخل کارت گزارش */
.report-logo {
  flex: 0 0 auto;
  width: clamp(30px, 4vh, 40px);
  height: clamp(30px, 4vh, 40px);
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 3px;
  background: #ffffff;
  overflow: hidden;
  transition: transform 250ms cubic-bezier(.34,1.4,.64,1), box-shadow 250ms;
}

.atramall-card .report-logo {
  border: 1px solid rgba(255, 227, 29, 0.55);
  box-shadow: 0 2px 10px rgba(255, 227, 29, 0.25);
}
.chipsel-card .report-logo {
  border: 1px solid rgba(20, 114, 227, 0.25);
  box-shadow: 0 2px 10px rgba(20, 114, 227, 0.14);
}
.tapsi-card .report-logo {
  border: 1px solid rgba(255, 91, 53, 0.25);
  box-shadow: 0 2px 10px rgba(255, 91, 53, 0.14);
}

.report-card:hover .report-logo {
  transform: scale(1.06);
}

.report-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.report-title h3 {
  margin: 0;
  font-size: clamp(12px, 0.95vw + 0.4vh, 16px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.report-title svg {
  width: clamp(16px, 2vh, 20px);
  height: clamp(16px, 2vh, 20px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  flex: 0 0 auto;
}

.report-card ul {
  list-style: none;
  padding: clamp(6px, 1vh, 12px) clamp(12px, 1.2vw, 20px);
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.report-card ul::-webkit-scrollbar {
  display: none;
}

.report-card li {
  flex: 0 0 auto;
  position: relative;
  font-size: clamp(9px, 0.68vw + 0.3vh, 12px);
  line-height: 1.6;
  padding: clamp(4px, 0.7vh, 9px) 0;
  padding-right: clamp(11px, 1vw, 15px);
  border-bottom: 1px solid rgba(230, 237, 245, 0.85);
  white-space: normal;
  color: #2a3d5c;
  font-weight: 400;
}

.report-card li:last-child {
  border-bottom: none;
}

.report-card li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(5px, 0.75vh, 7px);
  height: clamp(5px, 0.75vh, 7px);
  border-radius: 50%;
}

.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(6px, 1vh, 12px) clamp(12px, 1.2vw, 20px);
  border-top: 1px solid rgba(127, 153, 185, 0.08);
  flex: 0 0 auto;
  transition: background var(--transition-base);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.report-footer svg {
  width: clamp(14px, 1.8vh, 18px);
  height: clamp(14px, 1.8vh, 18px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.report-footer:hover svg {
  opacity: 1;
}

/* ============================================ */
/* ============== FOOTER ====================== */
/* ============================================ */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: clamp(8px, 0.6vw + 0.3vh, 11px);
  padding: clamp(6px, 1vh, 14px) 0 0;
  flex: 0 0 auto;
  opacity: 0.75;
  font-weight: 400;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
}

/* ============================================ */
/* ============= SIDEBAR (DESKTOP) ============ */
/* ============================================ */
.sidebar {
  position: fixed;
  z-index: 5;
  right: var(--page-pad);
  top: var(--page-pad);
  bottom: var(--page-pad);
  width: var(--side);
  border-radius: var(--radius-xl);
  padding: clamp(12px, 1.4vw, 20px) clamp(10px, 1vw, 18px);
  overflow: hidden;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.2vh, 16px);
  align-content: stretch;

  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 255, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  transition: box-shadow var(--transition-smooth);
}

.sidebar-bg-wave {
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 100%;
  height: 45%;
  background: linear-gradient(
    135deg,
    rgba(200, 225, 255, 0.25) 0%,
    rgba(220, 238, 255, 0.12) 50%,
    transparent 100%
  );
  border-radius: 50% 60% 40% 70% / 55% 45% 55% 45%;
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

.sidebar-bg-glow {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 35%;
  background: radial-gradient(
    ellipse at center,
    rgba(220, 238, 255, 0.35) 0%,
    rgba(240, 248, 255, 0.15) 50%,
    transparent 75%
  );
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.sidebar-dots {
  position: absolute;
  inset: auto -50px -70px auto;
  width: clamp(140px, 18vw, 220px);
  height: clamp(140px, 18vh, 220px);
  background-image: radial-gradient(circle, rgba(101, 158, 231, 0.15) 1px, transparent 1.3px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(ellipse, black 12%, transparent 68%);
  mask-image: radial-gradient(ellipse, black 12%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(120px, 18vh, 220px);
  padding: clamp(10px, 1.6vh, 20px);
  background: #ffffff;
  border: 1px solid rgba(127, 153, 185, 0.10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 20px rgba(40, 80, 130, 0.04);
}

.brand-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 225, 255, 0.35) 0%,
    rgba(220, 238, 255, 0.15) 40%,
    transparent 70%
  );
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

.sidebar-brand img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 153, 185, 0.25) transparent;
  position: relative;
  z-index: 1;
}

.nav-link {
  flex: 0 0 auto;
  min-height: clamp(40px, 5.5vh, 54px);
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(10px, 1vw, 16px);
  text-decoration: none;
  color: #1a2d4a;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: clamp(11px, 0.85vw + 0.4vh, 15px);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.30);
  transition: all var(--transition-base);
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(255, 255, 255, 0.75);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.nav-link svg {
  width: clamp(18px, 2.4vh, 21px);
  height: clamp(18px, 2.4vh, 21px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  transition: opacity var(--transition-fast), transform var(--transition-fast), filter var(--transition-fast);
  flex: 0 0 auto;
}

.nav-link:hover svg {
  opacity: 1;
  transform: scale(1.08);
}

.nav-link.active {
  color: var(--primary);
  background: linear-gradient(100deg, rgba(238, 246, 255, 0.95), rgba(248, 251, 255, 0.70));
  border-color: rgba(22, 119, 255, 0.12);
  box-shadow: 0 3px 14px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.nav-link.active svg {
  opacity: 1;
  stroke: var(--primary);
  filter: drop-shadow(0 2px 4px var(--primary-glow));
}

.nav-link.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.logout {
  direction: ltr;
  min-height: clamp(40px, 5.5vh, 54px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.14);
  background: linear-gradient(100deg, rgba(254, 240, 240, 0.85), rgba(255, 255, 255, 0.50));
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 1.2vw, 18px);
  cursor: pointer;
  font-size: clamp(11px, 0.85vw + 0.4vh, 15px);
  font-weight: 500;
  position: relative;
  z-index: 2;
  transition: all var(--transition-base);
}

.logout:hover {
  background: linear-gradient(100deg, rgba(254, 235, 235, 0.95), rgba(255, 245, 245, 0.65));
  border-color: rgba(239, 68, 68, 0.22);
  box-shadow: 0 4px 16px var(--red-glow);
}

.logout svg {
  width: clamp(18px, 2.6vh, 25px);
  height: clamp(18px, 2.6vh, 25px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  transition: transform var(--transition-fast);
}

.logout:hover svg {
  transform: translateX(-2px);
}

/* ============================================ */
/* ============== RESPONSIVE ================== */
/* ============================================ */

@media (max-width: 1100px) {
  :root {
    --side: clamp(160px, 20vw, 230px);
  }

  .hero-grid {
    grid-template-columns: minmax(220px, 0.35fr) minmax(0, 0.65fr);
  }

  .stat-item { gap: 6px; }
  .stat-icon { flex-basis: clamp(40px, 5.4vh, 62px); height: clamp(40px, 5.4vh, 62px); }
  .stat-icon svg { width: 50%; height: 50%; }
  .nav-link { min-height: clamp(36px, 5vh, 50px); }
}

@media (max-width: 900px) {
  :root {
    --page-pad: 12px;
    --gap: 14px;
    --radius-xl: 20px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
  }

  html, body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }

  .app-shell {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
    padding: var(--page-pad);
    padding-bottom: 110px;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    position: relative;
  }

  .sidebar {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 22px 22px 0 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    overflow: visible !important;
    z-index: 9999 !important;

    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 255, 0.99)) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.98) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    box-shadow:
      0 -8px 30px rgba(40, 80, 130, 0.12),
      0 -1px 0 rgba(255, 255, 255, 0.95),
      inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    transform: translateZ(0) !important;
  }

  .sidebar-bg-wave,
  .sidebar-bg-glow,
  .sidebar-dots,
  .brand-glow {
    display: none !important;
  }

  .sidebar-brand {
    display: none !important;
  }

  .nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    justify-content: space-around !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .nav-link {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 6px 4px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 3px !important;
    direction: rtl !important;
    border-radius: 14px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #5b7091 !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: all var(--transition-base) !important;
    position: relative !important;
    text-decoration: none !important;
  }

  .nav-link span {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .nav-link svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    stroke-width: 1.7 !important;
    opacity: 0.75 !important;
    transition: all var(--transition-base) !important;
  }

  .nav-link:hover {
    background: rgba(238, 246, 255, 0.60) !important;
    color: var(--primary) !important;
  }

  .nav-link:hover svg {
    opacity: 1 !important;
  }

  .nav-link.active {
    background: linear-gradient(135deg, rgba(22, 119, 255, 0.12), rgba(22, 119, 255, 0.05)) !important;
    color: var(--primary) !important;
    border-color: rgba(22, 119, 255, 0.16) !important;
    box-shadow: none !important;
    font-weight: 700 !important;
  }

  .nav-link.active svg {
    opacity: 1 !important;
    stroke: var(--primary) !important;
    stroke-width: 1.9 !important;
    filter: drop-shadow(0 2px 4px var(--primary-glow)) !important;
  }

  .nav-link.active::before {
    display: none !important;
  }

  .logout {
    flex: 0 0 auto !important;
    width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.65), rgba(254, 240, 240, 0.45)) !important;
    border: 1px solid rgba(239, 68, 68, 0.14) !important;
    color: #dc2626 !important;
    box-shadow: none !important;
    direction: ltr !important;
    margin-right: 4px !important;
  }

  .logout span {
    display: none !important;
  }

  .logout svg {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 1.7 !important;
    opacity: 0.85 !important;
  }

  .workspace {
    margin: 0;
    width: 100%;
    overflow: visible;
    gap: var(--gap);
  }

  .topbar {
    min-height: 62px;
    padding: 10px 14px;
    border-radius: 18px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .user-area {
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .user-avatar {
    width: 42px;
    height: 42px;
  }

  .user-text { min-width: 0; }

  .user-greeting {
    display: block;
    font-size: 10px;
  }

  .user-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
  }

  .header-meta {
    gap: 8px;
    flex: 0 0 auto;
  }

  .date,
  .datetime-divider,
  .header-divider {
    display: none;
  }

  .datetime-box {
    padding: 7px 11px;
    border-radius: 12px;
    gap: 0;
  }

  .clock {
    font-size: 12.5px;
    font-weight: 700;
    gap: 5px;
  }

  .clock-icon { width: 14px; height: 14px; }

  .bell-button { width: 42px; height: 42px; }

  .badge {
    min-width: 17px;
    height: 17px;
    font-size: 9.5px;
  }

  .page-content {
    overflow: visible;
    gap: var(--gap);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--gap);
    max-height: none;
  }

  .control-card {
    border-radius: 20px;
    min-height: 200px;
  }

  .panel-head {
    min-height: 52px;
    padding-inline: 18px;
  }

  .panel-head h2 { font-size: 15px; }
  .panel-head svg { width: 20px; height: 20px; }

  .control-content { padding: 20px 18px; }

  .control-label {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .switch {
    width: 66px;
    height: 36px;
    margin-bottom: 12px;
  }

  .switch span:after {
    width: 28px;
    height: 28px;
  }

  .switch input:not(:checked) + span:after {
    right: calc(100% - 28px - 3px);
  }

  .control-content strong { font-size: 16px; }

  .running-status {
    margin-top: 12px;
    font-size: 11.5px;
  }

  .stats-card {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 8px;
    border-radius: 20px;
  }

  .stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 18px;
    gap: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.65);
    transition: all var(--transition-base);
    direction: rtl;
  }

  .stat-item:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: translateY(-2px);
  }

  .stat-item + .stat-item {
    border-right: none;
    border-top: none;
    margin-top: 0;
  }

  .stat-icon {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    order: 0;
  }

  .stat-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.6;
  }

  .stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
    flex: 0 1 auto;
  }

  .stat-info strong {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--text-primary);
  }

  .stat-info span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    opacity: 0.85;
    line-height: 1.3;
  }

  .stat-rule { display: none; }

  .stat-info small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
  }

  .reports-panel {
    flex: 0 0 auto;
    padding: 16px;
    gap: 12px;
    border-radius: 20px;
    overflow: visible;
  }

  .reports-heading h2 { font-size: 15px; }
  .reports-heading svg { width: 20px; height: 20px; }

  .report-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
  }

  .report-card {
    min-height: auto;
    border-radius: 18px;
  }

  .report-title {
    min-height: 50px;
    padding-inline: 16px;
  }

  .report-title h3 { font-size: 14px; }
  .report-title svg { width: 20px; height: 20px; }

  .report-card ul {
    padding: 10px 16px 14px;
    overflow: visible;
  }

  .report-card li {
    font-size: 12.5px;
    line-height: 1.7;
    padding: 9px 0;
    padding-right: 15px;
    color: #1f3352;
  }

  .report-card li::before {
    width: 7px;
    height: 7px;
  }

  .report-footer { padding: 12px 16px; }
  .report-footer svg { width: 18px; height: 18px; }

  footer {
    font-size: 11px;
    padding: 8px 0 0;
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad: 10px;
    --gap: 12px;
  }

  .app-shell { padding-bottom: 100px; }

  .topbar {
    min-height: 58px;
    padding: 8px 12px;
    border-radius: 16px;
    gap: 8px;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
    border-width: 1.5px;
  }

  .user-avatar::after {
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .user-greeting { display: none; }

  .user-name {
    font-size: 12.5px;
    max-width: 90px;
  }

  .datetime-box { padding: 6px 10px; }

  .clock {
    font-size: 12px;
    gap: 4px;
  }

  .clock-icon { width: 13px; height: 13px; }

  .bell-button { width: 38px; height: 38px; }

  .badge {
    min-width: 15px;
    height: 15px;
    font-size: 9px;
    border-width: 2px;
  }

  .stat-item {
    padding: 14px 16px;
    gap: 12px;
  }

  .stat-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }

  .stat-icon svg { width: 24px; height: 24px; }
  .stat-info strong { font-size: 23px; }
  .stat-info span { font-size: 12px; }
  .stat-info small { font-size: 10.5px; }

  .panel-head {
    min-height: 48px;
    padding-inline: 16px;
  }

  .panel-head h2 { font-size: 14px; }

  .control-content { padding: 18px 16px; }
  .control-label { font-size: 11.5px; }

  .switch { width: 60px; height: 33px; }
  .switch span:after { width: 25px; height: 25px; }
  .switch input:not(:checked) + span:after { right: calc(100% - 25px - 3px); }

  .control-content strong { font-size: 15px; }
  .running-status { font-size: 11px; }

  .reports-panel { padding: 14px; }
  .reports-heading h2 { font-size: 14px; }

  .report-title {
    min-height: 46px;
    padding-inline: 14px;
  }
  .report-title h3 { font-size: 13px; }

  .report-card ul { padding: 8px 14px 12px; }

  .report-card li {
    font-size: 12px;
    padding: 8px 0;
    padding-right: 14px;
  }

  .report-footer { padding: 10px 14px; }

  .sidebar {
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 20px 20px 0 0 !important;
  }

  .nav-link {
    min-height: 54px !important;
    padding: 4px 2px !important;
    border-radius: 12px !important;
  }
  .nav-link svg { width: 20px !important; height: 20px !important; }
  .nav-link span { font-size: 9.5px !important; }

  .logout {
    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 12px !important;
  }
  .logout svg { width: 20px !important; height: 20px !important; }

  footer { font-size: 10px; }
}

@media (max-width: 480px) {
  :root {
    --page-pad: 8px;
    --gap: 10px;
  }

  .app-shell { padding-bottom: 92px; }

  .topbar {
    min-height: 54px;
    padding: 7px 10px;
    border-radius: 14px;
  }

  .user-avatar { width: 34px; height: 34px; }
  .user-name { font-size: 12px; max-width: 80px; }
  .datetime-box { padding: 5px 9px; }
  .clock { font-size: 11.5px; }
  .bell-button { width: 36px; height: 36px; }

  .stat-item {
    padding: 12px 14px;
    gap: 10px;
  }

  .stat-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .stat-icon svg { width: 22px; height: 22px; }
  .stat-info strong { font-size: 21px; }
  .stat-info span { font-size: 11.5px; }

  .control-content { padding: 16px 14px; }
  .switch { width: 56px; height: 31px; }
  .switch span:after { width: 23px; height: 23px; }
  .switch input:not(:checked) + span:after { right: calc(100% - 23px - 3px); }

  .reports-panel { padding: 12px; }
  .report-title {
    min-height: 42px;
    padding-inline: 12px;
  }
  .report-title h3 { font-size: 12.5px; }

  .report-card li {
    font-size: 11.5px;
    padding: 7px 0;
    padding-right: 13px;
  }

  .sidebar {
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .nav-link { min-height: 50px !important; border-radius: 11px !important; }
  .nav-link svg { width: 19px !important; height: 19px !important; }
  .nav-link span { font-size: 9px !important; }

  .logout {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
  }
  .logout svg { width: 18px !important; height: 18px !important; }
}

/* ============================================ */
/* ============== THEME TOGGLE ================ */
/* ============================================ */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 50%;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 350ms ease;
}

.theme-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
}

.theme-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(-90deg) scale(0);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(90deg) scale(0);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
}

/* ============================================ */
/* ============== DARK MODE =================== */
/* ============================================ */
[data-theme="dark"] {
  --bg-base: #0b1220;
  --navy: #e6ecf7;
  --text-primary: #e6ecf7;
  --text-secondary: #9aa9c2;
  --text-muted: #6b7d99;

  --primary: #4a95ff;
  --primary-soft: #14243f;
  --primary-glow: rgba(74, 149, 255, 0.15);

  --green: #22c77a;
  --green-soft: #122a22;
  --green-glow: rgba(34, 199, 122, 0.15);

  --purple: #a073ff;
  --purple-soft: #221a3a;
  --purple-glow: rgba(160, 115, 255, 0.15);

  --orange: #ffb02e;
  --orange-soft: #33260f;
  --orange-glow: rgba(255, 176, 46, 0.15);

  --red: #ff5c5c;
  --red-soft: #331414;
  --red-glow: rgba(255, 92, 92, 0.15);

  --gold: #ffc933;

  --atramall-teal:  #ffe31d;
  --atramall-yellow:#ffe31d;
  --chipsel-blue:   #5aa3ff;
  --tapsi-orange:   #ff8a68;

  --glass-bg: rgba(20, 28, 46, 0.75);
  --glass-border: rgba(255, 255, 255, 0.06);

  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .bg-top-light {
  background: radial-gradient(ellipse at center,
    rgba(50, 75, 120, 0.35) 0%, rgba(30, 45, 80, 0.15) 30%, transparent 70%);
}
[data-theme="dark"] .bg-blue-glow {
  background: radial-gradient(ellipse at center,
    rgba(40, 80, 160, 0.30) 0%, rgba(40, 80, 160, 0.10) 40%, transparent 70%);
}
[data-theme="dark"] .bg-purple-glow {
  background: radial-gradient(ellipse at center,
    rgba(100, 60, 180, 0.22) 0%, rgba(100, 60, 180, 0.08) 40%, transparent 70%);
}
[data-theme="dark"] .bg-green-glow {
  background: radial-gradient(ellipse at center,
    rgba(30, 120, 90, 0.22) 0%, rgba(30, 120, 90, 0.08) 40%, transparent 70%);
}
[data-theme="dark"] .bg-shape-1 {
  background: linear-gradient(145deg, rgba(80, 130, 220, 0.14), rgba(50, 80, 150, 0.04));
}
[data-theme="dark"] .bg-shape-2 {
  background: linear-gradient(140deg, transparent 35%, rgba(255, 227, 29, 0.06));
}
[data-theme="dark"] .bg-bottom-wave {
  background: linear-gradient(135deg,
    rgba(50, 90, 160, 0.25) 0%, rgba(30, 50, 100, 0.10) 40%, transparent 70%);
}

[data-theme="dark"] .topbar {
  background: linear-gradient(135deg,
    rgba(28, 38, 58, 0.88) 0%,
    rgba(22, 30, 48, 0.82) 50%,
    rgba(20, 28, 46, 0.88) 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .user-avatar {
  border-color: rgba(255, 255, 255, 0.10);
  background: linear-gradient(145deg, rgba(45, 60, 92, 0.90), rgba(30, 45, 75, 0.65));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .user-avatar::after { border-color: #1a2338; }

[data-theme="dark"] .datetime-box,
[data-theme="dark"] .bell-button {
  background: linear-gradient(135deg, rgba(42, 56, 84, 0.85), rgba(28, 38, 58, 0.55));
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 12px rgba(0, 0, 0, 0.20);
}
[data-theme="dark"] .bell-button { color: #9aa9c2; }
[data-theme="dark"] .bell-button:hover { color: var(--primary); }
[data-theme="dark"] .clock { color: var(--primary); }
[data-theme="dark"] .date { color: #c8d4e8; }

[data-theme="dark"] .header-divider,
[data-theme="dark"] .datetime-divider {
  background: linear-gradient(to bottom, transparent, rgba(150, 170, 200, 0.20), transparent);
}
[data-theme="dark"] .badge { border-color: #1a2338; color: #1a1400; }

[data-theme="dark"] .sidebar {
  background: linear-gradient(160deg, rgba(24, 34, 52, 0.95), rgba(18, 26, 42, 0.88));
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-link {
  color: #c8d4e8;
  background: rgba(40, 52, 78, 0.35);
}
[data-theme="dark"] .nav-link:hover {
  background: rgba(50, 65, 95, 0.65);
  color: var(--primary);
}
[data-theme="dark"] .nav-link.active {
  color: var(--primary);
  background: linear-gradient(100deg, rgba(74, 149, 255, 0.16), rgba(50, 65, 95, 0.40));
  border-color: rgba(74, 149, 255, 0.22);
}
[data-theme="dark"] .logout {
  background: linear-gradient(100deg, rgba(80, 30, 30, 0.50), rgba(40, 25, 25, 0.35));
  border-color: rgba(255, 92, 92, 0.20);
  color: #ff7a7a;
}
[data-theme="dark"] .logout:hover {
  background: linear-gradient(100deg, rgba(90, 35, 35, 0.65), rgba(50, 30, 30, 0.45));
  border-color: rgba(255, 92, 92, 0.32);
}
[data-theme="dark"] .sidebar-bg-wave {
  background: linear-gradient(135deg,
    rgba(50, 90, 160, 0.20) 0%, rgba(40, 70, 140, 0.10) 50%, transparent 100%);
}
[data-theme="dark"] .sidebar-bg-glow {
  background: radial-gradient(ellipse at center,
    rgba(60, 100, 180, 0.20) 0%, transparent 70%);
}
[data-theme="dark"] .sidebar-dots {
  background-image: radial-gradient(circle, rgba(100, 150, 220, 0.18) 1px, transparent 1.3px);
}

[data-theme="dark"] .control-card,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .reports-panel {
  background: linear-gradient(160deg,
    rgba(26, 35, 54, 0.85) 0%,
    rgba(20, 28, 46, 0.75) 50%,
    rgba(22, 30, 48, 0.78) 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .panel-head,
[data-theme="dark"] .report-title { border-bottom-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .stat-item:hover { background: rgba(40, 52, 78, 0.40); }
[data-theme="dark"] .stat-item + .stat-item { border-right-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .stat-info small { color: var(--text-secondary); }

[data-theme="dark"] .report-card {
  background: linear-gradient(160deg, rgba(26, 35, 54, 0.85), rgba(20, 28, 46, 0.65));
  border-color: rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .report-card li {
  color: #c8d4e8;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* === Dark Report Titles (Brand) === */
[data-theme="dark"] .atramall-card .report-title {
  background: linear-gradient(90deg,
    rgba(255, 227, 29, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(29, 90, 95, 0.20) 100%);
}
[data-theme="dark"] .atramall-card .report-title h3 {
  color: var(--atramall-yellow);
}
[data-theme="dark"] .atramall-card .report-footer {
  background: rgba(255, 227, 29, 0.08);
  color: var(--atramall-yellow);
}
[data-theme="dark"] .atramall-card li::before {
  background: var(--atramall-yellow);
  box-shadow: 0 0 0 3px rgba(255, 227, 29, 0.16);
}

[data-theme="dark"] .chipsel-card .report-title h3 {
  color: var(--chipsel-blue);
}
[data-theme="dark"] .chipsel-card .report-footer {
  background: rgba(90, 163, 255, 0.08);
  color: var(--chipsel-blue);
}
[data-theme="dark"] .chipsel-card li::before {
  background: var(--chipsel-blue);
  box-shadow: 0 0 0 3px rgba(90, 163, 255, 0.16);
}

[data-theme="dark"] .tapsi-card .report-title h3 {
  color: var(--tapsi-orange);
}
[data-theme="dark"] .tapsi-card .report-footer {
  background: rgba(255, 138, 104, 0.08);
  color: var(--tapsi-orange);
}
[data-theme="dark"] .tapsi-card li::before {
  background: var(--tapsi-orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 104, 0.16);
}

/* ============================================ */
/* ========== DARK MODE: TONE DOWN GLOWS ====== */
/* ============================================ */
[data-theme="dark"] .bg-top-light {
  background: radial-gradient(ellipse at center,
    rgba(60, 90, 140, 0.10) 0%, transparent 65%);
  opacity: 0.5;
}

[data-theme="dark"] .bg-blue-glow,
[data-theme="dark"] .bg-purple-glow,
[data-theme="dark"] .bg-green-glow {
  opacity: 0.25;
}

[data-theme="dark"] .bg-blue-glow {
  background: radial-gradient(ellipse at center,
    rgba(40, 80, 160, 0.18) 0%, transparent 65%);
}
[data-theme="dark"] .bg-purple-glow {
  background: radial-gradient(ellipse at center,
    rgba(90, 55, 170, 0.14) 0%, transparent 65%);
}
[data-theme="dark"] .bg-green-glow {
  background: radial-gradient(ellipse at center,
    rgba(25, 100, 75, 0.14) 0%, transparent 65%);
}

[data-theme="dark"] .bg-shape-1,
[data-theme="dark"] .bg-shape-2 { opacity: 0.10; }

[data-theme="dark"] .bg-bottom-wave {
  background: linear-gradient(135deg,
    rgba(40, 70, 130, 0.10) 0%,
    rgba(25, 40, 80, 0.04) 40%,
    transparent 70%);
  opacity: 0.4;
}

[data-theme="dark"] .cc-blob-blue,
[data-theme="dark"] .cc-glow-green,
[data-theme="dark"] .cc-bottom-wave,
[data-theme="dark"] .cc-white-curve,
[data-theme="dark"] .cc-gold-corner { opacity: 0.15; }

[data-theme="dark"] .stat-wave-purple,
[data-theme="dark"] .stat-wave-blue,
[data-theme="dark"] .stat-wave-green,
[data-theme="dark"] .stat-blob-purple,
[data-theme="dark"] .stat-blob-blue,
[data-theme="dark"] .stat-blob-green { opacity: 0.15; }

[data-theme="dark"] .reports-bg-glow,
[data-theme="dark"] .reports-bg-wave { opacity: 0.15; }

[data-theme="dark"] .report-bg-glow,
[data-theme="dark"] .report-bg-blob { opacity: 0.12; }

[data-theme="dark"] .control-card::before,
[data-theme="dark"] .control-card::after,
[data-theme="dark"] .stats-card::before,
[data-theme="dark"] .stats-card::after,
[data-theme="dark"] .reports-panel::before,
[data-theme="dark"] .reports-panel::after { opacity: 0.10; }

[data-theme="dark"] .bell-button,
[data-theme="dark"] .theme-toggle {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 12px rgba(0, 0, 0, 0.20);
}


/* ============================================ */
/* ═══════════════════════════════════════════ */
/* ═══ FIX: پس‌زمینه سفید برای لوگوها ═══════ */
/* ═══════════════════════════════════════════ */
/* ============================================ */

/* سایدبار — کادر لوگو در هر دو تم سفید می‌مونه */
.sidebar-brand,
html[data-theme] .sidebar-brand,
html[data-theme="dark"] .sidebar-brand,
[data-theme] .sidebar-brand,
[data-theme="dark"] .sidebar-brand {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid rgba(127, 153, 185, 0.10) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
  box-shadow: 0 4px 20px rgba(40, 80, 130, 0.04) !important;
}

html[data-theme="dark"] .sidebar-brand,
[data-theme="dark"] .sidebar-brand {
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

/* کارت‌های گزارش — کادر لوگو در هر دو تم سفید می‌مونه */
.report-logo,
html[data-theme] .report-logo,
html[data-theme="dark"] .report-logo,
[data-theme] .report-logo,
[data-theme="dark"] .report-logo {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

/* تب‌های کالاهای محدود — کادر لوگو سفید */
.lm-tab img,
[data-theme="dark"] .lm-tab img {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* =========================================================
   ATRAMALL SIDEBAR LOGO — THEME FIX
   Light mode: white logo container
   Dark mode: black logo container
   ========================================================= */

/* لوگوی سایدبار باید با خود پس‌زمینه سایدبار یکی باشد؛
   هیچ کادر سفید یا مشکی جداگانه‌ای پشت لوگو نمایش داده نشود. */
.sidebar-brand,
html[data-theme] .sidebar-brand,
html[data-theme="dark"] .sidebar-brand,
body[data-theme="dark"] .sidebar-brand,
[data-theme="dark"] .sidebar-brand {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

html[data-theme="dark"] .sidebar-brand,
body[data-theme="dark"] .sidebar-brand,
[data-theme="dark"] .sidebar-brand {
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}


/* =========================================================
   FINAL DARK MODE BACKGROUND FIX
   The dashboard background must follow the active theme.
   ========================================================= */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .bg-base {
  background-color: #0b1220 !important;
}

html[data-theme="dark"] .bg-base {
  background: #0b1220 !important;
}

/* Remove bright/light overlays in the dark dashboard background */
html[data-theme="dark"] .bg-top-light,
html[data-theme="dark"] .bg-blue-glow,
html[data-theme="dark"] .bg-purple-glow,
html[data-theme="dark"] .bg-green-glow,
html[data-theme="dark"] .bg-shape-1,
html[data-theme="dark"] .bg-shape-2,
html[data-theme="dark"] .bg-bottom-wave {
  mix-blend-mode: normal;
}

/* Logo container follows the sidebar/background instead of being white/black */
html[data-theme="dark"] .sidebar-brand {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}
