:root {
  --bg-0: #050505; --bg-1: #0a0a0a;
  --card-bg: rgba(20, 20, 20, 0.6); --card-border: rgba(255, 255, 255, 0.08);
  --glass: blur(20px); --text: #ededed; --text-muted: #888;
  --primary: #FE8D25; 
  --st-intro: #3b82f6; --st-prospect: #6366f1; --st-dd: #8b5cf6; --st-port: #10b981; --st-pass: #ef4444;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; font-family: 'Inter', sans-serif; color: var(--text); background: #050505; }

/* --- BACKGROUND ANIMATION --- */
.bg { 
    position: fixed; inset: 0; pointer-events: none; z-index: 0; 
    display: none; 
    background: radial-gradient(circle at 50% 0%, #1a1a1a, #000000);
}
body.isLogin .bg { display: block; }
canvas { display: block; width: 100%; height: 100%; }

/* --- CORE LAYOUT --- */
/* Z-Index 10 ensures app is ALWAYS above background */
.shell { 
    height: 100%; display: flex; align-items: center; justify-content: center; 
    padding: 2vh 2vw; position: relative; z-index: 10; 
}

.card { 
    width: 100%; max-width: 1400px; height: 92vh; 
    background: var(--card-bg); border: 1px solid var(--card-border); 
    border-radius: 24px; backdrop-filter: var(--glass); 
    display: flex; flex-direction: column; overflow: hidden; 
    position: relative; box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8); 
}
/* Make main card transparent on login screen so animation shows through */
body.isLogin .card { background: rgba(20, 20, 20, 0.1); box-shadow: none; border: none; backdrop-filter: none; }

.cardTop { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--st-intro), var(--st-dd), var(--st-port)); opacity: 0.8; }

/* HEADER: Z-Index 50 ensures buttons are always clickable */
.header { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 20px 32px; border-bottom: 1px solid var(--card-border); 
    flex-shrink: 0; position: relative; z-index: 50; 
}
body.isLogin .header { display: none; }

.content { flex: 1; overflow: hidden; position: relative; padding: 0; z-index: 10; }
.view { height: 100%; display: flex; flex-direction: column; padding: 24px 32px; overflow-y: auto; }

/* CRITICAL FIX: Ensure hidden attribute actually hides the element */
[hidden] { display: none !important; }
#loginView[hidden] { display: none !important; }

/* --- LOGIN VIEW FIX --- */
#loginView { 
    background: transparent !important; 
    height: 100%; position: relative; z-index: 1; 
}
/* Only apply Flexbox if it is NOT hidden */
#loginView:not([hidden]) {
    display: flex; justify-content: center; align-items: center; 
}

.loginCard { 
    width: 100%; max-width: 380px; 
    background: rgba(20, 20, 20, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 24px; padding: 40px; 
    text-align: center; 
    box-shadow: 0 40px 80px rgba(0,0,0,0.6); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.8s ease; 
    pointer-events: auto; /* Fix: Re-enable clicks on card */
}
.loginLogo { width: 48px; height: 48px; margin: 0 auto 20px; filter: drop-shadow(0 0 12px rgba(254,141,37,0.4)); }
.loginTitle { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.loginSubtitle { font-size: 11px; color: var(--text-muted); margin-bottom: 32px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }

/* --- DASHBOARD --- */
.kpiRow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; text-align: center; position: relative; }
.kpiValue { font-size: 32px; font-weight: 700; color: #fff; }
.kpiLabel { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dashSplit { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 24px; }
.momBadge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.mom-up { color: #10b981; background: rgba(16,185,129,0.1); } 
.volumeGraph { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-bottom: 8px; border-bottom: 1px solid var(--card-border); padding-top: 20px; }
.graphBar { flex: 1; max-width: 40px; background: rgba(59,130,246,0.2); border-radius: 4px; position: relative; border-top: 2px solid rgba(59,130,246,0.5); }
.graphVal { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: #fff; }
.graphLabel { font-size:9px; margin-top:6px; color:var(--text-muted); text-align:center; position: absolute; bottom: -20px; width: 100%; }

/* --- MEETINGS --- */
.split { display: grid; grid-template-columns: 350px 1fr; gap: 24px; height: 100%; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; background: rgba(255,255,255,0.02); border-radius: 16px; border: 1px solid var(--card-border); padding: 16px; }
.list { flex: 1; overflow-y: auto; padding-right: 4px; }

/* --- COMPANY GRID --- */
.companyGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 40px; }

/* --- MODAL --- */
.modalOverlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 100; animation: fadeIn 0.2s ease; }
.modalCard { width: 90%; max-width: 800px; max-height: 90%; background: #111; border: 1px solid var(--card-border); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; overflow-y: auto; box-shadow: 0 50px 100px rgba(0,0,0,0.9); position: relative; animation: slideUp 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- CARDS & ITEMS --- */
.item { background: rgba(255,255,255,0.03); padding: 20px; border-radius: 12px; cursor: pointer; margin-bottom: 8px; border: 1px solid transparent; transition: all 0.2s; }
.item:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); border-color: rgba(255,255,255,0.1); } 
.item.isSelected { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.4); }
.listStar { font-size: 11px; color: #facc15; font-weight: 700; background: rgba(250, 204, 21, 0.1); padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 2px; }
.title { font-weight: 700; font-size: 16px; color: #fff; } 
.meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; }

/* --- UI ELEMENTS --- */
.brand { display: flex; align-items: center; gap: 12px; }
.brandMark { width: 28px !important; height: 28px !important; object-fit: contain; }
.brandTitle { font-weight: 700; font-size: 16px; } .brandSubtitle { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-top: 2px; }
.tabs { display: flex; gap: 4px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 99px; border: 1px solid var(--card-border); }
.tab { background: transparent; border: none; color: var(--text-muted); padding: 8px 20px; border-radius: 99px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.tab:hover { color: var(--text); background: rgba(255,255,255,0.05); } .tab.isActive { background: rgba(255,255,255,0.1); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.account { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-muted); }
.input, .select, .textarea { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--card-border); border-radius: 10px; padding: 12px; color: var(--text); font-size: 14px; outline: none; font-family: 'Inter', sans-serif; transition: all 0.2s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--st-intro); background: rgba(0,0,0,0.4); box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
select option { background-color: #121212 !important; color: #fff !important; }
.primary { background: var(--primary); color: #000; border:none; padding:12px 20px; border-radius:10px; font-weight:600; cursor:pointer; font-size:14px; } .primary:hover { filter: brightness(1.1); transform:translateY(-1px); } .primary:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }
.secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--card-border); padding:10px 16px; border-radius:8px; cursor:pointer; } .secondary:hover { background: rgba(255,255,255,0.12); }
.danger { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); padding:10px 16px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:600; } .danger:hover { background: rgba(239,68,68,0.2); }
.ghost { background: transparent; color: var(--text-muted); border:none; padding:8px; cursor:pointer; } .ghost:hover { color:var(--text); } .ghost.delete:hover { color:var(--st-pass); }
.iconBtn { width: 32px; height: 32px; display:flex; align-items:center; justify-content:center; border-radius:6px; cursor:pointer; background:rgba(255,255,255,0.1); border:none; color:#fff; }
.actionLink { font-size: 12px; color: var(--text-muted); text-decoration: none; border: 1px solid var(--card-border); padding: 4px 10px; border-radius: 6px; } .actionLink:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.badge { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; border: 1px solid; }
.status-intro { color: var(--st-intro); background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); }
.status-prospect { color: var(--st-prospect); background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); }
.status-pass { color: var(--st-pass); background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }
.status-port { color: var(--st-port); background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); }
.status-dd { color: var(--st-dd); background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.3); }
.status-neutral { color: #cbd5e1; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.tagScroller { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-top: 8px; }
.filterPill { font-size: 11px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--card-border); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.filterPill.isActive { background: var(--text); color: #000; font-weight: 600; }
.tagInputContainer { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: rgba(0,0,0,0.2); border: 1px solid var(--card-border); border-radius: 10px; min-height: 42px; align-items: center; position: relative; }
.tagChip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 12px; border: 1px solid; margin-right: 4px; margin-bottom: 4px; white-space: nowrap; }
.tagInput { border: none; outline: none; background: transparent; min-width: 80px; flex: 1; color: #fff !important; }
.tagRemove { cursor: pointer; font-weight: 700; opacity: 0.6; }
.tag-c0 { color: #c4b5fd; background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.3); }
.tag-c1 { color: #67e8f9; background: rgba(6,182,212,0.15); border-color: rgba(6,182,212,0.3); }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; background: #1a1a1a; border: 1px solid var(--card-border); border-radius: 8px; z-index: 100; margin-top: 4px; max-height: 150px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.suggestionItem { padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.05); }
.suggestionItem:hover { background: rgba(255,255,255,0.1); color: #fff; }
.starRating { font-size: 20px; color: #444; cursor: pointer; display: inline-flex; }
.starRating span { transition: color 0.1s; } .starRating span.active { color: #facc15; }
.starRating:hover span { color: #facc15; } .starRating span:hover ~ span { color: #444 !important; } .starRating span:hover { color: #facc15 !important; }
.historyItem { padding: 12px; border-radius: 8px; background: rgba(255,255,255,0.02); margin-bottom: 8px; border-left: 2px solid var(--card-border); }
.historyHeader { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }
.historyGP { font-weight: 700; color: var(--text); }
.historyDate { color: var(--text-muted); }
.historyBody { font-size: 13px; line-height: 1.5; color: #ddd; white-space: pre-wrap; }
.historyDiff { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 12px; color: #aaa; line-height: 1.6; font-family: 'Inter', monospace; }
.diffVal { color: #fff; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.paneTitle { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.versionFooter { position: absolute; bottom: 12px; right: 20px; font-size: 10px; color: rgba(255,255,255,0.2); font-family: monospace; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }