:root {
    --bg: #f4f8fc;
    --bg-soft: #fbfdff;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --sidebar-bg: rgba(255, 255, 255, 0.84);
    --line: #d9e4ef;
    --line-strong: #c6d4e2;
    --text: #1f2d3d;
    --text-soft: #64748b;
    --text-faint: #94a3b8;
    --accent: #2e7cf6;
    --accent-strong: #1f6ae0;
    --accent-soft: rgba(46, 124, 246, 0.1);
    --success: #1f8b5f;
    --warning: #b7791f;
    --danger: #c24141;
    --shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
    --shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.04);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-body: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    background:
            radial-gradient(circle at top left, rgba(46, 124, 246, 0.08), transparent 32%),
            linear-gradient(180deg, #f9fbfe 0%, #f3f7fb 100%);
}

body.is-scroll-locked {
    overflow: hidden;
}

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

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

textarea {
    resize: vertical;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 24px 18px;
    color: var(--text);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.app-sidebar::after {
    display: none;
}

.brand-lockup {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.sidebar-section {
    flex: 1;
    margin-top: 0;
}

.sidebar-label {
    margin-bottom: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.nav-links {
    display: grid;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(46, 124, 246, 0.12);
    background: rgba(46, 124, 246, 0.08);
    color: var(--accent-strong);
}

.nav-link small {
    color: var(--text-faint);
}

.sidebar-footer {
    display: none;
}

.app-main {
    padding: 24px 26px 28px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.page-header > :first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.page-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 1.2vw + 1.2rem, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar-actions {
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-self: flex-start;
}

.topbar-menu {
    position: relative;
}

.icon-button,
.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
}

.icon-button {
    position: relative;
    justify-content: center;
    width: 42px;
    padding: 0;
}

.user-menu-trigger {
    gap: 12px;
    min-height: 44px;
    padding: 0 8px 0 4px;
    border: none;
    background: transparent;
    box-shadow: none;
}

.user-menu-trigger:hover {
    box-shadow: none;
    background: rgba(245, 248, 252, 0.9);
}

.icon-button svg,
.user-menu-trigger svg {
    width: 18px;
    height: 18px;
}

.notification-count {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e53935;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(229, 57, 53, 0.28);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #d6d7db;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    overflow: hidden;
}

.user-avatar img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.user-name {
    max-width: 116px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.98rem;
    font-weight: 600;
}

.user-role {
    color: var(--text-faint);
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    display: none;
    width: 320px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.topbar-menu.is-open .dropdown-panel {
    display: block;
}

.dropdown-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 10px;
}

.notification-dropdown {
    width: 360px;
}

.notification-preview-list {
    display: grid;
    gap: 8px;
}

.notification-preview {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #e7eef5;
    border-radius: 12px;
    background: #f8fbff;
}

.notification-preview--unread {
    border-color: rgba(229, 57, 53, 0.16);
    background: #fff7f7;
}

.notification-preview__title {
    font-size: 0.88rem;
    font-weight: 700;
}

.notification-preview__content {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.notification-preview__time {
    color: var(--text-faint);
    font-size: 0.76rem;
}

.empty-state--compact {
    padding: 18px 12px;
}

.user-dropdown {
    width: 200px;
}

.dropdown-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.dropdown-link svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.dropdown-link:hover {
    background: #f5f8fc;
}

.dropdown-link--danger {
    color: var(--danger);
}

.page-grid {
    display: grid;
    gap: 20px;
}

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

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

.surface {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.surface__header,
.surface__body,
.surface__footer {
    position: relative;
}

.surface__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
}

.surface__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.surface__meta {
    margin-top: 6px;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 0.92rem;
}

.surface__body {
    padding: 0 20px 20px;
}

.surface__footer {
    padding: 14px 20px 20px;
}

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

.dashboard-metrics {
    gap: 12px;
}

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

.metric-card {
    padding: 20px;
}

.metric-card--compact {
    padding: 16px 18px;
    border-radius: 16px;
}

.metric-card--compact .metric-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.metric-card--compact .metric-value {
    margin-top: 8px;
    font-size: clamp(1.65rem, 1.8vw, 2.15rem);
    line-height: 1.1;
}

.metric-label {
    color: var(--text-soft);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 10px;
    font-size: clamp(1.85rem, 2.2vw, 2.6rem);
    font-weight: 800;
    color: var(--accent-strong);
}

.metric-note {
    margin-top: 8px;
    color: var(--text-soft);
    line-height: 1.6;
    font-size: 0.9rem;
}

.list-stack,
.meta-stack {
    display: grid;
    gap: 14px;
}

.project-card,
.activity-item,
.ticket-row,
.user-card,
.role-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #e7eef5;
    border-radius: 16px;
    background: #f8fbff;
}

.ticket-row__top,
.project-card__top,
.user-card__top,
.role-card__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.entity-title {
    font-weight: 800;
}

.entity-subtitle {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.7;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-pill,
.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f2f7fc;
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1;
    white-space: nowrap;
}

.badge--slate {
    background: rgba(76, 97, 112, 0.12);
    color: #4c6170;
}

.badge--blue {
    background: rgba(34, 100, 176, 0.12);
    color: #225ea9;
}

.badge--indigo {
    background: rgba(76, 73, 161, 0.12);
    color: #4c49a1;
}

.badge--amber {
    background: rgba(183, 123, 9, 0.12);
    color: #9d6805;
}

.badge--orange {
    background: rgba(217, 99, 54, 0.12);
    color: var(--accent-strong);
}

.badge--green {
    background: rgba(29, 122, 85, 0.12);
    color: var(--success);
}

.badge--red {
    background: rgba(163, 59, 43, 0.12);
    color: var(--danger);
}

.badge--zinc {
    background: rgba(91, 99, 105, 0.1);
    color: #4d585f;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.toolbar__group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-grid {
    gap: 16px;
}

.dashboard-grid > .dashboard-panel {
    height: 100%;
}

.dashboard-panel .surface__header {
    padding: 14px 16px 10px;
}

.dashboard-panel .surface__body {
    padding: 0 16px 16px;
}

.dashboard-list {
    gap: 10px;
}

.dashboard-item {
    padding: 12px 14px;
    gap: 8px;
    border-radius: 12px;
}

.dashboard-item .entity-title {
    font-size: 0.96rem;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dashboard-item .entity-subtitle {
    font-size: 0.84rem;
    line-height: 1.45;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dashboard-item .meta-row {
    gap: 8px;
}

.dashboard-item .meta-pill,
.dashboard-item .badge {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.todo-stats {
    gap: 8px;
}

.todo-stats .meta-pill {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.todo-grid {
    gap: 14px;
    align-items: start;
}

.todo-column {
    display: grid;
    gap: 10px;
    align-content: start;
}

.todo-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.todo-column__header .surface__title {
    white-space: nowrap;
}

.todo-list {
    display: grid;
    gap: 10px;
}

.todo-item {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e7eef5;
    border-radius: 12px;
    background: #f8fbff;
}

.todo-item__main {
    display: grid;
    gap: 4px;
}

.todo-item .entity-title {
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.todo-item .entity-subtitle {
    font-size: 0.82rem;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.todo-item .meta-row {
    gap: 8px;
    align-items: center;
}

.todo-item .meta-pill,
.todo-item .badge {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.todo-item .btn {
    margin-left: auto;
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e7eef5;
    border-radius: 12px;
    background: #f8fbff;
}

.notification-item--unread {
    border-color: rgba(46, 124, 246, 0.18);
    background: #f3f8ff;
}

.notification-item__main {
    display: grid;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.notification-item__main .entity-title,
.notification-item__main .entity-subtitle {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.btn--primary {
    color: #ffffff;
    background: var(--accent);
    box-shadow: none;
}

.btn--secondary {
    border-color: var(--line);
    background: #f4f8fc;
    color: var(--text);
}

.btn--ghost {
    border-color: var(--line);
    background: #ffffff;
    color: var(--text);
}

.btn--danger {
    color: #ffffff;
    background: var(--danger);
    box-shadow: none;
}

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

.btn--small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.92rem;
}

.table-wrap {
    overflow: auto;
}

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

.table th,
.table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--text-soft);
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table td:not(:first-child) {
    word-break: keep-all;
}

.table td .entity-title {
    display: inline-block;
    white-space: nowrap;
}

.table td .entity-subtitle {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.table td .badge,
.table td .meta-pill,
.table td .chip,
.table td .timeline-time,
.table td .btn {
    white-space: nowrap;
}

.table td:last-child {
    min-width: 168px;
}

.table td:last-child .table-actions {
    flex-wrap: nowrap;
}

.issue-filter-panel .surface__body {
    padding-top: 18px;
}

.issue-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.issue-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, 0.8fr)) auto;
    gap: 12px;
    align-items: end;
}

.issue-filter-form .field {
    gap: 6px;
}

.issue-filter-form .field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-faint);
}

.issue-filter-form .input,
.issue-filter-form .select {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
}

.issue-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.issue-filter-actions .btn {
    min-height: 44px;
    white-space: nowrap;
}

.issues-table {
    width: 100%;
    table-layout: fixed;
}

.issues-table th,
.issues-table td {
    padding: 14px 10px;
}

.issues-table th:nth-child(1),
.issues-table td:nth-child(1) {
    width: 20%;
}

.issues-table th:nth-child(2),
.issues-table td:nth-child(2) {
    width: 7%;
}

.issues-table th:nth-child(3),
.issues-table td:nth-child(3) {
    width: 12%;
}

.issues-table th:nth-child(4),
.issues-table td:nth-child(4) {
    width: 8%;
}

.issues-table th:nth-child(5),
.issues-table td:nth-child(5) {
    width: 7%;
}

.issues-table th:nth-child(6),
.issues-table td:nth-child(6) {
    width: 8%;
}

.issues-table th:nth-child(7),
.issues-table td:nth-child(7) {
    width: 8%;
}

.issues-table th:nth-child(8),
.issues-table td:nth-child(8) {
    width: 10%;
}

.issues-table th:nth-child(9),
.issues-table td:nth-child(9) {
    width: 20%;
}

.issues-table__title-cell {
    min-width: 0;
}

.issues-table__title-cell .entity-title {
    display: inline-block;
    margin-bottom: 4px;
    white-space: nowrap;
}

.issues-table__title-cell .entity-subtitle {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.issues-table__pill-cell {
    white-space: nowrap;
    text-align: center;
}

.issues-table__project-cell {
    min-width: 0;
    line-height: 1.5;
    word-break: break-word;
}

.issues-table__owner-cell {
    min-width: 0;
    line-height: 1.5;
    word-break: break-word;
}

.issues-table__time-cell {
    min-width: 0;
    line-height: 1.5;
    word-break: break-word;
}

.issues-table__actions-cell {
    min-width: 0;
}

.issues-table td:last-child {
    min-width: 0;
}

.issues-table__actions-cell .table-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.issues-table__actions-cell .btn {
    min-width: 64px;
    padding: 0 12px;
}

.issues-table__actions-cell form {
    flex: 0 0 auto;
}

.issues-table__actions-cell .btn--small {
    min-height: 34px;
    font-size: 0.88rem;
}

.project-card__top > div,
.ticket-row__top > div,
.todo-item__main,
.notification-item__main,
.file-attachment-item__main {
    min-width: 0;
}

.project-card .surface__title,
.project-card .entity-title,
.ticket-row .entity-title,
.file-attachment-name {
    word-break: break-word;
}

.meta-row > .meta-pill,
.meta-row > .badge,
.meta-row > .chip {
    white-space: nowrap;
}

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

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

.field {
    display: grid;
    gap: 10px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-weight: 700;
}

.field small {
    color: var(--text-soft);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid rgba(25, 36, 46, 0.12);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea {
    min-height: 140px;
}

.input:focus,
.select:focus,
.textarea:focus,
.rich-editor__canvas:focus {
    border-color: rgba(217, 99, 54, 0.5);
    box-shadow: 0 0 0 4px rgba(217, 99, 54, 0.12);
}

.error-text {
    color: var(--danger);
    font-size: 0.9rem;
}

.error-panel {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(163, 59, 43, 0.18);
    background: rgba(163, 59, 43, 0.08);
    color: #7f3024;
}

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

.checkbox-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f8fbff;
}

.checkbox-card input {
    margin-top: 4px;
}

.rich-editor {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(25, 36, 46, 0.12);
    border-radius: 16px;
    background: #ffffff;
}

.rich-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #f7fafc;
}

.rich-editor__toolbar button {
    min-width: 36px;
    min-height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #ffffff;
    cursor: pointer;
}

.rich-editor__canvas {
    min-height: 280px;
    padding: 18px;
    outline: none;
    line-height: 1.8;
}

.rich-editor__canvas img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #e7eef5;
}

.rich-editor__canvas:empty::before {
    content: attr(data-placeholder);
    color: var(--text-faint);
}

.file-preview-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 14px;
}

.file-preview-card,
.attachment-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
}

.file-preview-thumb,
.attachment-thumb {
    display: grid;
    place-items: center;
    min-height: 120px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
}

.file-preview-thumb img,
.attachment-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.file-attachment-list {
    display: grid;
    gap: 10px;
}

.file-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e7eef5;
    border-radius: 12px;
    background: #f8fbff;
}

.file-attachment-item__main {
    display: grid;
    gap: 4px;
}

.file-attachment-name {
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.4;
}

.project-form-shell {
    border-radius: 16px;
}

.project-form-shell .surface__header {
    padding: 14px 16px 10px;
}

.project-form-body {
    padding: 0 16px 16px;
}

.project-form-grid {
    gap: 14px;
}

.project-form-grid .field {
    gap: 6px;
}

.project-form-grid .field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-faint);
}

.project-form-grid .input,
.project-form-grid .select {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
}

.project-form-grid .textarea {
    min-height: 108px;
    padding: 10px 12px;
    border-radius: 10px;
}

.password-form-shell {
    max-width: 520px;
}

.password-form-shell .surface__header {
    padding: 14px 16px 10px;
}

.password-form-body {
    padding: 0 16px 16px;
}

.password-form-grid {
    gap: 14px;
}

.password-form-grid .field {
    gap: 6px;
}

.password-form-grid .field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-faint);
}

.password-form-grid .input {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
}

.member-pick-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.member-pick-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
}

.member-pick-item:last-child {
    border-bottom: none;
}

.member-pick-item:hover {
    background: #f8fbff;
}

.member-pick-checkbox {
    margin: 0;
}

.member-pick-main {
    display: grid;
    gap: 3px;
}

.member-pick-name {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
}

.member-pick-meta {
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.35;
}

.member-pick-tag {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f2f7fc;
    color: var(--text-soft);
    font-size: 0.76rem;
    white-space: nowrap;
}

.detail-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.issue-detail-grid {
    gap: 16px;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.95fr);
}

.issue-detail-main,
.issue-detail-side {
    gap: 14px;
}

.issue-detail-card .surface__header {
    padding: 14px 16px 10px;
}

.issue-detail-card .surface__body {
    padding: 0 16px 16px;
}

.issue-toolbar {
    margin-bottom: 14px;
}

.issue-toolbar .badge,
.issue-toolbar .meta-pill {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.issue-compact-body {
    display: grid;
    gap: 12px;
}

.issue-compact-body .field {
    gap: 6px;
}

.issue-compact-body .field label {
    font-size: 0.82rem;
    color: var(--text-faint);
}

.issue-compact-body .input,
.issue-compact-body .select {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
}

.issue-compact-textarea {
    min-height: 92px;
    padding: 10px 12px;
    border-radius: 10px;
}

.detail-prose {
    line-height: 1.9;
    font-size: 0.92rem;
}

.detail-prose h1,
.detail-prose h2,
.detail-prose h3,
.detail-prose h4 {
    font-family: var(--font-display);
}

.detail-prose blockquote {
    margin: 0;
    padding-left: 16px;
    border-left: 3px solid rgba(217, 99, 54, 0.4);
    color: var(--text-soft);
}

.detail-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 10px;
    border: 1px solid #e7eef5;
}

.meta-stack {
    gap: 10px;
}

.timeline {
    display: grid;
    gap: 0;
}

.timeline--compact {
    gap: 0;
    position: relative;
}

.timeline--compact::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 8px;
    width: 1px;
    background: var(--line);
}

.timeline-item {
    position: relative;
    padding: 16px 16px 16px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-item strong {
    display: block;
    margin-bottom: 6px;
}

.timeline-item p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.8;
}

.timeline-item--compact {
    padding: 10px 0 10px 24px;
    border: none;
    border-bottom: 1px solid #edf2f7;
    border-radius: 0;
    background: transparent;
}

.timeline-item--compact::before {
    top: 16px;
    left: 4px;
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px #ffffff;
}

.timeline-item--compact strong {
    margin-bottom: 2px;
    font-size: 0.92rem;
    font-weight: 700;
}

.timeline-item__line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.timeline-item__actor {
    color: var(--text-faint);
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: nowrap;
}

.timeline-item__note {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-soft);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-item--compact:last-child {
    border-bottom: none;
}

.timeline-item--hidden {
    display: none;
}

.timeline-actions {
    margin-top: 10px;
}

.timeline-time {
    color: var(--text-faint);
    font-size: 0.78rem;
    white-space: nowrap;
}

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

.login-card {
    width: min(880px, 100%);
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(360px, 1fr);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: #ffffff;
}

.login-aside {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
    color: var(--text);
    background:
            radial-gradient(circle at top left, rgba(46, 124, 246, 0.12), transparent 36%),
            linear-gradient(180deg, #f8fbff 0%, #eff5fb 100%);
    border-right: 1px solid var(--line);
}

.login-aside h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.login-form-panel {
    padding: 36px;
    display: grid;
    align-content: center;
    gap: 18px;
}

.login-form-panel h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
}

.hint-panel {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px solid var(--line);
}

.hint-panel p {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.8;
}

.toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.toast--success {
    border-color: rgba(29, 122, 85, 0.18);
}

.toast--error {
    border-color: rgba(163, 59, 43, 0.18);
}

.toast__marker {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.toast--success .toast__marker {
    background: var(--success);
}

.toast--error .toast__marker {
    background: var(--danger);
}

.toast__close {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(31, 45, 61, 0.18);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.dialog-overlay.is-open {
    display: grid;
}

.dialog {
    width: min(460px, 100%);
    max-height: calc(100vh - 48px);
    padding: 22px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: auto;
}

.dialog h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
}

.dialog p {
    margin: 14px 0 0;
    color: var(--text-soft);
    line-height: 1.8;
}

.dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.dialog-close {
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1rem;
}

.password-dialog {
    width: min(420px, 100%);
}

.profile-dialog {
    width: min(760px, 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.password-dialog__form {
    display: grid;
    gap: 12px;
}

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

.profile-dialog__form {
    display: grid;
    gap: 18px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.profile-dialog__readonly,
.profile-dialog__grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-dialog__readonly .input[readonly] {
    background: #f8fbff;
    color: var(--text-soft);
}

.mobile-toggle {
    display: none;
}

.empty-state {
    padding: 32px 22px;
    text-align: center;
    color: var(--text-soft);
}

.empty-state strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 1200px) {
    .hero-metrics,
    .page-grid.three,
    .page-grid.two,
    .detail-grid {
        grid-template-columns: 1fr;
    }

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

    .issue-filter-actions {
        grid-column: 1 / -1;
    }

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

    .issue-detail-grid {
        grid-template-columns: 1fr;
    }
}

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

    .app-sidebar {
        display: none;
        min-height: auto;
    }

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

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

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

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

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

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

    .issue-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .issue-filter-actions {
        grid-column: auto;
    }

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

    .profile-dialog__readonly,
    .profile-dialog__grid {
        grid-template-columns: 1fr;
    }

    .file-attachment-item {
        flex-direction: column;
        align-items: stretch;
    }

    .member-pick-item {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .member-pick-tag {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .app-main,
    .login-shell {
        padding: 18px;
    }

    .page-header,
    .surface__header,
    .surface__body,
    .surface__footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .page-actions,
    .toolbar__group,
    .table-actions,
    .dialog__actions {
        width: 100%;
    }

    .topbar-actions {
        justify-content: stretch;
    }

    .topbar-menu,
    .topbar-menu .dropdown-panel,
    .user-menu-trigger,
    .icon-button {
        width: 100%;
    }

    .icon-button {
        justify-content: center;
    }

    .user-menu-trigger {
        justify-content: space-between;
        background: #ffffff;
        border: 1px solid var(--line);
        padding: 0 12px;
    }

    .page-actions .btn,
    .toolbar__group .btn,
    .dialog__actions .btn {
        flex: 1;
    }
}
