/* ═══════════════════════════════════════════════════════════════
   COPROJECTS — Arsela / Corestria Brand System v2.0
   Built to Arsela Branding Guidelines (May 2025)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand Colours ─────────────────────────────────────────── */
  --primary-navy:     #0E2F53;
  --secondary-blue:   #1B4D80;
  --accent-teal:      #00A8A8;
  --accent-teal-dark: #007F7F;
  --light-blue:       #EAF2FF;
  --bg:               #F7F9FC;
  --border-color:     #DDE3EE;
  --text-primary:     #1A2330;
  --text-secondary:   #66748C;
  --text-muted:       #9AAABB;
  --white:            #FFFFFF;

  /* ── Gradient (Signature) ──────────────────────────────────── */
  --gradient:         linear-gradient(135deg, #0E2F53 0%, #00A8A8 100%);
  --gradient-btn:     linear-gradient(90deg, #1B4D80 0%, #00A8A8 100%);
  --gradient-hero:    linear-gradient(135deg, #0E2F53 0%, #1B4D80 60%, #00A8A8 100%);

  /* ── Status Colours ────────────────────────────────────────── */
  --success:       #16A34A;
  --success-bg:    #DCFCE7;
  --success-text:  #15803D;
  --warning:       #F59E0B;
  --warning-bg:    #FEF3C7;
  --warning-text:  #B45309;
  --danger:        #EF4444;
  --danger-bg:     #FEE2E2;
  --danger-text:   #DC2626;
  --info:          #3B82F6;
  --info-bg:       #DBEAFE;
  --info-text:     #1D4ED8;
  --neutral-bg:    #F1F5F9;
  --neutral-text:  #64748B;

  /* ── Sidebar ───────────────────────────────────────────────── */
  --sidebar-bg:       #0E2F53;
  --sidebar-width:    240px;
  --sidebar-text:     rgba(255,255,255,0.75);
  --sidebar-active:   rgba(255,255,255,0.12);
  --sidebar-hover:    rgba(255,255,255,0.07);
  --sidebar-border:   rgba(255,255,255,0.08);

  /* ── Spacing & Shape ───────────────────────────────────────── */
  --topbar-height:  60px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --radius-pill:    999px;

  /* ── Shadows ───────────────────────────────────────────────── */
  --shadow-sm:  0 1px 3px rgba(14,47,83,0.08), 0 1px 2px rgba(14,47,83,0.04);
  --shadow:     0 4px 12px rgba(14,47,83,0.10), 0 2px 4px rgba(14,47,83,0.06);
  --shadow-md:  0 8px 24px rgba(14,47,83,0.12), 0 4px 8px rgba(14,47,83,0.08);
  --shadow-lg:  0 16px 40px rgba(14,47,83,0.15), 0 8px 16px rgba(14,47,83,0.10);
  --shadow-xl:  0 24px 64px rgba(14,47,83,0.20);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   AUTH / LOGIN SCREEN
   Split: left form + right gradient panel
   ═══════════════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Left panel — form */
.auth-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 64px;
  background: var(--white);
  position: relative;
}
.auth-left-inner {
  width: 100%;
  max-width: 380px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}
.auth-brand-logo {
  width: 40px; height: 40px;
  background: var(--gradient-btn);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-brand-name {
  font-size: 20px; font-weight: 700; color: var(--primary-navy);
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.auth-brand-sub {
  font-size: 10px; color: var(--text-secondary);
  letter-spacing: 0.5px; text-transform: uppercase;
}

.auth-welcome { margin-bottom: 32px; }
.auth-welcome h1 {
  font-size: 26px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.auth-welcome p { font-size: 14px; color: var(--text-secondary); }

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
  border: 1px solid var(--border-color);
}
.auth-tab {
  flex: 1; padding: 8px 12px; border-radius: 7px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--white);
  color: var(--primary-navy);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.auth-footer {
  margin-top: 32px;
}
.auth-poweredby {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px; opacity: 0.6;
}
.auth-poweredby span { font-size: 11px; color: var(--text-secondary); }

/* Right panel — gradient visual */
.auth-right {
  background: var(--gradient-hero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-right::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,168,168,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.auth-right-content {
  position: relative; z-index: 1;
  text-align: center; color: white;
  max-width: 380px;
}
.auth-right-content h2 {
  font-size: 28px; font-weight: 700; margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.auth-right-content p {
  font-size: 15px; opacity: 0.8; line-height: 1.6; margin-bottom: 40px;
}
.auth-preview-card {
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  text-align: left;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-lg);
}
.auth-preview-card h4 {
  color: white; font-size: 13px; font-weight: 600; margin-bottom: 12px;
  opacity: 0.9;
}
.auth-preview-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-preview-row:last-child { border-bottom: none; }
.auth-preview-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.auth-preview-title { font-size: 12px; color: rgba(255,255,255,0.85); flex: 1; }
.auth-preview-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.auth-stats-row {
  display: flex; gap: 12px; margin-top: 12px;
  transform: rotate(1deg);
}
.auth-stat-mini {
  flex: 1; background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius); padding: 12px;
  text-align: center; backdrop-filter: blur(8px);
}
.auth-stat-mini .num { font-size: 22px; font-weight: 700; color: white; display: block; }
.auth-stat-mini .lbl { font-size: 10px; color: rgba(255,255,255,0.65); display: block; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════ */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* Brand at top */
.sidebar-brand {
  padding: 0 20px;
  height: 68px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--gradient-btn);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,168,168,0.3);
}
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name {
  font-size: 15px; font-weight: 700; color: white;
  letter-spacing: -0.2px; line-height: 1.2;
}
.sidebar-brand-category {
  font-size: 9px; color: rgba(255,255,255,0.45);
  letter-spacing: 0.8px; text-transform: uppercase; margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 10px;
}
.sidebar-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
  border: none; background: none; width: 100%;
  text-align: left; margin-bottom: 1px;
}
.nav-item i {
  width: 18px; text-align: center;
  font-size: 14px; flex-shrink: 0;
  opacity: 0.7;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}
.nav-item:hover i { opacity: 1; }
.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}
.nav-item.active i { opacity: 1; color: var(--accent-teal); }
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  padding: 0 6px; border-radius: var(--radius-pill);
  min-width: 18px; height: 18px; line-height: 18px; text-align: center;
}

/* User profile */
.sidebar-user {
  padding: 10px;
  border-top: 1px solid var(--sidebar-border);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.user-widget {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
}
.user-widget:hover { background: var(--sidebar-hover); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-btn);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0; text-transform: uppercase;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 12px; font-weight: 600; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 10px; color: rgba(255,255,255,0.4);
  text-transform: capitalize; margin-top: 1px;
}

/* Powered by Arsela — MANDATORY bottom placement */
.sidebar-arsela {
  padding: 14px 16px;
  flex-shrink: 0;
}
.arsela-lockup {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.arsela-icon {
  width: 28px; height: 28px; flex-shrink: 0;
}
.arsela-text { display: flex; flex-direction: column; }
.arsela-powered-by {
  font-size: 9px; color: rgba(255,255,255,0.35);
  letter-spacing: 0.4px; line-height: 1;
}
.arsela-name {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.65);
  letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Topbar ──────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary); flex: 1;
  letter-spacing: -0.2px;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Page Content ─────────────────────────────────────────────── */
#page-content {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  /* Ensure content doesn't stretch excessively on ultra-wide screens */
  align-self: flex-start;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px; text-transform: uppercase;
  margin-bottom: 6px;
}
.form-control, .form-select, .form-textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0,168,168,0.12);
}
.form-control::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2366748C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-row { display: grid; gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
  text-decoration: none; white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 13px; }

/* Primary — gradient */
.btn-primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 2px 8px rgba(0,168,168,0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(90deg, #163F6B 0%, #008A8A 100%);
  box-shadow: 0 4px 16px rgba(0,168,168,0.35);
  transform: translateY(-1px);
}

/* Secondary — outlined */
.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--secondary-blue);
  color: var(--primary-navy);
  background: var(--light-blue);
}

/* Danger */
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }

/* Ghost */
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text-primary); }

/* Sizes */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
}
.card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); flex: 1;
  letter-spacing: -0.1px;
}
.card-body { padding: 22px; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD HERO CARD
   ═══════════════════════════════════════════════════════════════ */
.hero-card {
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,168,168,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-card::after {
  content: '';
  position: absolute; bottom: -60px; right: 120px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-greeting {
  font-size: 13px; color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.hero-name {
  font-size: 24px; font-weight: 700; color: white;
  letter-spacing: -0.5px; margin-bottom: 4px;
}
.hero-org {
  font-size: 13px; color: rgba(255,255,255,0.55);
  display: flex; align-items: center; gap: 6px;
}
.hero-org i { font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   KPI / STAT CARDS
   ═══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: rgba(0,168,168,0.2);
}
.stat-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 14px;
}
.stat-icon.blue   { background: var(--info-bg);    color: var(--info);    }
.stat-icon.teal   { background: #CCEFEF;            color: var(--accent-teal); }
.stat-icon.green  { background: var(--success-bg);  color: var(--success); }
.stat-icon.red    { background: var(--danger-bg);   color: var(--danger);  }
.stat-icon.amber  { background: var(--warning-bg);  color: var(--warning); }
.stat-icon.navy   { background: var(--light-blue);  color: var(--primary-navy); }
.stat-value {
  font-size: 28px; font-weight: 800; color: var(--text-primary);
  line-height: 1; letter-spacing: -1px; margin-bottom: 4px;
}
.stat-label {
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 11px 18px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--light-blue); cursor: pointer; }
tbody td {
  padding: 13px 18px;
  color: var(--text-primary);
  vertical-align: middle;
}
.td-secondary { color: var(--text-secondary); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES  (pill style per brand guide)
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
}

/* Project statuses */
.badge-not-started  { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-not-started::before { background: var(--neutral-text); }

.badge-active       { background: var(--info-bg); color: var(--info-text); }
.badge-active::before { background: var(--info); }

.badge-in-progress  { background: var(--info-bg); color: var(--info-text); }
.badge-in-progress::before { background: var(--info); }

.badge-on-hold { background: var(--warning-bg); color: var(--warning-text); }
.badge-on-hold::before { background: var(--warning); }

/* Blocked = red/danger per brand spec */
.badge-blocked { background: var(--danger-bg); color: var(--danger-text); }
.badge-blocked::before { background: var(--danger); }

.badge-completed    { background: var(--success-bg); color: var(--success-text); }
.badge-completed::before { background: var(--success); }

/* Priority */
.badge-low    { background: var(--success-bg); color: var(--success-text); }
.badge-low::before { background: var(--success); }
.badge-medium { background: var(--warning-bg); color: var(--warning-text); }
.badge-medium::before { background: var(--warning); }
.badge-high   { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-high::before { background: var(--danger); }

/* Roles */
.badge-admin         { background: var(--light-blue); color: var(--primary-navy); }
.badge-project-owner { background: #CCEFEF; color: var(--accent-teal-dark); }
.badge-contributor   { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-viewer        { background: var(--bg); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   PROJECT CARDS (card view)
   ═══════════════════════════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.project-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.project-card:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-card-header { display: flex; align-items: flex-start; gap: 12px; }
.project-card-icon {
  width: 42px; height: 42px;
  background: var(--light-blue);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.project-card-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 3px;
}
.project-card-company { font-size: 11px; color: var(--text-muted); }
.project-card-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.project-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border-color);
}
.project-card-owner {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   TASK ROWS
   ═══════════════════════════════════════════════════════════════ */
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--border-color);
  cursor: pointer; transition: background 0.1s;
}
.task-row:hover { background: var(--light-blue); }
.task-row:last-child { border-bottom: none; }
/* Blocked tasks get a subtle left accent */
.task-row.blocked-row { border-left: 3px solid var(--danger); padding-left: 17px; }
.task-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 2px solid var(--border-color); flex-shrink: 0;
  transition: all 0.15s;
}
.task-row.completed .task-check {
  background: var(--success); border-color: var(--success);
  position: relative;
}
.task-row.completed .task-title {
  text-decoration: line-through; color: var(--text-muted);
}
.task-title { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.task-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.task-due { font-size: 11px; padding: 3px 8px; border-radius: var(--radius-pill); font-weight: 500; }
.task-due.overdue { background: var(--danger-bg); color: var(--danger-text); font-weight: 600; }
.task-due.due-soon { background: var(--warning-bg); color: var(--warning-text); }
.task-due.normal { color: var(--text-muted); }
.task-assignee-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gradient-btn);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: white;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(14,47,83,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0;
  background: var(--white); z-index: 1;
}
.modal-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary); flex: 1;
}
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.15s; font-size: 14px;
}
.modal-close:hover {
  background: var(--danger-bg); color: var(--danger);
  border-color: var(--danger-bg);
}
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-color);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--bg);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ═══════════════════════════════════════════════════════════════
   TASK DETAIL
   ═══════════════════════════════════════════════════════════════ */
.task-detail-grid {
  display: grid; grid-template-columns: 1fr 260px; gap: 24px;
}
.meta-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.meta-row:last-child { border-bottom: none; }
.meta-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px;
  width: 80px; flex-shrink: 0;
}
.meta-value { flex: 1; font-weight: 500; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════════════════════════════ */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.comment-item { display: flex; gap: 10px; }
.comment-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gradient-btn);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0; margin-top: 2px;
}
.comment-bubble { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-author { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  background: var(--bg); padding: 10px 14px;
  border-radius: 0 10px 10px 10px;
  border: 1px solid var(--border-color);
}
.comment-input-wrap { display: flex; gap: 8px; margin-top: 16px; align-items: flex-end; }

/* ═══════════════════════════════════════════════════════════════
   ATTACHMENTS
   ═══════════════════════════════════════════════════════════════ */
.attachment-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--bg);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  transition: border-color 0.15s;
}
.attachment-item:hover { border-color: var(--accent-teal); }
.attachment-icon { color: var(--accent-teal); font-size: 14px; }
.attachment-name { flex: 1; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-link { color: var(--secondary-blue); text-decoration: none; font-size: 12px; }
.attachment-link:hover { color: var(--accent-teal); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 42px; margin-bottom: 16px;
  display: block; opacity: 0.25; color: var(--primary-navy);
}
.empty-state h3 {
  font-size: 15px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.empty-state p { font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 7px;
}
.section-title i { color: var(--accent-teal); }

/* ═══════════════════════════════════════════════════════════════
   FILTERS / SEARCH BAR
   ═══════════════════════════════════════════════════════════════ */
.filters-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filter-select {
  background: var(--white); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 7px 12px;
  color: var(--text-primary); font-family: var(--font);
  font-size: 12px; cursor: pointer; outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2366748C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 26px;
}
.filter-select:focus { border-color: var(--accent-teal); }
.search-wrap { position: relative; }
.search-wrap i {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 12px;
}
.search-input {
  background: var(--white); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 7px 12px 7px 30px;
  color: var(--text-primary); font-family: var(--font);
  font-size: 12px; outline: none; width: 210px;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent-teal); }

/* View toggle */
.view-toggle {
  display: flex; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px;
  border: 1.5px solid var(--border-color);
}
.view-btn {
  padding: 5px 10px; border-radius: 5px; border: none;
  background: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; transition: all 0.15s;
}
.view-btn.active { background: var(--white); color: var(--primary-navy); box-shadow: var(--shadow-sm); }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */
.progress-bar { height: 6px; background: var(--border-color); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--gradient-btn); transition: width 0.6s ease; }
.progress-fill.green { background: var(--success); }

/* ═══════════════════════════════════════════════════════════════
   OVERDUE INDICATOR
   ═══════════════════════════════════════════════════════════════ */
.overdue-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(239,68,68,0); } }

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 360px;
  animation: slideInRight 0.25s ease;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--secondary-blue); color: white; }

/* ═══════════════════════════════════════════════════════════════
   LOADER / SPINNER
   ═══════════════════════════════════════════════════════════════ */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(0,168,168,0.2);
  border-top-color: var(--accent-teal); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-state {
  display: flex; align-items: center; justify-content: center;
  padding: 56px; gap: 12px; color: var(--text-secondary);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   PROJECT DETAIL META
   ═══════════════════════════════════════════════════════════════ */
.project-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.project-link-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none;
  font-size: 12px; transition: all 0.15s;
}
.project-link-item:hover { border-color: var(--accent-teal); color: var(--accent-teal); }
.project-link-item i { color: var(--accent-teal); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   ECOSYSTEM BAR (top strip)
   ═══════════════════════════════════════════════════════════════ */
.ecosystem-bar {
  background: var(--primary-navy);
  padding: 0 24px;
  display: flex; gap: 4px; align-items: center;
  height: 30px; overflow-x: auto; flex-shrink: 0;
}
.eco-app {
  padding: 4px 10px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  color: rgba(255,255,255,0.4); text-decoration: none;
  white-space: nowrap; transition: color 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.eco-app:hover { color: rgba(255,255,255,0.8); }
.eco-app.current { color: var(--accent-teal); }
.eco-sep { color: rgba(255,255,255,0.15); font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER (mobile)
   ═══════════════════════════════════════════════════════════════ */
.hamburger {
  display: none; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 16px; color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border-color); margin: 18px 0; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #auth-screen { grid-template-columns: 1fr; }
  .auth-right { display: none; }
}
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  #main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  #page-content { padding: 16px; }
  .auth-left { padding: 32px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-teal { color: var(--accent-teal); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
