/* ════════════════════════════════════════════════════════
   sutracru — v3
   ════════════════════════════════════════════════════════ */

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

:root {
    --bg:         #0b0d14;
    --bg-2:       #0f1220;
    --bg-3:       #141829;
    --bg-4:       #1c2135;
    --bg-5:       #232843;
    --border:     rgba(255,255,255,.06);
    --border-2:   rgba(255,255,255,.1);
    --text:       #e8eaf6;
    --text-muted: #6b7494;
    --blue:       #4F8EF7;
    --blue-dark:  #3a6fd8;
    --purple:     #7C5CFC;
    --green:      #34D399;
    --orange:     #FB923C;
    --red:        #F87171;
    --pink:       #FF6B9D;
    --gold:       #FFD700;
    --sidebar-w:  260px;
    --topbar-h:   58px;
    --radius-xl:  20px;
    --radius-lg:  14px;
    --radius-md:  10px;
    --radius-sm:  6px;
    --t:          .18s ease;
}

html { font-size: 15px; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg); color: var(--text);
    height: 100vh; overflow: hidden;
    display: flex; align-items: stretch;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 99px; }

/* ════ AUTH ════════════════════════════════════════════════ */
.auth-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; background: var(--bg); overflow: hidden;
}
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-bg__orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .18; }
.auth-bg__orb--1 { width: 500px; height: 500px; background: var(--purple); top: -200px; left: -150px; animation: floatOrb 8s ease-in-out infinite alternate; }
.auth-bg__orb--2 { width: 400px; height: 400px; background: var(--blue); bottom: -150px; right: -100px; animation: floatOrb 10s ease-in-out infinite alternate-reverse; }
.auth-bg__orb--3 { width: 250px; height: 250px; background: var(--green); top: 50%; left: 60%; animation: floatOrb 7s ease-in-out infinite alternate; opacity:.1; }
@keyframes floatOrb { from{transform:translate(0,0) scale(1)} to{transform:translate(30px,20px) scale(1.08)} }
.auth-card {
    position: relative;
    background: var(--bg-3); border: 1px solid var(--border-2);
    border-radius: var(--radius-xl); padding: 36px;
    width: 400px; max-width: 95vw;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
    animation: cardIn .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from{opacity:0;transform:translateY(24px) scale(.97)} to{opacity:1;transform:none} }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-brand__name { font-size: 1.3rem; font-weight: 900; letter-spacing: -.03em; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg-4); padding: 4px; border-radius: var(--radius-md); }
.auth-tab { flex: 1; padding: 8px; border: none; background: transparent; color: var(--text-muted); font-family: inherit; font-size: .85rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--t); }
.auth-tab.active { background: var(--bg-2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-hint { font-size: .75rem; color: var(--text-muted); text-align: center; margin-top: 16px; }

/* ════ APP LAYOUT ══════════════════════════════════════════ */
.app { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* ════ SIDEBAR ═════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--bg-2); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    z-index: 10;
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 200;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* Profile */
.sidebar__profile {
    flex-shrink: 0; padding: 20px 16px 16px;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; border-bottom: 1px solid var(--border);
}
.sidebar__avatar-wrap { position: relative; display: inline-block; margin-bottom: 10px; }
.sidebar__avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800; color: #fff;
    box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px rgba(79,142,247,.25);
}
.sidebar__avatar--emoji { font-size: 1.8rem; background: var(--bg-4); }
.sidebar__online-dot {
    position: absolute; bottom: 2px; right: 2px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--green); border: 2px solid var(--bg-2);
}
.sidebar__name-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; max-width: 200px; }
.sidebar__name { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__status-emoji { font-size: 1rem; flex-shrink: 0; }
.sidebar__role-row { margin-bottom: 12px; }

.sidebar__stats { display: flex; align-items: center; width: 100%; }
.sidebar__stat { flex: 1; text-align: center; }
.sidebar__stat-val { display: block; font-size: 1rem; font-weight: 800; }
.sidebar__stat-val--green { color: var(--green); }
.sidebar__stat-label { font-size: .62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sidebar__stat-sep { width: 1px; height: 24px; background: var(--border); }

/* Nav */
.sidebar__nav { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border: none; background: transparent;
    color: var(--text-muted); font-family: inherit; font-size: .85rem; font-weight: 500;
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--t); text-align: left; width: 100%;
    position: relative;
}
.nav-item:hover { background: var(--bg-4); color: var(--text); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(79,142,247,.15), rgba(124,92,252,.1));
    color: var(--blue); font-weight: 600;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: linear-gradient(to bottom, var(--blue), var(--purple));
    border-radius: 0 2px 2px 0;
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; }

.sidebar__footer { padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar__logout {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px; border: none; background: transparent;
    color: var(--text-muted); font-family: inherit; font-size: .83rem; font-weight: 500;
    border-radius: var(--radius-md); cursor: pointer; transition: all var(--t);
}
.sidebar__logout:hover { background: rgba(248,113,113,.1); color: var(--red); }

/* ════ MAIN ════════════════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
    flex-shrink: 0; height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg-2);
    gap: 12px;
}
.topbar__hamburger {
    display: none; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; border-radius: var(--radius-md);
    transition: background var(--t), color var(--t); flex-shrink: 0;
}
.topbar__hamburger:hover { background: var(--bg-4); color: var(--text); }
.topbar__title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__btn {
    width: 36px; height: 36px; border: 1px solid var(--border); background: var(--bg-3);
    border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted); transition: all var(--t);
}
.topbar__btn:hover { background: var(--bg-4); color: var(--text); border-color: var(--border-2); }

/* Sections */
.section { padding: 20px 24px; overflow-y: auto; flex: 1; display: none; }
.section:not(.hidden) { display: block; }

/* ════ DASH HERO ════════════════════════════════════════════ */
.dash-hero {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 20px 24px; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: space-between;
    position: relative; overflow: hidden;
}
.dash-hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink));
}
.dash-hero__left { display: flex; align-items: center; gap: 16px; }
.dash-hero__avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.dash-hero__greeting { font-size: 1rem; font-weight: 800; margin-bottom: 3px; }
.dash-hero__sub { font-size: .8rem; color: var(--text-muted); }

/* ════ STATS ════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    display: flex; align-items: center; gap: 14px;
}
.stat-card__icon { font-size: 1.4rem; }
.stat-card__value { font-size: 1.8rem; font-weight: 900; display: block; line-height: 1; }
.stat-card__label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; display: block; }
.stat-card--blue  { border-left: 3px solid var(--blue); }
.stat-card--orange{ border-left: 3px solid var(--orange); }
.stat-card--green { border-left: 3px solid var(--green); }
.stat-card--purple{ border-left: 3px solid var(--purple); }

/* ════ TASK CARDS ═══════════════════════════════════════════ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.task-card {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    cursor: pointer; animation: fadeUp .3s ease both;
    position: relative;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.4); border-color: var(--border-2); }

.task-card__status-bar {
    height: 3px; flex-shrink: 0;
}
.task-card[data-status="pending"]     .task-card__status-bar { background: var(--orange); }
.task-card[data-status="in_progress"] .task-card__status-bar { background: var(--blue); }
.task-card[data-status="done"]        .task-card__status-bar { background: var(--green); }
.task-card[data-status="cancelled"]   .task-card__status-bar { background: var(--red); }

.task-card__body { padding: 14px 16px; flex: 1; }
.task-card__header-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.task-card__id { font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.task-card__status-label { font-size: .72rem; color: var(--text-muted); flex: 1; }
.task-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.task-card__title { font-size: .9rem; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.task-card__menu-wrap { position: relative; margin-left: auto; }
.task-card__menu { position: relative; }
.task-card__person { font-size: .78rem; color: var(--text-muted); }
.task-card__deadline { font-size: .78rem; color: var(--text-muted); }
.task-card__menu-btn {
    width: 28px; height: 28px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    transition: background var(--t), color var(--t); flex-shrink: 0;
}
.task-card__menu-btn:hover { background: var(--bg-5); color: var(--text); }
.task-card__dropdown {
    display: none; position: absolute; top: 32px; right: 0; z-index: 50;
    background: var(--bg-4); border: 1px solid var(--border-2);
    border-radius: var(--radius-md); min-width: 170px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    animation: dropIn .15s ease both;
}
.task-card__dropdown.open { display: block; }
@keyframes dropIn { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:none} }
.task-card__drop-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; font-size: .82rem; cursor: pointer;
    color: var(--text-muted); transition: background var(--t), color var(--t);
    border: none; background: transparent; font-family: inherit; width: 100%; text-align: left;
}
.task-card__drop-item:hover { background: var(--bg-5); color: var(--text); }
.task-card__drop-item--danger:hover { color: var(--red); background: rgba(248,113,113,.08); }
.task-card__drop-sep { height: 1px; background: var(--border); margin: 4px 0; }

.task-card__desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card__footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-top: 1px solid var(--border);
    background: rgba(0,0,0,.15);
}
.task-card__meta { display: flex; align-items: center; gap: 10px; }
.task-card__chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .72rem; color: var(--text-muted);
}
.task-card__chip svg { opacity: .6; }
.task-card__status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 99px;
    font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.pill--pending     { background: rgba(251,146,60,.12);  color: var(--orange); }
.pill--in_progress { background: rgba(79,142,247,.12);  color: var(--blue); }
.pill--done        { background: rgba(52,211,153,.12);  color: var(--green); }
.pill--cancelled   { background: rgba(248,113,113,.12); color: var(--red); }

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

/* ════ STATUS BADGES & ROLE BADGES ═════════════════════════ */
.role-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 99px;
    font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    border: 1px solid transparent;
}
.role-badge--admin    { background: rgba(255,215,0,.12);  color: var(--gold);   border-color: rgba(255,215,0,.2); }
.role-badge--customer { background: rgba(79,142,247,.12); color: var(--blue);   border-color: rgba(79,142,247,.2); }
.role-badge--executor { background: rgba(52,211,153,.12); color: var(--green);  border-color: rgba(52,211,153,.2); }
.role-badge--manager  { background: rgba(255,107,157,.12);color: var(--pink);   border-color: rgba(255,107,157,.2); }
.role-badge--user     { background: rgba(107,116,148,.1); color: var(--text-muted); border-color: rgba(107,116,148,.15); }

/* user status badge (emoji only) */
.u-status-emoji { font-size: 1rem; cursor: help; }

/* ════ FORM ELEMENTS ═══════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text); }
.form-hint  { font-size: .73rem; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.form-input {
    background: var(--bg-4); border: 1px solid var(--border-2);
    border-radius: var(--radius-md); padding: 10px 14px;
    font-family: inherit; font-size: .88rem; color: var(--text);
    width: 100%; transition: border-color var(--t), box-shadow var(--t); outline: none;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,142,247,.12); }
.form-textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
.form-select { cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpolyline points='6 9 12 15 18 9' stroke='%236b7494' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
    padding-right: 34px;
}
.form-select option { background: #1c2135; color: var(--text); }
.form-feedback { font-size: .8rem; padding: 8px 12px; border-radius: var(--radius-sm); }
.form-feedback--success { background: rgba(52,211,153,.1); color: var(--green); }
.form-feedback--error   { background: rgba(248,113,113,.1); color: var(--red); }
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 40px; }
.eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: .9rem; opacity: .5; }
.eye-btn:hover { opacity: 1; }

/* ════ BUTTONS ══════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius-md);
    font-family: inherit; font-weight: 600; cursor: pointer;
    transition: transform var(--t), box-shadow var(--t), background var(--t), opacity var(--t);
    position: relative; outline: none; white-space: nowrap;
}
.btn--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff; padding: 11px 22px; font-size: .88rem;
    box-shadow: 0 4px 16px rgba(79,142,247,.3);
}
.btn--primary:hover  { transform: scale(1.03); box-shadow: 0 6px 20px rgba(79,142,247,.4); }
.btn--primary:active { transform: scale(.97); }
.btn--outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-muted); padding: 10px 18px; font-size: .84rem; }
.btn--outline:hover { background: var(--bg-4); color: var(--text); }
.btn--ghost { background: transparent; border: 1px solid var(--border-2); color: var(--text-muted); padding: 8px 14px; font-size: .82rem; }
.btn--ghost:hover { background: var(--bg-4); color: var(--text); }
.btn--danger { background: rgba(248,113,113,.12); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.btn--danger:hover { background: rgba(248,113,113,.2); }
.btn--sm { padding: 8px 14px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn--full { width: 100%; padding: 13px; font-size: .9rem; }
.btn--pulse::after { content: ''; position: absolute; inset: 0; border-radius: inherit; animation: pulseBorder 2.5s ease-out infinite; }
@keyframes pulseBorder { 0%{box-shadow:0 0 0 0 rgba(79,142,247,.5)} 70%{box-shadow:0 0 0 8px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.icon-btn { background: transparent; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; transition: color var(--t); }
.icon-btn:hover { color: var(--text); }

/* ════ SECTION HEADER ══════════════════════════════════════ */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.section-header__title { font-size: 1rem; font-weight: 800; }
.section-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-input { width: 180px; padding: 8px 12px; font-size: .82rem; }

/* ════ CREATE TASK PANEL ════════════════════════════════════ */
.create-task-panel {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden;
}
.create-task-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px;
    border: none; background: transparent; color: var(--text-muted);
    font-family: inherit; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: color var(--t), background var(--t); text-align: left;
}
.create-task-toggle:hover { color: var(--text); background: var(--bg-4); }
.create-task-toggle.open { color: var(--blue); }
.create-task-arrow { margin-left: auto; transition: transform var(--t); }
.create-task-toggle.open .create-task-arrow { transform: rotate(180deg); }
.create-task-form { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.create-task-form form { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ctf-row { display: grid; grid-template-columns: 1fr 180px 140px; gap: 10px; }

/* ════ FILTER BAR ═══════════════════════════════════════════ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill {
    padding: 7px 14px; border: 1px solid var(--border-2); background: var(--bg-3);
    color: var(--text-muted); font-family: inherit; font-size: .8rem; font-weight: 500;
    border-radius: 99px; cursor: pointer; transition: all var(--t);
}
.filter-pill:hover { border-color: var(--blue); color: var(--text); }
.filter-pill.active { background: var(--blue); color: #fff; border-color: transparent; }

/* ════ USERS TABLE ══════════════════════════════════════════ */
.users-table-wrap { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; }
.users-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.users-table th {
    padding: 10px 14px; text-align: left; font-size: .72rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border); background: var(--bg-4); white-space: nowrap;
}
.users-table td {
    padding: 10px 14px; font-size: .83rem; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td { background: rgba(255,255,255,.02); }
.users-table th.sortable { cursor: pointer; transition: color var(--t); user-select: none; }
.users-table th.sortable:hover { color: var(--blue); }
.cell-id { color: var(--text-muted); font-size: .78rem; }

/* ════ CSELECT — custom dropdown ════════════════════════════ */
.cs { position: relative; width: 100%; }
.cs__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; padding: 10px 14px; box-sizing: border-box;
    background: var(--bg-4); border: 1px solid var(--border-2);
    border-radius: var(--radius-md); color: var(--text);
    font-family: inherit; font-size: .88rem; cursor: pointer;
    transition: border-color var(--t), box-shadow var(--t); outline: none; text-align: left;
}
.cs:not(.cs--pill) .cs__trigger:hover { border-color: var(--blue); }
.cs:not(.cs--pill).open .cs__trigger { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,142,247,.12); }
.cs__arrow { flex-shrink: 0; color: var(--text-muted); transition: transform .2s; }
.cs.open .cs__arrow { transform: rotate(180deg); }
.cs__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.cs__dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: var(--bg-4); border: 1px solid var(--border-2);
    border-radius: var(--radius-md); overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
    animation: dropIn .15s ease both; max-height: 240px; overflow-y: auto;
}
.cs.open .cs__dropdown { display: block; }
.cs__option {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 14px; background: none; border: none;
    color: var(--text-muted); font-family: inherit; font-size: .86rem;
    cursor: pointer; text-align: left; transition: background var(--t), color var(--t);
}
.cs__option:hover   { background: var(--bg-5); color: var(--text); }
.cs__option.selected { background: rgba(79,142,247,.1); color: var(--blue); font-weight: 600; }
.cs__opt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Pill variant (role select in table) */
.cs--pill { width: auto; display: inline-flex; }
.cs--pill .cs__trigger {
    width: auto; padding: 4px 26px 4px 10px; border-radius: 99px; position: relative;
    font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    white-space: nowrap;
}
.cs--pill .cs__arrow { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.cs--pill.open .cs__arrow { transform: translateY(-50%) rotate(180deg); }
.cs--pill .cs__dropdown { min-width: 170px; width: max-content; left: 0; right: auto; }
/* role colors on pill trigger */
.cs--pill .cs__trigger.cs__trigger--rps-admin    { background: rgba(255,215,0,.12);  color: #FFD700; border-color: rgba(255,215,0,.3); }
.cs--pill .cs__trigger.cs__trigger--rps-customer { background: rgba(79,142,247,.12); color: #4F8EF7; border-color: rgba(79,142,247,.3); }
.cs--pill .cs__trigger.cs__trigger--rps-executor { background: rgba(52,211,153,.12); color: #34D399; border-color: rgba(52,211,153,.3); }
.cs--pill .cs__trigger.cs__trigger--rps-manager  { background: rgba(255,107,157,.12);color: #FF6B9D; border-color: rgba(255,107,157,.3); }
.cs--pill .cs__trigger.cs__trigger--rps-user     { background: rgba(107,116,148,.08);color: #6b7494; border-color: rgba(107,116,148,.2); }

/* Status emoji in table */
.table-status-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-assign-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600;
    border: 1px solid transparent;
}
.status-assign-select {
    appearance: none; -webkit-appearance: none;
    font-size: .75rem; font-family: inherit;
    background: var(--bg-4); border: 1px solid var(--border-2);
    color: var(--text-muted); cursor: pointer;
    outline: none; padding: 3px 8px; border-radius: 99px;
    transition: border-color var(--t); max-width: 130px;
}
.status-assign-select:hover { border-color: var(--blue); }
.status-assign-select option { background: #1c2135; }

/* Toggle */
.toggle-wrap { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-wrap input { display: none; }
.toggle-track {
    width: 34px; height: 18px; background: var(--bg-5); border-radius: 99px;
    position: relative; transition: background var(--t);
}
.toggle-track::after {
    content: ''; position: absolute; left: 2px; top: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--text-muted); transition: all var(--t);
}
.toggle-wrap input:checked + .toggle-track { background: var(--green); }
.toggle-wrap input:checked + .toggle-track::after { left: 18px; background: #fff; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.tag--green { background: rgba(52,211,153,.1); color: var(--green); }
.tag--muted { background: rgba(107,116,148,.1); color: var(--text-muted); }

/* ════ BADGES SECTION ═══════════════════════════════════════ */
.badge-editor {
    background: var(--bg-3); border: 1px solid var(--blue);
    border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px;
}
.badge-editor__form { display: flex; flex-direction: column; gap: 12px; }
.be-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.badge-card {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    transition: border-color var(--t);
}
.badge-card.selected { border-color: var(--blue); }
.badge-card__top { display: flex; align-items: center; gap: 12px; }
.badge-card__emoji { font-size: 2rem; flex-shrink: 0; }
.badge-card__info { flex: 1; min-width: 0; }
.badge-card__name { font-size: .95rem; font-weight: 800; }
.badge-card__desc { font-size: .75rem; color: var(--text-muted); margin-top: 3px; }
.badge-card__count { font-size: .75rem; color: var(--text-muted); }
.badge-card__actions { display: flex; gap: 6px; }

.badge-users-panel {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
}
.badge-users-panel__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.badge-assign-wrap { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.badge-assign-wrap .cs { min-width: 0; }
.badge-users-list { display: flex; flex-direction: column; gap: 6px; }
.badge-user-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: var(--bg-4);
    border: 1px solid var(--border); border-radius: var(--radius-md);
}
.badge-user-item__avatar {
    width: 28px; height: 28px; border-radius: 50%; font-size: .85rem; font-weight: 800;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.badge-user-item__avatar--emoji { background: var(--bg-5); }
.badge-user-item__name { flex: 1; font-size: .85rem; font-weight: 600; }
.badge-user-item__role { font-size: .72rem; }

/* ════ EXECUTOR CARDS ═══════════════════════════════════════ */
.executor-card {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-align: center; animation: fadeUp .4s ease both; transition: transform var(--t), box-shadow var(--t);
}
.executor-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.executor-card__avatar {
    width: 56px; height: 56px; border-radius: 50%; font-size: 1.4rem; font-weight: 800;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.executor-card__avatar--emoji { background: var(--bg-4); font-size: 2rem; }
.executor-card__name { font-size: .9rem; font-weight: 700; }
.executor-card__status { display: flex; align-items: center; gap: 5px; font-size: .72rem; }
.executor-card__stats { display: flex; gap: 20px; }
.executor-card__stat { text-align: center; }
.executor-card__stat-val { display: block; font-size: 1.1rem; font-weight: 800; }
.executor-card__stat-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ════ MANAGERS SECTION ════════════════════════════════════ */
.managers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.manager-card {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    animation: fadeUp .4s ease both;
}
.manager-card__head { display: flex; align-items: center; gap: 14px; }
.manager-card__avatar {
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; font-weight: 800;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.manager-card__name { font-size: .95rem; font-weight: 700; }
.manager-card__sub { margin-top: 4px; }
.manager-card__divider { height: 1px; background: var(--border); margin: 4px 0; }
.manager-card__exec-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.manager-card__executors { display: flex; flex-direction: column; gap: 6px; }
.manager-card__executor {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-4); border-radius: var(--radius-md); padding: 8px 12px;
}
.manager-card__exec-avatar { font-size: 1.2rem; flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--bg-5); border-radius: 50%; }
.manager-card__exec-name { font-size: .85rem; font-weight: 600; flex: 1; }
.manager-card__exec-stats { font-size: .72rem; color: var(--text-muted); }

/* ════ HOME (user) ══════════════════════════════════════════ */
.user-home { display: flex; flex-direction: column; gap: 24px; max-width: 560px; margin: 0 auto; padding: 20px 0; }
.user-home__hero { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 32px; text-align: center; position: relative; overflow: hidden; }
.user-home__hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--purple)); }
.user-home__icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.user-home__title { font-size: 1.4rem; font-weight: 900; background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 10px; }
.user-home__sub { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
.user-home__steps { display: flex; flex-direction: column; gap: 10px; }
.user-home__step { display: flex; align-items: center; gap: 14px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; font-size: .85rem; }
.user-home__step-num { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0; }

/* ════ PROFILE ══════════════════════════════════════════════ */
.profile-layout { display: flex; gap: 20px; align-items: flex-start; }
.profile-identity { display: flex; flex-direction: column; gap: 16px; width: 260px; flex-shrink: 0; }

.profile-id-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.profile-id-card__cover {
    height: 80px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #3a6fd8 0%, var(--purple) 55%, #a855f7 100%);
}
.profile-id-card__cover::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(255,255,255,.08) 0%, transparent 65%);
}
.profile-id-card__avatar-wrap {
    display: flex; justify-content: center;
    margin-top: -40px; position: relative; z-index: 1;
}
.profile-id-card__avatar {
    width: 80px; height: 80px; border-radius: 50%; font-size: 1.8rem; font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border: 4px solid var(--bg-3);
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.profile-id-card__avatar--emoji { background: var(--bg-4); font-size: 2.6rem; }
.profile-id-card__body { padding: 12px 20px 20px; text-align: center; }
.profile-id-card__name { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.profile-id-card__meta { font-size: .75rem; color: var(--text-muted); margin-top: 10px; line-height: 1.8; }

.profile-stats-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 16px; }
.profile-stat-row { display: flex; align-items: center; justify-content: space-around; }
.profile-stat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.profile-stat-val { font-size: 1.5rem; font-weight: 900; }
.profile-stat-label { font-size: .68rem; color: var(--text-muted); }
.profile-stat-div { width: 1px; height: 32px; background: var(--border); }

/* Avatar picker */
.avatar-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.avatar-option {
    aspect-ratio: 1; border-radius: var(--radius-md); border: 2px solid transparent;
    background: var(--bg-4); font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--t);
}
.avatar-option:hover { border-color: var(--blue); background: var(--bg-5); }
.avatar-option.selected { border-color: var(--blue); background: rgba(79,142,247,.15); }
.avatar-clear-wrap { display: flex; justify-content: center; margin-top: 8px; }

/* Universal avatar circle */
.avatar-circle {
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; flex-shrink: 0; user-select: none;
    letter-spacing: -0.5px;
}

/* Public profile page */
.public-profile-screen {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
}
.public-profile-card {
    background: var(--bg-3); border: 1px solid var(--border-2);
    border-radius: var(--radius-xl); padding: 40px 32px; max-width: 360px; width: 100%;
    text-align: center;
}

.profile-panels { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.profile-panel { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.profile-panel__title { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; margin-bottom: 14px; }
.profile-tg-status { font-size: .82rem; }
.profile-tg-hint { font-size: .78rem; color: var(--text-muted); line-height: 1.5; margin-top: 6px; }
.profile-cooldown-hint { font-size: .78rem; color: var(--orange); margin-top: 5px; }
.profile-cooldown-hint.hidden { display: none; }

/* Form card (unused now but kept) */
.form-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; max-width: 560px; }
.form-card__title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; }
.task-form { display: flex; flex-direction: column; gap: 14px; }

/* ════ MODAL ════════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 500; backdrop-filter: blur(4px); padding: 16px; }
.modal { background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--radius-xl); padding: 28px 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; position: relative; animation: cardIn .25s ease both; }
.modal--wide { max-width: 600px; }
.modal__close { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border: none; background: var(--bg-5); color: var(--text-muted); border-radius: 50%; cursor: pointer; font-size: .85rem; transition: all var(--t); display: flex; align-items: center; justify-content: center; }
.modal__close:hover { background: rgba(248,113,113,.2); color: var(--red); }
.modal__title { font-size: 1rem; font-weight: 800; margin-bottom: 18px; }

/* ════ TASK MODAL (detail) ══════════════════════════════════ */
.task-detail__status { margin-bottom: 16px; }
.task-detail__title { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.task-detail__desc { font-size: .85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.task-detail__meta { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--bg-4); border-radius: var(--radius-md); margin-bottom: 16px; }
.task-detail__row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.task-detail__row span { color: var(--text-muted); min-width: 90px; }
.task-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ════ EMPTY STATE ══════════════════════════════════════════ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; gap: 12px; }
.empty-state__icon { font-size: 2.5rem; }
.empty-state__text { font-size: .9rem; color: var(--text-muted); text-align: center; }

/* ════ SKELETON ═════════════════════════════════════════════ */
.skeleton-card { background: var(--bg-4); border-radius: var(--radius-md); animation: shimmer 1.5s infinite linear; min-height: 120px; }
@keyframes shimmer { 0%{opacity:.6} 50%{opacity:1} 100%{opacity:.6} }

/* ════ TOAST ════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-4); border: 1px solid var(--border-2); border-radius: var(--radius-md); font-size: .83rem; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slideUp .25s ease both; min-width: 220px; }
@keyframes slideUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
.toast.removing { animation: slideDown .2s ease forwards; }
@keyframes slideDown { to{opacity:0;transform:translateY(12px)} }
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }
.toast--info    { border-left: 3px solid var(--blue); }
.toast-icon { font-size: 1rem; }

/* Exec item (manager modal) */
.exec-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-4); border: 1px solid var(--border); border-radius: var(--radius-md); }
.exec-item__name { flex: 1; font-size: .88rem; font-weight: 600; }
.exec-item__del { background: transparent; border: none; cursor: pointer; color: var(--text-muted); font-size: .85rem; padding: 2px 8px; border-radius: var(--radius-sm); transition: color var(--t), background var(--t); }
.exec-item__del:hover { color: var(--red); background: rgba(248,113,113,.1); }

/* ════ UTILS ════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ════ MOBILE ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    body { overflow: auto; height: auto; }
    .app { flex-direction: column; height: auto; min-height: 100svh; overflow: visible; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 250;
        transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.visible { display: block; }

    .main { width: 100%; overflow: visible; height: auto; flex: none; display: flex; flex-direction: column; min-height: 100svh; }
    .section { flex: 1; overflow: visible; padding: 14px 16px; }

    .topbar { position: sticky; top: 0; z-index: 100; padding: 0 14px; }
    .topbar__hamburger { display: flex; }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    .ctf-row { grid-template-columns: 1fr; }

    .col-hide-sm { display: none; }

    .profile-layout { flex-direction: column; }
    .profile-identity { width: 100%; }

    .dash-hero__left { flex-direction: column; text-align: center; align-items: center; }
    .be-row { flex-direction: column; }

    .modal { padding: 22px 16px; }
    .auth-card { padding: 28px 20px; }

    .badges-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-card__value { font-size: 1.5rem; }
    .filter-bar { gap: 6px; }
    .filter-pill { font-size: .74rem; padding: 6px 11px; }
}
