:root {
    --bg: #f3f3f3;
    --surface: #fff;
    --ink: #121212;
    --muted: #686868;
    --border: #dddddd;
    --accent: #111111;
    --sidebar: #101010;
    --danger: #a3382b;
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg)
}

a {
    color: var(--accent);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

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

button,
a,
input,
select,
textarea {
    outline-offset: 4px
}

button {
    cursor: pointer
}

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

h1 {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -.055rem;
    margin-bottom: 10px
}

h2 {
    font-size: 1.14rem;
    margin: 0
}

h3 {
    font-size: 1.08rem
}

small {
    font-size: .8125rem
}

button,
input,
select {
    min-height: 44px
}

input,
select,
textarea {
    background: white;
    border: 1px solid #c9c9c9;
    border-radius: 5px;
    padding: 10px 12px;
    color: var(--ink);
    max-width: 100%
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent)
}

textarea {
    min-height: 108px
}

label {
    font-size: .875rem;
    font-weight: 600
}

.shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 242px;
    flex-shrink: 0;
    background: var(--sidebar);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 26px 16px 16px
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    letter-spacing: .11rem;
    font-size: .97rem;
    margin: 0 8px 30px
}

.brand:hover {
    text-decoration: none
}

.spaceframe-logo-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #000;
    border-radius: 6px
}

/* Existing dark surfaces provide contrast without an additional logo box. */
.sidebar .spaceframe-logo-panel,
.login-brand-header .spaceframe-logo-panel {
    background: transparent;
    border-radius: 0
}

.spaceframe-logo {
    display: block;
    max-width: 100%;
    height: auto;
    background: transparent
}

.brand-logo {
    width: 162px
}

.nav-label {
    font-size: .625rem;
    color: #999;
    letter-spacing: .13rem;
    margin: 20px 12px 7px
}

.nav-link {
    display: flex;
    justify-content: space-between;
    color: #d4d4d4;
    padding: 9px 12px;
    border-radius: 5px;
    font-size: .875rem;
    min-height: 40px;
    margin: 2px 0
}

.nav-link span {
    opacity: 0
}

.nav-link:hover,
.nav-link.active {
    background: #2b2b2b;
    color: white;
    text-decoration: none
}

.nav-link.active span {
    opacity: 1
}

.identity {
    border-top: 1px solid #353535;
    padding: 20px 12px 0;
    margin-top: 28px
}

.identity strong,
.identity small {
    display: block
}

.identity small {
    color: #aaa
}

.text-button {
    border: 0;
    background: transparent;
    color: #ccc;
    padding: 8px 0;
    font-size: .8125rem
}

.workspace {
    margin-left: 242px;
    width: calc(100% - 242px)
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 36px;
    border-bottom: 1px solid var(--border);
    background: #fff
}

.breadcrumb {
    font-size: .8125rem;
    color: var(--muted);
    white-space: nowrap
}

.breadcrumb span {
    padding: 0 8px;
    color: #bbb
}

.global-search {
    display: flex;
    margin-left: auto
}

.global-search input {
    width: 280px;
    min-height: 38px;
    font-size: .8125rem;
    background: #f7f7f7;
    border-right: 0;
    border-radius: 5px 0 0 5px
}

.global-search button {
    border: 1px solid #c9c9c9;
    background: #f7f7f7;
    min-height: 38px;
    border-left: 0;
    border-radius: 0 5px 5px 0
}

.notification-link {
    font-size: .8125rem
}

.menu-button {
    display: none
}

main {
    padding: 34px 36px;
    max-width: 1680px;
    margin: auto
}

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

.eyebrow {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .13rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px
}

.muted {
    color: var(--muted);
    font-size: .875rem;
    margin-bottom: 0
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 44px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: var(--accent);
    color: white;
    padding: 10px 16px;
    font-weight: 600;
    font-size: .8125rem;
    white-space: nowrap
}

.button:hover {
    text-decoration: none;
    filter: brightness(.96)
}

.button.secondary {
    background: white;
    border-color: #cfcfcf;
    color: var(--ink)
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px
}

.metric {
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--ink)
}

.metric:hover {
    text-decoration: none;
    border-color: #888
}

.metric>span {
    font-size: .8125rem;
    color: var(--muted)
}

.metric strong {
    display: block;
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.5
}

.metric small {
    display: flex;
    justify-content: space-between;
    color: var(--accent);
    font-size: .75rem
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
    scroll-margin-top: 20px
}

.panel-heading {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border)
}

.panel-heading .eyebrow {
    margin-bottom: 5px
}

.panel-heading a {
    font-size: .8125rem
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 22px
}

.attention-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid #ededed;
    color: var(--ink)
}

.attention-row:last-child {
    border: 0
}

.attention-row:hover,
.update-row:hover {
    background: #fafafa;
    text-decoration: none
}

.attention-row>div {
    flex: 1
}

.attention-row strong,
.update-row strong {
    font-size: .875rem;
    font-weight: 600
}

.attention-row small,
.update-row small {
    display: block;
    color: var(--muted);
    font-size: .75rem;
    margin-top: 5px
}

.priority-dot {
    width: 8px;
    height: 8px;
    background: #777;
    border-radius: 50%;
    flex-shrink: 0
}

.priority-dot.red {
    background: #b26752
}

.chip {
    display: inline-block;
    font-size: .6875rem;
    border: 1px solid #dedede;
    background: #f2f2f2;
    border-radius: 4px;
    padding: 4px 8px;
    color: #3d3d3d;
    white-space: nowrap
}

.chip.danger {
    color: #995440;
    background: #fcf1e9;
    border-color: #f3ddd0
}

.update-row {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid #ededed;
    color: var(--ink);
    font-size: .875rem
}

.empty {
    padding: 36px 24px;
    text-align: center;
    color: var(--muted);
    font-size: .875rem
}

.empty p {
    margin: 6px 0 0
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 24px
}

.project-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px;
    color: var(--ink)
}

.project-card:hover {
    border-color: #888;
    text-decoration: none
}

.project-card h3 {
    margin: 18px 0 6px
}

.project-card p {
    font-size: .8125rem;
    color: var(--muted);
    margin-bottom: 20px
}

.project-card small {
    font-size: .75rem;
    color: var(--muted)
}

.project-card label {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    font-weight: 400
}

.split {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center
}

progress {
    width: 100%;
    height: 5px;
    border: 0;
    appearance: none;
    border-radius: 4px;
    margin: 8px 0 14px
}

progress::-webkit-progress-bar {
    background: #e9e9e9;
    border-radius: 4px
}

progress::-webkit-progress-value {
    background: #555;
    border-radius: 4px
}

progress::-moz-progress-bar {
    background: #555
}

.workload {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 20px;
    gap: 20px
}

.workload>div {
    display: flex;
    justify-content: space-between;
    font-size: .875rem
}

.filters {
    padding: 18px 22px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap
}

.filters input {
    flex: 1;
    min-width: 180px;
    font-size: .875rem
}

.filters select {
    max-width: 210px;
    font-size: .8125rem
}

.filters>a {
    font-size: .8125rem
}

.table-wrap {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
    text-align: left
}

th {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .04rem;
    color: var(--muted);
    background: #fafafa;
    font-weight: 600;
    white-space: nowrap
}

td,
th {
    padding: 15px 20px;
    border-bottom: 1px solid #ededed
}

td {
    max-width: 330px
}

tbody tr:hover {
    background: #fafafa
}

.record-link {
    font-weight: 600
}

.overdue td:first-child {
    border-left: 3px solid #b26752
}

.pagination {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8125rem;
    color: var(--muted)
}

.pagination>div {
    display: flex;
    gap: 8px
}

.subnav,
.tabs {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: .8125rem
}

.tabs {
    padding: 14px 0;
    border-bottom: 1px solid var(--border)
}

.tabs a {
    padding: 6px 0
}

.form-panel {
    max-width: 950px;
    padding: 28px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.field small {
    color: var(--muted)
}

.field input,
.field select,
.field textarea {
    width: 100%
}

.check-field {
    flex-direction: row;
    align-items: center
}

.check-field input {
    width: 22px;
    height: 22px;
    min-height: 22px
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border)
}

.errorlist {
    padding: 10px 14px;
    background: #fff0ec;
    color: #973f32;
    border-radius: 5px;
    list-style: none;
    font-size: .875rem
}

.message {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #cfcfcf;
    background: #f5f5f5
}

.message.error {
    background: #fff0ec;
    color: #973f32;
    border-color: #f2c8bf
}

.back {
    display: block;
    margin-bottom: 16px;
    font-size: .8125rem
}

.detail-grid,
.project-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    padding: 26px
}

.detail-grid dt,
.project-summary dt {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: 6px
}

.detail-grid dd,
.project-summary dd {
    margin: 0;
    font-size: .9375rem;
    overflow-wrap: anywhere
}

.archive {
    font-size: .875rem;
    color: var(--muted);
    margin: 25px 0
}

.danger-button {
    background: #a14435;
    border-color: #a14435
}

.permissions-table td,
.permissions-table th {
    padding: 10px
}

.permissions-table select {
    font-size: .75rem;
    min-width: 100px;
    padding: 8px
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: #f3f3f3ef;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--border);
    border-radius: 6px
}

.sticky-actions p {
    font-size: .875rem;
    margin: 0
}

footer {
    display: flex;
    justify-content: space-between;
    padding: 16px 36px 24px;
    font-size: .6875rem;
    color: #808080
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #e8e8e8
}

.login-card {
    --login-card-padding: 44px;
    width: min(460px, calc(100% - 32px));
    padding: var(--login-card-padding);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 18px 55px #00000012
}

.login-brand-header {
    margin: calc(-1 * var(--login-card-padding)) calc(-1 * var(--login-card-padding)) 28px;
    padding: 28px var(--login-card-padding);
    background: #000;
    border-radius: 9px 9px 0 0
}

.login-logo {
    width: 222px;
    max-width: 100%;
    margin: 0 auto
}

.login-logo img {
    display: block;
    width: 100%;
    height: auto
}

.google-button {
    background: #111;
    border-color: #111
}

.google-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #111;
    font-weight: 800
}

.login-card .muted {
    margin-bottom: 26px
}

.login-card .field {
    margin-bottom: 18px
}

.wide {
    width: 100%;
    justify-content: space-between;
    margin-top: 12px
}

.login-note {
    font-size: .75rem;
    color: var(--muted);
    margin: 25px 0 0
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.skip {
    position: absolute;
    left: 8px;
    top: -100px;
    background: white;
    padding: 10px;
    z-index: 10
}

.skip:focus {
    top: 8px
}

@media(min-width:1500px) {
    .metrics {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(max-width:1150px) {
    .breadcrumb {
        display: none
    }

    .project-cards {
        grid-template-columns: 1fr 1fr
    }

    .dashboard-grid {
        grid-template-columns: 1fr
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr)
    }

    .topbar {
        padding: 0 24px
    }

    main {
        padding: 26px 24px
    }

    .detail-grid,
    .project-summary {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:760px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 5;
        width: 250px
    }

    .nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 80px #0005
    }

    .workspace {
        margin: 0;
        width: 100%
    }

    .menu-button {
        display: flex;
        gap: 8px;
        align-items: center;
        border: 0;
        background: white;
        padding: 0;
        min-width: 58px
    }

    .menu-button span {
        font-size: .75rem
    }

    .topbar {
        padding: 0 16px;
        gap: 12px;
        height: 66px;
        position: sticky;
        top: 0;
        z-index: 4
    }

    .global-search {
        flex: 1;
        min-width: 0
    }

    .global-search input {
        width: 100%;
        min-width: 0
    }

    .notification-link {
        font-size: .6875rem
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px
    }

    h1 {
        font-size: 1.7rem
    }

    main {
        padding: 24px 16px
    }

    .metrics {
        gap: 10px
    }

    .metric {
        padding: 14px
    }

    .metric strong {
        font-size: 1.8rem
    }

    .metric>span {
        font-size: .75rem
    }

    .project-cards {
        grid-template-columns: 1fr;
        padding: 16px
    }

    .panel-heading {
        padding: 16px
    }

    .attention-row {
        padding: 16px;
        gap: 10px;
        flex-wrap: wrap
    }

    .attention-row .chip {
        margin-left: 18px
    }

    .update-row {
        padding: 16px
    }

    .detail-grid,
    .project-summary,
    .form-grid {
        grid-template-columns: 1fr
    }

    .form-panel {
        padding: 20px
    }

    .filters {
        padding: 16px
    }

    .filters input,
    .filters select {
        min-width: 100%;
        max-width: 100%
    }

    .workload {
        grid-template-columns: 1fr 1fr
    }

    .sticky-actions {
        align-items: flex-start;
        flex-direction: column
    }

    .tabs {
        gap: 12px
    }

    footer {
        padding: 16px;
        gap: 12px;
        flex-wrap: wrap
    }

    .login-card {
        --login-card-padding: 28px
    }

    .brand {
        margin-bottom: 24px
    }

    .subnav {
        gap: 12px
    }

    td,
    th {
        padding: 14px
    }

    .notification-link {
        max-width: 80px;
        overflow: hidden
    }
}
