/* ============================================
   MALAZ HUB — Design System v3
   Digital Navy + Gold + 7 Accent Colors
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&family=Quicksand:wght@400;600;700&display=swap');

:root {
  /* Navy Base (Lighter, Less Void-like) */
  --navy-900: #051525;
  /* Was #020c1b */
  --navy-800: #0f2342;
  /* Was #0a192f */
  --navy-700: #1a3055;
  /* Was #112240 */
  --navy-600: #25406b;
  --navy-500: #2f5080;

  /* Gold (Rich & Warm - Base for Night) */
  --gold: #dcb365;
  --gold-light: #faeab1;
  --gold-dark: #a1813d;
  --gold-gradient: linear-gradient(135deg, #dcb365, #faeab1, #dcb365);
  --gold-rgb: 220, 179, 101;

  /* 7 Accent Colors (Vibrant Base) */
  --c1: #ff7675;
  /* Coral Red */
  --c2: #55efc4;
  /* Bright Teal */
  --c3: #74b9ff;
  /* Sky Blue */
  --c4: #a8e6cf;
  /* Mint Green */
  --c5: #ffeaa7;
  /* Soft Yellow */
  --c6: #a29bfe;
  /* Lavender */
  --c7: #0984e3;
  /* Deep Blue */

  --c1-bg: rgba(255, 118, 117, 0.15);
  --c2-bg: rgba(85, 239, 196, 0.15);
  --c3-bg: rgba(116, 185, 255, 0.15);
  --c4-bg: rgba(168, 230, 207, 0.15);
  --c5-bg: rgba(255, 234, 167, 0.15);
  --c6-bg: rgba(162, 155, 254, 0.15);
  --c7-bg: rgba(9, 132, 227, 0.15);

  /* Sovereign Intertwined Blue Theme */
  --blue-deep: #051525;
  --blue-primary: #1e3a8a;
  --blue-light: #3b82f6;
  --bg-gradient: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-primary) 100%);
  --bg-mesh-center: rgba(5, 21, 37, 0.9);
  /* Night mesh center */

  /* Component Library Tokens v11.5 */
  --primary-glow: rgba(6, 6, 105, 0.55);
  --gold-glow: rgba(220, 179, 101, 0.08);
  --grid-color: rgba(220, 179, 101, 0.03);

  /* Day Mode Overrides v11.1 */
  --day-text: #051525;
  --day-muted: #4b5563;
  --day-bg: #f8fafc;
  --day-card: #ffffff;
  --day-border: #e2e8f0;

  /* Backgrounds (Night Mode - Connected to lighter Navy) */
  --bg-body: #051525;
  --bg-card: #0f2342;
  --bg-card-hover: #1a3055;
  --bg-sidebar: #0b1a33;
  --bg-input: #0b1a33;
  --bg-glass: rgba(15, 35, 66, 0.85);

  /* Text */
  --text-primary: #edf2f7;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Functional */
  --gold-rgb: 212, 175, 55;
  --c2-rgb: 0, 150, 255;
  --bg-card-rgb: 30, 42, 58;
  --red: #ff7675;
  --green: #00cec9;
  --yellow: #fdcb6e;
  --blue: #74b9ff;
  --border: rgba(255, 255, 255, 0.08);
  /* Slightly more visible */
  --border-gold: rgba(220, 179, 101, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 4px 20px rgba(220, 179, 101, 0.25);

  /* Layout */
  --sidebar-w: 110px;
  /* Slim Sidebar */
  --header-h: 70px;
  --radius: 20px;
  /* Even more rounded */
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bouncy Ease */
  --border-width: 2.5px;
}

/* === DAY MODE (High Vibrancy) === */
body.day-mode {
  /* Brighter Backgrounds (Paper-Premium) */
  --bg-body: #f1f5f9;
  /* Softer gray-blue */
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-input: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.95);

  /* Unified High Contrast for Day Mode v11.8 */
  --text-primary: #020617;
  /* Slate 950 (Extremely Dark) */
  --text-secondary: #334155;
  --text-muted: #64748b;
  --day-text: #020617;

  /* White & Light Gray Palette v11.8 */
  --primary-glow: rgba(226, 232, 240, 0.8);
  /* Light Gray */
  --gold-glow: rgba(255, 255, 255, 0.9);
  /* Pure White */
  --grid-color: rgba(148, 163, 184, 0.1);
  /* Subtle Slate Grid */
  --bg-mesh-center: rgba(255, 255, 255, 0.7);
  /* Bright center for Day */

  /* Vibrant Gold for Day v11.6 (Deeper for legibility on white) */
  --gold: #b3862b;
  --gold-gradient: linear-gradient(135deg, #b3862b, #dcb365, #b3862b);
  --gold-rgb: 179, 134, 43;
  --border-gold: rgba(179, 134, 43, 0.35);
  --border: rgba(0, 0, 0, 0.1);
}

.day-mode {
  background-color: var(--day-bg) !important;
  color: var(--day-text) !important;
}

.day-mode .card,
.day-mode .network-tile,
.day-mode .kpi-card,
.day-mode .kpi-card-exec {
  background: var(--day-card) !important;
  border-color: var(--day-border) !important;
  color: var(--day-text) !important;
}

.day-mode h1,
.day-mode h2,
.day-mode h3,
.day-mode h4,
.day-mode p,
.day-mode span:not(.icon) {
  color: var(--day-text) !important;
}

.day-mode .header {
  background: #ffffff !important;
  border-bottom: 2px solid var(--blue-primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Ensure Sidebar Text is dark in Day Mode */
.day-mode .nav-item span {
  color: var(--day-text) !important;
  font-weight: 900;
}

.day-mode .nav-item.active {
  background: rgba(var(--blue-primary-rgb), 0.1) !important;
}

.day-mode .control-btn {
  background: #f1f5f9;
  border-color: var(--blue-primary);
  color: var(--blue-deep) !important;
}

.day-mode .control-btn span {
  color: var(--blue-deep) !important;
}

.day-mode .xp-badge {
  background: #f1f5f9;
  border-color: var(--blue-primary);
  color: var(--blue-deep) !important;
}

.day-mode .header-icon-img {
  filter: none !important;
}

/* === RESET === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent
}

body {
  font-family: 'Quicksand', 'Cairo', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .4s, color .4s;
  position: relative;
}

/* PREMIUM MESH BACKGROUND v11.5 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, var(--primary-glow) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 85% 80%, var(--gold-glow) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, var(--bg-mesh-center) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* SUBTLE GRID OVERLAY v11.5 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

body[dir="ltr"] {
  direction: ltr;
  font-family: 'Quicksand', 'Cairo', sans-serif
}

a {
  text-decoration: none;
  color: inherit
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit
}

input,
textarea,
select {
  font-family: inherit;
  outline: none
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--navy-600);
  border-radius: 10px
}

/* === TYPOGRAPHY === */
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
}

@supports (text-wrap: balance) {

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }
}

h1 {
  font-size: 1.8rem;
  font-weight: 800
}

h2 {
  font-size: 1.4rem;
  font-weight: 700
}

h3 {
  font-size: 1.1rem;
  font-weight: 600
}

h4 {
  font-size: 0.95rem;
  font-weight: 600
}

p {
  line-height: 1.6;
  letter-spacing: 0.2px;
}

.text-gold {
  color: var(--gold);
  font-weight: 900;
}

.text-muted {
  color: var(--text-secondary)
}

/* === UTILITIES === */
.flex {
  display: flex
}

.items-center {
  align-items: center
}

.justify-between {
  justify-content: space-between
}

.gap-sm {
  gap: 8px
}

.gap-md {
  gap: 16px
}

.hidden {
  display: none !important
}

.font-light {
  font-weight: 300
}

.w-full {
  width: 100%
}

/* === GLASS === */
.glass {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border)
}

/* === CARD === */
.card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.15);
  /* Cartoonish Flat Shadow */
}

.card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.2);
  border-color: var(--gold)
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px
}

/* === INFOGRAPHIC CARD (PowerPoint Style) === */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.info-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-md)
}

.info-card .info-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
  transition: transform .3s;
}

.info-card:hover .info-icon {
  transform: scale(1.1) rotate(5deg)
}

.info-card h4 {
  margin-bottom: 6px;
  font-size: 1rem
}

.info-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5
}

/* Color Variants */
.info-card.c1 .info-icon {
  background: var(--c1-bg);
  color: var(--c1)
}

.info-card.c1:hover {
  border-color: var(--c1)
}

.info-card.c2 .info-icon {
  background: var(--c2-bg);
  color: var(--c2)
}

.info-card.c2:hover {
  border-color: var(--c2)
}

.info-card.c3 .info-icon {
  background: var(--c3-bg);
  color: var(--c3)
}

.info-card.c3:hover {
  border-color: var(--c3)
}

.info-card.c4 .info-icon {
  background: var(--c4-bg);
  color: var(--c4)
}

.info-card.c4:hover {
  border-color: var(--c4)
}

.info-card.c5 .info-icon {
  background: var(--c5-bg);
  color: var(--c5)
}

.info-card.c5:hover {
  border-color: var(--c5)
}

.info-card.c6 .info-icon {
  background: var(--c6-bg);
  color: var(--c6)
}

.info-card.c6:hover {
  border-color: var(--c6)
}

.info-card.c7 .info-icon {
  background: var(--c7-bg);
  color: var(--c7)
}

.info-card.c7:hover {
  border-color: var(--c7)
}

.info-card.gold .info-icon {
  background: rgba(200, 164, 92, 0.15);
  color: var(--gold)
}

.info-card.gold:hover {
  border-color: var(--gold)
}

/* === STEP FLOW (PowerPoint Process) === */
.step-flow {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 4px
}

/* ========== GLOBAL LAYOUT (v10.3) ========== */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  /* PERMANENTLY FIXED v11.9.2 */
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  transition: all 0.3s var(--ease);
}


body[dir="ltr"] .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

.main-content {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  transition: all 0.3s var(--ease);
  position: relative;
  z-index: 1;
}

body[dir="ltr"] .main-content {
  margin-right: 0;
  margin-left: var(--sidebar-w);
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    /* Wider drawer on mobile */
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  body[dir="ltr"] .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100%;
  }
}

/* Ensure branding from login doesn't leak */
body.app-active .login-page {
  display: none !important;
}

body.app-active .login-logo,
body.app-active h1 {
  display: none !important;
}

.header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--blue-deep);
  /* SOLID DESIGN COLOR v11.1 */
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  /* SYMMETRIC SPACING */
  z-index: 1500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.header-title h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-icon-img,
.menu-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: all 0.3s var(--ease);
  filter: drop-shadow(0 0 5px rgba(var(--gold-rgb), 0.3));
}

.day-mode .header-icon-img,
.day-mode .menu-icon-img {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1)) !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 12px;
  margin: 10px 8px;
  background: rgba(var(--gold-rgb), 0.05);
  /* Unified subtle gold tint */
  border: 2px solid transparent;
  /* Consistent border for cards */
}

.nav-item:hover {
  background: rgba(var(--gold-rgb), 0.12);
  transform: scale(1.15);
  /* PURE ZOOM v11.9.2 */
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--gold);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: var(--gold);
  transform: scale(1.05);
}

.nav-item .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.nav-item:hover .icon img {
  transform: translateY(-3px);
}

.nav-item span:not(.icon) {
  font-size: 0.72rem;
  font-weight: 800;
  white-space: pre-line !important;
  line-height: 1.1;
  color: var(--text-primary);
  text-align: center;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
    padding: 15px 25px;
    margin: 5px 15px;
    border-right: none;
    border-left: 5px solid transparent;
  }

  .nav-item.active {
    border-left-color: var(--gold);
  }

  .nav-item .icon {
    font-size: 1.6rem;
  }

  .nav-item span:not(.icon) {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-primary);
  }
}

.step-item {
  flex: 1;
  min-width: 140px;
  padding: 20px 16px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  transition: all .3s;
}

.step-item:first-child {
  border-radius: var(--radius) 0 0 var(--radius)
}

.step-item:last-child {
  border-radius: 0 var(--radius) var(--radius) 0
}

body[dir="ltr"] .step-item:first-child {
  border-radius: var(--radius) 0 0 var(--radius)
}

body[dir="ltr"] .step-item:last-child {
  border-radius: 0 var(--radius) var(--radius) 0
}

.step-item .step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin: 0 auto 10px;
}

.step-item h4 {
  font-size: 0.85rem;
  margin-bottom: 4px
}

.step-item p {
  font-size: 0.72rem;
  color: var(--text-muted)
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #020c1b;
  box-shadow: 0 5px 0 var(--gold-dark), 0 8px 15px rgba(220, 179, 101, 0.3);
  border: var(--border-width) solid #fff;
}

.btn-gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--gold-dark), 0 12px 20px rgba(220, 179, 101, 0.4)
}

.btn-gold:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gold-dark)
}

.btn-outline {
  border: var(--border-width) solid var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.btn-outline:hover {
  background: rgba(200, 164, 92, 0.1)
}

.btn-ghost {
  color: var(--text-secondary)
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05)
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center
}

/* === BADGES === */
.badge {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: var(--border-width) solid currentColor;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block
}

.priority-dot.red {
  background: var(--red);
  box-shadow: 0 0 8px var(--red)
}

.priority-dot.green {
  background: var(--green);
  box-shadow: 0 0 8px var(--green)
}

.priority-dot.yellow {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow)
}

/* === AVATAR === */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #020c1b;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem
}

/* === XP === */
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.xp-badge.xp {
  color: var(--gold);
  border-color: rgba(200, 164, 92, 0.3)
}

.xp-badge.coins {
  color: var(--yellow);
  border-color: rgba(255, 189, 46, 0.3)
}

.xp-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden
}

.xp-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 3px;
  transition: width .6s
}

/* === FORM === */
.form-group {
  margin-bottom: 18px
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all .3s;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.1)
}

.form-input::placeholder {
  color: var(--text-muted)
}

/* === TABLE === */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border)
}

table {
  width: 100%;
  border-collapse: collapse
}

th {
  text-align: right;
  padding: 12px 16px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap
}

body[dir="ltr"] th {
  text-align: left
}

td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem
}

tr:hover td {
  background: rgba(200, 164, 92, 0.03)
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  overflow-x: auto
}

.tab {
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all .3s
}

.tab.active {
  background: var(--bg-card);
  color: var(--gold)
}

.tab:hover:not(.active) {
  color: var(--text-primary)
}

/* === TOAST === */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn .4s var(--ease);
}

.toast.success {
  border-right: 4px solid var(--green)
}

.toast.error {
  border-right: 4px solid var(--red)
}

.toast.info {
  border-right: 4px solid var(--blue)
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0
  }

  to {
    transform: translateX(0);
    opacity: 1
  }
}

/* === STARS === */
.stars {
  display: flex;
  gap: 2px
}

.stars .star {
  color: var(--text-muted);
  font-size: 0.85rem
}

.stars .star.active {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 189, 46, 0.4)
}

/* === GRIDS === */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px
}

/* GOLD BORDERS v11.6 */
.gold-border {
  border: 1px solid var(--gold) !important;
  box-shadow: 0 4px 15px rgba(var(--gold-rgb), 0.1);
}

.day-mode .gold-border {
  border-color: var(--gold) !important;
  box-shadow: 0 4px 15px rgba(225, 177, 44, 0.15);
}

.grid-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .6
  }
}

@keyframes breathe {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(200, 164, 92, 0.3)
  }

  50% {
    box-shadow: 0 0 25px rgba(200, 164, 92, 0.6)
  }
}

.animate-in {
  animation: fadeIn .5s var(--ease) both
}

/* === SEARCH === */
.search-box {
  position: relative
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: all .3s
}

body[dir="rtl"] .search-box input {
  padding: 10px 40px 10px 16px
}

.search-box input:focus {
  border-color: var(--gold)
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem
}

body[dir="rtl"] .search-icon {
  left: auto;
  right: 14px
}

/* === RESPONSIVE === */
@media(max-width:768px) {
  .step-flow {
    flex-direction: column
  }

  .step-item:first-child,
  .step-item:last-child {
    border-radius: var(--radius)
  }

  .card {
    padding: 16px
  }

  h1 {
    font-size: 1.4rem
  }

  h2 {
    font-size: 1.2rem
  }

  .hidden-mobile {
    display: none !important;
  }
}

@media(max-width:480px) {
  .grid-info {
    grid-template-columns: 1fr 1fr
  }
}

/* ============================================
   MOBILE SUPER-APP & FAB (v7)
   Global Button | Motion | Safe Zones
   ============================================ */

/* --- GLOBAL AI FAB (Brain Button) --- */
.ai-fab-btn {
  position: fixed;
  bottom: 85px;
  /* Clear of Mobile Nav (approx 70px) */
  left: 20px;
  width: 56px;
  height: 56px;
  background: var(--gold-gradient);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(200, 164, 92, 0.5);
  z-index: 999;
  /* Above content, below modals */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #020c1b;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: pulse-gold-gentle 3s infinite;
}

body[dir="ltr"] .ai-fab-btn {
  left: auto;
  right: 20px;
}

.ai-fab-btn:active {
  transform: scale(0.9) rotate(-10deg);
}

@keyframes pulse-gold-gentle {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(200, 164, 92, 0.4);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 20px 10px rgba(200, 164, 92, 0);
    transform: scale(1.05);
  }
}

/* --- MOTION PRIMITIVES --- */
.touch-effect {
  position: relative;
  overflow: hidden;
}

.touch-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Staggered List Animation */
.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 768px) {

  /* Prevent Overlap: Add padding to bottom of page */
  .page-content {
    padding-bottom: 140px !important;
  }

  /* Login Page Components */
  .divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
  }

  .divider::before,
  .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
  }

  .divider:not(:empty)::before {
    margin-right: 15px;
  }

  .divider:not(:empty)::after {
    margin-left: 15px;
  }

  .mb_15 {
    margin-bottom: 15px !important;
  }

  /* Header Optimization */
  .header-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .header-title {
    position: static;
    transform: none;
    left: auto;
    flex: 1;
    text-align: center;
  }

  .header-title h2 {
    font-size: 1rem;
  }

  /* Vertical Card Lists (instead of Grid) */
  .grid-3,
  .grid-4,
  .super-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Larger Touch Targets */
  .info-card,
  .task-item,
  .nav-item {
    min-height: 60px;
    /* Easier to tap */
  }

  /* FAB Adjustment */
  .ai-fab-btn {
    bottom: 40px;
    right: 20px;
    left: auto;
  }

  body[dir="rtl"] .ai-fab-btn {
    right: auto;
    left: 20px;
  }

  /* Mobile Content Padding */
  .page-content {
    padding: 80px 15px 120px 15px !important;
  }
}

/* Strategic Modal (Bottom Sheet style for Mobile) */
.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.ai-modal.active {
  pointer-events: auto;
  opacity: 1;
}

.ai-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ai-modal-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--gold);
}

.ai-modal.active .ai-modal-content {
  transform: translateY(0);
}

/* === CODING ASSISTANT REFACTOR (v1.0) === */
.sidebar-nav {
  margin-top: 20px;
}

.menu-icon-custom {
  width: 24px;
  height: 24px;
  filter: invert(1) brightness(2);
}

.header-logo-custom {
  height: 38px;
  /* Reduced for better balance v12.6 */
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}

.header-logo-custom:hover {
  transform: scale(1.1) rotate(-2deg);
}

.ai-status-text {
  font-weight: 900;
  letter-spacing: 1px;
}

/* Fix for text-wrap warning */
@supports (text-wrap: balance) {

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }
}