:root, [data-theme="light"] {
    --bg: #f5f5f7;
    --bg2: #ffffff;
    --bg3: #f0f0f2;
    --border: #e5e5ea;
    --text: #1d1d1f;
    --text2: #86868b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99,102,241,.08);
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.08);
    --chart-text: #1d1d1f;
    --chart-muted: #86868b;
    --chart-ring: #e5e5ea;
    --chart-grid: #e5e5ea;
}
[data-theme="dark"] {
    --bg: #0f1117;
    --bg2: #1a1d2e;
    --bg3: #252836;
    --border: #2e3144;
    --text: #e4e4e7;
    --text2: #9ca3af;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(129,140,248,.1);
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --blue: #60a5fa;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
    --chart-text: #e4e4e7;
    --chart-muted: #9ca3af;
    --chart-ring: #252836;
    --chart-grid: #2e3144;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app { display: flex; min-height: 100vh; }

/* ── Sidebar (Colibrix style) ── */
#sidebar {
    width: 250px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}
#sidebar.hidden { display: none; }
.logo {
    padding: 24px 24px 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}
.logo span { color: var(--accent); }
.nav-links { flex: 1; display: flex; flex-direction: column; padding: 0 12px; gap: 2px; }
.nav-links a {
    padding: 11px 16px;
    color: var(--text2);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}
.nav-links a .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-links a:hover {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(59,130,246,.12), rgba(168,85,247,.12), rgba(236,72,153,.12));
    color: var(--text);
}
.nav-links a.active {
    background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    color: #fff;
}
.nav-mypage {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; margin: 4px 12px; color: var(--text2);
    text-decoration: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; transition: all .15s;
    border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px;
}
.nav-mypage .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-mypage:hover {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(59,130,246,.12), rgba(168,85,247,.12), rgba(236,72,153,.12));
    color: var(--text);
}
.nav-mypage.active {
    background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%; animation: gradientShift 4s ease infinite; color: #fff;
}
.nav-settings { padding: 12px 20px; border-top: 1px solid var(--border); }
.settings-row { display: flex; align-items: center; gap: 8px; }
/* Theme toggle switch */
.theme-switch {
    display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
}
.theme-icon { font-size: 16px; color: var(--text2); line-height: 1; }
.theme-track {
    width: 40px; height: 22px; border-radius: 11px; background: var(--border);
    position: relative; transition: background .2s;
}
[data-theme="dark"] .theme-track { background: var(--accent); }
.theme-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    position: absolute; top: 2px; left: 2px; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
[data-theme="dark"] .theme-thumb { transform: translateX(18px); }

/* Language buttons */
.lang-row { gap: 4px !important; margin-top: 8px; }
.lang-btn {
    flex: 1; padding: 6px 0; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    border-radius: 8px; border: 1px solid var(--border); background: var(--bg3);
    color: var(--text2); cursor: pointer; transition: all .2s; text-align: center;
}
.lang-btn:hover { border-color: var(--accent); color: var(--text); }
.lang-btn.active {
    background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #6366f1);
    background-size: 300% 300%; animation: gradientShift 4s ease infinite;
    color: #fff; border-color: transparent;
}
.nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text2);
}

/* ── Content ── */
#content {
    flex: 1;
    padding: 32px 40px;
    margin-left: 0;
    transition: margin-left .2s;
    max-width: 100%;
}
body.authed #content { margin-left: 250px; }

/* ── Buttons ── */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    color: #fff;
    transition: all .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(99,102,241,.35); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626, #f87171, #ef4444); background-size: 300% 300%; animation: gradientShift 4s ease infinite; }
.btn-danger:hover { box-shadow: 0 4px 15px rgba(239,68,68,.35); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); animation: none; }
.btn-secondary:hover { background: var(--border); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #6366f1); background-size: 300% 300%; animation: gradientShift 4s ease infinite; }
.btn-green { background: linear-gradient(135deg, #22c55e, #10b981, #34d399, #22c55e); background-size: 300% 300%; animation: gradientShift 4s ease infinite; }

/* ── Forms ── */
input, select, textarea {
    background: var(--bg2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text2); font-weight: 500; }
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; background: var(--bg2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
th { color: var(--text2); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; background: var(--bg3); }
tr:hover { background: var(--bg); }

/* ── Cards (Colibrix style) ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card-value { font-size: 28px; font-weight: 700; color: var(--text); }
.card-label { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── Status badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-select { cursor: pointer; transition: all .2s; -webkit-appearance: none; appearance: none; text-align: center; }
.status-select:focus { outline: none; box-shadow: 0 0 0 2px var(--accent-light); }
.badge-in_progress { background: rgba(59,130,246,.1); color: var(--blue); }
.badge-review { background: rgba(245,158,11,.1); color: var(--yellow); }
.badge-approved { background: rgba(34,197,94,.1); color: var(--green); }
.badge-reject { background: rgba(239,68,68,.1); color: var(--red); }
.badge-founder { background: rgba(99,102,241,.1); color: var(--accent); }
.badge-teamlead { background: rgba(59,130,246,.1); color: var(--blue); }
.badge-developer { background: rgba(34,197,94,.1); color: var(--green); }
.badge-mercenary { background: rgba(245,158,11,.1); color: var(--yellow); }
.badge-server_overseer { background: rgba(168,85,247,.1); color: #a855f7; }
.badge-new { background: rgba(34,197,94,.12); color: #22c55e; }
.badge-used { background: rgba(148,163,184,.15); color: #94a3b8; }
.farm-status-btn { font-weight: 600; letter-spacing: .02em; transition: filter .15s; }
.farm-status-btn:hover { filter: brightness(1.2); }

/* Activity leaderboards */
.activity-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 900px) { .activity-stats { grid-template-columns: 1fr; } }
.leader-card { background: var(--card, #1a1a1a); border: 1px solid var(--border, #2a2a2a); border-radius: 12px; padding: 16px; }
.leader-card-title { font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.leader-list { display: flex; flex-direction: column; gap: 6px; }
.leader-row { display: grid; grid-template-columns: 36px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; transition: background .15s; }
.leader-row:hover { background: rgba(255,255,255,.03); }
.leader-rank { font-size: 18px; text-align: center; }
.rank-num { display:inline-block; width:24px; height:24px; line-height:24px; border-radius:50%; background:rgba(255,255,255,.06); font-size:12px; font-weight:600; color:var(--text2,#888); }
.leader-name { font-weight: 600; text-decoration: none; color: var(--text,#fff); }
.leader-name:hover { color: var(--accent,#6366f1); }
.leader-role { font-size: 10px; padding: 2px 8px; }
.leader-value { font-size: 13px; white-space: nowrap; }

/* Agreements */
.agree-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 18px; }
.agree-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border, #2a2a2a); border-radius: 10px; background: var(--card2, #1a1a1a); }
.agree-row-title { font-weight: 600; }
.agree-doc { max-height: 50vh; overflow-y: auto; padding: 18px 22px; border: 1px solid var(--border, #2a2a2a); border-radius: 10px; background: var(--card2, #131313); margin-bottom: 14px; line-height: 1.55; font-size: 13.5px; }
.agree-doc h2 { font-size: 18px; margin: 4px 0 12px; }
.agree-doc h3 { font-size: 14px; margin: 16px 0 6px; color: var(--text, #fff); }
.agree-doc p { margin: 4px 0 8px; color: var(--text2, #b8b8b8); }
.agree-checkbox { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.2); border-radius: 10px; margin-bottom: 12px; cursor: pointer; }
.agree-checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent, #6366f1); }
.agree-signed-box { padding: 12px 14px; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.3); border-radius: 10px; color: #22c55e; margin-bottom: 12px; }
.agree-history { font-size: 11px; color: var(--text2,#888); margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--border,#2a2a2a); }
.agree-history div { padding: 1px 0; }

/* Tables inside agreement docs */
.agree-doc table.agree-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 12.5px; }
.agree-doc table.agree-table th, .agree-doc table.agree-table td { border: 1px solid var(--border,#2a2a2a); padding: 6px 10px; text-align: left; }
.agree-doc table.agree-table th { background: rgba(255,255,255,.04); font-weight: 600; }
.agree-doc ul { margin: 4px 0 10px 20px; padding: 0; }
.agree-doc ul li { margin: 3px 0; }

/* Developer salary card */
.dev-salary-card { background: var(--card,#1a1a1a); border: 1px solid var(--border,#2a2a2a); border-radius: 14px; padding: 22px 24px; margin-bottom: 20px; }
.dev-salary-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.dev-salary-month { font-size: 20px; font-weight: 700; }
.dev-salary-sub { font-size: 11px; color: var(--text2,#888); margin-top: 2px; }
.dev-salary-amounts { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0; align-items: center; padding: 16px 0; border-top: 1px solid var(--border,#2a2a2a); border-bottom: 1px solid var(--border,#2a2a2a); }
.amt-item { text-align: center; }
.amt-label { font-size: 11px; color: var(--text2,#888); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.amt-value { font-size: 26px; font-weight: 800; }
.amt-value.amt-bonus { color: #22c55e; }
.amt-value.amt-total { color: #6366f1; }
.amt-value.amt-penalty { color: #f97316; }
.amt-note { font-size: 10px; color: var(--text2,#888); margin-top: 2px; }
.amt-divider { width: 1px; height: 40px; background: var(--border,#2a2a2a); }

.dev-salary-progress { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.progress-row { display: flex; flex-direction: column; gap: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.progress-ok { color: #22c55e; }
.progress-warn { color: #ef4444; }
.progress-bar { height: 10px; background: rgba(255,255,255,.05); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.fill-ok { background: linear-gradient(90deg, #22c55e, #4ade80); }
.fill-warn { background: linear-gradient(90deg, #ef4444, #f97316); }
.fill-tier { background: linear-gradient(90deg, #6366f1, #a855f7); }

.dev-salary-alerts { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.salary-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.salary-alert .alert-icon { font-size: 16px; line-height: 1; }
.salary-alert.alert-danger { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.salary-alert.alert-warning { background: rgba(249,115,22,.08); border: 1px solid rgba(249,115,22,.3); color: #fdba74; }
.salary-alert.alert-info { background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.3); color: #c7d2fe; }
.salary-alert.alert-success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.3); color: #86efac; }

/* Salary history modal */
.salary-history-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; }
.salary-history-table th, .salary-history-table td { padding: 8px 12px; border-bottom: 1px solid var(--border,#2a2a2a); text-align: left; }
.salary-history-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text2,#888); }

/* Team Lead — per-developer cards */
.tl-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tl-dev-card { background: var(--card2,#1a1a1a); border: 1px solid var(--border,#2a2a2a); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s; }
.tl-dev-card:hover { border-color: rgba(99,102,241,.4); transform: translateY(-1px); }
.tl-personal-card { border-color: rgba(99,102,241,.35); background: linear-gradient(180deg, rgba(99,102,241,.05), transparent); }
.tl-dev-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tl-dev-name { font-weight: 600; color: var(--text,#fff); text-decoration: none; font-size: 14px; }
.tl-dev-name:hover { color: var(--accent,#6366f1); }
.tl-bonus-amt { font-weight: 800; font-size: 18px; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.tl-bonus-amt.tl-bonus-active { color: #22c55e; background: rgba(34,197,94,.10); }
.tl-bonus-amt.tl-bonus-zero { color: var(--text2,#888); background: rgba(255,255,255,.04); }
.tl-bonus-amt.voided { color: #ef4444; background: rgba(239,68,68,.08); text-decoration: line-through; }
.tl-bonus-amt.voided small { font-size: 9px; display: block; text-decoration: none; opacity: .7; }
.tl-dev-progress { display: flex; flex-direction: column; gap: 4px; }
.tl-dev-alert { font-size: 11.5px; padding: 7px 10px; }

/* Mercenary terms block */
.merc-terms-block { margin-top: 18px; padding: 14px 16px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.25); border-radius: 10px; }
.merc-terms-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #fbbf24; margin-bottom: 8px; font-weight: 600; }
.merc-terms-body { font-size: 13px; line-height: 1.5; color: var(--text,#fff); white-space: pre-wrap; }
.merc-tier-table tr.tier-active { background: rgba(34,197,94,.07); }
.merc-tier-table tr.tier-active td { color: var(--text,#fff); }
.merc-tier-table td:nth-child(3), .merc-tier-table td:nth-child(4) { text-align: right; }

/* ── Modal ── */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); backdrop-filter: blur(4px); z-index: 50; }
#modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    min-width: 440px; max-width: 600px; max-height: 80vh;
    overflow-y: auto; z-index: 51;
    box-shadow: var(--shadow-lg);
}
#modal.hidden, #modal-overlay.hidden { display: none; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Login ── */
.login-box {
    max-width: 380px; margin: 15vh auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}
.login-box h1 { text-align: center; margin-bottom: 28px; font-size: 24px; }

/* ── Toast ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); font-size: 14px; animation: slideIn .25s; min-width: 250px; box-shadow: var(--shadow-md); }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Page header ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }

/* ── Filters ── */
.filters { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; }

/* ── Drop zone ── */
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--text2); cursor: pointer; transition: all .15s; background: var(--bg2); }
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-light); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* Permissions matrix */
.perm-matrix td { padding: 6px 8px; }
.perm-matrix select { width: 110px; font-size: 12px; padding: 6px; }

/* SDK */
.sdk-checks { display: flex; gap: 12px; align-items: center; }
.sdk-checks label { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text); cursor: pointer; margin-bottom: 0; }
.sdk-checks input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.sdk-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--bg3); color: var(--text2); margin-right: 3px; font-weight: 500; }

/* Number expiry */
.num-warn { animation: blinkOrange 1.2s infinite; }
.num-danger { animation: blinkRed 0.8s infinite; }
.num-expired { color: var(--red); opacity: 0.6; }
@keyframes blinkOrange { 0%,100% { color: var(--yellow); } 50% { color: transparent; } }
@keyframes blinkRed { 0%,100% { color: var(--red); } 50% { color: transparent; } }
.app-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--accent-light); color: var(--accent); margin: 1px 2px; font-weight: 500; }

/* ── Charts ── */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-block { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--text2); }
.chart-block canvas { display: block; margin: 0 auto; }

.eff-fast { color: var(--green); font-weight: 600; }

/* ── Animated cards ── */
.anim-card { animation: cardPop 0.4s ease-out both; }
.anim-card:nth-child(1) { animation-delay: 0s; }
.anim-card:nth-child(2) { animation-delay: 0.06s; }
.anim-card:nth-child(3) { animation-delay: 0.12s; }
.anim-card:nth-child(4) { animation-delay: 0.18s; }
.anim-card:nth-child(5) { animation-delay: 0.24s; }
.anim-card:nth-child(6) { animation-delay: 0.30s; }
.anim-card:nth-child(7) { animation-delay: 0.36s; }
@keyframes cardPop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Dashboard ── */
.dash-page { max-width: 1000px; }
.dash-top-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 28px; }
.dash-section { margin-top: 36px; margin-bottom: 12px; }

/* Award cards */
.dash-awards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.award-card {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
    padding: 24px; text-align: center; cursor: pointer; transition: all .3s;
    position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.award-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.award-card::before {
    content: ''; position: absolute; inset: -1px; border-radius: 14px; padding: 2px;
    background: var(--award-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .3s;
}
.award-card:hover::before { opacity: 1; }
.award-gold { --award-gradient: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706); }
.award-platinum { --award-gradient: linear-gradient(135deg, #818cf8, #6366f1, #4f46e5); }
.award-fire { --award-gradient: linear-gradient(135deg, #f87171, #ef4444, #dc2626); }
.award-icon { font-size: 36px; margin-bottom: 8px; }
.award-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); margin-bottom: 8px; }
.award-name { font-size: 18px; font-weight: 700; }
.award-detail { font-size: 12px; color: var(--text2); margin-top: 4px; }
.award-empty { font-size: 13px; color: var(--text2); font-style: italic; }

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm);
}
.lb-row:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-md); }
.lb-row:first-child { border-left: 3px solid #fbbf24; }
.lb-row:nth-child(2) { border-left: 3px solid #c0c0c0; }
.lb-row:nth-child(3) { border-left: 3px solid #cd7f32; }
.lb-medal { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.lb-rank { font-size: 14px; font-weight: 700; color: var(--text2); }
.lb-avatar { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.lb-stats-bar { width: 100%; }
.lb-bar-track { height: 6px; background: var(--bg3); border-radius: 3px; position: relative; overflow: hidden; }
.lb-bar-fill { position: absolute; top: 0; height: 100%; border-radius: 3px; transition: width .8s ease-out; }
.lb-bar-approved { background: var(--green); }
.lb-bar-rejected { background: var(--red); }
.lb-numbers { display: flex; align-items: baseline; gap: 4px; flex-shrink: 0; }
.lb-approved { font-size: 18px; font-weight: 700; color: var(--green); }
.lb-total { font-size: 13px; color: var(--text2); }
.lb-pct { font-size: 11px; color: var(--text2); background: var(--bg3); padding: 2px 6px; border-radius: 4px; margin-left: 4px; }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.feed-content { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.feed-user { font-weight: 600; }
.feed-action { font-weight: 500; }
.feed-target { color: var(--text2); }
.feed-detail { color: var(--text2); font-size: 11px; }
.feed-time { color: var(--text2); font-size: 11px; flex-shrink: 0; }

/* ── Salary block ── */
.salary-block {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
    padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.salary-row { display: flex; align-items: center; justify-content: center; }
.salary-item { text-align: center; flex: 1; padding: 0 20px; }
.salary-label { font-size: 12px; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.salary-value { font-size: 26px; font-weight: 700; }
.salary-total { color: var(--accent); }
.salary-divider { width: 1px; height: 50px; background: var(--border); }
.bonus-glow { color: var(--green); }
.bonus-breakdown { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text2); padding-top: 14px; border-top: 1px solid var(--border); }

/* ── Interactive stat cards ── */
.stat-card-interactive {
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; text-align: center; cursor: pointer; transition: all .2s;
    position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat-card-interactive:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-interactive.stat-active { border-color: var(--accent); background: var(--accent-light); }
.stat-card-interactive .stat-icon { font-size: 20px; margin-bottom: 4px; }
.stat-card-interactive .card-value { font-size: 24px; font-weight: 700; }
.stat-card-interactive .card-label { font-size: 11px; margin-top: 2px; }
.stat-card-interactive::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(99,102,241,.06) 0%, transparent 60%);
    pointer-events: none;
}

/* ── Project/account card interactions ── */
.profile-project-card {
    cursor: pointer; transition: all .25s; position: relative; overflow: hidden;
    background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow-sm);
}
.profile-project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.profile-project-card.expanded { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.card-glow-green { border-color: rgba(34,197,94,.4); }
.card-glow-green:hover { box-shadow: 0 4px 20px rgba(34,197,94,.15); border-color: var(--green); }
.card-glow-red { border-color: rgba(239,68,68,.3); }
.card-glow-red:hover { box-shadow: 0 4px 20px rgba(239,68,68,.12); border-color: var(--red); }
.card-expand-content { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s, opacity .3s, margin .3s; }
.profile-project-card.expanded .card-expand-content { max-height: 200px; opacity: 1; margin-top: 8px; }
.profile-project-header { display: flex; justify-content: space-between; align-items: center; }

/* App Store button */
.appstore-btn {
    display: inline-block; margin-top: 8px; padding: 6px 14px;
    background: linear-gradient(135deg, #6366f1, #3b82f6, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%; animation: gradientShift 4s ease infinite;
    color: #fff; border-radius: 20px;
    font-size: 12px; font-weight: 600; text-decoration: none; transition: all .2s;
}
.appstore-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(99,102,241,.35); }
.appstore-pending { background: var(--bg3); color: var(--text2); cursor: default; }
.appstore-pending:hover { opacity: 1; }

.card-reveal { animation: cardReveal .3s ease-out; }
@keyframes cardReveal { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── Profile ── */
.profile-page { max-width: 840px; }
.profile-header {
    display: flex; gap: 24px; align-items: center; margin-bottom: 28px;
    padding: 28px; background: var(--bg2); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-sm);
}
.profile-avatar { width: 120px; height: 120px; border-radius: 26px; flex-shrink: 0; }
.profile-info { flex: 1; }
.profile-name { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.profile-role { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text2); }
.profile-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 28px; }
.profile-section-title { font-size: 18px; font-weight: 700; margin: 28px 0 14px; letter-spacing: -0.3px; }
.profile-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ── Users card grid (Colibrix wallet-card style) ── */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.user-card {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
    padding: 24px; cursor: pointer; transition: all .25s; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.user-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.user-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.user-card-avatar { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.user-card-name { font-size: 16px; font-weight: 600; }
.user-card-username { font-size: 12px; color: var(--text2); }
.user-card-body { display: flex; flex-direction: column; gap: 8px; }
.user-card-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.user-card-row .label { color: var(--text2); }
.user-card-row .value { font-weight: 500; }
.user-card-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-card-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.user-card-actions .btn { flex: 1; text-align: center; }
.user-card-inactive { opacity: 0.5; }

/* ── Task Desk ── */
.tasks-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.task-card {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
    transition: all .25s; box-shadow: var(--shadow-sm);
}
.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.task-card-header { display: flex; align-items: center; gap: 8px; }
.task-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-status-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.task-status-select { width: auto; padding: 3px 6px; font-size: 11px; border-radius: 6px; margin-left: auto; }
.task-card-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.task-card-desc { font-size: 13px; color: var(--text2); line-height: 1.5; max-height: 80px; overflow: hidden; }
.task-card-reqs { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.task-req-row { display: flex; gap: 8px; font-size: 12px; align-items: baseline; }
.task-req-label { font-weight: 600; color: var(--text2); min-width: 50px; flex-shrink: 0; text-transform: uppercase; font-size: 10px; letter-spacing: 0.3px; }
.task-card-footer { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.task-card-dates { display: flex; gap: 14px; font-size: 11px; color: var(--text2); }
.task-card-dev { font-size: 12px; }
.task-card-project { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--accent-light); border-radius: 8px; font-size: 12px; }
.task-card-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ── Dashboard month filter ── */
.dash-month-filter {
    width: auto !important; min-width: 200px; padding: 8px 14px; font-size: 14px; font-weight: 500;
    border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg2);
    color: var(--text); cursor: pointer;
}
.dash-month-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }


/* ── Dashboard loading ── */
.dash-loading { text-align: center; padding: 60px 0; color: var(--text2); font-size: 14px; }

/* ── Utility ── */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--text2); font-size: 13px; }
.clickable { cursor: pointer; }
.clickable:hover { color: var(--accent); }

/* ── Kanban Board ── */
.kanban-board {
    display: flex;
    gap: 12px;
    min-height: 500px;
    align-items: stretch;
}
.kanban-board > .kanban-column {
    flex: 1 1 0;
}
.kanban-column {
    background: var(--bg3);
    border-radius: 14px;
    padding: 12px;
    min-height: 400px;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background .2s;
}
.kanban-column.drag-over {
    background: var(--accent-light);
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}
.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kanban-col-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg2);
}
.kanban-col-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}
.kanban-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 50px;
}
.kanban-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: grab;
    transition: all .2s;
    box-shadow: var(--shadow-sm);
    position: relative;
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: var(--shadow-lg);
}
.kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}
.kanban-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text2);
}
.kanban-card-meta .sdk-badge {
    font-size: 10px;
    padding: 1px 6px;
}
.kanban-card-dev {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text2);
}
.kanban-card-screenshots {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.kanban-card-screenshots img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .15s;
}
.kanban-card-screenshots img:hover {
    transform: scale(1.5);
    z-index: 5;
    box-shadow: var(--shadow-md);
}

/* View toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg3);
    border-radius: 8px;
    padding: 3px;
}
.view-toggle-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.view-toggle-btn.active {
    background: var(--bg2);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Screenshot upload modal */
.screenshot-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text2);
    cursor: pointer;
    transition: all .15s;
    background: var(--bg);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.screenshot-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}
.screenshot-drop .drop-icon {
    font-size: 36px;
    opacity: 0.5;
}
.screenshot-preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-top: 12px;
    border: 1px solid var(--border);
}

/* Screenshot modal image viewer */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.screenshot-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .2s;
}
.screenshot-gallery img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ── Accounts table ── */
.pwd-mask { font-family: monospace; font-size: 12px; color: var(--text2); }
.apps-toggle { font-size: 11px; }

/* ── Inbox Panel ── */
.inbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 900;
}
.inbox-overlay.open { display: block; }

.inbox-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    height: 100vh;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    z-index: 901;
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.inbox-panel.open { right: 0; }

.inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.inbox-close {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.inbox-close:hover { background: var(--bg3); }

.inbox-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.inbox-loading, .inbox-empty, .inbox-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text2);
    font-size: 14px;
}
.inbox-error { color: var(--red); }

.inbox-list { padding: 0; }

.inbox-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}
.inbox-item:hover { background: var(--bg3); }
.inbox-item.unread { border-left: 3px solid var(--accent); }
.inbox-item.unread .inbox-item-from,
.inbox-item.unread .inbox-item-subject { font-weight: 600; }

.inbox-item-from {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}
.inbox-item-subject {
    font-size: 13px;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inbox-item-date {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}

.inbox-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
.inbox-page-info {
    font-size: 12px;
    color: var(--text2);
}

/* Message detail */
.inbox-message { padding: 16px 18px; }
.msg-subject {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}
.msg-meta {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
}
.msg-body { font-size: 14px; }
.msg-iframe {
    width: 100%;
    border: none;
    min-height: 200px;
    background: #fff;
    border-radius: 6px;
}
.msg-text {
    white-space: pre-wrap;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}
