/* ═══════════════════════════════════════════════════════════════════════════
   ProjexaAI Corporate Backend — Design System
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --primary:      #4f46e5;
  --primary-2:    #6366f1;
  --primary-hover:#4338ca;
  --primary-soft: #eef2ff;
  --accent:       #06b6d4;
  --accent-2:     #0ea5e9;
  --violet:       #8b5cf6;
  --emerald:      #10b981;
  --rose:         #f43f5e;
  --amber:        #f59e0b;
  --orange:       #f97316;

  --navy:         #020614;
  --navy-2:       #050b1c;
  --navy-3:       #091529;
  --navy-4:       #0d1f3c;

  --bg:           #ffffff;
  --bg-soft:      #f8faff;
  --bg-deep:      #f0f4ff;
  --border:       #e2e8f0;
  --border-strong:#c7d2e7;

  --text:         #0a0f1d;
  --text-2:       #1e2a45;
  --text-muted:   #4a5876;
  --text-faint:   #7a8499;

  --shadow-sm:    0 1px 3px rgba(10,14,32,.07);
  --shadow:       0 4px 14px -2px rgba(10,14,32,.11), 0 2px 6px -2px rgba(10,14,32,.06);
  --shadow-lg:    0 20px 48px -10px rgba(10,14,32,.20), 0 8px 18px -6px rgba(10,14,32,.10);

  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --grad-brand:   linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --grad-text:    linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);

  /* Layout */
  --sidebar-w:    260px;
  --sidebar-collapsed-w: 72px;
  --topbar-h:     64px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg-soft); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
img, svg { display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-root {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-orbs { position: absolute; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .18;
  animation: orbFloat 14s ease-in-out infinite;
}
.login-orb-1 { width: 420px; height: 420px; background: var(--primary); top: -100px; left: -100px; animation-delay: 0s; }
.login-orb-2 { width: 320px; height: 320px; background: var(--accent); bottom: -80px; right: -60px; animation-delay: -5s; }
.login-orb-3 { width: 250px; height: 250px; background: var(--violet); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -9s; }
@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 44px; margin: 0 auto 12px; }
.login-logo-title {
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.5px;
}
.login-logo-sub {
  font-size: 13px; color: rgba(255,255,255,.45); margin-top: 4px;
}

.login-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.login-lead  { font-size: 14px; color: rgba(255,255,255,.5); margin-bottom: 28px; }

.login-field { margin-bottom: 20px; }
.login-label { display: block; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.65); margin-bottom: 8px; }
.login-input-wrap { position: relative; }
.login-input {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  padding: 12px 48px 12px 16px;
  font-size: 15px;
  color: #fff;
  outline: none;
  transition: border-color .2s, background .2s;
}
.login-input::placeholder { color: rgba(255,255,255,.3); }
.login-input:focus { border-color: var(--primary-2); background: rgba(255,255,255,.1); }
.login-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,.4); font-size: 16px;
  padding: 4px; transition: color .2s;
}
.login-eye:hover { color: rgba(255,255,255,.8); }

.login-error { font-size: 13px; color: var(--rose); margin-top: 6px; display: none; }
.login-error.show { display: block; }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.2px;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  margin-top: 8px;
}
.btn-login:hover { opacity: .9; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.login-footer { text-align: center; margin-top: 28px; font-size: 12px; color: rgba(255,255,255,.25); }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(2,6,20,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  z-index: 9999; backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg); border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 92vh; overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 0 0 1px var(--border);
  transform: translateY(-10px) scale(.97); transition: transform .22s cubic-bezier(.16,.84,.44,1), opacity .2s;
  opacity: 0; display: flex; flex-direction: column;
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); opacity: 1; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky; top: 0; z-index: 1; flex-shrink: 0;
}
.modal-header-title {
  font-size: 15px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.modal-header-title i { color: rgba(255,255,255,.85); font-size: 16px; }
.modal-close {
  background: rgba(255,255,255,.15); border: none; color: rgba(255,255,255,.9); font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background .15s, color .15s;
  line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,.28); color: #fff; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  position: sticky; bottom: 0; background: var(--bg); z-index: 1;
}

/* stat-mini-card — used in email marketing stats bar */
.stat-mini-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 20px; min-width: 100px; text-align: center;
}
.stat-mini-val { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-mini-lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT (SPA)
   ═══════════════════════════════════════════════════════════════════════════ */
.app-root { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy-3);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-logo img { height: 36px; flex-shrink: 0; }
.sidebar-logo-text { white-space: nowrap; overflow: hidden; }
.sidebar-logo-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.4px; }
.sidebar-logo-sub  { font-size: 10px; color: rgba(255,255,255,.35); }
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; overflow-x: hidden; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.25);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
  user-select: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(79,70,229,.25); color: #fff; }
.nav-item.active .nav-icon { color: var(--primary-2); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; transition: opacity .2s, width .25s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 8px;
}
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  transition: background .15s; cursor: default;
}
.user-pill:hover { background: rgba(255,255,255,.05); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name  { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: rgba(255,255,255,.4); }
.sidebar.collapsed .user-info { display: none; }

/* ── Main Area ──────────────────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s;
}
.main-area.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar-corp {
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle {
  background: none; border: none; font-size: 18px; color: var(--text-muted);
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.sidebar-toggle:hover { background: var(--bg-deep); color: var(--text); }
.breadcrumb { font-size: 14px; color: var(--text-muted); }
.breadcrumb strong { color: var(--text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  background: none; border: none; font-size: 16px; color: var(--text-muted);
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
  position: relative;
}
.topbar-btn:hover { background: var(--bg-deep); color: var(--text); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--rose);
  border: 2px solid var(--bg);
}

/* ── Content ────────────────────────────────────────────────────────────── */
.content { flex: 1; padding: 28px 28px 40px; max-width: 1400px; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-header-left {}
.page-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-brand { background: var(--grad-brand); color: #fff; }
.btn-brand:hover { opacity: .92; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-deep); color: var(--text); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ── Stat Cards ─────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.primary::before  { background: var(--primary); }
.stat-card.accent::before   { background: var(--accent); }
.stat-card.emerald::before  { background: var(--emerald); }
.stat-card.amber::before    { background: var(--amber); }
.stat-card.rose::before     { background: var(--rose); }
.stat-card.violet::before   { background: var(--violet); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.stat-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon.accent  { background: #e0f9ff; color: var(--accent); }
.stat-icon.emerald { background: #d1fae5; color: var(--emerald); }
.stat-icon.amber   { background: #fef3c7; color: var(--amber); }
.stat-icon.rose    { background: #ffe4e6; color: var(--rose); }
.stat-icon.violet  { background: #ede9fe; color: var(--violet); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-trend { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up   { color: var(--emerald); }
.stat-trend.down { color: var(--rose); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
.data-table td {
  padding: 13px 16px; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.table-empty { text-align: center; padding: 40px 16px; color: var(--text-muted); font-size: 14px; }

/* ── Badges / Status Pills ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-draft         { background: #f1f5f9; color: #64748b; }
.badge-active        { background: #d1fae5; color: #065f46; }
.badge-success       { background: #d1fae5; color: #065f46; }
.badge-warning       { background: #fef3c7; color: #92400e; }
.badge-danger        { background: #ffe4e6; color: #9f1239; }
.badge-info          { background: var(--primary-soft); color: var(--primary); }
.badge-muted         { background: #f1f5f9; color: #64748b; }
.badge-violet        { background: #ede9fe; color: #5b21b6; }
.badge-cyan          { background: #e0f9ff; color: #0e7490; }
.badge-orange        { background: #ffedd5; color: #9a3412; }

/* Project status badges */
.status-draft               { background:#f1f5f9; color:#64748b; }
.status-proposal_generated  { background:#ede9fe; color:#5b21b6; }
.status-proposal_sent       { background:var(--primary-soft); color:var(--primary); }
.status-proposal_viewed     { background:#e0f9ff; color:#0e7490; }
.status-proposal_approved   { background:#d1fae5; color:#065f46; }
.status-in_progress         { background:#fef3c7; color:#92400e; }
.status-paid, .status-closed { background:#d1fae5; color:#065f46; }
.status-cancelled, .status-rejected { background:#ffe4e6; color:#9f1239; }
.status-comments_received   { background:#ffedd5; color:#9a3412; }
.status-payment_reported, .status-payment_under_review { background:#fef3c7; color:#92400e; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-label.required::after { content: ' *'; color: var(--rose); }
.form-input, .form-select, .form-textarea {
  padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 14px; color: var(--text); background: var(--bg);
  outline: none; transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-input::placeholder { color: var(--text-faint); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-faint); }
.form-error-text { font-size: 12px; color: var(--rose); }
.input-group { position: relative; }
.input-group .form-input { padding-right: 40px; }
.input-group .input-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); cursor: pointer;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all .15s; margin-bottom: -2px; border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--text); background: var(--bg-deep); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Invoice Upload Zone ────────────────────────────────────────────────── */
.invoice-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex; flex-direction: column; align-items: center;
}
.invoice-upload-zone:hover, .invoice-upload-zone.drag-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

/* ── Filters Bar ────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 16px 20px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px;
}
.filter-search { position: relative; flex: 1; min-width: 200px; }
.filter-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 14px; }
.filter-search .form-input { padding-left: 36px; }
.filter-select { min-width: 140px; }

/* ── Kanban ─────────────────────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col {
  min-width: 260px; flex-shrink: 0;
  background: var(--bg-deep); border-radius: var(--radius); padding: 16px;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.kanban-col-title { font-size: 13px; font-weight: 700; color: var(--text); }
.kanban-col-count {
  background: var(--border); color: var(--text-muted); font-size: 11px;
  font-weight: 600; padding: 2px 7px; border-radius: 99px;
}
.kanban-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kanban-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── Charts container ───────────────────────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-container { position: relative; height: 280px; }

/* ── Platform Cards ─────────────────────────────────────────────────────── */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.platform-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.platform-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.platform-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.platform-card.evalexpert::before { background: var(--violet); }
.platform-card.projexapm::before  { background: var(--amber); }
.platform-card.projexago::before  { background: var(--emerald); }
.platform-card.projexaone::before { background: var(--accent); }
.platform-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.platform-health { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; }
.health-good    { background: var(--emerald); }
.health-warning { background: var(--amber); }
.health-danger  { background: var(--rose); }
.platform-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pm-item { }
.pm-value { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.pm-label { font-size: 11px; color: var(--text-faint); }

/* ── Health Bar ─────────────────────────────────────────────────────────── */
.health-bar { background: var(--border); border-radius: 99px; height: 6px; margin-top: 16px; }
.health-fill { height: 6px; border-radius: 99px; transition: width .5s; }
.health-fill.good    { background: var(--emerald); }
.health-fill.warning { background: var(--amber); }
.health-fill.danger  { background: var(--rose); }

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: .2; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Loading Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; flex-direction: column; gap: 12px; color: var(--text-muted); font-size: 14px;
}

/* ── Toast Notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
}
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--navy-3); color: #fff;
  padding: 14px 18px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
}
.toast.success { border-left: 4px solid var(--emerald); }
.toast.error   { border-left: 4px solid var(--rose); }
.toast.info    { border-left: 4px solid var(--primary-2); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Modals (corporate style) ───────────────────────────────────────────── */
.corp-modal-header {
  background: var(--navy-3); color: #fff;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.corp-modal-title { font-size: 16px; font-weight: 700; }
.corp-modal-body { padding: 24px; }
.corp-modal-footer {
  padding: 16px 24px; background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Confirm Dialog ─────────────────────────────────────────────────────── */
#confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#confirm-overlay.show { opacity: 1; pointer-events: all; }
#confirm-box {
  background: var(--bg); border-radius: var(--radius-lg); width: 100%; max-width: 420px; margin: 16px;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
#confirm-box .corp-modal-header { border-radius: 0; }

/* ── Avatar initials ────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ── Activity Feed ──────────────────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.activity-content { flex: 1; }
.activity-title { font-size: 14px; font-weight: 500; color: var(--text); }
.activity-meta  { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ── Progress bar ───────────────────────────────────────────────────────── */
.progress { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { height: 8px; border-radius: 99px; background: var(--grad-brand); transition: width .5s; }

/* ═══════════════════════════════════════════════════════════════════════════
   PORTAL PAGE (Client-facing)
   ═══════════════════════════════════════════════════════════════════════════ */
.portal-root {
  min-height: 100vh; background: var(--bg-soft);
  font-family: var(--font);
}
.portal-header {
  background: var(--navy); padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.portal-header img { height: 38px; }
.portal-content { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.portal-verify-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px; max-width: 480px; margin: 80px auto; text-align: center;
  box-shadow: var(--shadow-lg);
}
.portal-section {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 20px; overflow: hidden;
}
.portal-section-header {
  background: var(--navy-3); color: #fff;
  padding: 16px 24px; font-size: 16px; font-weight: 700;
}
.portal-section-body { padding: 24px; }

/* ── Grad text ──────────────────────────────────────────────────────────── */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Chip ───────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 12px; font-size: 13px; color: var(--text-muted);
}

/* ── Summary row ────────────────────────────────────────────────────────── */
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: 14px; color: var(--text-muted); }
.summary-value { font-size: 14px; font-weight: 600; color: var(--text); }
.summary-total .summary-label { font-size: 16px; font-weight: 700; color: var(--text); }
.summary-total .summary-value { font-size: 20px; font-weight: 800; color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-area { margin-left: 0 !important; }
  .content { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .kanban-board { padding-bottom: 8px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 36px 28px; }
  .modal-box { margin: 8px; }
}
