:root {
    --navy: #141821;
    --navy-2: #1c2330;
    --navy-hover: #282f3d;
    --muted: #909cb5;
    --page: #f4f8fd;
    --panel: #ffffff;
    --line: #e4ebf4;
    --accent: #0e9f90;
    --accent-soft: #d8f4f0;
    --danger: #d64545;
    --text: #141821;
    --header-h: 56px;
    --sidebar-w: 232px;
    --font: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    --shadow: 0 10px 30px rgba(20, 24, 33, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    font-family: var(--font);
    margin: 0;
    background-color: var(--page);
    color: var(--text);
    min-height: 100vh;
}

body:has(.atlas-app) {
    overflow: hidden;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-form {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 280px;
}

.login-form h2 {
    margin-top: 0;
    color: var(--navy);
}

.error {
    color: var(--danger);
    margin-bottom: 10px;
}

input[type="password"] {
    padding: 8px;
    margin: 10px 0;
    width: 200px;
    font-family: var(--font);
}

input[type="submit"] {
    padding: 8px 15px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font);
}

input[type="submit"]:hover {
    background-color: #0b8276;
}

.menu {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.menu > ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    height: var(--header-h);
    padding: 0 18px;
    margin: 0;
}

.menu li {
    display: block;
    margin: 0;
}

.menu a {
    text-decoration: none;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.menu a:hover {
    background-color: var(--navy-hover);
    color: #ffffff;
}

.menu a.menu-brand {
    display: inline-flex;
    align-items: center;
    padding: 0 10px 0 0;
    margin-right: 10px;
    vertical-align: middle;
}

.menu a.menu-brand img {
    height: 26px;
    width: auto;
    display: block;
}

.menu a.menu-brand:hover {
    background-color: transparent;
}

.menu-category {
    position: relative;
}

.category-name,
.menu-category-standalone > a {
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block;
    font-size: 0.92rem;
}

.category-name:hover,
.menu-category:hover .category-name,
.menu-category-standalone > a:hover,
.menu-category.is-active .category-name,
.menu-category-standalone.is-active > a {
    background-color: var(--navy-hover);
    color: #ffffff;
}

.menu-category:hover .dropdown {
    display: block;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--navy);
    min-width: 250px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    padding: 8px 0;
    z-index: 1000;
    margin-top: 0;
    padding-top: 10px;
}

.dropdown::before {
    content: "";
    display: block;
    height: 8px;
    margin-top: -8px;
}

.dropdown li {
    display: block;
    margin: 0;
}

.dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown a:hover,
.dropdown a.is-active {
    background-color: var(--navy-hover);
    color: #ffffff;
}

.start-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 72px;
}

.start-header {
    margin-bottom: 40px;
}

.start-header h1 {
    margin: 0 0 8px;
}

.start-header h1 img {
    height: 48px;
    width: auto;
    display: block;
}

.start-header p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.start-category {
    margin-bottom: 40px;
}

.start-category h2 {
    margin: 0 0 16px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.start-card {
    display: block;
    min-height: 140px;
    padding: 24px;
    background: var(--panel);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(20, 24, 33, 0.06);
    border-left: 4px solid var(--navy);
    text-decoration: none;
    color: var(--navy);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.start-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.start-card-featured {
    border-left-color: var(--accent);
    background:
        linear-gradient(180deg, rgba(14, 159, 144, 0.08), rgba(255, 255, 255, 0) 48%),
        var(--panel);
}

.start-card h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: var(--navy);
}

.start-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.atlas-app {
    display: flex;
    height: calc(100vh - var(--header-h));
    min-height: 0;
    background: var(--page);
}

.atlas-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.atlas-sidebar-brand {
    padding: 22px 20px 12px;
}

.atlas-sidebar-kicker,
.atlas-kicker,
.atlas-nav-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.atlas-sidebar-brand strong {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
    font-weight: 650;
}

.atlas-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 12px 24px;
    gap: 2px;
}

.atlas-nav-label {
    margin: 18px 10px 6px;
}

.atlas-nav-link {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #c5cedd;
    text-decoration: none;
    font-size: 0.95rem;
}

.atlas-nav-link:hover {
    background: var(--navy-hover);
    color: #fff;
}

.atlas-nav-link.is-active {
    background: rgba(14, 159, 144, 0.16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.atlas-nav-empty {
    margin: 0 12px;
    color: var(--muted);
    font-size: 0.85rem;
}

.atlas-main {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 28px 32px 48px;
}

.atlas-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.atlas-page-head h1,
.atlas-empty h1,
.atlas-empty h2,
.atlas-panel h2,
.atlas-panel h3 {
    margin: 0;
    color: var(--navy);
}

.atlas-page-head h1 {
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.atlas-lead,
.atlas-panel-head p,
.atlas-inline-empty,
.atlas-empty p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.atlas-head-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.atlas-scroll-controls {
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}

.atlas-scroll-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    color: var(--navy);
}

.atlas-scroll-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.atlas-scroll-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.atlas-scroll-btn:focus-visible {
    outline: 2px solid rgba(14, 159, 144, 0.35);
    outline-offset: 1px;
}

.atlas-scroll-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.atlas-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
}

.atlas-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5b677c;
    font-size: 0.82rem;
}

.atlas-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20, 24, 33, 0.04);
    padding: 20px 22px;
    margin-bottom: 18px;
}

.atlas-panel-head {
    margin-bottom: 16px;
}

.atlas-panel-head.is-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.atlas-panel-head h2 {
    font-size: 1.05rem;
}

.atlas-table-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20, 24, 33, 0.04);
    overflow: hidden;
}

.atlas-table-scroll {
    overflow: auto;
    max-width: 100%;
}

.atlas-table-inset {
    border: 1px solid var(--line);
    border-radius: 12px;
}

.atlas-matrix {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    width: 100%;
    font-size: 0.92rem;
}

.atlas-matrix th,
.atlas-matrix td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 10px 12px;
    text-align: center;
    background: #fff;
    vertical-align: middle;
}

.atlas-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
    color: var(--navy);
    font-weight: 650;
    white-space: nowrap;
}

.atlas-col-dept,
.atlas-col-task {
    text-align: left;
    white-space: nowrap;
}

.atlas-col-dept {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 132px;
    width: 132px;
    background: #f8fafc;
}

.atlas-col-task {
    position: sticky;
    left: 132px;
    z-index: 3;
    min-width: 180px;
    width: 180px;
    background: #fff;
}

.atlas-matrix thead .atlas-col-dept,
.atlas-matrix thead .atlas-col-task {
    z-index: 5;
    background: #eef3f8;
}

.atlas-matrix-edit .atlas-col-task {
    left: 0;
}

.atlas-cell-edit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
}

.atlas-cell-comment {
    width: 100%;
    max-width: 148px;
    min-height: 44px;
    resize: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
    font-family: var(--font);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--navy);
    text-align: center;
    background: #f8fafc;
}

.atlas-cell-comment:focus {
    outline: 2px solid rgba(14, 159, 144, 0.35);
    outline-offset: 1px;
    background: #fff;
}

.atlas-cell-comment::placeholder {
    color: #9aa6b8;
}

.atlas-matrix a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 650;
}

.atlas-matrix a:hover {
    color: var(--accent);
}

.atlas-priority-row td,
.atlas-priority-row th {
    background: #f3fbf9;
}

.atlas-priority-row.is-first .atlas-priority-label {
    background: #e7f7f4;
    border-right: 1px solid var(--line);
}

.atlas-priority-label span {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0b8276;
}

.atlas-priority-label small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.atlas-priority-row.is-lead .atlas-col-task,
.atlas-priority-row.is-lead td,
.atlas-priority-row.is-total .atlas-col-task,
.atlas-priority-row.is-total td {
    background: #dff3ef;
    font-weight: 700;
}

.atlas-priority-row.is-total td,
.atlas-priority-row.is-total th,
.atlas-priority-row.is-first .atlas-priority-label {
    border-bottom: 4px double #6b7c90;
}

.atlas-task-row.is-group-start th,
.atlas-task-row.is-group-start td {
    border-top: 1px solid #d5deea;
}

.atlas-task-row .atlas-col-dept {
    background: #f7f9fc;
    font-weight: 650;
}

.atlas-muted-head,
.atlas-empty-cell {
    color: var(--muted);
    font-weight: 500;
}

.atlas-swatch {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: inset 0 -1px 0 rgba(20, 24, 33, 0.08);
    vertical-align: middle;
}

button.atlas-swatch {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.atlas-swatch:hover,
button.atlas-swatch:focus-visible {
    transform: scale(1.08);
    outline: 2px solid rgba(14, 159, 144, 0.35);
    outline-offset: 2px;
}

.atlas-swatch.is-none {
    background: #e8edf5;
    color: #7b8699;
}

.atlas-swatch.is-planned {
    background: #4f8cff;
}

.atlas-swatch.is-progress {
    background: #2bb673;
}

.atlas-swatch.is-done {
    background: #1b8a58;
}

.atlas-swatch.is-blocked {
    background: #e24c4c;
}

.atlas-swatch-icon {
    width: 11px;
    height: 11px;
    display: block;
}

.atlas-swatch.is-na {
    background: #cfd6e1;
    color: #5b677c;
}

.atlas-priority {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.atlas-priority.is-empty {
    color: #9aa6b8;
    background: #eef2f7;
}

.atlas-priority.is-p1,
.atlas-pill.is-p1.is-selected {
    background: #0e9f90;
    color: #fff;
}

.atlas-priority.is-p2,
.atlas-pill.is-p2.is-selected {
    background: #3b82f6;
    color: #fff;
}

.atlas-priority.is-p3,
.atlas-pill.is-p3.is-selected {
    background: #f0b429;
    color: #1d2433;
}

.atlas-priority.is-p4,
.atlas-pill.is-p4.is-selected {
    background: #f97316;
    color: #fff;
}

.atlas-priority.is-p5,
.atlas-pill.is-p5.is-selected {
    background: #e11d48;
    color: #fff;
}

.atlas-priority-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.atlas-priority-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: #f8fbfc;
}

.atlas-priority-card h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.atlas-priority-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.atlas-priority-card .atlas-cell-comment {
    max-width: none;
    margin-top: 10px;
}

.atlas-pill {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    color: #5b677c;
}

.atlas-pill:hover {
    border-color: var(--accent);
}

.atlas-pill.is-clear.is-selected {
    background: #e8edf5;
    color: #5b677c;
}

.atlas-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.atlas-panel-wide {
    grid-column: 1 / -1;
}

.atlas-item-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atlas-item-row,
.atlas-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.atlas-item-row input[type="text"],
.atlas-add-row input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    font-family: var(--font);
    background: #fff;
}

.atlas-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.atlas-icon-btn,
.atlas-btn {
    height: 34px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0 10px;
    cursor: pointer;
    font-family: var(--font);
    color: var(--navy);
}

.atlas-icon-btn:hover,
.atlas-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.atlas-icon-btn.is-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.atlas-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 650;
    height: 38px;
}

.atlas-btn-primary:hover {
    background: #0b8276;
    border-color: #0b8276;
    color: #fff;
}

.atlas-task-boards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.atlas-task-board {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: #f8fbfc;
}

.atlas-task-board h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.atlas-empty {
    text-align: left;
    max-width: 560px;
}

.atlas-inline-empty a,
.atlas-empty a {
    color: var(--accent);
}

.atlas-popover {
    position: fixed;
    z-index: 400;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 6px;
}

.atlas-popover-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 7px 8px;
    cursor: pointer;
    font-family: var(--font);
    color: var(--navy);
    text-align: left;
}

.atlas-popover-option:hover,
.atlas-popover-option.is-selected {
    background: #f3fbf9;
}

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

    .atlas-main {
        padding: 20px 16px 32px;
    }

    .atlas-col-dept,
    .atlas-col-task {
        position: static;
        left: auto;
    }
}

@media (max-width: 720px) {
    body:has(.atlas-app) {
        overflow: auto;
    }

    .atlas-app {
        display: block;
        height: auto;
    }

    .atlas-sidebar {
        width: 100%;
        flex: none;
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
    }

    .atlas-sidebar-brand {
        display: none;
    }

    .atlas-nav {
        flex-direction: row;
        align-items: center;
        padding: 10px;
        gap: 6px;
    }

    .atlas-nav-label {
        margin: 0 4px 0 10px;
        white-space: nowrap;
    }

    .atlas-nav-link {
        white-space: nowrap;
    }
}
