:root {
    color-scheme: light;
    --bg: #f3f1f8;
    --bg-dark: #060517;
    --surface: #ffffff;
    --text: #060517;
    --muted: rgba(6, 5, 23, 0.6);
    --primary: #CC0083;
    --primary-dark: #a80069;
    --primary-glow: rgba(204, 0, 131, 0.35);
    --danger: #dc2626;
    --success: #15803d;
    --border: rgba(6, 5, 23, 0.08);
    --shadow: 0 4px 24px rgba(6, 5, 23, 0.06);
    --shadow-lg: 0 12px 40px rgba(6, 5, 23, 0.1);
    --radius: 20px;
    --radius-sm: 12px;
    --padding-x: clamp(1.25rem, 4vw, 2.5rem);
    --padding-y: clamp(1.25rem, 3vw, 2rem);
    --topbar-height: 76px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: "Rubik", sans-serif;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
}

body.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.app--auth {
    background: linear-gradient(145deg, #fdf8fc 0%, #f8f0f8 35%, #f3eef9 70%, #faf5f9 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ── Logo ── */
.brand-logo {
    display: block;
    height: 36px;
    width: auto;
}

.brand-logo--large {
    height: 52px;
    margin: 0 auto 1.5rem;
}

/* ── Topbar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: var(--topbar-height);
    padding: 0 var(--padding-x);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar__brand a {
    display: inline-flex;
    align-items: center;
}

.topbar__menu-btn {
    margin-left: auto;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.15s;
}

.icon-btn:hover {
    background: rgba(204, 0, 131, 0.08);
}

/* ── Drawer (native dialog) ── */
.drawer-dialog {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    width: min(320px, 88vw);
    max-width: min(320px, 88vw);
    height: 100%;
    max-height: none;
    background: transparent;
    overflow: visible;
}

.drawer-dialog::backdrop {
    background: rgba(6, 5, 23, 0.45);
}

.drawer-dialog .drawer__panel {
    position: static;
    width: 100%;
    height: 100%;
    transform: none;
    box-shadow: -8px 0 32px rgba(6, 5, 23, 0.12);
}

/* ── App dialogs ── */
.app-dialog {
    margin: auto;
    padding: 0;
    border: 0;
    width: min(560px, calc(100% - 2rem));
    max-width: min(560px, calc(100% - 2rem));
    background: transparent;
    overflow: visible;
}

.app-dialog::backdrop {
    background: rgba(6, 5, 23, 0.5);
}

.app-dialog .modal__panel {
    transform: none;
    opacity: 1;
}

/* Legacy drawer/modal rules removed — native dialog handles overlays */

.drawer__panel {
    width: min(320px, 88vw);
    height: 100%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.drawer__header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.drawer__link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.drawer__link:hover {
    background: rgba(204, 0, 131, 0.08);
    color: var(--primary);
}

.drawer__link--muted {
    color: var(--muted);
}

.drawer__footer {
    padding: 1rem 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer__user {
    color: var(--muted);
    font-size: 0.9rem;
}

body.dialog-open {
    overflow: hidden;
}

/* ── Auth / Liquid glass login ── */
.auth {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--padding-y) var(--padding-x);
    overflow: hidden;
}

.auth__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
    animation: orbFloat 12s ease-in-out infinite;
}

.auth__orb--1 {
    width: 480px;
    height: 480px;
    background: rgba(204, 0, 131, 0.18);
    top: -15%;
    left: -10%;
}

.auth__orb--2 {
    width: 400px;
    height: 400px;
    background: rgba(204, 0, 131, 0.12);
    bottom: -20%;
    right: -12%;
    animation-delay: -4s;
}

.auth__orb--3 {
    width: 320px;
    height: 320px;
    background: rgba(106, 0, 130, 0.08);
    top: 35%;
    right: 15%;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;
    box-shadow:
        0 4px 24px rgba(204, 0, 131, 0.06),
        0 16px 48px rgba(6, 5, 23, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.auth__title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth__subtitle {
    color: var(--muted);
    margin: 0 0 1.75rem;
    text-align: center;
    font-size: 0.95rem;
}

.form__field {
    display: grid;
    gap: 0.45rem;
}

.input-password {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password input {
    padding-right: 3rem;
}

.input-password__toggle {
    position: absolute;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.input-password__toggle:hover {
    background: rgba(204, 0, 131, 0.08);
}

.input-password__icon {
    display: block;
    width: 20px;
    height: 20px;
}

.input-password__icon--hide {
    display: none;
}

.input-password__icon[hidden] {
    display: none !important;
}

body.app--auth .form label {
    color: var(--text);
}

body.app--auth input:not(.input-password input) {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(6, 5, 23, 0.1);
}

body.app--auth .input-password input {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(6, 5, 23, 0.1);
}

body.app--auth .alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

body.app--auth .alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

body.app--auth .alert a {
    color: var(--primary);
}

body.app--auth .alert--success a {
    color: #047857;
}

/* ── Page layout ── */
.page {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--padding-y) var(--padding-x);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.page--board {
    max-width: 1400px;
    min-height: calc(100vh - var(--topbar-height));
    padding-bottom: 0;
}

.page__header {
    margin-bottom: 0;
}

.page__header h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page__header p {
    margin: 0;
    color: var(--muted);
}

.page__back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

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

.page__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page__toolbar h1,
.page__toolbar h2 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
}

.page__toolbar p {
    margin: 0;
    color: var(--muted);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.tabs__list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.tabs__tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
}

.tabs__tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tabs__tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tabs__panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.tabs__panel[hidden] {
    display: none !important;
}

/* ── Modal panels ── */
.modal__panel {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal__header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.modal__body {
    display: grid;
    gap: 1rem;
}

.task-detail__meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.task-detail__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.task-detail__status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--status-color);
}

.task-detail__desc h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.task-detail__desc p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card--flat {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.card--hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(204, 0, 131, 0.2);
}

.card__title {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.area-card {
    display: block;
    text-decoration: none;
    color: var(--text);
}

.area-card h2 {
    margin: 1rem 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.area-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.area-card__dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(6, 5, 23, 0.04);
}

.section--compact {
    flex-shrink: 0;
}

/* ── Forms ── */
.form {
    display: grid;
    gap: 1rem;
}

.form--inline {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
    align-items: end;
}

.form--grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form__full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

input,
select,
textarea,
button {
    font-family: "Rubik", sans-serif;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(204, 0, 131, 0.4);
    box-shadow: 0 0 0 3px rgba(204, 0, 131, 0.12);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

/* ── Buttons ── */
.btn {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn--glow {
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn--glow:hover {
    box-shadow: 0 6px 28px var(--primary-glow);
}

.btn--ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.alert--error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert--success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.alert a {
    color: var(--primary);
    font-weight: 600;
}

.alert--success a {
    color: #047857;
}

/* ── Kanban ── */
.board-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding-bottom: var(--padding-y);
}

.kanban__column {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid rgba(6, 5, 23, 0.06);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.35);
}

.kanban__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem 0.75rem;
    flex-shrink: 0;
}

.kanban__header h2 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.kanban__header span,
.kanban__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--status-color, #94a3b8) 14%, white);
    border: 1px solid color-mix(in srgb, var(--status-color, #94a3b8) 28%, white);
    color: var(--status-color, #94a3b8);
}

.page__toolbar-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.page__toolbar-title h2 {
    margin: 0;
}

.user-filter {
    position: relative;
}

.user-filter__btn img {
    display: block;
}

.user-filter__menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 40;
    min-width: 12rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(6, 5, 23, 0.14);
}

.user-filter__option {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.user-filter__option:hover,
.user-filter__option.is-active {
    background: rgba(204, 0, 131, 0.08);
    color: var(--primary-dark);
}

.task-card.is-filtered-out {
    display: none !important;
}

.board-list__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.board-list__delete-form {
    margin: 0;
}

.board-list__delete {
    color: var(--danger);
}

.kanban__cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.task-card {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

.task-card:hover {
    border-color: rgba(204, 0, 131, 0.25);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.task-card:focus-visible {
    outline: 2px solid rgba(204, 0, 131, 0.35);
    outline-offset: 2px;
}

.task-card__top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.task-card__status-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: var(--status-color, #94a3b8);
}

.task-card__title {
    margin: 0;
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.task-card__menu {
    position: relative;
    flex-shrink: 0;
}

.task-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--badge-color, var(--primary));
}

.badge--neutral {
    color: var(--text);
    background: rgba(6, 5, 23, 0.06);
    border: 1px solid var(--border);
}

.task-card__desc-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.task-card--overdue {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), var(--shadow);
}

.task-card--overdue:hover {
    border-color: rgba(239, 68, 68, 0.45);
}

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

.task-card__due--overdue strong {
    color: #dc2626;
}

.task-card__desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.45;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Slide drawer (task detail) ── */
.slide-drawer {
    position: fixed;
    inset: 0;
    z-index: 260;
    pointer-events: none;
    visibility: hidden;
}

.slide-drawer.is-open,
.slide-drawer.is-closing {
    pointer-events: auto;
    visibility: visible;
}

.slide-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 5, 23, 0.45);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.slide-drawer.is-open .slide-drawer__backdrop {
    opacity: 1;
}

.slide-drawer.is-closing .slide-drawer__backdrop {
    opacity: 0;
}

.slide-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(560px, 94vw);
    height: 100%;
    background: var(--surface);
    box-shadow: -10px 0 40px rgba(6, 5, 23, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.slide-drawer.is-open .slide-drawer__panel {
    transform: translateX(0);
}

.slide-drawer.is-closing .slide-drawer__panel {
    transform: translateX(100%);
}

body.slide-drawer-open {
    overflow: hidden;
}

.task-drawer {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.task-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.task-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem 2rem;
}

.task-drawer__content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.task-drawer__block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-drawer__block--pills {
    gap: 0;
}

.task-drawer__loading {
    padding: 2rem 1rem;
    color: var(--muted);
    text-align: center;
}

.task-drawer__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.task-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.pill-dropdown {
    position: relative;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.1rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.pill--status {
    border: 1px solid var(--pill-color, #94a3b8);
    background: color-mix(in srgb, var(--pill-color, #94a3b8) 12%, white);
    color: var(--text);
}

.pill--status:hover,
.pill-dropdown.is-open .pill--status {
    background: color-mix(in srgb, var(--pill-color, #94a3b8) 18%, white);
}

.pill--category {
    border: 1px solid var(--text);
    background: rgba(6, 5, 23, 0.04);
    color: var(--text);
}

.pill--category:hover,
.pill-dropdown.is-open .pill--category {
    background: rgba(6, 5, 23, 0.08);
}

.pill--assignee {
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
}

.pill--assignee:hover,
.pill-dropdown.is-open .pill--assignee {
    background: rgba(6, 5, 23, 0.03);
}

.pill-dropdown__menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 30;
    min-width: 11.5rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(6, 5, 23, 0.14);
}

.pill-dropdown__option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.pill-dropdown__option:hover {
    background: rgba(6, 5, 23, 0.05);
}

.pill-dropdown__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--option-color, #94a3b8);
    flex-shrink: 0;
}

.pill-dropdown__option--category {
    font-weight: 600;
}

.task-drawer__title-label {
    display: block;
}

.task-drawer__title {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    font-weight: 700;
    color: var(--text);
    padding: 0;
    line-height: 1.2;
}

.task-drawer__title:focus {
    outline: none;
}

.task-drawer__block--meta {
    gap: 0.45rem;
}

.task-drawer__meta-line {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
}

.task-drawer__meta-line strong {
    color: var(--text);
    font-weight: 600;
}

.task-drawer__due {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
}

.task-drawer__due-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#task-due-label {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(6, 5, 23, 0.18);
    text-underline-offset: 0.15em;
}

.task-drawer__section h3 {
    margin: 0;
    font-size: 0.95rem;
}

.task-drawer__section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.task-drawer__section-head h3 {
    margin: 0;
}

.task-drawer__upload {
    cursor: pointer;
}

.rich-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.rich-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(6, 5, 23, 0.02);
}

.rich-editor__toolbar button {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--text);
}

.rich-editor__toolbar button:hover {
    background: rgba(204, 0, 131, 0.08);
}

.rich-editor__sep {
    width: 1px;
    height: 1.5rem;
    background: var(--border);
    margin: 0 0.15rem;
    align-self: center;
}

.rich-editor__area {
    min-height: 180px;
    padding: 0.85rem 1rem;
    line-height: 1.55;
    font-size: 0.95rem;
}

.rich-editor__area:focus {
    outline: none;
}

.rich-editor__area a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.rich-editor__area a:hover {
    color: var(--primary-dark, #a00068);
}

.attachment-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
}

.attachment-gallery__empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.attachment-gallery__item {
    position: relative;
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
}

.attachment-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-gallery__preview {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.attachment-gallery__preview img {
    pointer-events: none;
}

.attachment-gallery__remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(6, 5, 23, 0.65);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.task-comments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-comments__empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.task-comments__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
}

.task-comments__item--activity .task-comments__meta {
    color: var(--muted);
}

.task-comments__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(6, 5, 23, 0.08);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.task-comments__avatar--alt {
    background: #fff;
    border: 2px solid rgba(6, 5, 23, 0.18);
}

.task-comments__meta {
    margin: 0 0 0.35rem;
    font-size: 0.84rem;
    color: var(--muted);
}

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

.task-comments__text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
}

.task-comments__text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.task-comments__text a:hover {
    color: var(--primary-dark, #a00068);
}

.task-comments__form {
    display: grid;
    gap: 0.75rem;
}

.task-comments__input {
    width: 100%;
    min-height: 5.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    resize: vertical;
}

.task-comments__input:focus {
    outline: none;
    border-color: rgba(204, 0, 131, 0.35);
}

.task-comments__actions {
    display: flex;
    justify-content: flex-end;
}

.dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    overflow: hidden;
}

.dropdown button,
.dropdown form button {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
}

.dropdown button:hover,
.dropdown form button:hover {
    background: rgba(204, 0, 131, 0.06);
}

.dropdown__danger {
    color: var(--danger);
}

.dropdown form {
    margin: 0;
}

/* ── Table ── */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tbody tr:hover {
    background: rgba(6, 5, 23, 0.02);
}

.table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.table__inline-form {
    display: inline;
    margin: 0;
}

.table__self-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.board-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.board-list__empty {
    margin: 0;
    color: var(--muted);
}

.board-list__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.board-list__item:last-child {
    border-bottom: 0;
}

.board-list__swatch {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(6, 5, 23, 0.08);
}

.board-list__name {
    font-weight: 600;
    color: var(--text);
}

.board-list__edit img {
    display: block;
}

.account-card__meta {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.account-card__meta div {
    display: grid;
    gap: 0.25rem;
}

.account-card__meta dt {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.account-card__meta dd {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.account-card__hint {
    margin: -0.35rem 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.account-card__form {
    max-width: 28rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .kanban {
        grid-template-columns: repeat(4, minmax(220px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 1rem var(--padding-x);
        min-height: auto;
    }

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

    .glass-card {
        padding: 2rem 1.5rem;
    }

    .page--board {
        min-height: auto;
    }

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

    .task-pills {
        gap: 0.5rem;
    }
}

.image-lightbox {
    width: min(96vw, 1200px);
    max-width: min(96vw, 1200px);
    padding: 0;
    border: 0;
    background: transparent;
}

.image-lightbox::backdrop {
    background: rgba(6, 5, 23, 0.82);
}

.image-lightbox__panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 90vh;
}

.image-lightbox__panel img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.image-lightbox__close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
