:root {
    --bg: #f3f0e8;
    --bg-accent: #e7efe9;
    --surface: rgba(255, 252, 247, 0.88);
    --surface-solid: #fffdf9;
    --ink: #1c2a24;
    --muted: #5f6f67;
    --line: rgba(28, 42, 36, 0.1);
    --teal: #0f766e;
    --teal-deep: #115e59;
    --teal-soft: #d7ebe6;
    --amber: #c27803;
    --rose: #be3a4b;
    --blue: #1d4ed8;
    --shadow: 0 18px 50px rgba(28, 42, 36, 0.08);
    --radius: 18px;
    --sidebar: 320px;
    --font: "Outfit", "Segoe UI", sans-serif;
    --display: "Outfit", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* old Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    font-synthesis: none;
    color: var(--ink);
    scrollbar-width: none;
    -ms-overflow-style: none;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, #d9ebe4 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, #f0e2c8 0%, transparent 50%),
        linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

select {
    font-size: 1.05rem;
    line-height: 1.35;
    min-height: 2.75rem;
    padding: 0.7rem 2.5rem 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background-color: var(--surface-solid);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

select option,
select optgroup {
    font-size: 1.05rem;
    line-height: 1.5;
    padding: 0.65rem 0.85rem;
    font-family: var(--font);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.app {
    display: grid;
    grid-template-columns: var(--sidebar) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    padding: 1.25rem;
    border-right: 1px solid var(--line);
    background: transparent;
    overflow: hidden;
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.25rem 1.15rem;
    border-radius: 20px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.4rem 0.35rem 0.75rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.brand-home {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.brand-home:hover .brand-text strong,
.brand-home:focus-visible .brand-text strong {
    color: var(--teal-deep);
}

.brand-home:focus-visible {
    outline: 2px solid rgba(15, 118, 110, 0.45);
    outline-offset: 3px;
    border-radius: 0.75rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.95rem;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
    flex-shrink: 0;
    display: block;
    object-fit: cover;
}

.brand strong,
.brand-text strong {
    display: block;
    font-family: var(--display);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.brand span,
.brand-text > span {
    color: var(--muted);
    font-size: 0.95rem;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-shrink: 0;
}

.sidebar-label {
    margin: 0;
    padding: 0 0.45rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.nav-link,
.project-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    color: var(--muted);
    font-size: 1.05rem;
    min-width: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.project-link:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--ink);
}

.nav-link.is-active,
.project-link.is-active {
    background: var(--teal-soft);
    color: var(--teal-deep);
    font-weight: 600;
}

.nav-link em,
.project-link em {
    margin-left: auto;
    font-style: normal;
    font-size: 0.88rem;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(28, 42, 36, 0.06);
    flex-shrink: 0;
}

.nav-link em.warn {
    background: rgba(190, 58, 75, 0.12);
    color: var(--rose);
}

.sidebar-projects {
    flex: 1 1 auto;
    min-height: 8rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.85rem 0.7rem;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.05);
    border: 1px solid var(--line);
    overflow: hidden;
}

.sidebar-projects .section-head {
    margin-bottom: 0.2rem;
    flex-shrink: 0;
}

.sidebar-projects .project-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.15rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-projects .project-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sidebar-empty {
    margin: 0;
    padding: 0.75rem 0.95rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.project-link-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    padding: 0 0.15rem;
    gap: 0.5rem;
}

.section-head .sidebar-label {
    padding: 0;
}

.section-head h2 {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.text-btn {
    font-size: 0.9rem;
    color: var(--teal);
    font-weight: 600;
    flex-shrink: 0;
}

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--dot, var(--teal));
    flex-shrink: 0;
}

.sidebar-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.progress-block {
    padding: 1.05rem;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(15, 118, 110, 0.1), rgba(194, 120, 3, 0.08));
    border: 1px solid var(--line);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    font-size: 0.98rem;
}

.progress-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(28, 42, 36, 0.08);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--teal), #2dd4bf);
    border-radius: inherit;
}

.progress-block p {
    margin: 0.55rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.main {
    padding: 1.75rem 2rem 3rem;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 1.12rem;
}

.topbar h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.45rem 0.45rem 0.9rem;
    border-radius: 14px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
}

.topbar-user .account-meta {
    text-align: right;
}

.topbar-user .account-meta strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.topbar-user .account-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.1rem;
}

.topbar-user .btn {
    white-space: nowrap;
}

.search input,
.filter-form select,
.inline-form input[type="text"],
.modal input,
.modal textarea,
.modal select,
.task-actions select,
.project-edit input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    background-color: var(--surface-solid);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    outline: none;
}

.filter-form select,
.modal select,
.task-actions select,
.admin-form select,
#admin-edit-modal select {
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    font-size: 1.05rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
}

.search input:focus,
.filter-form select:focus,
.inline-form input:focus,
.modal input:focus,
.modal textarea:focus,
.modal select:focus,
.task-actions select:focus,
.project-edit input:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search input {
    min-width: 220px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 12px;
    padding: 0.7rem 1.05rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
    background: var(--teal-deep);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.btn-ghost:hover {
    background: rgba(28, 42, 36, 0.04);
    color: var(--ink);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--rose);
    border: 1px solid rgba(190, 58, 75, 0.2);
}

.btn-danger-ghost:hover {
    background: rgba(190, 58, 75, 0.08);
}

.toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 50;
    margin: 0;
    padding: 0.95rem 1.15rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 36px rgba(28, 42, 36, 0.12);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: min(420px, calc(100vw - 2rem));
    text-align: center;
}

.toast-success {
    color: var(--teal-deep);
    border-left: 4px solid var(--teal);
}

.toast-error {
    color: var(--rose);
    border-left: 4px solid var(--rose);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.dashboard-progress {
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: var(--ink);
}

.dashboard-progress-score {
    padding: 1.25rem 1.35rem;
    background: linear-gradient(135deg, var(--teal-soft), rgba(255, 253, 249, 0.9));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
}

.dashboard-progress-label {
    color: var(--teal-deep);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-progress-score > strong {
    font-family: var(--display);
    font-size: 2.6rem;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--teal-deep);
}

.dashboard-progress-bar {
    height: 0.55rem;
    background: rgba(17, 94, 89, 0.15);
}

.dashboard-progress-bar span {
    background: linear-gradient(90deg, var(--teal-deep), var(--teal));
}

.dashboard-progress-score p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.progress-breakdown {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-solid);
}

.progress-breakdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 1;
    padding: 0.85rem 1.35rem;
    border-bottom: 1px solid var(--line);
}

.progress-breakdown li:last-child {
    border-bottom: 0;
}

.progress-breakdown span {
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
}

.progress-breakdown strong {
    font-family: var(--display);
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
}

.progress-todo strong {
    color: var(--muted);
}

.progress-doing strong {
    color: var(--amber);
}

.progress-done strong {
    color: var(--teal);
}

@media (max-width: 720px) {
    .dashboard-progress-score {
        padding: 1.15rem 1.2rem;
    }
}

.stat {
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.stat strong {
    font-family: var(--display);
    font-size: 2.1rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-warn strong {
    color: var(--rose);
}

.stat-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-link:hover,
.stat-link:focus-visible {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.stat-link.is-active {
    border-color: rgba(15, 118, 110, 0.4);
    background: var(--teal-soft);
}

.due-alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.due-alert[hidden] {
    display: none !important;
}

.due-alert-urgent {
    border-color: rgba(190, 58, 75, 0.28);
    background: linear-gradient(180deg, rgba(190, 58, 75, 0.07), var(--surface));
}

.due-alert-today {
    border-color: rgba(15, 118, 110, 0.28);
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.08), var(--surface));
}

.due-alert-body {
    min-width: 0;
    flex: 1;
}

.due-alert-title {
    display: block;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.due-alert-urgent .due-alert-title {
    color: var(--rose);
}

.due-alert-today .due-alert-title {
    color: var(--teal-deep);
}

.due-alert-body p {
    margin: 0 0 0.85rem;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.95rem;
}

.due-alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.due-alert-dismiss {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    flex-shrink: 0;
}

.due-alert-dismiss:hover,
.due-alert-dismiss:focus-visible {
    color: var(--ink);
}

@media (max-width: 640px) {
    .due-alert {
        flex-direction: column;
        gap: 0.75rem;
    }

    .due-alert-dismiss {
        align-self: flex-end;
    }
}

.filters {
    margin-bottom: 1.25rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-form label,
.inline-form label,
.modal label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}

.filter-form select {
    min-width: 170px;
    font-size: 1.05rem;
}

.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.task-item:hover {
    box-shadow: var(--shadow);
}

.task-item.status-done {
    opacity: 0.72;
}

.task-item.status-done .task-title-row h3 {
    text-decoration: line-through;
    color: var(--muted);
}

.check {
    width: 1.55rem;
    height: 1.55rem;
    margin-top: 0.15rem;
    border-radius: 50%;
    border: 2px solid rgba(15, 118, 110, 0.45);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.check:hover {
    border-color: var(--teal);
}

.check.is-done {
    background: var(--teal);
    border-color: var(--teal);
}

.check.is-done::after {
    content: "";
    position: absolute;
    left: 0.38rem;
    top: 0.18rem;
    width: 0.35rem;
    height: 0.65rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.task-title-row h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: capitalize;
}

.task-notes {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    text-transform: capitalize;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.task-meta .meta-pill,
.task-title-row .badge {
    text-transform: capitalize;
}

.meta-pill,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(28, 42, 36, 0.05);
    color: var(--muted);
}

.badge-urgent {
    background: rgba(190, 58, 75, 0.12);
    color: var(--rose);
}

.badge-high {
    background: rgba(194, 120, 3, 0.14);
    color: #9a6700;
}

.badge-medium {
    background: rgba(29, 78, 216, 0.1);
    color: var(--blue);
}

.badge-low {
    background: rgba(15, 118, 110, 0.1);
    color: var(--teal-deep);
}

.due.overdue {
    background: rgba(190, 58, 75, 0.12);
    color: var(--rose);
}

.due.today {
    background: rgba(194, 120, 3, 0.14);
    color: #9a6700;
}

.due.soon {
    background: rgba(15, 118, 110, 0.1);
    color: var(--teal-deep);
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-actions select {
    width: auto;
    min-width: 9.5rem;
    padding: 0.65rem 2.4rem 0.65rem 0.85rem;
    font-size: 1.05rem;
    text-transform: capitalize;
}

.empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border-radius: calc(var(--radius) + 4px);
    border: 1px dashed rgba(15, 118, 110, 0.3);
    background: rgba(255, 252, 247, 0.55);
}

.empty h2 {
    margin: 0 0 0.5rem;
    font-family: var(--display);
}

.empty p {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.panel-intro {
    margin-bottom: 1.25rem;
}

.panel-intro h2 {
    margin: 0 0 0.35rem;
    font-family: var(--display);
}

.panel-intro p {
    margin: 0;
    color: var(--muted);
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.85rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}

.inline-form label {
    font-size: 1.05rem;
    gap: 0.45rem;
}

.inline-form label span {
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 600;
}

.inline-form input[type="text"] {
    font-size: 1.15rem;
    padding: 0.9rem 1rem;
    min-height: 3rem;
}

.inline-form input[type="color"] {
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.inline-form .btn {
    font-size: 1.05rem;
    padding: 0.9rem 1.2rem;
    min-height: 3rem;
}

.projects-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.project-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.15rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.project-create-form-top {
    flex-direction: unset;
}

.project-create-form label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 600;
}

.project-create-form input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-solid);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-size: 1.15rem;
    min-height: 3rem;
    height: 3rem;
    outline: none;
}

.project-create-form input:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.projects-table {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.projects-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 0 0.35rem 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.projects-table-head span:last-child {
    text-align: right;
    padding-right: 0.35rem;
}

.project-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent, var(--teal));
    box-shadow: var(--shadow);
}

.project-row-identity {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.project-swatch {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.75rem;
    background: var(--accent, var(--teal));
    flex-shrink: 0;
}

.project-row-identity strong {
    display: block;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}

.project-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.project-view-link {
    display: inline-block;
    color: var(--teal);
    font-size: 0.88rem;
    font-weight: 600;
}

.project-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .projects-summary {
        grid-template-columns: 1fr;
    }

    .projects-table-head {
        display: none;
    }

    .project-row {
        grid-template-columns: 1fr;
    }

    .project-row-actions {
        width: 100%;
    }
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.9rem;
}

.project-card {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent, var(--teal));
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-edit-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    align-items: center;
}

.project-edit input[type="color"] {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.project-edit input[type="text"] {
    font-size: 1.15rem;
    padding: 0.85rem 0.95rem;
    min-height: 2.85rem;
}

.project-edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.back-link {
    margin-top: 1.5rem;
}

.back-link a {
    color: var(--teal);
    font-weight: 600;
}

dialog.modal {
    border: 0;
    padding: 1rem;
    background: transparent;
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

dialog.modal:not([open]) {
    display: none;
}

.modal::backdrop {
    background: rgba(28, 42, 36, 0.45);
}

.today-modal::backdrop {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(15, 118, 110, 0.22), transparent 60%),
        rgba(28, 42, 36, 0.55);
}

.today-modal-card {
    width: min(720px, 100%);
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: hidden;
    font-size: 1.08rem;
}

#task-modal .modal-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 2rem);
    font-size: 1.08rem;
}

.today-modal-hero {
    position: relative;
    padding: 1.7rem 1.7rem 1.45rem;
    padding-right: 4.2rem;
    background:
        radial-gradient(ellipse 90% 80% at 100% 0%, rgba(45, 212, 191, 0.28), transparent 55%),
        linear-gradient(145deg, #0f766e 0%, #115e59 100%);
    color: #fff;
}

.today-modal-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.today-modal-copy {
    min-width: 0;
    flex: 1;
}

.today-modal-close.icon-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.35rem;
}

.today-modal-close.icon-btn:hover,
.today-modal-close.icon-btn:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
}

.today-modal-date {
    margin: 0 0 0.4rem;
    font-size: 1.08rem;
    opacity: 0.88;
}

.today-modal-hero h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.1rem, 4.5vw, 2.55rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.today-modal-lead {
    margin: 0.75rem 0 0;
    max-width: none;
    font-size: 1.12rem;
    line-height: 1.45;
    opacity: 0.92;
}

.today-modal-count {
    position: static;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    align-self: flex-start;
    min-width: 5rem;
    margin: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    text-align: center;
    line-height: 1.1;
}

.today-modal-count strong {
    font-size: 1.75rem;
    font-weight: 700;
}

.today-modal-count span {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
}

.today-modal-body {
    gap: 0;
    padding: 1rem 1.2rem 0.5rem 2.15rem;
    max-height: min(60vh, 480px);
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.today-modal-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.today-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.today-task-btn {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-solid);
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.today-task-btn:hover,
.today-task-btn:focus-visible {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 10px 24px rgba(28, 42, 36, 0.08);
}

.today-task-btn.is-hot {
    border-color: rgba(190, 58, 75, 0.22);
}

.today-task-accent {
    display: block;
    background: var(--teal);
}

.today-task-btn.priority-urgent .today-task-accent {
    background: var(--rose);
}

.today-task-btn.priority-high .today-task-accent {
    background: #dc6b2f;
}

.today-task-btn.priority-medium .today-task-accent {
    background: var(--teal);
}

.today-task-btn.priority-low .today-task-accent {
    background: #94a3b8;
}

.today-task-main {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.05rem 0;
    min-width: 0;
}

.today-task-title {
    font-weight: 650;
    font-size: 1.18rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-transform: capitalize;
}

.today-task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.98rem;
    text-transform: capitalize;
}

.today-task-side .badge,
.today-task-due {
    text-transform: capitalize;
}

.today-task-project {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.today-task-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.05rem 1.1rem 1.05rem 0;
}

.today-task-side .badge {
    font-size: 0.9rem;
    padding: 0.28rem 0.55rem;
}

.today-task-due {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--teal-deep);
}

.today-task-due.overdue {
    color: var(--rose);
}

.today-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1.15rem 1.35rem 1.35rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(215, 235, 230, 0.35));
}

.today-modal-foot .btn {
    font-size: 1.08rem;
    padding: 0.85rem 1.25rem;
}

@media (max-width: 560px) {
    dialog.modal {
        padding: 0.625rem;
    }

    .today-modal-card,
    #task-modal .modal-card {
        width: min(100%, calc(100vw - 1.25rem));
        max-height: calc(100vh - 1.25rem);
    }

    .today-modal-card {
        font-size: 1.02rem;
    }

    .today-modal-hero {
        padding: 1.4rem 1.25rem 1.25rem;
        padding-right: 3.75rem;
    }

    .today-modal-count {
        min-width: 0;
        padding: 0.4rem 0.7rem;
    }

    .today-modal-count strong {
        font-size: 1.2rem;
    }

    .today-task-btn {
        grid-template-columns: 8px 1fr;
    }

    .today-task-side {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 0 1rem 1rem;
    }

    .today-task-title {
        font-size: 1.1rem;
    }
}

.plan-modal-card {
    width: min(560px, 100%);
}

.plan-modal-eyebrow {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.plan-modal-body {
    gap: 1.15rem;
    max-height: min(60vh, 420px);
    overflow: auto;
}

.plan-group h3 {
    margin: 0 0 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.plan-group h3 em {
    font-style: normal;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.8rem;
}

.plan-group-overdue h3 {
    color: var(--rose);
}

.plan-group-today h3 {
    color: var(--teal-deep);
}

.plan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.plan-list a,
.plan-task-btn {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.plan-list a:hover,
.plan-list a:focus-visible,
.plan-task-btn:hover,
.plan-task-btn:focus-visible {
    border-color: rgba(15, 118, 110, 0.35);
    background: var(--teal-soft);
}

.plan-task-title {
    font-weight: 600;
    line-height: 1.3;
}

.plan-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.plan-task-meta .overdue {
    color: var(--rose);
}

.plan-task-meta .today {
    color: var(--teal-deep);
}

.plan-task-meta .soon {
    color: var(--ink);
}

.modal-card {
    width: min(560px, 100%);
    max-width: 100%;
    background: var(--surface-solid);
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(28, 42, 36, 0.22);
    overflow: hidden;
}

.modal-card.today-modal-card {
    width: min(720px, 100%);
}

#task-modal .modal-head,
#task-modal .modal-foot,
#task-modal .modal-body {
    padding: 1.25rem 1.4rem;
}

#task-modal .modal-head h2 {
    font-size: 1.65rem;
}

#task-modal .modal-body {
    gap: 1rem;
}

#task-modal label {
    font-size: 1.12rem;
    gap: 0.5rem;
    color: var(--ink);
    font-weight: 400;
}

#task-modal label span {
    font-size: 1.12rem;
    font-weight: 700;
    text-transform: capitalize;
}

#task-modal .modal input,
#task-modal .modal textarea,
#task-modal .modal select,
#task-modal input,
#task-modal textarea,
#task-modal select {
    padding: 0.85rem 1rem;
    font-size: 1.12rem;
    font-weight: 400;
    border-radius: 12px;
    border: 2.5px solid rgba(28, 42, 36, 0.35);
    background-color: #fff;
    text-transform: capitalize;
}

#task-modal input:focus,
#task-modal textarea:focus,
#task-modal select:focus {
    border-color: var(--teal-deep);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

#task-modal input[type="date"] {
    text-transform: none;
    font-weight: 400;
}

#task-modal select {
    padding-right: 2.5rem;
    min-height: 3rem;
}

#task-modal .form-grid {
    gap: 0.9rem;
}

#task-modal .btn {
    padding: 0.8rem 1.2rem;
    font-size: 1.08rem;
}

#project-edit-modal .modal-card {
    width: min(560px, 100%);
    font-size: 1.12rem;
}

#project-edit-modal .modal-head,
#project-edit-modal .modal-foot,
#project-edit-modal .modal-body {
    padding: 1.35rem 1.6rem;
}

#project-edit-modal .modal-head h2 {
    font-size: 1.6rem;
}

#project-edit-modal .modal-body {
    gap: 1.1rem;
}

#project-edit-modal label {
    font-size: 1.1rem;
    gap: 0.5rem;
}

#project-edit-modal label span {
    font-size: 1.1rem;
    font-weight: 600;
}

#project-edit-modal input[type="text"] {
    font-size: 1.2rem;
    padding: 0.95rem 1.05rem;
    min-height: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
}

#project-edit-modal .color-box-field input[type="color"] {
    width: 3.25rem !important;
    height: 3.25rem !important;
    min-height: 3.25rem !important;
}

#project-edit-modal .btn {
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
}

.modal-head,
.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.modal-head {
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 1.35rem;
}

.modal-body {
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.modal-foot {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.icon-btn {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
}

.icon-btn:hover {
    background: rgba(28, 42, 36, 0.06);
    color: var(--ink);
}

.mobile-bar {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-close {
    display: none;
}

@media (max-width: 980px) {
    .app {
        grid-template-columns: 1fr;
    }

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        position: sticky;
        top: 0;
        z-index: 40;
        padding: 0.85rem 1rem;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    .mobile-bar-brand {
        display: inline-flex;
        align-items: center;
        gap: 0.65rem;
        min-width: 0;
        color: inherit;
        text-decoration: none;
        font-family: var(--display);
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    .mobile-bar-brand .brand-mark {
        width: 2rem;
        height: 2rem;
        border-radius: 0.65rem;
        box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
    }

    .mobile-bar-brand:hover,
    .mobile-bar-brand:focus-visible {
        color: var(--teal-deep);
    }

    .mobile-bar-title {
        font-family: var(--display);
        font-size: 1.25rem;
        letter-spacing: -0.02em;
        color: inherit;
        text-decoration: none;
    }

    .mobile-bar-title:hover,
    .mobile-bar-title:focus-visible {
        color: var(--teal-deep);
    }

    .menu-toggle {
        width: 2.6rem;
        height: 2.6rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.32rem;
        cursor: pointer;
        padding: 0;
    }

    .menu-toggle span {
        display: block;
        width: 1.15rem;
        height: 2px;
        border-radius: 2px;
        background: var(--ink);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(28, 42, 36, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.menu-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.menu-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        width: min(320px, 88vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding: 0.85rem;
        border-right: 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow: hidden;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-inner {
        height: 100%;
        overflow: hidden;
    }

    .sidebar-close {
        display: grid;
        place-items: center;
        margin-left: auto;
        width: 2.4rem;
        height: 2.4rem;
        border: 0;
        border-radius: 10px;
        background: rgba(28, 42, 36, 0.06);
        color: var(--ink);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
        flex-shrink: 0;
    }

    .brand {
        gap: 0.7rem;
    }

    .brand-home {
        gap: 0.7rem;
    }

    .sidebar-projects {
        flex: none;
        min-height: 0;
        max-height: 16rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-list {
        gap: 0.85rem;
    }

    .task-item {
        grid-template-columns: auto 1fr;
        gap: 0.7rem 0.8rem;
        padding: 0.95rem 1rem 1rem;
        align-items: start;
    }

    .task-check {
        padding-top: 0.1rem;
    }

    .task-body {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .task-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .task-title-row h3 {
        font-size: 1.08rem;
        line-height: 1.35;
        width: 100%;
        word-break: break-word;
    }

    .task-notes {
        margin: 0;
        font-size: 0.95rem;
    }

    .task-meta {
        margin-top: 0.15rem;
        gap: 0.4rem;
    }

    .task-meta .meta-pill.muted {
        display: none;
    }

    .task-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.55rem;
        width: 100%;
        margin-top: 0.35rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--line);
        justify-content: stretch;
        align-items: center;
    }

    .task-actions > form:first-child {
        grid-column: 1 / -1;
    }

    .task-actions select {
        width: 100%;
        min-width: 0;
    }

    .task-actions .btn {
        min-height: 2.6rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 1.25rem 1rem 2.5rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-user {
        justify-content: space-between;
        width: 100%;
    }

    .topbar-user .account-meta {
        text-align: left;
    }

    .search input {
        min-width: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .task-item {
        padding: 0.9rem 0.9rem 0.95rem;
    }

    .task-title-row h3 {
        font-size: 1.05rem;
    }

    .task-actions {
        grid-template-columns: 1fr 1fr;
    }

    .task-actions > form:first-child {
        grid-column: 1 / -1;
    }

    .task-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .filters {
        margin-bottom: 1rem;
    }

    .filter-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .filter-form select {
        min-width: 0;
        width: 100%;
    }
}

/* Auth — top-anchored layout avoids vertical jump from font/centering recalculation */
html:has(body.auth-page) {
    scrollbar-gutter: auto;
}

.auth-page {
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: block;
    padding: clamp(2.5rem, 14vh, 7rem) 1.5rem 2rem;
    overflow: hidden;
    box-sizing: border-box;
}

.auth-shell {
    width: min(560px, 100%);
    margin: 0 auto;
}

.auth-card {
    padding: 2.25rem 2.4rem;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: 1.12rem;
    min-height: 26rem;
}

.auth-brand {
    margin-bottom: 1.6rem;
}

.auth-brand strong {
    font-size: 1.7rem;
}

.auth-brand span {
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 400;
}

.auth-form label span {
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    border: 2.5px solid rgba(28, 42, 36, 0.35);
    background: #fff;
    border-radius: 14px;
    padding: 0.95rem 1.05rem;
    font-size: 1.05rem;
    font-weight: 400;
    outline: none;
    min-height: 3.25rem;
    height: 3.25rem;
    box-sizing: border-box;
}

.auth-form input:focus {
    border-color: var(--teal-deep);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.btn-block {
    width: 100%;
}

.auth-form .btn {
    padding: 0.95rem 1.25rem;
    font-size: 1.08rem;
    margin-top: 0.25rem;
    min-height: 3.25rem;
}

.auth-toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 50;
    margin: 0;
    padding: 0.95rem 1.15rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 36px rgba(28, 42, 36, 0.12);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: min(420px, calc(100vw - 2rem));
    text-align: center;
}

.auth-toast.toast-success {
    color: var(--teal-deep);
    border-left: 4px solid var(--teal);
}

.auth-toast.toast-error {
    color: var(--rose);
    border-left: 4px solid var(--rose);
}

.auth-hint {
    margin: 1.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-hint code {
    font-family: var(--font);
    font-size: 0.92rem;
    background: rgba(28, 42, 36, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.account-block {
    margin-top: 0;
    padding: 1rem;
    border-radius: 16px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-meta strong {
    display: block;
    font-size: 1.05rem;
}

.account-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 0.15rem;
    word-break: break-all;
}

.create-block {
    margin-bottom: 1.75rem;
}

.create-block .panel-intro {
    margin-bottom: 0.85rem;
}

.create-block-action {
    display: flex;
    align-items: flex-end;
}

.admin-form-top {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.admin-form-top .btn {
    white-space: nowrap;
    min-height: 2.75rem;
}

.project-create-form-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.85rem;
    align-items: end;
}

.project-create-form-top .project-name-field {
    min-width: 0;
}

.project-create-form-top .btn {
    white-space: nowrap;
    min-height: 3rem;
}

.color-box-field {
    display: flex !important;
    flex-direction: column;
    gap: 0.45rem;
    width: fit-content;
}

.color-box-field input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 3rem !important;
    height: 3rem !important;
    min-width: 3rem;
    min-height: 3rem !important;
    padding: 0 !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-solid);
    cursor: pointer;
    overflow: hidden;
}

.color-box-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 11px;
}

.color-box-field input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 11px;
}

.color-box-field input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 11px;
}

.project-create-form-top .color-box-field input[type="color"] {
    width: 3rem !important;
    height: 3rem !important;
}

@media (max-width: 980px) {
    .admin-form-top,
    .project-create-form-top {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .create-block {
        margin-bottom: 1.35rem;
    }

    .create-block .panel-intro h2 {
        font-size: 1.35rem;
    }

    .admin-form.admin-form-top {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.15rem;
    }

    .admin-form-top label {
        width: 100%;
        font-size: 1.05rem;
        gap: 0.45rem;
    }

    .admin-form-top input,
    .admin-form-top select {
        width: 100%;
        min-height: 3.25rem;
        font-size: 1.1rem;
        padding: 0.9rem 1rem;
        border-radius: 14px;
    }

    .admin-form-top select {
        padding-right: 2.6rem;
    }

    .create-block-action {
        width: 100%;
        margin-top: 0.25rem;
    }

    .create-block-action .btn {
        width: 100%;
        min-height: 3.25rem;
        font-size: 1.1rem;
        padding: 0.95rem 1.15rem;
    }

    .admin-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #admin-edit-modal .modal-card {
        width: min(100%, calc(100vw - 1.5rem));
        font-size: 1.08rem;
    }

    #admin-edit-modal .form-grid {
        grid-template-columns: 1fr;
    }

    #admin-edit-modal input,
    #admin-edit-modal select {
        min-height: 3.15rem;
        font-size: 1.08rem;
    }

    #admin-edit-modal .modal-foot {
        flex-direction: column-reverse;
    }

    #admin-edit-modal .modal-foot .btn {
        width: 100%;
        min-height: 3rem;
    }
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.admin-form-top {
    flex-direction: unset;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 600;
}

.admin-form input,
.admin-form select,
.admin-row input,
.admin-row select {
    width: 100%;
    border: 1px solid var(--line);
    background-color: var(--surface-solid);
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    outline: none;
    font-size: 1.05rem;
}

.admin-form select {
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-row input:focus,
.admin-row select:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.admin-table {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 120px minmax(140px, 1fr) auto;
    gap: 0.75rem;
    padding: 0 0.35rem 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.admin-table-head-simple {
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-table-head span:last-child {
    text-align: right;
    padding-right: 0.35rem;
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.admin-row-simple {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.admin-row-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 120px minmax(140px, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.admin-person {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.admin-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--teal-soft);
    color: var(--teal-deep);
    font-weight: 700;
    margin-top: 0.15rem;
}

.admin-person-fields,
.admin-person-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.admin-person-info {
    gap: 0.2rem;
}

.admin-person-info strong {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.admin-person-info > span:not(.meta-pill) {
    color: var(--muted);
    font-size: 0.88rem;
    word-break: break-all;
}

.admin-person-info .meta-pill {
    margin-top: 0.3rem;
    width: fit-content;
}

.you-tag {
    font-style: normal;
    font-size: 0.75rem;
    color: var(--teal-deep);
    font-weight: 600;
}

.admin-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.admin-delete,
.admin-delete-spacer {
    width: 5.5rem;
}

.admin-delete .btn {
    width: 100%;
}

@media (max-width: 860px) {
    .admin-summary {
        grid-template-columns: 1fr;
    }

    .admin-table-head {
        display: none;
    }

    .admin-row,
    .admin-row-simple {
        grid-template-columns: 1fr;
    }

    .admin-row-form {
        grid-template-columns: 1fr;
    }

    .admin-row-actions,
    .admin-delete,
    .admin-delete-spacer {
        width: 100%;
    }

    .admin-row-actions .btn,
    .admin-delete .btn {
        width: auto;
    }
}

.settings-panel {
    max-width: 40rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1.25rem 0 1rem;
}

.setting-row {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}

.setting-row input {
    margin-top: 0.3rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--teal);
    flex-shrink: 0;
}

.setting-row strong {
    display: block;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.setting-row em {
    display: block;
    margin-top: 0.25rem;
    font-style: normal;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.settings-status {
    min-height: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.settings-box {
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 1.5rem;
}

.settings-box h3 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
}

.settings-box p {
    margin: 0 0 0.7rem;
    color: var(--ink);
    line-height: 1.5;
}

.settings-install-list {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    color: var(--ink);
    line-height: 1.55;
}

.settings-install-list li + li {
    margin-top: 0.35rem;
}

.settings-box code,
.settings-code {
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
    font-size: 0.86rem;
}

.settings-ok {
    color: var(--teal-deep) !important;
    font-weight: 600;
}

.settings-hint {
    color: var(--muted) !important;
    font-size: 0.92rem;
}

.settings-code {
    display: block;
    padding: 0.75rem 0.85rem;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 0.55rem;
    word-break: break-all;
    line-height: 1.45;
}

.settings-inline-form {
    margin-bottom: 0.85rem;
}
