:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f3f5fc;
    background: #0b1020
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100svh;
    background: radial-gradient(ellipse at top right, #245d6266, transparent 65%)
}

.shell {
    max-width: 1400px;
    margin: auto;
    padding: 32px 24px
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px
}

.brand {
    color: #f3f5fc;
    text-decoration: none;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.6px
}

.brand span,
h1 span {
    color: #91e6cc
}

.back {
    font-size: 13px;
    color: #b8c5d8;
    text-decoration: none
}

.layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    align-items: center;
    gap: 70px;
    min-height: 74vh;
    padding: 70px 0
}

.eyebrow {
    font-size: 11px !important;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #91e6cc !important;
    font-weight: 650
}

h1 {
    font-size: clamp(54px, 7vw, 84px);
    letter-spacing: -.055em;
    line-height: 1.06;
    margin: 24px 0
}

p {
    color: #b8c5d8;
    line-height: 1.8;
    font-size: 17px;
    max-width: 440px
}

.detail {
    font-size: 12px;
    color: #8c9db6;
    margin-top: 50px;
    border-left: 2px solid #91e6cc;
    padding-left: 15px
}

.panel {
    padding: 34px;
    border: 1px solid #ffffff24;
    border-radius: 20px;
    background: #101c2be8;
    box-shadow: 0 24px 70px #0002
}

.badge {
    font-size: 11px;
    color: #91e6cc;
    border: 1px solid #91e6cc44;
    border-radius: 20px;
    padding: 6px 10px;
    display: inline-block
}

h2 {
    font-size: 28px;
    letter-spacing: -1px;
    margin: 23px 0 7px
}

.subtle {
    font-size: 14px;
    color: #a5b5cc;
    margin: 0 0 27px
}

.panel label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 20px 0 8px
}

input:not([type=hidden]) {
    display: block;
    width: 100%;
    border: 1px solid #ffffff28;
    background: #0b1422;
    color: #f3f5fc;
    border-radius: 9px;
    padding: 14px;
    font: inherit;
    font-size: 15px
}

input::placeholder {
    color: #7789a4
}

button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: #91e6cc;
    color: #0b1020;
    border-radius: 9px;
    padding: 15px 18px;
    margin-top: 27px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer
}

button:hover {
    background: #b6f4e1
}

:focus-visible {
    outline: 2px solid #91e6cc;
    outline-offset: 4px
}

.help {
    font-size: 12px;
    text-align: center;
    color: #94a6c0;
    margin: 24px 0 0
}

.alert {
    color: #ffd7d7;
    background: #713d3d33;
    border: 1px solid #ffaaaa44;
    padding: 13px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.6;
    margin: 20px 0
}

.logout {
    margin: 0;
    width: auto;
    background: transparent;
    color: #b8c5d8;
    border: 1px solid #ffffff28;
    font-size: 12px
}

.logout:hover {
    background: #ffffff12
}

.dashboard {
    padding: 75px 0
}

.account {
    max-width: 470px;
    margin-top: 35px
}

.account h2 {
    margin-top: 0
}

.account .subtle {
    margin: 20px 0 0
}

.account p {
    overflow-wrap: anywhere
}

footer {
    border-top: 1px solid #ffffff24;
    padding: 24px 0;
    color: #8e9eb5;
    font-size: 12px
}

@media(max-width:800px) {
    .layout {
        gap: 35px;
        grid-template-columns: 1fr 1fr
    }

    .panel {
        padding: 24px
    }
}

@media(max-width:620px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 50px 0;
        gap: 32px
    }

    .detail {
        display: none
    }

    .intro h1 {
        font-size: 56px
    }

    .intro p {
        font-size: 15px
    }

    .shell {
        padding: 24px 20px
    }

    .back {
        font-size: 11px
    }

    .brand {
        font-size: 19px
    }

    .panel {
        padding: 26px
    }

    .dashboard {
        padding: 50px 0
    }
}

/* User management */
.manage-link {
    display: inline-block;
    margin-top: 15px;
    padding: 13px 18px;
    border-radius: 9px;
    background: #91e6cc;
    color: #0b1020;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none
}

.manage-link:hover {
    background: #b6f4e1
}

.management {
    padding: 65px 0
}

.management h1 {
    font-size: clamp(36px, 6vw, 64px)
}

.management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 24px;
    margin-top: 34px
}

.field-help {
    font-size: 12px;
    margin: 6px 0;
    color: #94a6c0
}

.notice {
    padding: 16px 20px;
    color: #bcf6e1;
    background: #91e6cc15;
    border: 1px solid #91e6cc44;
    border-radius: 10px;
    margin: 24px 0
}

.user-list ul {
    list-style: none;
    padding: 0;
    margin: 0
}

.user-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #ffffff1c;
    padding: 18px 0
}

.user-list li div {
    min-width: 0
}

.user-list strong {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere
}

.user-list li div span {
    display: block;
    font-size: 12px;
    color: #a5b5cc;
    margin-top: 6px;
    overflow-wrap: anywhere
}

.role {
    font-size: 11px;
    color: #91e6cc;
    white-space: nowrap
}

@media(max-width:760px) {
    .management-grid {
        grid-template-columns: 1fr
    }

    .management {
        padding: 45px 0
    }
}

/* User account actions */
.user-list li.managed-user {
    display: block
}

.user-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.user-state {
    display: inline-block;
    font-size: 11px;
    color: #91e6cc;
    margin: 10px 0 0
}

.user-state.blocked {
    color: #ffb6a3
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px
}

.user-actions button {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 9px 12px;
    font-size: 12px
}

.secondary {
    background: transparent;
    color: #91e6cc;
    border: 1px solid #91e6cc55
}

.secondary:hover {
    background: #91e6cc18
}

.danger-outline {
    background: transparent;
    color: #ffc2b7;
    border: 1px solid #ffc2b744
}

.danger-outline:hover {
    background: #ff8f7918
}

.danger {
    background: #ffb6a3;
    color: #35130b
}

.danger:hover {
    background: #ffd0c4
}

.self-label {
    display: block;
    font-size: 11px;
    color: #8e9eb5;
    margin-top: 9px
}

.delete-confirm {
    border-color: #ffb6a366;
    margin-top: 25px
}

.delete-confirm h2 {
    margin-top: 0
}

.delete-confirm p {
    font-size: 14px;
    max-width: 650px
}

.delete-confirm form {
    max-width: 330px
}

.cancel-link {
    display: inline-block;
    color: #b8c5d8;
    margin-top: 18px;
    font-size: 14px
}

/* Projects */
textarea,
select {
    display: block;
    width: 100%;
    border: 1px solid #ffffff28;
    background: #0b1422;
    color: #f3f5fc;
    border-radius: 9px;
    padding: 14px;
    font: inherit;
    font-size: 14px
}

textarea {
    resize: vertical;
    min-height: 95px
}

.check-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px !important;
    line-height: 1.6
}

.check-row input[type=checkbox] {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    padding: 0;
    margin: 2px 0 0;
    accent-color: #91e6cc
}

.check-row span {
    min-width: 0;
    overflow-wrap: anywhere
}

.check-row strong {
    font-weight: 600
}

.check-row small {
    display: block;
    color: #93a4bc;
    font-size: 11px
}

.members {
    border: 1px solid #ffffff24;
    border-radius: 10px;
    padding: 16px;
    margin: 28px 0 0;
    min-width: 0
}

.members legend {
    padding: 0 7px;
    font-size: 13px;
    font-weight: 650
}

.members .check-row {
    margin: 14px 0 0
}

.project-list ul {
    list-style: none;
    padding: 0
}

.project-list li {
    border-top: 1px solid #ffffff24;
    padding: 22px 0;
    overflow-wrap: anywhere
}

.project-list li strong {
    display: block;
    font-size: 16px
}

.project-list li>span {
    display: block;
    font-size: 12px;
    color: #a5b5cc;
    margin-top: 7px
}

.project-list li .user-state {
    color: #91e6cc
}

.project-list .manage-link {
    font-size: 12px;
    padding: 10px 14px
}

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

.project-cards .panel {
    min-width: 0;
    overflow-wrap: anywhere
}

.project-cards h2 {
    font-size: 24px
}

.project-cards .subtle {
    white-space: pre-wrap
}

.empty-projects {
    margin-top: 35px
}

.empty-projects h2 {
    margin-top: 0
}

@media(max-width:960px) {
    .project-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:620px) {
    .project-cards {
        grid-template-columns: 1fr
    }
}

/* Automatic project hosts */
.generated-host {
    margin-top: 24px;
    padding: 16px;
    background: #91e6cc08;
    border: 1px solid #91e6cc33;
    border-radius: 10px;
    overflow-wrap: anywhere
}

.generated-host>strong {
    font-size: 13px
}

.generated-host>p {
    font-size: 14px;
    margin: 9px 0
}

.generated-host .field-help {
    font-size: 12px
}

.new-tab-hint {
    display: block;
    font-size: 10px;
    font-weight: 400;
    margin-top: 6px;
    opacity: .75
}

/* Inline Caddy controls */
.caddy-controls {
    margin-top: 28px;
    max-width: 650px
}

.caddy-controls h2 {
    margin-top: 0;
    font-size: 23px
}

.caddy-controls button {
    max-width: 420px
}

.caddy-controls .subtle {
    margin-bottom: 15px
}

/* Project images */
.project-image {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 0 22px;
    background: #0b1422
}

.project-image.image-preview {
    height: 180px;
    margin: 18px 0 10px
}

.project-image.image-thumbnail {
    height: 115px;
    margin-bottom: 16px
}

input[type=file] {
    font-size: 12px;
    padding: 10px
}

input[type=file]::file-selector-button {
    background: #91e6cc;
    color: #0b1020;
    border: 0;
    border-radius: 6px;
    padding: 9px 11px;
    margin-right: 10px;
    cursor: pointer
}

/* Multiple project controllers and compact admin images */
.controller-fields {
    border: 1px solid #ffffff26;
    border-radius: 12px;
    padding: 18px;
    margin: 25px 0;
    min-width: 0
}

.controller-fields legend {
    padding: 0 8px;
    font-size: 14px;
    font-weight: 650
}

.controller-extra {
    margin: 20px 0
}

.controller-extra summary {
    cursor: pointer;
    color: #91e6cc;
    font-size: 14px
}

.controller-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 22px
}

.controller-actions .manage-link {
    display: block;
    width: 100%;
    margin-top: 0;
    max-width: 100%;
    overflow-wrap: anywhere
}

.project-image.image-preview,
.project-image.image-thumbnail {
    width: auto;
    height: auto;
    max-width: min(100%, 10cm);
    max-height: 10cm;
    object-fit: contain
}

/* Controller test buttons in project administration */
.admin-controller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0;
    padding: 12px 0;
    border-bottom: 1px solid #ffffff18
}

.admin-controller-details {
    min-width: 0
}

.admin-controller-details>strong {
    font-size: 13px !important
}

.admin-controller-details>span {
    display: block;
    font-size: 12px;
    color: #a5b5cc;
    margin-top: 5px;
    overflow-wrap: anywhere
}

.controller-test {
    flex-shrink: 0;
    display: inline-block;
    border: 1px solid #91e6cc55;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 650;
    color: #91e6cc;
    text-decoration: none
}

.controller-test:hover {
    background: #91e6cc15
}

/* Personal user logos */
.brand-group {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0
}

.user-brand-logo {
    display: block;
    width: auto;
    max-width: 170px;
    height: auto;
    max-height: 65px;
    object-fit: contain
}

.user-logo-settings {
    margin-top: 16px
}

.user-logo-settings summary {
    font-size: 12px;
    color: #91e6cc;
    cursor: pointer
}

.user-logo-settings label {
    font-size: 12px !important
}

.user-logo-settings button {
    font-size: 12px;
    padding: 10px 14px;
    margin-top: 15px
}

.user-logo-preview {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 10cm);
    max-height: 10cm;
    object-fit: contain;
    margin-top: 18px
}

@media(max-width:620px) {
    .brand-group {
        gap: 10px;
        flex-wrap: wrap
    }

    .user-brand-logo {
        max-width: 120px;
        max-height: 50px
    }
}

/* Editing user account details */
.user-edit-panel {
    max-width: 600px;
    margin-top: 30px
}

.user-edit-panel h2 {
    margin-top: 0
}

.user-edit-link {
    font-size: 12px;
    padding: 9px 13px;
    margin-top: 14px
}

/* Searching users and projects */
.list-search {
    margin: 24px 0 18px
}

.list-search>label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin: 0 0 9px
}

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

.search-controls input[type=search] {
    flex: 1;
    min-width: 150px;
    width: auto
}

.search-controls button {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 14px 17px
}

.search-controls a {
    font-size: 12px;
    color: #91e6cc;
    white-space: nowrap
}

/* MaraTeq logo in page headers */
.brand-wordmark {
    display: block;
    width: 213px;
    max-width: 50vw;
    height: auto
}

.brand {
    flex-shrink: 0
}

@media(max-width:600px) {
    .brand-wordmark {
        width: 165px;
        max-width: 50vw;
    }
}
/* Consistent page header, matching the public homepage */
.shell {
    padding: 0 24px 32px;
}
.shell > header {
    height: 67px;
    margin: 0 -24px;
    padding: 14px 24px;
    border-bottom: 1px solid #ffffff24;
}
.shell > header.centered-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.centered-header > .header-action {
    justify-self: end;
}
.shell > header .brand-group {
    flex-wrap: nowrap;
}
.shell > header .user-brand-logo {
    max-height: 38px;
}
@media (max-width: 620px) {
    .shell {
        padding: 0 20px 24px;
    }
    .shell > header {
        margin: 0 -20px;
        padding: 14px 20px;
    }
}

/* Centered login panel */
.login-layout {
    display: grid;
    place-items: center;
    min-height: calc(100svh - 67px - 100px);
    padding: 48px 0;
}
.login-layout > .panel {
    width: 100%;
    max-width: 420px;
    min-width: 0;
}

/* Fixed header positions on dashboard and projects. */
html {
    scrollbar-gutter: stable;
}
.shell > header.centered-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 38px;
    align-items: center;
    height: 67px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.centered-header > .customer-header-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    min-width: 0;
}
.centered-header > .header-center-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
}
.centered-header > .header-action {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin: 0;
}
.centered-header .user-brand-logo {
    max-height: 38px;
    max-width: min(170px, 100%);
}
@media (max-width: 620px) {
    .centered-header .brand-wordmark {
        width: min(165px, 34vw);
    }
    .centered-header .user-brand-logo {
        max-width: min(120px, 23vw);
        max-height: 38px;
    }
    .shell > header.centered-header {
        column-gap: 8px;
    }
    .centered-header .back {
        font-size: 10px;
    }
    .centered-header .logout {
        font-size: 10px;
        padding: 8px;
    }
}

/* Shared footer at the bottom of every page. */
.shell {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding-bottom: 0;
}
.shell > header {
    flex-shrink: 0;
}
.shell > main {
    flex: 1 0 auto;
}
.shell > footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 24px 0;
    border-top: 1px solid #ffffff24;
    color: #8e9eb5;
    font-size: 12px;
    text-align: center;
}
