:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --ink: #20242c;
    --muted: #727b8d;
    --soft: #f1f2f7;
    --line: #e1e4ea;
    --purple: #7c3aed;
    --purple-soft: #efe7ff;
    --purple-light: #f6f1ff;
    --danger: #b42318;
    --warn: #b54708;
    --ok: #067647;
    --shadow: 0 14px 32px rgba(23, 32, 51, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

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

button {
    cursor: pointer;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

.pm-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.pm-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.pm-sidebar h1 {
    font-size: 1.35rem;
    margin-bottom: 18px;
}

.side-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 16px 12px 8px;
    text-transform: uppercase;
}

.side-label-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.side-nav,
.recent-list {
    display: grid;
    gap: 4px;
}

.side-nav a,
.recent-list a,
.empty-nav {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    font-size: 1.03rem;
    gap: 12px;
    min-height: 38px;
    padding: 0 14px;
}

.side-nav a.active {
    background: var(--purple-soft);
    color: var(--purple);
    font-weight: 700;
}

.side-nav.muted a {
    min-height: 36px;
}

.nav-icon {
    color: currentColor;
    font-weight: 700;
    width: 22px;
}

.recent-list a {
    font-size: 0.98rem;
    padding-left: 28px;
}

.dot,
.project-bullet {
    background: #635bff;
    border-radius: 4px;
    display: inline-block;
    flex: 0 0 auto;
    height: 12px;
    width: 12px;
}

.project-bullet {
    border-radius: 50%;
}

.pm-main {
    min-width: 0;
}

.pm-topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    height: 48px;
    justify-content: space-between;
    padding: 0 28px 0 12px;
}

.breadcrumbs {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.98rem;
    gap: 12px;
}

.breadcrumbs strong {
    color: #111318;
}

.top-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}

.top-actions button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #697386;
    display: inline-flex;
    font-size: 1.2rem;
    height: 40px;
    justify-content: center;
    min-width: 40px;
}

.top-actions .active,
.grid-app {
    background: var(--purple-light);
    border-radius: 6px;
    color: var(--purple);
}

.avatar,
.member-avatar {
    align-items: center;
    background: #1f2937;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.member-avatar {
    height: 30px;
    width: 30px;
}

.projects-page {
    padding: 14px 32px;
}

.page-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.page-heading h2 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

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

.primary-button,
.form-actions button {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
}

.primary-button,
.form-actions button {
    background: var(--purple);
    border: 1px solid var(--purple);
    color: #fff;
}

.status-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
}

.status-tabs a {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: inline-flex;
    font-size: 1.02rem;
    font-weight: 700;
    gap: 12px;
    min-height: 50px;
    padding: 0 20px;
}

.status-tabs a.active {
    background: #fff;
    box-shadow: var(--shadow);
    color: #111318;
}

.status-tabs span {
    background: var(--purple-light);
    border-radius: 999px;
    color: #6d5cff;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.project-toolbar {
    display: grid;
    grid-template-columns: 264px 236px 236px auto;
    gap: 12px;
    margin-bottom: 12px;
}

.search-box {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
}

.search-box input,
.project-toolbar select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    min-height: 38px;
    padding: 0 14px;
    width: 100%;
}

.search-box input {
    border: 0;
    min-height: auto;
    padding: 0;
}

.search-box input:focus,
.project-toolbar select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(124, 58, 237, 0.18);
}

.view-toggle {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    justify-self: start;
    overflow: hidden;
}

.view-toggle button {
    background: #fff;
    border: 0;
    color: #111318;
    font-size: 1.2rem;
    min-width: 54px;
}

.view-toggle button.active {
    background: var(--purple);
    color: #fff;
}

.project-table {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.project-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) 136px minmax(220px, 1fr) 132px 128px 82px;
    gap: 14px;
    min-height: 50px;
    padding: 0 24px;
}

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

.table-head {
    color: #9299a8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    min-height: 36px;
    text-transform: uppercase;
}

.project-name-cell {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.project-name-cell strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    align-items: center;
    background: var(--purple-light);
    border-radius: 999px;
    color: var(--purple);
    display: inline-flex;
    gap: 8px;
    padding: 6px 12px;
}

.status-pill.done {
    background: #eaf8ef;
    color: var(--ok);
}

.status-pill i {
    background: currentColor;
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.progress-cell {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 8px;
}

.progress-cell small {
    color: var(--muted);
    display: none;
    grid-column: 1 / -1;
}

.progress-track {
    background: #f0f0f2;
    border-radius: 999px;
    display: block;
    height: 5px;
    margin-top: 7px;
    overflow: hidden;
}

.progress-track span {
    background: var(--purple);
    display: block;
    height: 100%;
}

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

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

.row-actions {
    font-weight: 800;
    letter-spacing: 0.12em;
    position: relative;
}

.action-menu {
    display: inline-block;
    position: relative;
}

.action-menu summary {
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    padding: 6px 8px;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu[open] summary,
.action-menu summary:hover {
    background: var(--purple-light);
    color: var(--purple);
}

.action-menu-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    display: grid;
    gap: 2px;
    min-width: 132px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
}

.action-menu-panel a,
.action-menu-panel button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    display: block;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.action-menu-panel a:hover,
.action-menu-panel button:hover {
    background: var(--soft);
}

.action-menu-panel button {
    color: var(--danger);
}

.reminder-strip,
.task-workspace {
    margin-top: 16px;
}

.reminder-strip {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}

.reminder-strip h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.reminder-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.reminder {
    background: #fff7ed;
    border-left: 4px solid var(--warn);
    border-radius: 6px;
    padding: 12px;
}

.reminder.overdue {
    background: #fff1f3;
    border-left-color: var(--danger);
}

.reminder strong,
.reminder span,
.reminder small {
    display: block;
}

.reminder span,
.reminder small {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.task-workspace {
    align-items: start;
    display: block;
    gap: 20px;
}

.form-panel,
.task-card,
.empty-state {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-panel {
    padding: 22px;
}

.form-panel h3 {
    font-size: 1.2rem;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 0.86rem;
    font-weight: 700;
    gap: 8px;
    margin-bottom: 14px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    padding: 11px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.field-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.form-actions button {
    min-height: 44px;
    padding: 0 18px;
}

.form-actions a {
    color: var(--muted);
    font-weight: 700;
}

.task-board {
    display: grid;
    gap: 14px;
}

.board-title,
.project-section > header,
.completed-section > header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.eyebrow {
    color: var(--purple);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.board-title h3,
.project-section h3,
.completed-section h2 {
    margin-bottom: 0;
}

.board-title > span,
.project-section > header span,
.completed-section > header span {
    color: var(--muted);
    font-size: 0.9rem;
}

.project-section,
.completed-section {
    display: grid;
    gap: 12px;
}

.completed-section {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 20px;
}

.empty-state {
    padding: 32px;
    text-align: center;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 0;
}

.task-card {
    border-left: 5px solid transparent;
    padding: 18px;
}

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

.task-card.soon {
    border-left-color: var(--warn);
}

.task-card.scheduled {
    border-left-color: var(--purple);
}

.task-card.completed {
    background: #fafbfe;
    opacity: 0.9;
}

.task-card.completed h2 {
    text-decoration: line-through;
}

.task-head {
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.project-name {
    color: var(--purple);
    font-size: 0.82rem;
    font-weight: 700;
}

.task-card h2 {
    font-size: 1.16rem;
    margin: 4px 0 10px;
}

.task-card p {
    color: #344054;
    line-height: 1.5;
}

.priority {
    align-self: flex-start;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 10px;
}

.priority.low {
    background: #ecfdf3;
    color: var(--ok);
}

.priority.medium {
    background: #fffaeb;
    color: var(--warn);
}

.priority.high {
    background: #fff1f3;
    color: var(--danger);
}

.task-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.88rem;
    gap: 10px;
    margin-top: 14px;
}

.task-meta span {
    background: var(--soft);
    border-radius: 999px;
    padding: 7px 10px;
}

.task-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.task-actions button {
    background: transparent;
    border: 0;
    color: var(--danger);
    font-weight: 700;
    padding: 0;
}

.task-actions .complete-button {
    color: var(--ok);
}

.hidden {
    display: none !important;
}

.is-hidden {
    display: none !important;
}

.project-table.grid-view {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    overflow: visible;
}

.project-table.grid-view .table-head {
    display: none;
}

.project-table.grid-view .project-row {
    align-items: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr auto;
    min-height: 0;
    min-width: 0;
    padding: 20px;
}

.project-table.grid-view .project-name-cell,
.project-table.grid-view .progress-cell {
    grid-column: 1 / -1;
}

.project-table.grid-view .progress-cell {
    grid-template-columns: 1fr 46px;
}

.project-table.grid-view .created-date::before {
    content: "Created ";
}

.modal-overlay {
    align-items: center;
    background: rgba(17, 24, 39, 0.48);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 50;
}

.modal-overlay.open {
    display: flex;
}

.modal-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    width: min(560px, 100%);
}

.modal-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 18px 22px;
}

.modal-head h3 {
    margin-bottom: 0;
}

.modal-close {
    align-items: center;
    background: #f4f5f8;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    display: inline-flex;
    font-size: 1.4rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    width: 36px;
}

.modal-panel .form-panel {
    border: 0;
    border-radius: 0;
}

.modal-panel .form-panel > h3 {
    display: none;
}

@media (max-width: 1180px) {
    .pm-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .project-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .project-table {
        overflow-x: auto;
    }

    .project-table.list-view .project-row {
        min-width: 1180px;
    }
}

@media (max-width: 860px) {
    .pm-layout {
        display: block;
    }

    .pm-sidebar {
        height: auto;
        position: static;
    }

    .pm-topbar,
    .page-heading,
    .task-workspace {
        display: block;
    }
}

@media (max-width: 560px) {
    .projects-page {
        padding: 22px 14px;
    }

    .project-toolbar,
    .field-row {
        grid-template-columns: 1fr;
    }

    .status-tabs {
        overflow-x: auto;
    }
}
