/* ═══════════════════════════════════════════════════════════
   HEGAZY FLOWS CMS — STYLE.CSS
   Theme: Dark Futuristic / Space Control Center
   Font: Tajawal (Arabic) + Oxanium (accents/numbers)
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Oxanium:wght@300;400;600;700;800&display=swap');

/* ── CSS Variables ────────────────────────────────────── */
:root {
  /* Core palette */
  --bg:       #03070f;
  --bg2:      #070d18;
  --bg3:      #0a1220;
  --bg4:      #0e1928;
  --bg5:      #131f30;
  --bg6:      #182538;

  /* Accent — electric teal/cyan */
  --a1:       #00f5e4;
  --a2:       #0af;
  --a3:       #0088cc;
  --grad:     linear-gradient(135deg, #00f5e4, #00aaff);
  --grad2:    linear-gradient(135deg, #00aaff, #7b2fff);

  /* Status colors */
  --green:    #00e676;
  --green-d:  rgba(0,230,118,.12);
  --orange:   #ff9100;
  --orange-d: rgba(255,145,0,.12);
  --red:      #ff3d5a;
  --red-d:    rgba(255,61,90,.12);
  --purple:   #9c57ff;
  --purple-d: rgba(156,87,255,.12);

  /* Client accent colors (will be overridden per client) */
  --c-accent: #00f5e4;

  /* Borders & glow */
  --border:   rgba(0,245,228,.1);
  --border2:  rgba(255,255,255,.06);
  --glow:     0 0 40px rgba(0,245,228,.08);
  --glow2:    0 0 80px rgba(0,245,228,.04);
  --sh:       0 12px 40px rgba(0,0,0,.6);
  --sh2:      0 4px 20px rgba(0,0,0,.4);

  /* Text */
  --w:        #e8f0f8;
  --w2:       #8fa8c0;
  --w3:       #4a6078;
  --w4:       #2a3848;

  /* Radius */
  --r:        16px;
  --rs:       10px;
  --rsm:      6px;

  /* Sidebar width */
  --sw:       260px;

  /* Transition */
  --t:        .22s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--w);
  min-height: 100vh;
  overflow: hidden;
  direction: rtl;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg6); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* Numbers use Oxanium */
.num, .badge, .stat-num, .progress-pct, .kpi-val {
  font-family: 'Oxanium', monospace;
}

/* ── Noise texture overlay ──────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1000; opacity: .4;
}

/* Animated grid background */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,245,228,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,228,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0% { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* ── Screens ─────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* ══════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════ */
#login {
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% -10%, rgba(0,170,255,.15) 0%, transparent 60%),
              radial-gradient(ellipse 50% 50% at 80% 80%, rgba(0,245,228,.06) 0%, transparent 50%);
  pointer-events: none;
}

/* Orbiting rings */
.login-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,245,228,.06);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ringRotate 25s linear infinite;
}
.login-ring:nth-child(1) { width: 600px; height: 600px; animation-duration: 25s; }
.login-ring:nth-child(2) { width: 900px; height: 900px; animation-duration: 40s; animation-direction: reverse; }
.login-ring:nth-child(3) { width: 1200px; height: 1200px; animation-duration: 60s; }

.login-ring::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: var(--a1);
  border-radius: 50%;
  top: 0; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--a1);
}

@keyframes ringRotate { to { transform: translate(-50%, -50%) rotate(360deg); } }

.login-box {
  position: relative; z-index: 2;
  width: 420px;
  background: linear-gradient(160deg, rgba(10,18,32,.95), rgba(7,13,24,.98));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--sh), var(--glow), inset 0 1px 0 rgba(255,255,255,.05);
  animation: loginIn .6s cubic-bezier(.34,1.56,.64,1);
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 36px; gap: 12px;
}

.login-icon {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(0,245,228,.15), rgba(0,170,255,.1));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 0 40px rgba(0,245,228,.15);
}

.login-icon::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 23px;
  background: var(--grad);
  opacity: 0;
  animation: iconPulse 3s ease-in-out infinite;
  z-index: -1;
}

@keyframes iconPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: .15; transform: scale(1.05); }
}

.login-icon svg { width: 36px; height: 36px; }

.login-title {
  font-family: 'Oxanium', monospace;
  font-size: 22px; font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.login-sub { font-size: 13px; color: var(--w3); letter-spacing: .5px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; color: var(--w3);
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}

.finp {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--rs);
  padding: 13px 16px;
  color: var(--w);
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  outline: none;
  transition: all var(--t);
  text-align: right;
}
.finp:focus {
  border-color: rgba(0,245,228,.4);
  background: var(--bg5);
  box-shadow: 0 0 0 3px rgba(0,245,228,.06), inset 0 0 20px rgba(0,245,228,.03);
}
.finp::placeholder { color: var(--w4); }

.fsel2 {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--rs);
  padding: 12px 16px;
  color: var(--w);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t);
  text-align: right;
  appearance: none;
}
.fsel2:focus { border-color: rgba(0,245,228,.4); }
.fsel2 option { background: var(--bg3); }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--grad);
  border: none; border-radius: var(--rs);
  color: var(--bg);
  font-family: 'Tajawal', sans-serif;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  position: relative; overflow: hidden;
  letter-spacing: .5px;
  margin-top: 8px;
}

.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0; transition: opacity var(--t);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,245,228,.3); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

/* ══════════════════════════════════════════════════════
   MAIN APP LAYOUT
══════════════════════════════════════════════════════ */
#app { flex-direction: row; overflow: hidden; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sw);
  min-width: var(--sw);
  height: 100vh;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-left: 1px solid var(--border2);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--a1) 30%, var(--a2) 70%, transparent);
  opacity: .2;
}

.sb-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; gap: 12px;
}

.sb-logo {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0,245,228,.2), rgba(0,170,255,.15));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(0,245,228,.1);
}

.sb-logo svg { width: 20px; height: 20px; }

.sb-brand h2 {
  font-family: 'Oxanium', monospace;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sb-brand p { font-size: 11px; color: var(--w3); margin-top: 1px; }

.sb-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }

.nav-label {
  font-size: 9px; font-weight: 700; color: var(--w4);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 10px; margin: 16px 0 6px;
  font-family: 'Oxanium', monospace;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--rs);
  cursor: pointer;
  transition: all var(--t);
  font-size: 14px; font-weight: 500; color: var(--w3);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--bg4); color: var(--w); }
.nav-item.active {
  background: rgba(0,245,228,.08);
  color: var(--a1);
  border: 1px solid rgba(0,245,228,.12);
}
.nav-item.active::before {
  content: '';
  position: absolute; right: 0; top: 20%; bottom: 20%;
  width: 2px; border-radius: 2px 0 0 2px;
  background: var(--a1);
  box-shadow: 0 0 8px var(--a1);
}

.nav-icon { font-size: 16px; flex-shrink: 0; opacity: .8; }
.nav-text { flex: 1; }

.nav-badge {
  font-family: 'Oxanium', monospace;
  background: rgba(0,245,228,.15);
  color: var(--a1);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  min-width: 20px; text-align: center;
}
.nav-item.active .nav-badge { background: rgba(0,245,228,.25); }

/* Sidebar footer */
.sb-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border2);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--rs);
  background: var(--bg3);
  border: 1px solid var(--border2);
}

.user-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--bg);
  flex-shrink: 0;
  font-family: 'Oxanium', monospace;
}

.user-info h4 { font-size: 13px; font-weight: 600; }
.user-info p { font-size: 11px; color: var(--a1); font-family: 'Oxanium', monospace; }

.btn-notif {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--w3);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 16px; transition: all var(--t);
  position: relative; flex-shrink: 0;
  margin-right: auto;
}
.btn-notif:hover { border-color: var(--a1); color: var(--a1); }

.notif-dot {
  position: absolute; top: -3px; left: -3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
  font-family: 'Oxanium', monospace;
}

.btn-logout {
  background: none; border: none; color: var(--w4);
  cursor: pointer; font-size: 16px; padding: 4px;
  transition: color var(--t); flex-shrink: 0;
}
.btn-logout:hover { color: var(--red); }

/* ── MAIN CONTENT ──────────────────────────────────── */
.main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}

/* Topbar */
.topbar {
  padding: 16px 28px;
  background: rgba(7,13,24,.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; position: relative; z-index: 10;
}

.topbar-left h1 {
  font-size: 20px; font-weight: 700; color: var(--w);
  display: flex; align-items: center; gap: 10px;
}
.topbar-left p { font-size: 12px; color: var(--w3); margin-top: 3px; font-family: 'Oxanium', monospace; }

.topbar-right { display: flex; gap: 10px; align-items: center; }

.btn-action {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--grad);
  border: none; border-radius: var(--rs);
  color: var(--bg);
  font-family: 'Tajawal', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--t);
  letter-spacing: .3px;
}
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,245,228,.25); }

.btn-outline {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--rs);
  color: var(--w2);
  font-family: 'Tajawal', sans-serif; font-size: 13px;
  cursor: pointer; transition: all var(--t);
}
.btn-outline:hover { border-color: var(--a1); color: var(--a1); }

/* Page container */
.page-container {
  flex: 1; overflow-y: auto; padding: 28px;
}

.page { display: none; }
.page.active { display: block; animation: pgIn .3s ease; }

@keyframes pgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════
   CLIENTS GRID
══════════════════════════════════════════════════════ */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.client-card {
  background: linear-gradient(160deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 24px;
  cursor: pointer;
  transition: all var(--t);
  position: relative; overflow: hidden;
}

.client-card::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity var(--t);
}

/* Per-client color accent */
.client-card[data-color="teal"]   { --c-accent: #00f5e4; }
.client-card[data-color="blue"]   { --c-accent: #00aaff; }
.client-card[data-color="purple"] { --c-accent: #9c57ff; }
.client-card[data-color="green"]  { --c-accent: #00e676; }
.client-card[data-color="orange"] { --c-accent: #ff9100; }
.client-card[data-color="pink"]   { --c-accent: #ff4dc4; }

.client-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(var(--c-accent-rgb, 0,245,228),.04), transparent 60%);
  pointer-events: none;
}

.client-card:hover {
  border-color: rgba(0,245,228,.2);
  transform: translateY(-4px);
  box-shadow: var(--sh), 0 0 40px rgba(0,245,228,.06);
}
.client-card:hover::before { opacity: 1; }

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px;
}

.client-logo {
  width: 52px; height: 52px; border-radius: 13px;
  background: var(--bg5);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border2);
  overflow: hidden; flex-shrink: 0;
}
.client-logo img { width: 100%; height: 100%; object-fit: cover; }

.card-menu {
  opacity: 0; transition: opacity var(--t);
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: var(--rsm); color: var(--w3);
  width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
  transition: all var(--t);
}
.client-card:hover .card-menu { opacity: 1; }
.card-menu:hover { color: var(--w); background: var(--bg5); }

.client-name { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.client-url  { font-size: 12px; color: var(--w3); margin-bottom: 18px; }

/* Progress bar */
.progress-wrap { margin-bottom: 16px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--w3); margin-bottom: 6px;
}
.progress-pct { color: var(--a1); font-weight: 700; }

.progress-track {
  height: 3px; background: var(--bg5); border-radius: 99px;
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; background: var(--grad);
  border-radius: 99px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--a1);
  box-shadow: 0 0 8px var(--a1);
}

/* Stats row */
.card-stats { display: flex; gap: 8px; }
.stat-pill {
  flex: 1; background: var(--bg4); border-radius: var(--rsm);
  padding: 8px 6px; text-align: center;
  border: 1px solid var(--border2);
}
.stat-num  { font-size: 16px; font-weight: 700; font-family: 'Oxanium', monospace; }
.stat-lbl  { font-size: 10px; color: var(--w3); margin-top: 2px; }
.stat-done { color: var(--green); }
.stat-prog { color: var(--orange); }
.stat-wait { color: var(--w3); }

/* ══════════════════════════════════════════════════════
   CLIENT DETAIL
══════════════════════════════════════════════════════ */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--w3);
  font-family: 'Tajawal', sans-serif; font-size: 14px;
  cursor: pointer; margin-bottom: 20px;
  transition: color var(--t); padding: 0;
}
.back-btn:hover { color: var(--a1); }

.client-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 24px;
  padding: 22px;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border-radius: var(--r);
  border: 1px solid var(--border2);
  position: relative; overflow: hidden;
}

.client-header::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--a1), transparent);
  opacity: .3;
}

.client-header-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--bg5); display: flex; align-items: center;
  justify-content: center; font-size: 26px;
  border: 1px solid var(--border); flex-shrink: 0;
  overflow: hidden;
}
.client-header-logo img { width: 100%; height: 100%; object-fit: cover; }

.client-header-info h2 { font-size: 22px; font-weight: 700; }
.client-header-info p  { font-size: 13px; color: var(--w3); margin-top: 4px; }

.client-kpis {
  margin-right: auto; display: flex; gap: 12px;
}

.kpi-box {
  text-align: center; padding: 12px 20px;
  background: var(--bg4); border-radius: var(--rs);
  border: 1px solid var(--border2);
}
.kpi-val  { font-size: 20px; font-weight: 700; font-family: 'Oxanium', monospace; color: var(--a1); }
.kpi-lbl  { font-size: 11px; color: var(--w3); margin-top: 2px; }

/* Section tabs */
.section-tabs-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}

.section-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }

.sec-tab {
  padding: 8px 16px; border-radius: 30px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--w3); font-family: 'Tajawal', sans-serif;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--t);
  display: flex; align-items: center; gap: 7px;
}
.sec-tab:hover { border-color: var(--border); color: var(--w); }
.sec-tab.active {
  background: rgba(0,245,228,.08);
  border-color: rgba(0,245,228,.25);
  color: var(--a1);
}

.tab-cnt {
  background: var(--bg5); font-size: 10px;
  padding: 1px 6px; border-radius: 10px; color: var(--w3);
  font-family: 'Oxanium', monospace;
}
.sec-tab.active .tab-cnt {
  background: rgba(0,245,228,.15); color: var(--a1);
}

.tab-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.btn-add-task {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(0,245,228,.08);
  border: 1px solid rgba(0,245,228,.18);
  border-radius: var(--rs); color: var(--a1);
  font-family: 'Tajawal', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
}
.btn-add-task:hover { background: rgba(0,245,228,.15); border-color: rgba(0,245,228,.35); }

.view-toggle {
  display: flex; gap: 3px;
  background: var(--bg4); border-radius: var(--rs);
  padding: 4px; border: 1px solid var(--border2);
}
.vbtn {
  padding: 6px 12px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--w3); font-family: 'Tajawal', sans-serif;
  font-size: 12px; cursor: pointer; transition: all var(--t);
}
.vbtn.active {
  background: var(--bg2); color: var(--a1);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════════════════════
   TASK LIST
══════════════════════════════════════════════════════ */
.task-list { display: flex; flex-direction: column; gap: 6px; }

.task-row {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--rs);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--t); position: relative;
  cursor: default;
}
.task-row:hover { border-color: rgba(0,245,228,.15); background: var(--bg4); }

/* Status dot */
.t-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  transition: all var(--t);
}
.t-dot.ns  { background: var(--w4); }
.t-dot.ip  { background: var(--orange); box-shadow: 0 0 8px rgba(255,145,0,.5); animation: dotPulse 2s ease-in-out infinite; }
.t-dot.dn  { background: var(--green); box-shadow: 0 0 8px rgba(0,230,118,.5); }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,145,0,.5); }
  50% { box-shadow: 0 0 16px rgba(255,145,0,.8); }
}

/* Priority badge */
.pri-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  cursor: pointer; transition: all var(--t); flex-shrink: 0;
  font-family: 'Oxanium', monospace; letter-spacing: .5px;
}
.pri-urgent { background: var(--red-d);    color: var(--red);    border: 1px solid rgba(255,61,90,.2);  }
.pri-normal { background: var(--orange-d); color: var(--orange); border: 1px solid rgba(255,145,0,.2); }
.pri-low    { background: var(--bg5);      color: var(--w3);     border: 1px solid var(--border2);     }

/* Task name */
.task-name-wrap { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.task-name {
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: color var(--t);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-name:hover { color: var(--a1); }
.task-name.done { text-decoration: line-through; color: var(--w3); }

.cmt-badge {
  font-size: 11px; background: rgba(0,170,255,.1);
  color: var(--a2); padding: 2px 7px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
  font-family: 'Oxanium', monospace;
}

/* Assignees avatars */
.av-stack { display: flex; }
.av {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  border: 2px solid var(--bg3); margin-left: -5px;
  font-family: 'Oxanium', monospace;
  flex-shrink: 0;
}
.av.designer { background: rgba(156,87,255,.25); color: var(--purple); }
.av.writer   { background: rgba(0,170,255,.25);  color: var(--a2);    }
.av.account  { background: rgba(0,245,228,.2);   color: var(--a1);    }
.av.ceo      { background: var(--grad); color: var(--bg); }

/* Assign dropdown */
.assign-wrap { position: relative; }
.btn-assign {
  padding: 5px 11px;
  background: var(--bg5);
  border: 1px dashed var(--border2);
  border-radius: var(--rs); color: var(--w3);
  font-family: 'Tajawal', sans-serif; font-size: 11px;
  cursor: pointer; transition: all var(--t); white-space: nowrap;
}
.btn-assign:hover { border-color: var(--a1); color: var(--a1); }

.assign-drop {
  display: none; position: absolute;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--rs); min-width: 175px; z-index: 50;
  overflow: hidden; box-shadow: var(--sh);
  top: calc(100% + 4px); left: 0;
}
.assign-drop.open { display: block; animation: dropIn .15s ease; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.drop-header { padding: 8px 12px 4px; font-size: 10px; color: var(--w3); text-transform: uppercase; letter-spacing: 1px; font-family: 'Oxanium', monospace; }

.drop-opt {
  padding: 9px 13px; cursor: pointer; font-size: 13px;
  transition: background var(--t);
  display: flex; align-items: center; gap: 9px;
}
.drop-opt:hover { background: var(--bg4); }
.drop-check { color: var(--a1); margin-right: auto; font-size: 12px; }

/* Date input */
.date-inp {
  background: var(--bg5); border: 1px solid var(--border2);
  border-radius: var(--rs); padding: 5px 9px;
  color: var(--w); font-family: 'Tajawal', sans-serif;
  font-size: 12px; outline: none; cursor: pointer;
  transition: border-color var(--t);
}
.date-inp:focus { border-color: rgba(0,245,228,.4); }

/* Status chip */
.status-chip {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  white-space: nowrap; border: none;
  font-family: 'Tajawal', sans-serif; transition: all var(--t);
  flex-shrink: 0;
}
.chip-ns { background: rgba(255,255,255,.06); color: var(--w3); }
.chip-ip { background: var(--orange-d); color: var(--orange); }
.chip-dn { background: var(--green-d); color: var(--green); }

/* ══════════════════════════════════════════════════════
   BOARD VIEW
══════════════════════════════════════════════════════ */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }

.board-col {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); overflow: hidden;
}

.board-col-hd {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border2);
}
.board-col-hd h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.board-cnt {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; font-family: 'Oxanium', monospace;
}
.bcnt-ns { background: rgba(255,255,255,.06); color: var(--w3); }
.bcnt-ip { background: var(--orange-d); color: var(--orange); }
.bcnt-dn { background: var(--green-d); color: var(--green); }

.board-col-body {
  padding: 10px; display: flex; flex-direction: column;
  gap: 8px; min-height: 120px;
}

.board-card {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--rs); padding: 13px;
  cursor: pointer; transition: all var(--t);
}
.board-card:hover {
  border-color: rgba(0,245,228,.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.board-card-name { font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.board-card-sec  { font-size: 11px; color: var(--w3); margin-bottom: 8px; }
.board-card-meta { display: flex; align-items: center; justify-content: space-between; }
.board-dl { font-size: 11px; color: var(--w3); }
.board-dl.urgent { color: var(--red); }
.board-dl.soon   { color: var(--orange); }

/* ══════════════════════════════════════════════════════
   ALL TASKS PAGE
══════════════════════════════════════════════════════ */
.filters-bar {
  display: flex; gap: 10px; margin-bottom: 12px;
  flex-wrap: wrap; align-items: center;
}

.fsel {
  padding: 9px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--rs); color: var(--w);
  font-family: 'Tajawal', sans-serif; font-size: 13px;
  outline: none; cursor: pointer; transition: border-color var(--t);
}
.fsel:focus { border-color: rgba(0,245,228,.4); }
.fsel option { background: var(--bg3); }

.task-count { font-size: 13px; color: var(--w3); margin-right: auto; font-family: 'Oxanium', monospace; }

.date-filter-strip {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.date-filter-strip span { font-size: 12px; color: var(--w3); font-weight: 600; }

.df-btn {
  padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent; color: var(--w3);
  font-family: 'Tajawal', sans-serif; font-size: 12px;
  cursor: pointer; transition: all var(--t);
}
.df-btn:hover { border-color: var(--border); color: var(--w); }
.df-btn.active { background: rgba(0,245,228,.08); border-color: rgba(0,245,228,.25); color: var(--a1); }

/* ══════════════════════════════════════════════════════
   TASK DETAIL PAGE
══════════════════════════════════════════════════════ */
.task-detail-wrap {
  display: grid; grid-template-columns: 1fr 290px;
  gap: 24px; align-items: start;
}

.td-main  { display: flex; flex-direction: column; gap: 20px; }
.td-aside { display: flex; flex-direction: column; gap: 16px; }

.td-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 22px;
}

.td-card-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; font-size: 14px; font-weight: 600;
}

.task-title-hdr {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}

.task-title-hdr h2 {
  font-size: 22px; font-weight: 700; line-height: 1.3; flex: 1;
}

.task-breadcrumb { font-size: 13px; color: var(--w3); margin-bottom: 20px; }

/* Meta rows */
.meta-list { display: flex; flex-direction: column; gap: 14px; }
.meta-row  { display: flex; flex-direction: column; gap: 6px; }
.meta-label {
  font-size: 10px; color: var(--w3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  font-family: 'Oxanium', monospace;
}
.meta-val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Priority buttons */
.pri-btn {
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent; color: var(--w3);
  font-family: 'Tajawal', sans-serif; font-size: 12px;
  cursor: pointer; transition: all var(--t);
}
.pri-btn:hover { border-color: var(--border); }
.pri-btn.active { border-color: rgba(0,245,228,.3); background: rgba(0,245,228,.08); color: var(--a1); }

/* Comment area */
.comment-item { display: flex; gap: 10px; margin-bottom: 12px; }
.cmt-av {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  font-family: 'Oxanium', monospace;
}
.cmt-body {
  flex: 1; background: var(--bg3); border-radius: 0 var(--rs) var(--rs) var(--rs);
  padding: 10px 14px; border: 1px solid var(--border2);
}
.cmt-who { font-size: 11px; color: var(--w3); margin-bottom: 5px; }
.cmt-who b { color: var(--w2); font-weight: 600; }
.cmt-text { font-size: 13px; line-height: 1.6; }

.cmt-inp-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
}

/* File row */
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg3);
  border-radius: var(--rs); border: 1px solid var(--border2);
  margin-bottom: 8px;
}
.file-ico { font-size: 20px; flex-shrink: 0; }
.file-info { flex: 1; }
.file-name { font-size: 13px; font-weight: 500; }
.file-size { font-size: 11px; color: var(--w3); }

.btn-del-file {
  background: none; border: none; color: var(--w3);
  cursor: pointer; font-size: 14px; padding: 4px 6px;
  border-radius: 4px; transition: all var(--t);
}
.btn-del-file:hover { color: var(--red); background: var(--red-d); }

/* Upload label */
.upload-label {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: rgba(0,245,228,.06); border: 1px solid rgba(0,245,228,.15);
  border-radius: var(--rs); color: var(--a1);
  font-family: 'Tajawal', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
}
.upload-label:hover { background: rgba(0,245,228,.12); }

/* Textarea */
.tx-area {
  width: 100%; min-height: 80px; resize: vertical;
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: var(--rs); padding: 12px 14px;
  color: var(--w); font-family: 'Tajawal', sans-serif;
  font-size: 13px; outline: none; transition: border-color var(--t);
  line-height: 1.6; text-align: right;
}
.tx-area:focus { border-color: rgba(0,245,228,.4); }

.btn-save {
  padding: 7px 16px;
  background: var(--grad); border: none; border-radius: var(--rs);
  color: var(--bg); font-family: 'Tajawal', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all var(--t); margin-top: 8px;
}
.btn-save:hover { box-shadow: 0 4px 16px rgba(0,245,228,.25); }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--w3);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--w2); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ══════════════════════════════════════════════════════
   EMPLOYEES PAGE
══════════════════════════════════════════════════════ */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.emp-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 26px 22px;
  text-align: center; transition: all var(--t);
}
.emp-card:hover { border-color: rgba(0,245,228,.15); transform: translateY(-3px); box-shadow: var(--sh); }

.emp-av {
  width: 68px; height: 68px; border-radius: 50%;
  margin: 0 auto 14px; display: flex;
  align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; border: 2px solid;
  position: relative;
  font-family: 'Oxanium', monospace;
}
.emp-av.designer { background: rgba(156,87,255,.18); color: var(--purple); border-color: rgba(156,87,255,.3); }
.emp-av.writer   { background: rgba(0,170,255,.18);  color: var(--a2);    border-color: rgba(0,170,255,.3);  }
.emp-av.account  { background: rgba(0,245,228,.15);  color: var(--a1);    border-color: rgba(0,245,228,.3);  }
.emp-av.ceo      { background: linear-gradient(135deg,rgba(0,245,228,.18),rgba(0,170,255,.18)); color: var(--a1); border-color: rgba(0,245,228,.4); }

.emp-online {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg2);
}

.emp-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

.role-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
  margin-bottom: 16px;
}
.role-badge.designer { background: var(--purple-d); color: var(--purple); border: 1px solid rgba(156,87,255,.2); }
.role-badge.writer   { background: rgba(0,170,255,.1); color: var(--a2); border: 1px solid rgba(0,170,255,.2); }
.role-badge.account  { background: rgba(0,245,228,.08); color: var(--a1); border: 1px solid rgba(0,245,228,.2); }
.role-badge.ceo      { background: var(--grad); color: var(--bg); border: none; font-family: 'Oxanium', monospace; }

.emp-stats { display: flex; gap: 8px; margin-bottom: 16px; }
.emp-stat  {
  flex: 1; background: var(--bg3); border-radius: var(--rsm);
  padding: 8px 6px; text-align: center;
}
.emp-sn { font-size: 15px; font-weight: 700; color: var(--a1); font-family: 'Oxanium', monospace; }
.emp-sl { font-size: 10px; color: var(--w3); margin-top: 2px; }

.emp-actions { display: flex; gap: 8px; }
.btn-emp-edit {
  flex: 1; padding: 8px; border-radius: var(--rs);
  background: transparent; border: 1px solid var(--border2);
  color: var(--w2); font-family: 'Tajawal', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--t);
}
.btn-emp-edit:hover { border-color: var(--a1); color: var(--a1); }

.btn-emp-del {
  flex: 1; padding: 8px; border-radius: var(--rs);
  background: var(--red-d); border: 1px solid rgba(255,61,90,.15);
  color: var(--red); font-family: 'Tajawal', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--t);
}
.btn-emp-del:hover { background: rgba(255,61,90,.2); }

/* ══════════════════════════════════════════════════════
   EMPLOYEE SCREEN (non-CEO)
══════════════════════════════════════════════════════ */
#empsc { flex-direction: column; }

.emp-topbar {
  padding: 16px 28px;
  background: rgba(7,13,24,.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.emp-topbar-logo { display: flex; align-items: center; gap: 12px; }

.emp-greeting { text-align: center; padding: 28px 28px 0; }
.emp-greeting h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.emp-greeting p  { font-size: 14px; color: var(--w3); }

.emp-stats-row {
  display: flex; gap: 14px; padding: 20px 28px;
  justify-content: center; flex-shrink: 0;
}

.emp-stat-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 18px 24px; text-align: center;
  min-width: 110px;
}
.emp-stat-num {
  font-size: 28px; font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-family: 'Oxanium', monospace;
}
.emp-stat-lbl { font-size: 12px; color: var(--w3); margin-top: 4px; }

.emp-tasks-wrap { flex: 1; overflow-y: auto; padding: 0 28px 28px; }
.emp-tasks-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

/* ══════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 100;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: linear-gradient(160deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 22px; padding: 32px;
  width: 480px; max-width: 95vw; max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sh), var(--glow);
  animation: modalIn .28s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}

.modal::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--a1), transparent);
  opacity: .3;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-hdr h2 { font-size: 18px; font-weight: 700; }

.btn-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg5); border: none; color: var(--w3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: all var(--t);
}
.btn-close:hover { background: var(--red-d); color: var(--red); }

.modal-footer {
  display: flex; gap: 10px; margin-top: 24px;
}
.btn-cancel {
  flex: 1; padding: 13px;
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--rs); color: var(--w2);
  font-family: 'Tajawal', sans-serif; font-size: 15px;
  cursor: pointer; transition: all var(--t);
}
.btn-cancel:hover { border-color: var(--red); color: var(--red); }

.btn-submit {
  flex: 1; padding: 13px;
  background: var(--grad); border: none; border-radius: var(--rs);
  color: var(--bg); font-family: 'Tajawal', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all var(--t);
}
.btn-submit:hover { box-shadow: 0 6px 24px rgba(0,245,228,.28); }

/* Wide modal (task detail for employee) */
.modal-wide { width: 720px; }

/* ══════════════════════════════════════════════════════
   NOTIFICATIONS PANEL
══════════════════════════════════════════════════════ */
#notif-panel {
  position: fixed; bottom: 70px; right: 12px;
  width: 350px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh), var(--glow);
  z-index: 300;
  display: none; flex-direction: column; max-height: 520px;
  overflow: hidden; animation: modalIn .2s ease;
}
#notif-panel.open { display: flex; }

.np-hdr {
  padding: 16px 18px; border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.np-hdr h3 { font-size: 15px; font-weight: 700; }
.np-hdr span { font-size: 12px; color: var(--w3); }

#np-body { overflow-y: auto; flex: 1; }

.np-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; cursor: pointer; transition: background var(--t);
  position: relative; border-bottom: 1px solid var(--border2);
}
.np-item:hover { background: var(--bg4); }
.np-unread { background: rgba(0,245,228,.03); }

.np-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.np-body-text { flex: 1; }
.np-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.np-sub   { font-size: 12px; color: var(--w3); line-height: 1.4; }
.np-ts    { font-size: 10px; color: var(--w3); margin-top: 4px; opacity: .7; font-family: 'Oxanium', monospace; }
.np-dot   { position: absolute; top: 14px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--a1); }

.np-empty { padding: 40px 20px; text-align: center; color: var(--w3); font-size: 13px; }

.np-footer {
  padding: 10px 16px; border-top: 1px solid var(--border2);
  flex-shrink: 0;
}
.btn-clear-notif {
  background: none; border: none; color: var(--w3);
  font-family: 'Tajawal', sans-serif; font-size: 12px;
  cursor: pointer; transition: color var(--t);
  padding: 4px 8px; border-radius: 6px;
}
.btn-clear-notif:hover { color: var(--red); background: var(--red-d); }

/* ══════════════════════════════════════════════════════
   TOAST & FEEDBACK
══════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 30px; padding: 12px 24px;
  font-size: 14px; font-weight: 600; color: var(--a1);
  box-shadow: var(--sh), var(--glow);
  z-index: 500; opacity: 0; pointer-events: none;
  transition: all .3s; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#ntoast {
  position: fixed; top: 20px; right: 20px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 290px; max-width: 340px;
  box-shadow: var(--sh), var(--glow); z-index: 400;
  opacity: 0; transform: translateX(20px);
  transition: all .3s; pointer-events: none;
}
#ntoast.show { opacity: 1; transform: translateX(0); }

/* Undo button */
#undo-btn {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 30px; padding: 10px 18px;
  color: var(--w2); font-family: 'Tajawal', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: none; align-items: center; gap: 8px;
  box-shadow: var(--sh); z-index: 150;
  transition: all var(--t); animation: pgIn .2s ease;
}
#undo-btn:hover { border-color: var(--a1); color: var(--a1); }
#undo-btn.show { display: flex; }

/* Loading overlay */
#loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(3,7,15,.8); z-index: 600;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  backdrop-filter: blur(4px);
}
.spin-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--border2);
  border-top-color: var(--a1);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Subtask popup */
.stpop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.stpop.open { display: flex; }

.stpbox {
  background: linear-gradient(160deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 22px; padding: 30px;
  width: 460px; max-width: 95vw;
  box-shadow: var(--sh), var(--glow);
  animation: modalIn .25s ease;
}
.stpbox h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.stpbox p  { font-size: 13px; color: var(--w3); margin-bottom: 20px; }
.stp-acts  { display: flex; gap: 10px; margin-top: 20px; }

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sw: 0px; }

  .sidebar {
    position: fixed; right: -280px; top: 0; bottom: 0;
    width: 280px; z-index: 200;
    transition: right var(--t);
    box-shadow: none;
  }
  .sidebar.open { right: 0; box-shadow: var(--sh); }

  .mobile-menu-btn {
    display: flex !important;
    width: 38px; height: 38px; border-radius: var(--rs);
    background: var(--bg3); border: 1px solid var(--border2);
    align-items: center; justify-content: center;
    cursor: pointer; color: var(--w2); font-size: 18px;
  }

  .mobile-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 199;
  }
  .mobile-overlay.show { display: block; }

  .topbar { padding: 12px 16px; }
  .topbar-left h1 { font-size: 16px; }
  .page-container { padding: 16px; }

  .clients-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .task-detail-wrap { grid-template-columns: 1fr; }
  .employees-grid { grid-template-columns: 1fr; }

  .client-kpis { display: none; }
  .client-header { flex-wrap: wrap; }

  .section-tabs-bar { flex-direction: column; align-items: flex-start; }

  .emp-stats-row { flex-wrap: wrap; justify-content: center; }

  .modal { padding: 24px 20px; }
  .modal-wide { width: 95vw; }

  .task-row { flex-wrap: wrap; gap: 8px; }
  .task-row .date-inp { width: 100%; }

  #notif-panel { right: 8px; left: 8px; width: auto; }
}

@media (max-width: 480px) {
  .login-box { width: 100%; margin: 16px; padding: 32px 24px; }
  .emp-stats-row { padding: 16px; }
  .emp-greeting { padding: 20px 16px 0; }
}

/* Mobile menu btn hidden on desktop */
.mobile-menu-btn { display: none; }

/* ══════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.txt-teal   { color: var(--a1); }
.txt-green  { color: var(--green); }
.txt-orange { color: var(--orange); }
.txt-red    { color: var(--red); }
.txt-dim    { color: var(--w3); }
