/* ==========================================================================
   Прометей — дизайн-система корпоративного таск-менеджера
   ========================================================================== */

:root {
    --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;

    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f8;
    --border: #e4e9f2;
    --border-strong: #d4dbe8;

    --text: #0f172a;
    --text-2: #4a5568;
    --text-3: #8a94a6;

    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-700: #3730a3;
    --primary-soft: #eef2ff;
    --primary-soft-2: #e0e7ff;

    --green: #059669;
    --green-soft: #ecfdf5;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --amber: #b45309;
    --amber-soft: #fffbeb;
    --orange: #ea580c;
    --orange-soft: #fff7ed;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --violet: #7c3aed;
    --violet-soft: #f5f3ff;
    --slate-soft: #f1f5f9;

    --sidebar-bg: #0e1629;
    --sidebar-bg-2: #141f38;
    --sidebar-text: #aab4c8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.06);

    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);

    --sidebar-w: 264px;
    --topbar-h: 66px;
    --content-max: 1440px;
}

/* ---------- Reset / base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
p {
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-600);
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::selection {
    background: var(--primary-soft-2);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cfd6e3;
    border-radius: 99px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Layout ---------- */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #101a30 100%);
    color: var(--sidebar-text);
    transition: transform 0.25s ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 20px 18px;
}

.sidebar__logo {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7 55%, #f97316);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.sidebar__title {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}

.sidebar__subtitle {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7381a0;
    font-weight: 600;
}

.sidebar__close {
    display: none;
    margin-left: auto;
    background: none;
    border: 0;
    color: #94a3b8;
    padding: 6px;
    border-radius: 8px;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 16px;
}

.sidebar__label {
    padding: 16px 10px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #5e6c8a;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 550;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
    flex: 0 0 19px;
    opacity: 0.9;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.1));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.25);
}

.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #818cf8;
}

.nav-link__badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 99px;
    background: rgba(248, 113, 113, 0.18);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.nav-link__badge--soft {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.sidebar__footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    color: #e2e8f0;
    transition: background 0.15s ease;
}

.sidebar__user:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar__user-name {
    font-size: 13px;
    font-weight: 650;
    color: #f1f5f9;
    line-height: 1.3;
}

.sidebar__user-role {
    font-size: 11.5px;
    color: #8493b2;
}

.sidebar__logout {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8493b2;
}

.sidebar__logout:hover {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: none;
    background: rgba(8, 13, 26, 0.55);
    backdrop-filter: blur(2px);
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-w);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.topbar__menu {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.topbar__search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.topbar__search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.topbar__search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    font-size: 13.5px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.topbar__search input:focus {
    outline: none;
    background: #fff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.topbar__spacer {
    flex: 1;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-2);
    transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}

.icon-btn__badge {
    position: absolute;
    top: 3px;
    right: 2px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    border: 2px solid #fff;
}

.topbar__avatar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 6px 4px 4px;
    border: 1px solid transparent;
    border-radius: 99px;
    background: transparent;
    color: var(--text);
}

.topbar__avatar:hover {
    background: var(--surface-3);
}

.topbar__avatar-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 26px 28px 56px;
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-header__title {
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.page-header__subtitle {
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--text-3);
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 12.5px;
    color: var(--text-3);
}

.breadcrumbs a {
    color: var(--text-3);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
        box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn svg {
    flex: 0 0 auto;
}

.btn--primary {
    background: linear-gradient(180deg, #5b52ea, var(--primary));
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.32);
}

.btn--primary:hover {
    background: var(--primary-600);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}

.btn--secondary:hover {
    border-color: #c3ccdd;
    color: var(--text);
    background: var(--surface-2);
}

.btn--ghost {
    color: var(--text-2);
}

.btn--ghost:hover {
    background: var(--surface-3);
    color: var(--text);
}

.btn--danger {
    background: var(--red-soft);
    color: var(--red);
    border-color: #fecaca;
}

.btn--danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn--success {
    background: var(--green-soft);
    color: var(--green);
    border-color: #a7f3d0;
}

.btn--success:hover {
    background: #d1fae5;
}

.btn--sm {
    height: 32px;
    padding: 0 11px;
    font-size: 12.5px;
    border-radius: 9px;
}

.btn--lg {
    height: 46px;
    padding: 0 22px;
    font-size: 14.5px;
    border-radius: 12px;
}

.btn--icon {
    width: 38px;
    height: 38px;
    padding: 0;
}

.btn--icon.btn--sm {
    width: 30px;
    height: 30px;
}

.btn--block {
    width: 100%;
}

.btn[disabled],
.btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.btn-group {
    display: inline-flex;
    gap: 7px;
    flex-wrap: wrap;
}

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.card--flush {
    overflow: hidden;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__subtitle {
    font-size: 12.5px;
    color: var(--text-3);
    font-weight: 500;
    margin-top: 2px;
}

.card__body {
    padding: 20px;
}

.card__footer {
    padding: 13px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card__link {
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ---------- Statistics ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 17px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

a.stat-card:hover {
    border-color: #c7d2fe;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-card__icon--green {
    background: var(--green-soft);
    color: var(--green);
}

.stat-card__icon--red {
    background: var(--red-soft);
    color: var(--red);
}

.stat-card__icon--amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.stat-card__icon--blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.stat-card__icon--violet {
    background: var(--violet-soft);
    color: var(--violet);
}

.stat-card__label {
    font-size: 12.5px;
    color: var(--text-3);
    font-weight: 550;
}

.stat-card__value {
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

.stat-card__hint {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 3px;
}

.stat-card__hint--danger {
    color: var(--red);
    font-weight: 600;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.55;
    white-space: nowrap;
    background: var(--slate-soft);
    color: #475569;
}

.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--green {
    background: var(--green-soft);
    color: #047857;
}

.badge--red {
    background: var(--red-soft);
    color: #b91c1c;
}

.badge--amber {
    background: var(--amber-soft);
    color: #b45309;
}

.badge--orange {
    background: var(--orange-soft);
    color: #c2410c;
}

.badge--blue {
    background: var(--blue-soft);
    color: #1d4ed8;
}

.badge--violet {
    background: var(--violet-soft);
    color: #6d28d9;
}

.badge--slate {
    background: var(--slate-soft);
    color: #475569;
}

.badge--outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-2);
}

/* ---------- Avatars ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    overflow: hidden;
    background: #e2e8f0;
    color: #334155;
    text-transform: uppercase;
    user-select: none;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--xs {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 9.5px;
}

.avatar--sm {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    font-size: 10.5px;
}

.avatar--lg {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 16px;
}

.avatar--xl {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 23px;
}

.avatar--indigo {
    background: #e0e7ff;
    color: #3730a3;
}

.avatar--rose {
    background: #ffe4e6;
    color: #9f1239;
}

.avatar--emerald {
    background: #d1fae5;
    color: #065f46;
}

.avatar--amber {
    background: #fef3c7;
    color: #92400e;
}

.avatar--sky {
    background: #e0f2fe;
    color: #075985;
}

.avatar--violet {
    background: #ede9fe;
    color: #5b21b6;
}

.avatar--teal {
    background: #ccfbf1;
    color: #115e59;
}

.avatar--orange {
    background: #ffedd5;
    color: #9a3412;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack .avatar {
    border: 2px solid #fff;
    margin-left: -8px;
}

.avatar-stack .avatar:first-child {
    margin-left: 0;
}

.avatar-stack__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 29px;
    padding: 0 7px;
    margin-left: -6px;
    border-radius: 99px;
    border: 2px solid #fff;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 700;
}

/* ---------- Forms ---------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
    margin-bottom: 17px;
    min-width: 0;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-2);
}

.form-label__optional {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
}

.form-label__required {
    color: var(--red);
}

.form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-3);
}

.form-error {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--red);
}

.input,
.select,
.textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: #c3ccdd;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.13);
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
    border-color: #fca5a5;
}

.input.is-invalid:focus,
.select.is-invalid:focus,
.textarea.is-invalid:focus {
    box-shadow: 0 0 0 3.5px rgba(220, 38, 38, 0.12);
}

.textarea {
    min-height: 112px;
    resize: vertical;
    line-height: 1.55;
}

.select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
}

.checkbox input {
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    flex: 0 0 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox__text {
    line-height: 1.45;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.form-actions--between {
    justify-content: space-between;
}

/* File upload */

.file-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
    color: var(--text-3);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover {
    border-color: #a5b4fc;
    background: #f5f7ff;
}

.file-drop svg {
    color: var(--text-3);
}

.file-drop strong {
    color: var(--text-2);
    font-weight: 650;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop__selected {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.45;
    animation: alert-in 0.25s ease;
}

@keyframes alert-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert svg {
    flex: 0 0 18px;
    margin-top: 1px;
}

.alert__content {
    flex: 1;
    min-width: 0;
}

.alert__title {
    font-weight: 700;
    margin-bottom: 2px;
}

.alert--success {
    background: var(--green-soft);
    border-color: #a7f3d0;
    color: #046c4e;
}

.alert--error {
    background: var(--red-soft);
    border-color: #fecaca;
    color: #991b1b;
}

.alert--warning {
    background: var(--amber-soft);
    border-color: #fde68a;
    color: #92400e;
}

.alert--info {
    background: var(--blue-soft);
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert ul {
    margin: 4px 0 0;
    padding-left: 17px;
    list-style: disc;
}

/* ---------- Dropdown ---------- */

.dropdown {
    position: relative;
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 80;
    min-width: 224px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.dropdown.is-open .dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
}

.dropdown__item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.dropdown__item svg {
    color: var(--text-3);
}

.dropdown__item--danger {
    color: var(--red);
}

.dropdown__item--danger svg {
    color: var(--red);
}

.dropdown__item--danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

.dropdown__divider {
    height: 1px;
    margin: 5px 4px;
    background: var(--border);
}

.dropdown__menu--wide {
    width: min(360px, calc(100vw - 32px));
    padding: 0;
}

.dropdown__footer {
    padding: 8px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.dropdown__footer a {
    font-size: 12.5px;
    font-weight: 600;
}

/* Notifications inside dropdown */

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-form {
    display: block;
    width: 100%;
}

.notif {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: 10px;
    transition: background 0.12s ease;
}

.notif:hover {
    background: var(--surface-2);
}

.notif.is-unread {
    background: #f6f7ff;
}

.notif.is-unread:hover {
    background: #eef1ff;
}

.notif__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
}

.notif__icon--green {
    background: var(--green-soft);
    color: var(--green);
}

.notif__icon--red {
    background: var(--red-soft);
    color: var(--red);
}

.notif__icon--amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.notif__icon--blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.notif__icon--violet {
    background: var(--violet-soft);
    color: var(--violet);
}

.notif__icon--orange {
    background: var(--orange-soft);
    color: var(--orange);
}

.notif__body {
    flex: 1;
    min-width: 0;
}

.notif__title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
}

.notif__text {
    font-size: 12.5px;
    color: var(--text-2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif__time {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

.notif__dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--primary);
}

/* ---------- Tabs ---------- */

.tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-3);
    overflow-x: auto;
    max-width: 100%;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.tab__count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.tab.is-active .tab__count {
    background: var(--primary-soft);
    color: var(--primary);
}

.tab__count--danger {
    background: var(--red-soft);
    color: var(--red);
}

/* ---------- Filters bar ---------- */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.filter-bar .input,
.filter-bar .select {
    width: auto;
    min-width: 148px;
    height: 38px;
    min-height: 38px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 13px;
}

.filter-bar .input--search {
    min-width: 210px;
}

.filters-mobile-toggle {
    display: none;
}

/* ---------- Tables ---------- */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background 0.12s ease;
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

.data-table__user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.data-table__name {
    font-weight: 650;
    color: var(--text);
    line-height: 1.3;
}

.data-table__sub {
    font-size: 12px;
    color: var(--text-3);
}

.data-table__actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.cell-nowrap {
    white-space: nowrap;
}

/* ---------- Task rows / lists ---------- */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.task-row:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-sm);
}

.task-row--overdue {
    box-shadow: inset 3px 0 0 var(--red);
}

.task-row--done {
    opacity: 0.72;
}

.task-check {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    border: 1.8px solid var(--border-strong);
    border-radius: 50%;
    background: transparent;
    color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.task-check:hover {
    border-color: var(--green);
    color: var(--green);
}

.task-check.is-done {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.task-check:disabled {
    cursor: default;
}

.task-row__main {
    flex: 1;
    min-width: 0;
}

.task-row__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.8px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.task-row__title:hover {
    color: var(--primary);
}

.task-row__title.is-done {
    text-decoration: line-through;
    color: var(--text-3);
}

.task-row__meta {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-3);
}

.task-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-row__side {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.task-row__due {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.task-row__due--danger {
    color: var(--red);
}

.task-row__due--warning {
    color: var(--orange);
}

.task-row__due--muted {
    color: var(--text-3);
}

.task-row__project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 550;
}

.color-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--primary);
}

/* ---------- Progress ---------- */

.progress {
    position: relative;
    height: 7px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.35s ease;
}

.progress__bar--green {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress__bar--amber {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress--lg {
    height: 10px;
}

.progress-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-line .progress {
    flex: 1;
}

.progress-line__value {
    font-size: 12px;
    font-weight: 650;
    color: var(--text-2);
    min-width: 34px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Project cards ---------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #c7d2fe;
    color: var(--text);
}

.project-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.project-card__title {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.project-card__desc {
    font-size: 12.8px;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}

.project-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}

.project-card__manager {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 550;
    min-width: 0;
}

.project-card__manager span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Kanban board ---------- */

.board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
    min-height: 60vh;
}

.board__column {
    display: flex;
    flex-direction: column;
    flex: 1 0 288px;
    max-width: 340px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.board__column.drag-over {
    background: var(--primary-soft);
    border-color: #a5b4fc;
}

.board__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 15px 11px;
}

.board__title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.board__count {
    min-width: 21px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 19px;
}

.board__add {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
}

.board__add:hover {
    background: var(--surface);
    color: var(--primary);
}

.board__body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 11px 12px;
    min-height: 80px;
}

.task-card {
    display: block;
    padding: 12px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    color: var(--text);
    cursor: grab;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.task-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.is-dragging {
    opacity: 0.45;
}

.task-card__title {
    font-size: 13.3px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.task-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-3);
}

.task-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--surface-3);
}

.task-card__project {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 70%;
    font-size: 11.5px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card__progress {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
}

/* ---------- Detail layout (task/project) ---------- */

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.detail-main,
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.detail-side {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
}

.task-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.task-head__badges {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.task-head__title {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.task-head__title--done {
    color: var(--text-3);
    text-decoration: line-through;
}

.task-head__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-3);
}

.task-head__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.task-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.task-description {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.65;
    white-space: pre-line;
    word-break: break-word;
}

.meta-list {
    display: flex;
    flex-direction: column;
}

.meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.meta-row:last-child {
    border-bottom: 0;
}

.meta-row__label {
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.meta-row__value {
    text-align: right;
    font-weight: 600;
    color: var(--text);
    min-width: 0;
}

.meta-row__value a {
    color: inherit;
}

.meta-row__value a:hover {
    color: var(--primary);
}

.meta-row__value--muted {
    color: var(--text-3);
    font-weight: 500;
}

.meta-row__value--danger {
    color: var(--red);
}

/* Subtasks */

.subtask {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.subtask:last-child {
    border-bottom: 0;
}

.subtask__main {
    flex: 1;
    min-width: 0;
}

.subtask__title {
    font-size: 13.5px;
    font-weight: 600;
}

.subtask__title--done {
    color: var(--text-3);
    text-decoration: line-through;
}

.subtask__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-3);
}

/* Reports */

.report {
    position: relative;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 12px;
}

.report:last-child {
    margin-bottom: 0;
}

.report--pending {
    border-left: 3px solid #f59e0b;
}

.report--approved {
    border-left: 3px solid var(--green);
}

.report--rejected {
    border-left: 3px solid var(--red);
}

.report__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.report__author {
    display: flex;
    align-items: center;
    gap: 9px;
}

.report__author-name {
    font-size: 13px;
    font-weight: 650;
}

.report__time {
    font-size: 11.5px;
    color: var(--text-3);
}

.report__body {
    font-size: 13.5px;
    color: var(--text-2);
    white-space: pre-line;
    line-height: 1.6;
}

.report__review {
    margin-top: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
}

.report__review strong {
    color: var(--text);
}

.report__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.report__files {
    margin-top: 10px;
}

/* Comments */

.comment {
    display: flex;
    gap: 11px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-child {
    border-bottom: 0;
}

.comment__main {
    flex: 1;
    min-width: 0;
}

.comment__head {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.comment__author {
    font-size: 13px;
    font-weight: 700;
}

.comment__time {
    font-size: 11.5px;
    color: var(--text-3);
}

.comment__badge {
    padding: 0 6px;
    border-radius: 5px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comment__body {
    font-size: 13.5px;
    color: var(--text-2);
    white-space: pre-line;
    word-break: break-word;
    line-height: 1.6;
}

.comment__actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.comment__action {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 11.5px;
    color: var(--text-3);
    font-weight: 600;
}

.comment__action:hover {
    color: var(--red);
}

.comment-form {
    display: flex;
    gap: 11px;
    padding-top: 16px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
}

.comment-form__main {
    flex: 1;
    min-width: 0;
}

/* ---------- Files ---------- */

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-item:hover {
    border-color: #c7d2fe;
    background: var(--surface-2);
}

.file-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
}

.file-icon--pdf {
    background: var(--red-soft);
    color: var(--red);
}

.file-icon--doc {
    background: var(--blue-soft);
    color: var(--blue);
}

.file-icon--sheet {
    background: var(--green-soft);
    color: var(--green);
}

.file-icon--archive {
    background: var(--amber-soft);
    color: var(--amber);
}

.file-icon--image {
    background: var(--violet-soft);
    color: var(--violet);
}

.file-item__main {
    flex: 1;
    min-width: 0;
}

.file-item__name {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item__meta {
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item__actions {
    display: flex;
    gap: 2px;
}

.file-action {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-3);
}

.file-action:hover {
    background: var(--surface-3);
    color: var(--primary);
}

.file-action--danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

.file-preview {
    display: block;
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 320px;
}

.file-preview img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Activity feed ---------- */

.activity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
}

.activity__item:last-child {
    border-bottom: 0;
}

.activity__icon {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    border-radius: 8px;
    background: var(--slate-soft);
    color: var(--text-3);
}

.activity__icon--green {
    background: var(--green-soft);
    color: var(--green);
}

.activity__icon--red {
    background: var(--red-soft);
    color: var(--red);
}

.activity__icon--amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.activity__icon--blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.activity__icon--violet {
    background: var(--violet-soft);
    color: var(--violet);
}

.activity__body {
    flex: 1;
    min-width: 0;
}

.activity__text {
    font-size: 12.8px;
    color: var(--text-2);
    line-height: 1.45;
}

.activity__text strong {
    color: var(--text);
    font-weight: 650;
}

.activity__time {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px;
}

/* ---------- Empty state ---------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 46px 20px;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-3);
}

.empty__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.empty__text {
    max-width: 360px;
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-3);
}

.empty__action {
    margin-top: 16px;
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: transparent;
}

.pagination__item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.pagination__item.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

.pagination__item.is-disabled {
    color: var(--text-3);
    pointer-events: none;
    opacity: 0.6;
}

.pagination__dots {
    padding: 0 4px;
    color: var(--text-3);
}

.pagination__info {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
}

/* ---------- Modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(9, 14, 27, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal__dialog {
    width: min(540px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.18s ease;
}

.modal.is-open .modal__dialog {
    transform: translateY(0) scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}

.modal__title {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.modal__body {
    padding: 16px 22px 20px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 16px 22px 20px;
    border-top: 1px solid var(--border);
}

.modal__close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-3);
}

.modal__close:hover {
    background: var(--surface-3);
    color: var(--text);
}

/* ---------- Auth pages ---------- */

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(800px 480px at 90% 92%, rgba(249, 115, 22, 0.12), transparent 55%),
        linear-gradient(160deg, #f7f8fc 0%, #eef1f8 100%);
}

.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 18px;
}

.auth__card {
    width: min(432px, 100%);
    padding: 34px 34px 30px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.auth__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.auth__logo {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7 55%, #f97316);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.auth__brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.auth__brand-sub {
    font-size: 11.5px;
    color: var(--text-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.auth__title {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.02em;
    margin-bottom: 5px;
}

.auth__subtitle {
    font-size: 13.5px;
    color: var(--text-3);
    margin-bottom: 22px;
}

.auth__footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-3);
    text-align: center;
}

.auth__demo {
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.7;
}

.auth__demo strong {
    color: var(--text-2);
    font-weight: 650;
}

.auth__demo code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-2);
}

/* ---------- Misc ---------- */

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title__text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-title__link {
    font-size: 12.5px;
    font-weight: 600;
}

.divider {
    height: 1px;
    margin: 16px 0;
    background: var(--border);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack--sm {
    gap: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.list-plain {
    display: flex;
    flex-direction: column;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row__main {
    flex: 1;
    min-width: 0;
}

.list-row__title {
    font-size: 13.3px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row__title:hover {
    color: var(--primary);
}

.list-row__meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: 11.8px;
    color: var(--text-3);
}

.list-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.workload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.workload-row:last-child {
    border-bottom: 0;
}

.workload-row__main {
    flex: 1;
    min-width: 0;
}

.workload-row__name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.8px;
    font-weight: 600;
    margin-bottom: 5px;
}

.workload-row__count {
    color: var(--text-3);
    font-weight: 600;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.workload-row__count--danger {
    color: var(--red);
}

.attention-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.attention-item:last-child {
    border-bottom: 0;
}

.attention-item__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: var(--red-soft);
    color: var(--red);
}

.attention-item__icon--amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.attention-item__main {
    flex: 1;
    min-width: 0;
}

.attention-item__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.attention-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-3);
}

/* Chart (analytics) */

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    height: 148px;
    padding: 10px 4px 0;
}

.chart-bars__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    min-width: 0;
}

.chart-bars__bar {
    width: 100%;
    max-width: 34px;
    min-height: 3px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, #818cf8, #4f46e5);
    transition: height 0.4s ease;
}

.chart-bars__bar--empty {
    background: var(--surface-3);
}

.chart-bars__label {
    font-size: 9.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.donut {
    display: flex;
    align-items: center;
    gap: 20px;
}

.donut__chart {
    position: relative;
    width: 132px;
    height: 132px;
    flex: 0 0 132px;
    border-radius: 50%;
}

.donut__center {
    position: absolute;
    inset: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    text-align: center;
}

.donut__value {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.donut__label {
    font-size: 10.5px;
    color: var(--text-3);
}

.donut__legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    min-width: 0;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-2);
}

.legend-row__dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 3px;
}

.legend-row__value {
    margin-left: auto;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* Notification page item */

.notification-page-item {
    display: flex;
    gap: 13px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.notification-page-item.is-unread {
    background: #f7f8ff;
}

.notification-page-item__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
}

.notification-page-item__body {
    flex: 1;
    min-width: 0;
}

.notification-page-item__title {
    font-size: 13.5px;
    font-weight: 700;
}

.notification-page-item__text {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 1px;
}

.notification-page-item__time {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 3px;
}

/* Auth split hero (optional) */

.text-muted {
    color: var(--text-3);
}

.text-2 {
    color: var(--text-2);
}

.text-danger {
    color: var(--red);
}

.text-success {
    color: var(--green);
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.small {
    font-size: 12px;
}

.tiny {
    font-size: 11px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-5 {
    gap: 20px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-5 {
    margin-top: 20px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 20px;
}

.ml-auto {
    margin-left: auto;
}

.hidden {
    display: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
    .detail-grid {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 1100px) {
    .detail-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }

    .form-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar__close {
        display: grid;
        place-items: center;
    }

    .sidebar-backdrop.is-open {
        display: block;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 0 18px;
    }

    .topbar__menu {
        display: grid;
        place-items: center;
    }

    .content {
        padding: 22px 18px 48px;
    }
}

@media (max-width: 760px) {
    .breadcrumbs {
        display: none;
    }

    .topbar {
        height: 60px;
        gap: 10px;
        padding: 0 14px;
    }

    .topbar__search {
        max-width: none;
    }

    .topbar__avatar-name {
        display: none;
    }

    .content {
        padding: 18px 14px 42px;
    }

    .page-header__title {
        font-size: 20px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 13px 14px;
        gap: 10px;
    }

    .stat-card__icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 10px;
    }

    .stat-card__value {
        font-size: 21px;
    }

    .stat-card__hint {
        display: none;
    }

    .form-grid,
    .form-grid--3 {
        grid-template-columns: 1fr;
    }

    .task-row {
        padding: 11px 12px;
        flex-wrap: wrap;
    }

    .task-row__side {
        width: 100%;
        justify-content: space-between;
        padding-left: 33px;
        margin-top: 2px;
    }

    .task-row__meta {
        gap: 8px;
    }

    .task-row__meta .hide-sm {
        display: none;
    }

    .comment-form {
        flex-direction: column;
    }

    .data-table {
        min-width: 560px;
    }

    .board__column {
        flex-basis: 84vw;
        max-width: 84vw;
        scroll-snap-align: start;
    }

    .board {
        scroll-snap-type: x mandatory;
    }

    .filter-bar {
        width: 100%;
        padding-top: 4px;
    }

    .filter-panel {
        display: none;
    }

    .filter-panel.is-open {
        display: block;
    }

    .filters-mobile-toggle {
        display: inline-flex;
    }

    .detail-side {
        order: 2;
    }

    .breadcrumbs {
        margin-bottom: 7px;
    }

    .auth__card {
        padding: 26px 22px 24px;
    }

    .chart-bars {
        height: 120px;
        gap: 4px;
    }

    .donut {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}

@media (max-width: 520px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        align-items: center;
    }

    .stat-card__value {
        font-size: 19px;
    }

    .page-header__actions {
        width: 100%;
    }

    .page-header__actions .btn {
        flex: 1;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }

    .tab {
        flex: 0 0 auto;
        gap: 5px;
        padding: 6px 8px;
        font-size: 11.5px;
    }

    .tab__count {
        min-width: 18px;
        padding: 0 5px;
        font-size: 10px;
    }

    .modal__dialog {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Toasts ---------- */

.toast-stack {
    position: fixed;
    top: calc(var(--topbar-h) + 14px);
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(360px, calc(100vw - 28px));
}

.toast-stack .alert {
    margin: 0;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ---------- Kanban empty placeholder ---------- */

.board__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 10px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-3);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 760px) {
    .toast-stack {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}

/* ---------- Color picker ---------- */

.color-picker {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.color-picker input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.color-picker label {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--border-strong);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.color-picker label:hover {
    transform: scale(1.08);
}

.color-picker input[type="radio"]:checked + label {
    box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px var(--primary-soft);
}

.color-picker input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- Member picker ---------- */

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.member-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.member-option:hover {
    border-color: #c7d2fe;
    background: var(--surface-2);
}

.member-option:has(input:checked) {
    border-color: #a5b4fc;
    background: #f5f7ff;
}

.member-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.member-option__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.member-option__name {
    font-size: 12.8px;
    font-weight: 650;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-option__role {
    font-size: 11px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-option .badge {
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    .member-grid {
        grid-template-columns: 1fr;
    }
}
