:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #69758a;
    --line: #dce4ef;
    --line-strong: #c5d0df;
    --primary: #2563eb;
    --primary-dark: #1e4fc1;
    --accent: #0f766e;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #15803d;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

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

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0.76rem 0.85rem;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

label {
    display: grid;
    gap: 0.42rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

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

th,
td {
    padding: 0.95rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

td small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    line-height: 1.35;
}

.login-body {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(315deg, rgba(15, 118, 110, 0.13), transparent 35%),
        #f6f8fb;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(100%, 430px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(197, 208, 223, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-brand h1 {
    margin: 0;
    font-size: 2rem;
}

.login-brand p,
.login-hint {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.login-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    color: #e8eef8;
    background: #162033;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.35rem;
}

.brand strong,
.mini-profile strong {
    display: block;
}

.brand small,
.mini-profile small {
    display: block;
    max-width: 180px;
    overflow: hidden;
    color: #aebbd0;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius);
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 900;
}

.brand-mark.large {
    width: 56px;
    height: 56px;
}

.sidebar-nav {
    display: grid;
    gap: 0.28rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    border-radius: var(--radius);
    padding: 0.7rem 0.8rem;
    color: #c8d4e6;
    font-weight: 750;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-count {
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    background: var(--danger);
    font-size: 0.72rem;
}

.sidebar-footer {
    display: grid;
    gap: 0.85rem;
    margin-top: auto;
}

.mini-profile,
.person-row,
.comment-head {
    display: flex;
    align-items: center;
    gap: 0.72rem;
}

.person-row {
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0;
}

.person-row.tight {
    justify-content: flex-start;
    border-bottom: 0;
    padding: 0;
}

.person-row > div {
    min-width: 0;
    flex: 1;
}

.person-row small,
.comment-head small {
    display: block;
    color: var(--muted);
}

.avatar {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    color: #123;
    background: #dbeafe;
    font-size: 0.82rem;
    font-weight: 900;
}

.main-panel {
    min-width: 0;
    padding: 1.5rem;
}

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

.topbar h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2vw, 2.25rem);
}

.topbar-actions,
.button-group,
.quick-actions,
.badge-row,
.form-actions,
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.topbar-actions {
    flex-wrap: nowrap;
}

.eyebrow {
    margin: 0 0 0.25rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
}

.bell-shape {
    width: 15px;
    height: 18px;
    border: 2px solid var(--text);
    border-radius: 9px 9px 5px 5px;
    position: relative;
}

.bell-shape::after {
    content: "";
    width: 8px;
    height: 2px;
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: var(--text);
}

.bell-dot {
    width: 9px;
    height: 9px;
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 999px;
    background: var(--danger);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    z-index: 40;
    top: 0.85rem;
    left: 0.85rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.12);
}

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
}

.panel,
.stat-card,
.assistant-hero,
.note-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.04);
}

.panel {
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.panel-header h2,
.detail-header h2,
.assistant-hero h2 {
    margin: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    padding: 1rem;
    border-left: 4px solid var(--primary);
}

.stat-card span {
    color: var(--muted);
    font-weight: 750;
}

.stat-card strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 2rem;
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card.info {
    border-left-color: var(--accent);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

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

.content-grid.uneven {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
}

.assistant-hero,
.detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.detail-header {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
}

.detail-header p {
    max-width: 850px;
    margin-bottom: 0;
    color: var(--muted);
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0.62rem 0.9rem;
    color: var(--text);
    background: white;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
}

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

.button.primary {
    border-color: var(--primary);
    color: white;
    background: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.ghost {
    background: transparent;
}

.button.danger {
    border-color: rgba(220, 38, 38, 0.25);
    color: #991b1b;
    background: #fee2e2;
}

.button.small {
    min-height: 34px;
    padding: 0.48rem 0.7rem;
    font-size: 0.86rem;
}

.button.full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    color: #3b4658;
    background: #eef2f7;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-completed,
.priority-low,
.status-approved {
    color: #166534;
    background: #dcfce7;
}

.status-pending,
.priority-medium {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-not_completed,
.priority-high,
.status-removed {
    color: #9a3412;
    background: #ffedd5;
}

.status-needs_review,
.priority-urgent {
    color: #991b1b;
    background: #fee2e2;
}

.status-missed {
    color: #7f1d1d;
    background: #fecaca;
}

.priority-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
}

.priority-dot.priority-low {
    background: var(--success);
}

.priority-dot.priority-medium {
    background: var(--primary);
}

.priority-dot.priority-high {
    background: var(--warning);
}

.priority-dot.priority-urgent {
    background: var(--danger);
}

.toolbar {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-stack.compact {
    gap: 0.8rem;
}

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

.span-2 {
    grid-column: span 2;
}

.wide-form {
    max-width: 1080px;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}

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

.strong-link {
    color: var(--primary);
    font-weight: 900;
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

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

.task-list,
.list-stack,
.activity-feed,
.notification-list,
.comment-list {
    display: grid;
    gap: 0.75rem;
}

.task-row,
.notification-row,
.notification-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.8rem;
    background: #fbfdff;
}

.task-row > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.task-row small,
.notification-row span {
    display: block;
    margin-top: 0.22rem;
    color: var(--muted);
}

.notification-row.unread,
.notification-card.unread {
    border-color: rgba(37, 99, 235, 0.28);
    background: #eff6ff;
}

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

.notification-card p {
    margin: 0.35rem 0;
    color: var(--muted);
}

.notification-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.activity-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 0.75rem;
}

.activity-item > span {
    width: 10px;
    height: 10px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: var(--primary);
}

.activity-item p {
    margin: 0.2rem 0;
    color: var(--muted);
}

.activity-item small {
    color: var(--muted);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 0;
}

.meta-grid div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.8rem;
    background: #fbfdff;
}

.meta-grid dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.meta-grid dd {
    margin: 0.25rem 0 0;
    font-weight: 800;
}

.note-box {
    margin-top: 1rem;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.8rem;
    background: #ecfeff;
}

.note-box p {
    margin-bottom: 0;
}

.link-list {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.comment {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem;
    background: #fbfdff;
}

.comment p,
.note-card p {
    margin: 0.8rem 0 0;
    line-height: 1.55;
}

.comment-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.comment-form .button {
    justify-self: end;
}

.strike-row {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.75rem;
}

.alert {
    border-radius: var(--radius);
    padding: 0.78rem;
    margin-bottom: 1rem;
    font-weight: 750;
}

.alert.danger {
    color: #991b1b;
    background: #fee2e2;
}

.mention {
    color: var(--primary);
    font-weight: 900;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.note-card {
    padding: 1rem;
}

.note-card form {
    margin-top: 1rem;
}

[hidden] {
    display: none !important;
}

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

    .content-grid.two,
    .content-grid.uneven,
    .note-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        left: 0;
        top: 0;
        width: min(82vw, 300px);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
        box-shadow: 20px 0 45px rgba(0, 0, 0, 0.24);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-panel {
        padding: 5rem 1rem 1rem;
    }

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

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

    .assistant-hero,
    .detail-header,
    .notification-card {
        align-items: stretch;
        flex-direction: column;
    }

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

    .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 560px) {
    .main-panel {
        padding-inline: 0.75rem;
    }

    .topbar-actions .avatar {
        display: none;
    }

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

    .toolbar,
    .inline-form,
    .quick-actions,
    .button-group {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .toolbar .button,
    .quick-actions .button,
    .button-group .button,
    .button-group form {
        width: 100%;
    }

    th,
    td {
        padding: 0.78rem;
    }
}

/* ClickUp-style compact refinement pass */
body {
    background:
        radial-gradient(circle at 30% 0%, rgba(37, 99, 235, 0.08), transparent 32%),
        linear-gradient(180deg, #e8eef6 0%, #eef3f8 48%, #e9f3f1 100%);
}

.sidebar-nav .nav-divider {
    display: block;
    height: 1px;
    margin: 0.38rem 0.55rem;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
}

.nav-with-icon {
    gap: 0.52rem;
}

.nav-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
}

.task-icon {
    background: linear-gradient(135deg, #60a5fa, #2dd4bf);
}

.daily-icon {
    background: #22c55e;
}

.weekly-icon {
    background: #eab308;
}

.monthly-icon {
    background: #fb923c;
}

.space-icon,
.space-dot {
    border-radius: 5px;
    background: #60a5fa;
}

.folder-dot {
    width: 13px;
    height: 10px;
    margin-top: 2px;
    border-radius: 2px;
    background: #fbbf24;
    position: relative;
}

.folder-dot::before {
    content: "";
    width: 7px;
    height: 3px;
    position: absolute;
    top: -3px;
    left: 1px;
    border-radius: 2px 2px 0 0;
    background: #fde68a;
}

.nav-section {
    color: #f8fafc !important;
    font-size: 0.76rem !important;
    text-transform: uppercase;
}

.space-child {
    padding-left: 1.05rem !important;
}

.folder-child {
    padding-left: 1.75rem !important;
    font-size: 0.8rem !important;
}

.folder-child .lock-icon,
.space-child .lock-icon {
    width: 11px;
    height: 9px;
}

.folder-child .lock-icon::before,
.space-child .lock-icon::before {
    width: 6px;
    height: 5px;
    top: -7px;
}

.compact-toolbar {
    min-height: 54px;
    padding: 0.72rem;
}

.compact-filters label {
    min-width: 140px;
}

.compact-filters select,
.compact-filters input {
    min-height: 34px;
    padding: 0.42rem 0.55rem;
    font-size: 0.84rem;
}

.clickup-task-sections {
    gap: 0.9rem;
}

.task-section-head.compact {
    min-height: 32px;
    padding-inline: 0.15rem;
}

.task-section-head.compact h2 {
    color: #334155;
    font-size: 0.84rem;
    font-weight: 950;
    text-transform: uppercase;
}

.compact-list {
    gap: 0;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: var(--radius);
    overflow: visible;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(12px);
}

.task-card.task-row-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    min-height: 60px;
    border: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0;
    padding: 0.68rem 0.78rem;
    background: transparent;
    box-shadow: none;
}

.task-card.task-row-compact:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.task-card.task-row-compact:last-child {
    border-bottom: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

.task-card.task-row-compact:hover {
    transform: none;
    background: rgba(248, 250, 252, 0.92);
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.6);
}

.task-row-content {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.task-row-content .task-card-title {
    font-size: 0.94rem;
}

.task-row-content .task-card-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 0.82rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.task-row-content .task-meta-row {
    gap: 0.45rem;
    font-size: 0.76rem;
}

.quick-edit-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.38rem;
    min-width: 0;
}

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

.quick-chip,
.quick-popover summary {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 900;
    white-space: nowrap;
}

.quick-popover {
    position: relative;
}

.quick-popover summary {
    list-style: none;
}

.quick-popover summary::-webkit-details-marker {
    display: none;
}

.quick-menu {
    width: max-content;
    min-width: 190px;
    max-width: min(300px, calc(100vw - 2rem));
    position: absolute;
    z-index: 90;
    top: calc(100% + 0.45rem);
    right: 0;
    display: grid;
    gap: 0.28rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 10px;
    padding: 0.42rem;
    color: #e5edf7;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(18px);
}

.quick-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border: 0;
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    color: #e5edf7;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 0.84rem;
}

.quick-menu-item:hover,
.quick-menu-item.selected {
    background: rgba(255, 255, 255, 0.09);
}

.quick-menu-item .checkmark {
    opacity: 0;
    color: #93c5fd;
}

.quick-menu-item.selected .checkmark {
    opacity: 1;
}

.quick-menu label {
    color: #dbeafe;
}

.quick-menu input[type="date"],
.quick-menu input[type="time"],
.quick-menu input[type="search"] {
    min-height: 34px;
    border-color: rgba(148, 163, 184, 0.42);
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.date-menu {
    min-width: 220px;
}

.assignee-menu {
    min-width: 260px;
    max-height: 310px;
    overflow-y: auto;
}

.quick-save {
    min-height: 28px;
    padding: 0.36rem 0.58rem;
    font-size: 0.76rem;
}

.priority-badge.compact {
    min-height: 24px;
    min-width: 0;
    padding: 0.22rem 0.5rem;
    font-size: 0.7rem;
}

.status-completed,
.status-missed,
.status-pending,
.status-needs_review,
.status-not_completed,
.status-needs_more_time,
.status-extended {
    font-size: 0.72rem;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.72);
}

.glass-panel > .list-stack,
.glass-panel > .mini-task-list,
.glass-panel > .activity-feed,
.glass-panel .scroll-panel,
.notification-popover-list,
.comment-list,
.note-grid {
    scrollbar-width: none;
}

.glass-panel > .list-stack,
.glass-panel > .mini-task-list,
.glass-panel > .activity-feed {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.glass-panel > .activity-feed {
    max-height: 430px;
}

.glass-panel > .list-stack:hover,
.glass-panel > .mini-task-list:hover,
.glass-panel > .activity-feed:hover,
.glass-panel > .list-stack:focus-within,
.glass-panel > .mini-task-list:focus-within,
.glass-panel > .activity-feed:focus-within,
.notification-popover-list:hover,
.comment-list:hover,
.note-grid:hover {
    scrollbar-width: thin;
}

.glass-panel > .list-stack::-webkit-scrollbar,
.glass-panel > .mini-task-list::-webkit-scrollbar,
.glass-panel > .activity-feed::-webkit-scrollbar,
.notification-popover-list::-webkit-scrollbar,
.comment-list::-webkit-scrollbar,
.note-grid::-webkit-scrollbar {
    width: 0;
}

.glass-panel > .list-stack:hover::-webkit-scrollbar,
.glass-panel > .mini-task-list:hover::-webkit-scrollbar,
.glass-panel > .activity-feed:hover::-webkit-scrollbar,
.notification-popover-list:hover::-webkit-scrollbar,
.comment-list:hover::-webkit-scrollbar,
.note-grid:hover::-webkit-scrollbar {
    width: 8px;
}

.glass-panel > .list-stack::-webkit-scrollbar-thumb,
.glass-panel > .mini-task-list::-webkit-scrollbar-thumb,
.glass-panel > .activity-feed::-webkit-scrollbar-thumb,
.notification-popover-list::-webkit-scrollbar-thumb,
.comment-list::-webkit-scrollbar-thumb,
.note-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.32);
}

.activity-card {
    padding: 0.72rem 0.8rem;
}

.compact-row-list {
    display: grid;
    gap: 0;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
}

.compact-row,
.space-task-row {
    min-height: 46px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0.62rem 0.75rem;
    background: transparent;
}

.compact-row:last-child,
.space-task-row:last-child {
    border-bottom: 0;
}

.compact-row:hover,
.space-task-row:hover {
    background: rgba(248, 250, 252, 0.9);
}

.form-shell {
    max-width: 820px;
}

.access-settings {
    display: grid;
    gap: 0.7rem;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: var(--radius);
    padding: 0.8rem;
    background: rgba(248, 250, 252, 0.74);
}

.assignee-picker {
    display: grid;
    gap: 0.42rem;
    min-width: 0;
}

.field-label {
    color: #475569;
    font-size: 0.86rem;
    font-weight: 800;
}

.form-popover .quick-menu {
    left: 0;
    right: auto;
}

.compact-members {
    max-height: 220px;
    overflow-y: auto;
}

.selected-chip-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.compact-context {
    padding: 0.8rem 0.95rem;
}

@media (max-width: 980px) {
    .task-card.task-row-compact {
        grid-template-columns: 1fr;
    }

    .quick-edit-bar {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .quick-edit-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-popover,
    .quick-chip,
    .quick-save {
        width: 100%;
    }

    .quick-popover summary,
    .quick-chip,
    .quick-save {
        justify-content: center;
    }

    .quick-menu {
        left: 0;
        right: auto;
        width: min(290px, calc(100vw - 2rem));
    }

    .compact-row,
    .space-task-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

/* AssistFlow expansion: glass UI, spaces/folders, task cards, and popovers */
.glass-panel,
.glass-toolbar,
.activity-card,
.mini-task-card,
.task-card,
.workspace-card,
.context-banner,
.access-denied-card,
.alert-panel {
    border: 1px solid rgba(203, 213, 225, 0.72);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

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

.nav-group {
    display: grid;
    gap: 0.18rem;
}

.nav-group > .nav-parent {
    display: flex;
}

.nav-group.active > .nav-parent {
    color: #fff;
    background: rgba(255, 255, 255, 0.105);
}

.nav-children {
    display: grid;
    gap: 0.12rem;
    padding-left: 0.65rem;
}

.nav-children a {
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.84rem;
    font-weight: 750;
}

.lock-icon {
    width: 14px;
    height: 12px;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.lock-icon::before {
    content: "";
    width: 8px;
    height: 7px;
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.corner-lock {
    position: absolute;
    right: 0.72rem;
    bottom: 0.72rem;
    color: #64748b;
    opacity: 0.9;
}

.topbar-actions {
    position: relative;
}

.notification-popover {
    width: min(390px, calc(100vw - 1.5rem));
    max-height: min(640px, calc(100vh - 7rem));
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.7rem);
    right: 3.1rem;
    display: grid;
    gap: 0.85rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: var(--radius);
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(18px);
}

.notification-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.notification-popover-list {
    display: grid;
    gap: 0.65rem;
    overflow-y: auto;
}

.notification-mini {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.72rem;
    background: #ffffff;
}

.notification-mini.unread {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.notification-mini-body {
    min-width: 0;
}

.notification-mini-body strong,
.notification-mini-body span,
.notification-mini-body small {
    display: block;
}

.notification-mini-body span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.notification-mini-body small {
    margin-top: 0.35rem;
    color: var(--subtle);
}

.text-button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    cursor: pointer;
    font-weight: 900;
}

.popover-empty {
    margin: 0;
    padding: 1rem;
    text-align: center;
}

.activity-feed.bubble-feed {
    gap: 0.9rem;
}

.activity-card {
    display: block;
    position: relative;
    min-width: 0;
    border-radius: var(--radius);
    padding: 0.95rem;
}

.activity-card p {
    margin: 0.4rem 0;
    color: var(--muted);
}

.activity-card small {
    color: var(--subtle);
}

.mini-task-list,
.task-card-list,
.task-sections,
.workspace-card-grid,
.workspace-overview {
    display: grid;
    gap: 0.85rem;
}

.mini-task-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    position: relative;
    border-radius: var(--radius);
    padding: 0.85rem;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.mini-task-card:hover,
.task-card:hover,
.workspace-card:hover,
.activity-card.clickable-card:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.10);
}

.mini-task-main {
    min-width: 0;
}

.mini-task-main strong,
.mini-task-main small {
    display: block;
}

.mini-task-main small {
    margin-top: 0.25rem;
    color: var(--muted);
}

.task-sections {
    gap: 1.15rem;
}

.task-section {
    display: grid;
    gap: 0.72rem;
}

.task-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.1rem;
}

.task-section-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 0.36fr);
    gap: 1rem;
    position: relative;
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.task-card-main {
    min-width: 0;
    display: grid;
    gap: 0.6rem;
}

.task-card-title-row,
.task-meta-row,
.assignee-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.task-card-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 950;
}

.task-card-description {
    margin: 0;
    color: var(--muted);
}

.task-meta-row {
    color: var(--muted);
    font-size: 0.86rem;
}

.due-today {
    color: #c2410c;
    font-weight: 950;
}

.due-overdue {
    color: #b91c1c;
    font-weight: 950;
}

.name-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0.25rem 0.52rem;
    color: #1e40af;
    background: #eff6ff;
    font-size: 0.78rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.quick-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    align-content: start;
}

.quick-edit-grid label {
    font-size: 0.74rem;
}

.quick-edit-grid input,
.quick-edit-grid select {
    min-height: 34px;
    padding: 0.44rem 0.52rem;
    font-size: 0.84rem;
}

.quick-edit-grid select[multiple] {
    min-height: 78px;
}

.workspace-manager {
    align-items: start;
}

.workspace-form {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.member-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.45rem;
}

.member-check-grid label,
.checkbox-line,
.toggle-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 750;
}

.member-check-grid input,
.checkbox-line input,
.toggle-line input {
    width: auto;
}

.workspace-card-grid,
.workspace-overview {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.workspace-card {
    display: grid;
    gap: 0.45rem;
    position: relative;
    border-radius: var(--radius);
    padding: 0.9rem;
}

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

.workspace-card details {
    margin-top: 0.25rem;
}

.workspace-card summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 900;
}

.delete-inline {
    margin-top: 0.6rem;
}

.context-banner,
.access-denied-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
}

.access-denied-card {
    justify-content: flex-start;
    min-height: 220px;
}

.access-denied-icon {
    width: 42px;
    height: 34px;
    color: var(--primary);
}

.alert-panel {
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    font-weight: 850;
}

.alert-panel.warning {
    color: #9a3412;
    background: rgba(255, 247, 237, 0.86);
}

.task-editor-panel {
    max-width: 1180px;
}

.editor-section {
    display: grid;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 0 0 1.15rem;
    margin-bottom: 1.15rem;
}

.editor-section:last-of-type {
    border-bottom: 0;
}

.panel-header.flat {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
}

.toggle-line {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.72rem;
    background: #f8fafc;
}

.subtask-editor-list {
    display: grid;
    gap: 0.7rem;
}

.subtask-editor-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr) minmax(120px, 0.7fr) auto;
    gap: 0.55rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.65rem;
    background: #f8fafc;
}

.review-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem;
    background: #fff;
}

.button-group.compact {
    gap: 0.35rem;
}

.compact-table table {
    min-width: 520px;
}

.restricted-card {
    border-color: rgba(148, 163, 184, 0.86);
}

.badge.soft {
    color: #334155;
    border-color: #e2e8f0;
    background: #f8fafc;
}

@media (max-width: 1180px) {
    .content-grid.three {
        grid-template-columns: 1fr;
    }

    .task-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .notification-popover {
        right: 0;
    }

    .mini-task-card {
        grid-template-columns: 1fr;
    }

    .review-row,
    .context-banner,
    .access-denied-card {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .subtask-editor-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .notification-popover {
        position: fixed;
        top: 4.6rem;
        right: 0.7rem;
        left: 0.7rem;
        width: auto;
    }

    .quick-edit-grid,
    .form-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .workspace-card-grid,
    .workspace-overview {
        grid-template-columns: 1fr;
    }
}

/* Premium UI polish and resilient wrapping layer */
:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #111827;
    --muted: #64748b;
    --subtle: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0f766e;
    --danger: #dc2626;
    --warning: #f97316;
    --success: #16a34a;
    --yellow: #ca8a04;
    --shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.07);
    --radius: 8px;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 48%, #edf6f4 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
.app-layout,
.main-panel,
.panel,
.stat-card,
.assistant-hero,
.detail-header,
.note-card,
.task-row,
.notification-card,
.notification-row,
.person-row,
.comment,
.meta-grid div,
td,
th {
    min-width: 0;
    max-width: 100%;
}

p,
small,
strong,
span,
dd,
dt,
td,
th,
a,
.user-content,
.wrap-anywhere,
.table-preview,
.strong-link,
.notification-title,
.activity-item,
.strike-row,
.comment,
.note-card,
.note-box,
.meta-grid dd {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.user-content {
    display: block;
    white-space: pre-wrap;
    line-height: 1.58;
}

.wrap-anywhere {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-preview {
    display: -webkit-box;
    color: var(--muted);
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.app-layout {
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    padding: 1.1rem;
    background:
        linear-gradient(180deg, #111827 0%, #172033 58%, #10231f 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    min-height: 62px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.055);
}

.brand-mark {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.sidebar-nav {
    gap: 0.35rem;
}

.sidebar-nav a {
    position: relative;
    min-height: 46px;
    padding: 0.78rem 0.86rem;
    color: #d8e2f0;
    border: 1px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.105);
}

.sidebar-nav a.active::before {
    content: "";
    width: 3px;
    height: 20px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 999px 999px 0;
    background: #5eead4;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
}

.mini-profile {
    min-width: 0;
    border-radius: var(--radius);
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.055);
}

.main-panel {
    padding: 1.75rem;
}

.topbar {
    min-height: 76px;
    margin-bottom: 1.4rem;
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.topbar h1 {
    max-width: 100%;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.eyebrow {
    color: var(--accent);
    letter-spacing: 0;
}

.icon-button,
.button,
input,
select,
textarea,
.panel,
.stat-card,
.assistant-hero,
.detail-header,
.note-card,
.task-row,
.notification-row,
.notification-card,
.comment,
.meta-grid div {
    border-radius: var(--radius);
}

.panel,
.stat-card,
.assistant-hero,
.detail-header,
.note-card {
    border: 1px solid rgba(203, 213, 225, 0.88);
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 1.15rem;
    background: rgba(255, 255, 255, 0.92);
}

.panel-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.85rem;
}

.panel-header h2,
.assistant-hero h2,
.detail-header h2 {
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0;
}

.stat-grid {
    gap: 1rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-left: 0;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.info::before {
    background: var(--accent);
}

.stat-card span {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.stat-card strong {
    color: #0f172a;
    font-size: 2.15rem;
    line-height: 1;
}

.assistant-hero,
.detail-header {
    border-color: rgba(148, 163, 184, 0.35);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.09), transparent 44%),
        linear-gradient(315deg, rgba(15, 118, 110, 0.09), transparent 42%),
        #ffffff;
    box-shadow: var(--shadow);
}

.detail-header > div:first-child {
    min-width: 0;
}

.detail-header p {
    max-width: 920px;
}

.button {
    position: relative;
    border-color: #cbd5e1;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.button.primary {
    border-color: #1d4ed8;
    background: linear-gradient(180deg, #3478f6, #1d4ed8);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.button.ghost {
    background: rgba(255, 255, 255, 0.62);
}

.button.danger {
    border-color: #fecaca;
    color: #991b1b;
    background: #fff1f2;
}

.link-button {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

input,
select,
textarea {
    border-color: #cbd5e1;
    background: #fbfdff;
}

label {
    color: #475569;
    letter-spacing: 0;
}

textarea {
    min-height: 112px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.badge,
.priority-badge {
    border: 1px solid transparent;
    letter-spacing: 0;
}

.badge {
    padding: 0.28rem 0.58rem;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 28px;
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    font-size: 0.75rem;
    font-weight: 950;
    line-height: 1;
    text-transform: capitalize;
    white-space: nowrap;
}

.priority-badge.compact {
    min-width: 96px;
    justify-content: center;
}

.priority-flag {
    width: 15px;
    height: 15px;
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    color: currentColor;
}

.priority-flag::before {
    content: "";
    width: 2px;
    height: 15px;
    position: absolute;
    left: 1px;
    top: 0;
    border-radius: 999px;
    background: currentColor;
}

.priority-flag::after {
    content: "";
    width: 11px;
    height: 8px;
    position: absolute;
    left: 3px;
    top: 1px;
    border-radius: 2px 3px 3px 1px;
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%);
}

.priority-badge.priority-urgent {
    color: #991b1b;
    border-color: #fecaca;
    background: #fee2e2;
}

.priority-badge.priority-high {
    color: #9a3412;
    border-color: #fed7aa;
    background: #ffedd5;
}

.priority-badge.priority-medium {
    color: #854d0e;
    border-color: #fde68a;
    background: #fef3c7;
}

.priority-badge.priority-low {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
}

.badge.status-pending {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #dbeafe;
}

.badge.status-completed,
.badge.status-approved {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
}

.badge.status-not_completed,
.badge.status-removed {
    color: #9a3412;
    border-color: #fed7aa;
    background: #ffedd5;
}

.badge.status-needs_review {
    color: #7c2d12;
    border-color: #fdba74;
    background: #fff7ed;
}

.badge.status-missed {
    color: #991b1b;
    border-color: #fecaca;
    background: #fee2e2;
}

table {
    table-layout: fixed;
}

th,
td {
    overflow: hidden;
    white-space: normal;
}

tbody tr {
    transition: background-color 0.14s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    min-width: 720px;
}

.task-list,
.list-stack,
.activity-feed,
.notification-list,
.comment-list {
    gap: 0.85rem;
}

.task-row,
.notification-row,
.notification-card,
.comment {
    border-color: #dbe4ef;
    background: #ffffff;
}

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

.task-row:hover,
.notification-row:hover {
    border-color: #bfdbfe;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.08);
}

.task-row-main {
    display: grid;
    gap: 0.18rem;
    flex: 1 1 auto;
    min-width: 0;
}

.task-link-with-priority {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.task-link-with-priority .priority-badge {
    width: fit-content;
}

.task-row > .badge {
    margin-left: auto;
}

.notification-row,
.notification-card {
    align-items: flex-start;
}

.notification-row {
    display: grid;
    grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
}

.notification-card > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.notification-card .button-group {
    flex: 0 0 auto;
}

.activity-item {
    grid-template-columns: 14px minmax(0, 1fr);
}

.activity-item > div,
.strike-row > div,
.comment-head > div,
.person-row > div {
    min-width: 0;
}

.meta-grid div {
    background: #f8fafc;
}

.note-box {
    border-left-color: var(--accent);
    background: #f0fdfa;
}

.comment {
    padding: 1rem;
}

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

.comment p,
.note-card p,
.notification-card p,
.note-box p,
.detail-header p {
    margin-top: 0.78rem;
}

.collapsible-text {
    position: relative;
    max-width: 100%;
}

.collapsible-text.is-collapsed {
    max-height: 8.4rem;
    overflow: hidden;
}

.collapsible-text.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.6rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--panel));
    pointer-events: none;
}

.note-box .collapsible-text.is-collapsed::after {
    background: linear-gradient(180deg, rgba(240, 253, 250, 0), #f0fdfa);
}

.notification-card.unread .collapsible-text.is-collapsed::after,
.notification-row.unread .collapsible-text.is-collapsed::after {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0), #eff6ff);
}

.show-more-button {
    width: fit-content;
    min-height: 30px;
    margin-top: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.36rem 0.68rem;
    color: var(--primary);
    background: #eff6ff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
}

.show-more-button:hover {
    color: #1e40af;
    background: #dbeafe;
}

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

.note-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #ffffff;
}

.note-card form {
    margin-top: auto;
}

.avatar {
    color: #0f172a;
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.sidebar .avatar {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.login-card {
    border-color: rgba(203, 213, 225, 0.82);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-brand h1 {
    color: #0f172a;
    font-weight: 950;
}

@media (max-width: 1120px) {
    .app-layout {
        grid-template-columns: 270px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .main-panel {
        padding: 5rem 0.9rem 1rem;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .detail-header,
    .assistant-hero,
    .notification-card {
        align-items: stretch;
    }

    .task-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .priority-badge.compact {
        width: fit-content;
        min-width: 0;
    }

    .task-row > .badge {
        width: fit-content;
        margin-left: 0;
    }

    .notification-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .main-panel {
        padding-inline: 0.7rem;
    }

    .panel,
    .assistant-hero,
    .detail-header,
    .note-card,
    .stat-card {
        padding: 0.95rem;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-wrap table {
        min-width: 640px;
    }

    .notification-card .button-group {
        width: 100%;
    }

    .comment-form .button {
        width: 100%;
        justify-self: stretch;
    }
}

/* Final polish layer: theme, stacking, sidebar containment, compact task controls */
html[data-theme="dark"] {
    --bg: #0b1220;
    --panel: rgba(15, 23, 42, 0.78);
    --text: #e5edf7;
    --muted: #9aa8bd;
    --subtle: #7f8da3;
    --line: rgba(148, 163, 184, 0.22);
    --line-strong: rgba(148, 163, 184, 0.34);
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --accent: #2dd4bf;
    --danger: #fb7185;
    --warning: #f59e0b;
    --success: #22c55e;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body.app-body {
    overflow-y: auto;
}

html[data-theme="dark"] body {
    color: var(--text);
    background:
        radial-gradient(circle at 16% 10%, rgba(59, 130, 246, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 4%, rgba(45, 212, 191, 0.13), transparent 30rem),
        linear-gradient(180deg, #0b1220 0%, #101827 48%, #111c27 100%);
}

html[data-theme="light"] body {
    color: #172033;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 48%, #edf6f4 100%);
}

.app-layout {
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    gap: 0.85rem;
}

.brand,
.sidebar-footer {
    flex: 0 0 auto;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.15rem;
    scrollbar-width: none;
}

.sidebar-nav:hover,
.sidebar-nav:focus-within {
    scrollbar-width: thin;
    scrollbar-color: rgba(226, 232, 240, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
}

.sidebar-nav:hover::-webkit-scrollbar,
.sidebar-nav:focus-within::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.24);
}

.sidebar-nav a,
.sidebar-nav .nav-with-icon {
    min-width: 0;
}

.sidebar-nav .nav-with-icon {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    column-gap: 0.56rem;
}

.sidebar-nav .nav-with-icon > span:not(.nav-icon):not(.lock-icon) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-group > .nav-parent.nav-with-icon {
    display: grid;
}

.nav-children {
    gap: 0.08rem;
    padding-left: 0.35rem;
}

.nav-children a {
    min-height: 32px;
    border-radius: 7px;
    padding-block: 0.46rem;
    font-size: 0.82rem;
}

.sidebar-nav .space-child {
    margin-left: 0.3rem;
    padding-left: 0.62rem;
}

.sidebar-nav .folder-child {
    margin-left: 1.05rem;
    padding-left: 0.58rem;
    color: #b9c7da;
}

.nav-icon {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    justify-self: center;
    flex: 0 0 16px;
}

.space-dot,
.folder-dot {
    border-radius: 5px;
}

.space-dot {
    background: linear-gradient(135deg, #60a5fa, #2dd4bf);
}

.folder-dot {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
}

.lock-icon {
    width: 12px;
    height: 10px;
    align-self: center;
    justify-self: end;
    border-width: 1.5px;
    border-radius: 2.5px;
}

.lock-icon::before {
    width: 7px;
    height: 6px;
    top: -6.5px;
    border-width: 1.5px;
}

.nav-divider {
    height: 1px;
    margin: 0.42rem 0.62rem;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
}

.nav-section {
    color: #f8fafc;
    letter-spacing: 0;
}

.main-panel {
    min-width: 0;
    overflow: visible;
}

.topbar {
    position: relative;
    z-index: 11000;
    overflow: visible;
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .glass-panel,
html[data-theme="dark"] .glass-toolbar,
html[data-theme="dark"] .assistant-hero,
html[data-theme="dark"] .detail-header,
html[data-theme="dark"] .context-banner,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .compact-row-list,
html[data-theme="dark"] .compact-list,
html[data-theme="dark"] .access-settings,
html[data-theme="dark"] .alert-panel,
html[data-theme="dark"] .access-denied-card {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.24);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.76), rgba(15, 23, 42, 0.74));
    box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .panel-header {
    border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .panel-header h2,
html[data-theme="dark"] .assistant-hero h2,
html[data-theme="dark"] .detail-header h2,
html[data-theme="dark"] .task-card-title,
html[data-theme="dark"] .mini-task-main strong,
html[data-theme="dark"] .activity-card strong,
html[data-theme="dark"] .compact-row strong,
html[data-theme="dark"] .space-task-row strong,
html[data-theme="dark"] .login-brand h1 {
    color: #f8fafc;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] label,
html[data-theme="dark"] small,
html[data-theme="dark"] .task-card-description,
html[data-theme="dark"] .notification-mini-body span,
html[data-theme="dark"] .activity-card p,
html[data-theme="dark"] .mini-task-main small,
html[data-theme="dark"] .compact-row small,
html[data-theme="dark"] .space-task-row small,
html[data-theme="dark"] td small {
    color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(15, 23, 42, 0.74);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: rgba(203, 213, 225, 0.58);
}

html[data-theme="dark"] .button {
    color: #e5edf7;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.76);
}

html[data-theme="dark"] .button.primary {
    color: white;
    border-color: rgba(96, 165, 250, 0.74);
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

html[data-theme="dark"] .button.ghost {
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.36);
}

html[data-theme="dark"] .button.danger {
    color: #fecdd3;
    border-color: rgba(244, 63, 94, 0.34);
    background: rgba(127, 29, 29, 0.34);
}

.theme-toggle {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    padding: 0.25rem 0.58rem 0.25rem 0.3rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.66);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .theme-toggle {
    color: #e5edf7;
    border-color: rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.72);
}

.theme-toggle-track {
    width: 40px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px;
    background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
}

html[data-theme="dark"] .theme-toggle-track {
    background: linear-gradient(135deg, #1e293b, #0f766e);
}

.theme-toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
    transform: translateX(0);
    transition: transform 0.16s ease;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle-knob {
    transform: translateX(18px);
}

.topbar-actions {
    position: relative;
    z-index: 11020;
    overflow: visible;
}

.icon-button {
    flex: 0 0 auto;
}

.notification-popover {
    z-index: 12000;
    right: 3.05rem;
    overflow: visible;
    isolation: isolate;
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.32);
}

html[data-theme="dark"] .notification-popover {
    color: #e5edf7;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.52);
}

.notification-popover[hidden] {
    display: none;
}

.notification-mini {
    min-width: 0;
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .notification-mini {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.78);
}

html[data-theme="dark"] .notification-mini.unread {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(30, 64, 175, 0.28);
}

.quick-edit-bar {
    align-items: center;
    gap: 0.34rem;
    overflow: visible;
}

.quick-control,
.quick-popover,
.date-popover,
.assignee-popover {
    position: relative;
    z-index: 2;
    overflow: visible;
}

.quick-popover[open] {
    z-index: 9000;
}

.task-card-list,
.compact-list,
.clickup-task-sections,
.task-section,
.task-card.task-row-compact,
.quick-edit-bar {
    overflow: visible;
}

.task-card.task-row-compact {
    position: relative;
    align-items: center;
    min-height: 54px;
    padding: 0.58rem 0.72rem;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.task-card.task-row-compact:has(.quick-popover[open]) {
    z-index: 8000;
}

html[data-theme="dark"] .task-card.task-row-compact {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

.task-card.task-row-compact:hover {
    background: rgba(241, 245, 249, 0.76);
}

html[data-theme="dark"] .task-card.task-row-compact:hover {
    background: rgba(30, 41, 59, 0.72);
}

.quick-chip,
.quick-popover > summary,
.quick-save {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    border-radius: 999px;
    font-size: 0.73rem;
    line-height: 1;
}

.quick-popover > summary {
    border: 1px solid rgba(148, 163, 184, 0.34);
    padding: 0 0.62rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

html[data-theme="dark"] .quick-popover > summary,
html[data-theme="dark"] .quick-chip {
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.58);
}

.quick-popover > summary .priority-badge,
.quick-popover > summary .badge,
.quick-popover > summary .quick-chip {
    min-width: 0;
    min-height: 0;
    height: auto;
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    background: transparent !important;
    box-shadow: none;
}

.quick-popover > summary:has(.priority-urgent) {
    color: #dc2626;
    border-color: rgba(248, 113, 113, 0.52);
    background: rgba(254, 226, 226, 0.86);
}

.quick-popover > summary:has(.priority-high) {
    color: #ea580c;
    border-color: rgba(251, 146, 60, 0.54);
    background: rgba(255, 237, 213, 0.88);
}

.quick-popover > summary:has(.priority-medium) {
    color: #ca8a04;
    border-color: rgba(250, 204, 21, 0.54);
    background: rgba(254, 249, 195, 0.88);
}

.quick-popover > summary:has(.priority-low) {
    color: #16a34a;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(220, 252, 231, 0.88);
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-urgent) {
    color: #fecdd3;
    background: rgba(127, 29, 29, 0.42);
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-high) {
    color: #fed7aa;
    background: rgba(124, 45, 18, 0.42);
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-medium) {
    color: #fef08a;
    background: rgba(113, 63, 18, 0.36);
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-low) {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.38);
}

.quick-popover > summary:focus-visible,
.theme-toggle:focus-visible,
.icon-button:focus-visible,
.button:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.75);
    outline-offset: 2px;
}

.quick-menu {
    z-index: 12000;
    overflow: visible;
    border-color: rgba(148, 163, 184, 0.26);
    color: #e5edf7;
    background: rgba(15, 23, 42, 0.99);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.48);
}

.quick-menu-item {
    min-height: 32px;
    border-radius: 7px;
    padding: 0.4rem 0.48rem;
    color: #e5edf7;
}

.quick-menu .priority-badge,
.quick-menu .badge {
    border-width: 1px;
}

.quick-menu input[type="date"],
.quick-menu input[type="time"],
.quick-menu input[type="search"] {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.72);
}

.quick-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.62);
    padding: 0 0.68rem;
    box-shadow: none;
}

.task-row-content .task-meta-row {
    align-items: center;
    row-gap: 0.2rem;
}

.badge,
.priority-badge {
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1;
}

.badge {
    padding: 0.25rem 0.5rem;
}

.priority-badge {
    min-height: 26px;
    padding: 0.24rem 0.54rem;
}

.priority-badge.compact {
    min-height: 24px;
    padding: 0.18rem 0.46rem;
}

.mini-task-card {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: none;
}

html[data-theme="dark"] .mini-task-card {
    border-color: rgba(148, 163, 184, 0.22) !important;
    background: rgba(15, 23, 42, 0.45);
}

.mini-task-card:hover {
    border-color: rgba(96, 165, 250, 0.42) !important;
}

.activity-card,
.review-row,
.person-row,
.comment,
.notification-card,
.note-card,
.compact-row,
.space-task-row,
.workspace-card {
    min-width: 0;
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .activity-card,
html[data-theme="dark"] .review-row,
html[data-theme="dark"] .person-row,
html[data-theme="dark"] .comment,
html[data-theme="dark"] .notification-card,
html[data-theme="dark"] .notification-row,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .compact-row,
html[data-theme="dark"] .space-task-row,
html[data-theme="dark"] .workspace-card,
html[data-theme="dark"] .meta-grid div {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.42);
}

.compact-row-list {
    border-color: rgba(148, 163, 184, 0.2);
}

.compact-row,
.space-task-row {
    min-height: 42px;
    grid-template-columns: 18px minmax(0, 1fr) auto auto auto;
    padding: 0.54rem 0.68rem;
}

.compact-row .nav-icon,
.space-task-row .nav-icon {
    justify-self: center;
}

.compact-row:hover,
.space-task-row:hover {
    background: rgba(241, 245, 249, 0.76);
}

html[data-theme="dark"] .compact-row:hover,
html[data-theme="dark"] .space-task-row:hover {
    background: rgba(30, 41, 59, 0.72);
}

.glass-panel > .list-stack,
.glass-panel > .mini-task-list,
.glass-panel > .activity-feed,
.panel > .list-stack,
.panel > .comment-list,
.notification-list,
.notification-popover-list,
.comment-list,
.note-grid {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
    scrollbar-width: none;
}

.glass-panel > .activity-feed,
.panel > .activity-feed {
    max-height: 430px;
}

.notification-popover-list {
    max-height: min(410px, calc(100vh - 13rem));
}

.comment-list {
    max-height: min(560px, calc(100vh - 15rem));
}

.note-grid {
    max-height: min(680px, calc(100vh - 12rem));
}

.glass-panel > .list-stack:hover,
.glass-panel > .mini-task-list:hover,
.glass-panel > .activity-feed:hover,
.panel > .list-stack:hover,
.panel > .comment-list:hover,
.notification-list:hover,
.notification-popover-list:hover,
.comment-list:hover,
.note-grid:hover,
.glass-panel > .list-stack:focus-within,
.glass-panel > .mini-task-list:focus-within,
.glass-panel > .activity-feed:focus-within,
.panel > .list-stack:focus-within,
.panel > .comment-list:focus-within,
.notification-list:focus-within,
.notification-popover-list:focus-within,
.comment-list:focus-within,
.note-grid:focus-within {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

.glass-panel > .list-stack::-webkit-scrollbar,
.glass-panel > .mini-task-list::-webkit-scrollbar,
.glass-panel > .activity-feed::-webkit-scrollbar,
.panel > .list-stack::-webkit-scrollbar,
.panel > .comment-list::-webkit-scrollbar,
.notification-list::-webkit-scrollbar,
.notification-popover-list::-webkit-scrollbar,
.comment-list::-webkit-scrollbar,
.note-grid::-webkit-scrollbar {
    width: 0;
}

.glass-panel > .list-stack:hover::-webkit-scrollbar,
.glass-panel > .mini-task-list:hover::-webkit-scrollbar,
.glass-panel > .activity-feed:hover::-webkit-scrollbar,
.panel > .list-stack:hover::-webkit-scrollbar,
.panel > .comment-list:hover::-webkit-scrollbar,
.notification-list:hover::-webkit-scrollbar,
.notification-popover-list:hover::-webkit-scrollbar,
.comment-list:hover::-webkit-scrollbar,
.note-grid:hover::-webkit-scrollbar {
    width: 8px;
}

.glass-panel > .list-stack::-webkit-scrollbar-thumb,
.glass-panel > .mini-task-list::-webkit-scrollbar-thumb,
.glass-panel > .activity-feed::-webkit-scrollbar-thumb,
.panel > .list-stack::-webkit-scrollbar-thumb,
.panel > .comment-list::-webkit-scrollbar-thumb,
.notification-list::-webkit-scrollbar-thumb,
.notification-popover-list::-webkit-scrollbar-thumb,
.comment-list::-webkit-scrollbar-thumb,
.note-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.38);
}

.user-content,
.wrap-anywhere,
.activity-card,
.review-row,
.person-row,
.comment,
.note-card,
.notification-mini,
.notification-card,
.task-card,
.mini-task-card,
.compact-row,
.space-task-row,
.workspace-card,
.table-wrap,
td,
th {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.user-content,
.collapsible-text {
    white-space: pre-wrap;
}

html[data-theme="dark"] .collapsible-text.is-collapsed::after {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.92));
}

html[data-theme="dark"] .show-more-button {
    color: #bfdbfe;
    background: rgba(30, 64, 175, 0.34);
}

html[data-theme="dark"] tbody tr:hover {
    background: rgba(30, 41, 59, 0.62);
}

@media (max-width: 820px) {
    .sidebar-toggle {
        z-index: 13010;
    }

    .sidebar {
        position: fixed;
        z-index: 13000;
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
    }

    .theme-toggle-label {
        display: none;
    }

    .notification-popover {
        right: 0;
        width: min(360px, calc(100vw - 1.4rem));
    }
}

@media (max-width: 640px) {
    .topbar {
        gap: 0.85rem;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .quick-edit-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
    }

    .quick-control,
    .quick-popover,
    .quick-chip,
    .quick-save {
        width: 100%;
    }

    .quick-popover > summary,
    .quick-chip,
    .quick-save {
        justify-content: center;
        width: 100%;
    }

    .compact-row,
    .space-task-row {
        grid-template-columns: 18px minmax(0, 1fr) auto;
    }

    .compact-row small,
    .space-task-row small {
        grid-column: 2 / -1;
    }
}

/* Targeted bug fixes: notification button, floating quick menus, notes, priority labels */
html[data-theme="dark"] .topbar .icon-button {
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .topbar .icon-button:hover {
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(30, 41, 59, 0.82);
}

html[data-theme="dark"] .topbar .bell-shape {
    border-color: #dbeafe;
}

html[data-theme="dark"] .topbar .bell-shape::after {
    background: #dbeafe;
}

html[data-theme="dark"] .topbar .bell-dot {
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.95);
}

.popover-layer-active {
    position: relative;
    z-index: 18000 !important;
    overflow: visible !important;
}

.quick-popover.popover-active {
    z-index: 22000 !important;
}

.quick-popover[open] .quick-menu {
    position: fixed;
    top: var(--popover-top, auto);
    left: var(--popover-left, auto);
    right: auto;
    z-index: 30000;
    max-height: min(var(--popover-max-height, 360px), 420px);
    overflow-y: auto;
    isolation: isolate;
    transform: translateZ(0);
}

.quick-popover[open] .assignee-menu {
    max-height: min(var(--popover-max-height, 360px), 360px);
}

.quick-menu-floating {
    width: var(--popover-width, max-content) !important;
    min-width: min(220px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    position: fixed !important;
    top: var(--popover-top, 0px) !important;
    left: var(--popover-left, 0px) !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 30000 !important;
    max-height: min(var(--popover-max-height, 360px), calc(100dvh - 20px));
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateZ(0);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.quick-menu-floating.assignee-menu {
    min-width: min(280px, calc(100vw - 20px));
}

.quick-menu-floating.date-menu {
    min-width: min(230px, calc(100vw - 20px));
}

.quick-menu-floating::-webkit-scrollbar {
    width: 8px;
}

.quick-menu-floating::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.38);
}

.space-task-row {
    grid-template-columns: minmax(86px, max-content) minmax(0, 1fr) auto auto;
    overflow: hidden;
}

.space-task-row > .priority-badge {
    min-width: 82px;
    justify-self: start;
}

.space-task-row > .wrap-anywhere {
    min-width: 0;
}

.space-task-row > .badge,
.space-task-row > small {
    justify-self: end;
}

.note-box {
    border: 1px solid rgba(14, 116, 144, 0.16);
    border-left: 4px solid var(--accent);
    background: rgba(236, 254, 255, 0.86);
    color: #0f172a;
}

.note-box strong {
    color: inherit;
}

html[data-theme="dark"] .note-box {
    color: #e5edf7;
    border-color: rgba(45, 212, 191, 0.22);
    border-left-color: rgba(45, 212, 191, 0.82);
    background:
        linear-gradient(180deg, rgba(20, 184, 166, 0.14), rgba(15, 23, 42, 0.62));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .note-box p,
html[data-theme="dark"] .note-box .user-content {
    color: #dbeafe;
}

html[data-theme="dark"] .note-box .collapsible-text.is-collapsed::after {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.92));
}

html[data-theme="dark"] .priority-badge.priority-urgent,
html[data-theme="dark"] .quick-menu .priority-badge.priority-urgent,
html[data-theme="dark"] .priority-urgent {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.42);
    background:
        linear-gradient(180deg, rgba(127, 29, 29, 0.58), rgba(88, 28, 28, 0.42));
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-urgent) {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.46);
    background:
        linear-gradient(180deg, rgba(127, 29, 29, 0.56), rgba(88, 28, 28, 0.4));
}

html[data-theme="dark"] .priority-badge.priority-urgent .priority-flag,
html[data-theme="dark"] .quick-popover > summary:has(.priority-urgent) .priority-flag {
    color: #fb7185;
}

.task-card .corner-lock.lock-icon,
.mini-task-card .corner-lock.lock-icon,
.workspace-card .corner-lock.lock-icon {
    width: 10px;
    height: 8px;
    right: 0.55rem;
    bottom: 0.55rem;
    border-width: 1.4px;
    border-radius: 2px;
    color: #64748b;
    opacity: 0.62;
}

.task-card .corner-lock.lock-icon::before,
.mini-task-card .corner-lock.lock-icon::before,
.workspace-card .corner-lock.lock-icon::before {
    width: 6px;
    height: 5px;
    top: -5.8px;
    border-width: 1.4px;
}

.task-card .corner-lock.lock-icon:hover,
.mini-task-card .corner-lock.lock-icon:hover,
.workspace-card .corner-lock.lock-icon:hover {
    opacity: 0.9;
}

.task-card .priority-badge .lock-icon,
.context-banner .priority-badge .lock-icon {
    width: 10px;
    height: 8px;
    border-width: 1.3px;
}

.task-card .priority-badge .lock-icon::before,
.context-banner .priority-badge .lock-icon::before {
    width: 6px;
    height: 5px;
    top: -5.6px;
    border-width: 1.3px;
}

.compact-row > .lock-icon,
.space-task-row > .lock-icon {
    width: 10px;
    height: 8px;
    border-width: 1.3px;
    opacity: 0.68;
}

.compact-row > .lock-icon::before,
.space-task-row > .lock-icon::before {
    width: 6px;
    height: 5px;
    top: -5.6px;
    border-width: 1.3px;
}

html[data-theme="dark"] .task-card .corner-lock.lock-icon,
html[data-theme="dark"] .mini-task-card .corner-lock.lock-icon,
html[data-theme="dark"] .workspace-card .corner-lock.lock-icon,
html[data-theme="dark"] .compact-row > .lock-icon,
html[data-theme="dark"] .space-task-row > .lock-icon {
    color: rgba(203, 213, 225, 0.72);
}

@media (max-width: 640px) {
    .space-task-row {
        grid-template-columns: minmax(78px, max-content) minmax(0, 1fr);
        align-items: center;
    }

    .space-task-row > .badge,
    .space-task-row > small {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

/* Responsive hardening for task-heavy pages */
.main-panel > *,
.content-grid,
.stat-grid,
.task-sections,
.task-card-list,
.compact-row-list,
.workspace-overview,
.workspace-card-grid,
.toolbar,
.glass-toolbar,
.detail-header,
.context-banner {
    min-width: 0;
}

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

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

@media (max-width: 960px) {
    .content-grid.two,
    .content-grid.three,
    .content-grid.uneven,
    .workspace-overview,
    .workspace-card-grid {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .glass-toolbar,
    .context-banner,
    .detail-header,
    .assistant-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar .button-group,
    .glass-toolbar .button-group,
    .context-banner .button-group,
    .detail-header .button-group {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .inline-form,
    .compact-filters {
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .task-card.task-row-compact {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .quick-edit-bar {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

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

    .quick-edit-bar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
        gap: 0.42rem;
    }

    .quick-control,
    .quick-popover,
    .quick-popover > summary,
    .quick-chip,
    .quick-save {
        width: 100%;
    }

    .quick-popover > summary,
    .quick-chip,
    .quick-save {
        justify-content: center;
    }

    .form-grid,
    .settings-grid,
    .subtask-editor-row,
    .member-check-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .compact-row,
    .space-task-row,
    .mini-task-card {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .compact-row > .nav-icon,
    .space-task-row > .priority-badge,
    .space-task-row > .badge,
    .space-task-row > small,
    .mini-task-card > .priority-badge,
    .mini-task-card > .badge {
        justify-self: start;
    }

    .space-task-row > .badge,
    .space-task-row > small {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .main-panel {
        padding-inline: 0.7rem;
    }

    .topbar {
        padding: 0.85rem;
    }

    .topbar-actions {
        gap: 0.45rem;
    }

    .stat-grid,
    .stat-grid.premium {
        grid-template-columns: 1fr;
    }

    .button-group,
    .quick-actions,
    .form-actions {
        width: 100%;
    }

    .button-group .button,
    .quick-actions .button,
    .form-actions .button {
        flex: 1 1 auto;
    }

    .notification-popover {
        width: auto;
        max-height: calc(100dvh - 6rem);
        position: fixed;
        top: 4.8rem;
        right: 0.7rem;
        left: 0.7rem;
    }

    .quick-menu-floating {
        min-width: min(220px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 380px) {
    .quick-edit-bar {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        padding-right: 0.3rem;
    }

    .avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
}

/* Final space/sidebar/stat polish */
.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 1rem;
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: var(--radius);
    padding: 0.78rem;
    background: rgba(254, 242, 242, 0.72);
}

.danger-zone > div {
    min-width: 0;
}

.danger-zone strong,
.danger-zone small {
    display: block;
}

.danger-zone small {
    margin-top: 0.2rem;
    color: #991b1b;
}

html[data-theme="dark"] .danger-zone {
    border-color: rgba(251, 113, 133, 0.28);
    background: rgba(127, 29, 29, 0.22);
}

html[data-theme="dark"] .danger-zone small {
    color: #fecdd3;
}

.stat-card strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.stat-card span {
    color: #475569;
}

html[data-theme="dark"] .stat-card strong {
    color: #f8fafc !important;
    text-shadow: 0 10px 26px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] .stat-card span {
    color: #cbd5e1;
}

.task-section-head .badge,
.panel-header .badge:not([class*="status-"]) {
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(241, 245, 249, 0.92);
}

html[data-theme="dark"] .task-section-head .badge,
html[data-theme="dark"] .panel-header .badge:not([class*="status-"]) {
    color: #e0f2fe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(30, 41, 59, 0.86);
}

html[data-theme="dark"] .priority-badge.priority-high,
html[data-theme="dark"] .quick-menu .priority-badge.priority-high,
html[data-theme="dark"] .priority-high {
    color: #fed7aa;
    border-color: rgba(251, 146, 60, 0.42);
    background:
        linear-gradient(180deg, rgba(154, 52, 18, 0.5), rgba(124, 45, 18, 0.34));
}

html[data-theme="dark"] .priority-badge.priority-medium,
html[data-theme="dark"] .quick-menu .priority-badge.priority-medium,
html[data-theme="dark"] .priority-medium {
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.38);
    background:
        linear-gradient(180deg, rgba(113, 63, 18, 0.46), rgba(82, 52, 12, 0.32));
}

html[data-theme="dark"] .priority-badge.priority-low,
html[data-theme="dark"] .quick-menu .priority-badge.priority-low,
html[data-theme="dark"] .priority-low {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.34);
    background:
        linear-gradient(180deg, rgba(20, 83, 45, 0.48), rgba(22, 78, 99, 0.24));
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-high) {
    color: #fed7aa;
    border-color: rgba(251, 146, 60, 0.42);
    background:
        linear-gradient(180deg, rgba(154, 52, 18, 0.5), rgba(124, 45, 18, 0.34));
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-medium) {
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.38);
    background:
        linear-gradient(180deg, rgba(113, 63, 18, 0.46), rgba(82, 52, 12, 0.32));
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-low) {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.34);
    background:
        linear-gradient(180deg, rgba(20, 83, 45, 0.48), rgba(22, 78, 99, 0.24));
}

html[data-theme="dark"] .priority-badge.priority-high .priority-flag,
html[data-theme="dark"] .quick-popover > summary:has(.priority-high) .priority-flag {
    color: #fb923c;
}

html[data-theme="dark"] .priority-badge.priority-medium .priority-flag,
html[data-theme="dark"] .quick-popover > summary:has(.priority-medium) .priority-flag {
    color: #facc15;
}

html[data-theme="dark"] .priority-badge.priority-low .priority-flag,
html[data-theme="dark"] .quick-popover > summary:has(.priority-low) .priority-flag {
    color: #4ade80;
}

.priority-normal {
    color: #854d0e;
    background: #fef3c7;
}

.priority-dot.priority-normal {
    background: #eab308;
}

.priority-badge.priority-normal {
    color: #854d0e;
    border-color: #fde68a;
    background: #fef3c7;
}

.badge.status-overdue {
    color: #991b1b;
    border-color: #fecaca;
    background: #fee2e2;
}

.quick-popover > summary:has(.priority-normal) {
    color: #ca8a04;
    border-color: rgba(250, 204, 21, 0.54);
    background: rgba(254, 249, 195, 0.88);
}

html[data-theme="dark"] .priority-badge.priority-normal,
html[data-theme="dark"] .quick-menu .priority-badge.priority-normal,
html[data-theme="dark"] .priority-normal {
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.38);
    background:
        linear-gradient(180deg, rgba(113, 63, 18, 0.46), rgba(82, 52, 12, 0.32));
}

html[data-theme="dark"] .badge.status-overdue {
    color: #fecdd3;
    border-color: rgba(248, 113, 113, 0.42);
    background:
        linear-gradient(180deg, rgba(127, 29, 29, 0.44), rgba(88, 28, 28, 0.3));
}

html[data-theme="dark"] .quick-popover > summary:has(.priority-normal) {
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.38);
    background:
        linear-gradient(180deg, rgba(113, 63, 18, 0.46), rgba(82, 52, 12, 0.32));
}

html[data-theme="dark"] .priority-badge.priority-normal .priority-flag,
html[data-theme="dark"] .quick-popover > summary:has(.priority-normal) .priority-flag {
    color: #facc15;
}

.sidebar-nav .space-child,
.sidebar-nav .folder-child {
    position: relative;
}

.sidebar-nav .tree-connector {
    position: absolute;
    pointer-events: none;
    opacity: 0.72;
}

.sidebar-nav .space-child .tree-connector {
    width: 0.62rem;
    height: calc(100% + 0.14rem);
    left: 0.18rem;
    top: -0.14rem;
    border-left: 1px solid rgba(148, 163, 184, 0.24);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0 0 0 6px;
}

.sidebar-nav .folder-child .tree-connector {
    width: 0.74rem;
    height: calc(100% + 0.16rem);
    left: -0.48rem;
    top: -0.16rem;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0 0 0 6px;
}

html[data-theme="dark"] .sidebar-nav .space-child .tree-connector,
html[data-theme="dark"] .sidebar-nav .folder-child .tree-connector {
    border-image: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.32), rgba(94, 234, 212, 0.14)) 1;
}

.sidebar-nav .folder-dot {
    width: 16px;
    height: 12px;
    position: relative;
    margin-top: 1px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 3px 4px 4px 4px;
    background:
        linear-gradient(180deg, #fde68a 0%, #fbbf24 52%, #f59e0b 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        0 5px 12px rgba(245, 158, 11, 0.16);
}

.sidebar-nav .folder-dot::before {
    content: "";
    width: 8px;
    height: 4px;
    position: absolute;
    left: 1px;
    top: -4px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #fef3c7, #fbbf24);
}

.sidebar-nav .folder-dot::after {
    content: "";
    position: absolute;
    inset: 2px 3px auto 3px;
    height: 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] .sidebar-nav .folder-dot {
    border-color: rgba(251, 191, 36, 0.42);
    background:
        linear-gradient(180deg, #fcd34d 0%, #f59e0b 58%, #b45309 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 6px 16px rgba(245, 158, 11, 0.20);
}

html[data-theme="dark"] .sidebar-nav .folder-dot::before {
    border-color: rgba(251, 191, 36, 0.42);
    background: linear-gradient(180deg, #fde68a, #f59e0b);
}

@media (max-width: 700px) {
    .danger-zone {
        align-items: stretch;
        flex-direction: column;
    }
}

.panel:target {
    border-color: rgba(96, 165, 250, 0.62);
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.14),
        var(--shadow-soft);
    scroll-margin-top: 1rem;
}

html[data-theme="dark"] .panel:target {
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.18),
        0 24px 58px rgba(0, 0, 0, 0.34);
}

/* Private SterlixGroup login polish */
.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96) 44%, rgba(8, 47, 73, 0.92)),
        linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(45, 212, 191, 0.08));
    color: #f8fafc;
}

.login-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 88%);
}

.security-login-card {
    position: relative;
    width: min(100%, 460px);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.82));
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px);
}

.security-login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #2dd4bf, #a7f3d0);
}

.secure-login-brand {
    align-items: flex-start;
}

.secure-login-brand .brand-mark.large {
    width: 58px;
    height: 58px;
    color: #ecfeff;
    border-color: rgba(125, 211, 252, 0.32);
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.95), rgba(13, 148, 136, 0.9));
    box-shadow: 0 16px 36px rgba(14, 165, 233, 0.24);
}

.security-login-card .eyebrow {
    color: #67e8f9;
}

.security-login-card h1,
.security-login-card .login-brand h1 {
    color: #ffffff;
    letter-spacing: 0;
}

.security-login-card .login-brand p:not(.eyebrow),
.security-login-card .login-hint {
    color: #cbd5e1;
}

.login-copy {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.42);
}

.login-copy strong {
    color: #f8fafc;
}

.login-copy span {
    color: #cbd5e1;
    font-size: 0.92rem;
}

.security-login-card label {
    color: #e2e8f0;
}

.security-login-card input {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.64);
}

.security-login-card input:focus {
    border-color: rgba(56, 189, 248, 0.74);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}
