:root {
    color-scheme: light;
    --text: #163039;
    --muted: #4b636c;
    --line: #d0e0e3;
    --wash: #f4f9fa;
    --primary: #006c61;
    --primary-dark: #075044;
    --teal: #038c7c;
    --blue: #005ea7;
    --accent: #e0f1f0;
    --table-head: #e9f4f5;
    --white: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--wash); }
button, input, summary { font: inherit; }
a { color: var(--blue); }
h1, p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }

.sign-in { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 2rem 1.25rem; }
.sign-in-inner { width: min(100%, 29rem); padding: 2rem; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 8px; }
.sign-in-logo { display: block; width: min(100%, 18rem); height: auto; margin-bottom: 2rem; }
.sign-in h1 { font-size: 1.65rem; font-weight: 670; line-height: 1.2; }
.sign-in .muted { margin-top: .55rem; }
.sign-in-form { display: grid; gap: .55rem; margin-top: 1.45rem; }
.back-link { display: inline-block; margin-top: 1.25rem; text-underline-offset: .2em; font-weight: 550; }
label { font-size: .94rem; font-weight: 620; }
input:not([type="hidden"]) { display: block; width: 100%; min-width: 0; min-height: 2.9rem; padding: .58rem .78rem; color: var(--text); background: var(--white); border: 1px solid #8ba7ad; border-radius: 6px; }
input::placeholder { color: var(--muted); }
input.code { font-variant-numeric: tabular-nums; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.9rem; padding: .54rem .95rem; border: 1px solid transparent; border-radius: 6px; color: var(--white); background: var(--primary); cursor: pointer; font-weight: 620; }
.primary:hover { background: var(--primary-dark); }
.sign-in-form .primary { margin-top: .3rem; }
.feedback { margin-top: 1rem; min-height: 2.35rem; padding: .55rem .72rem; overflow-wrap: anywhere; color: var(--primary-dark); background: var(--accent); border-radius: 5px; }
.feedback.error { color: #872e28; background: #fbefed; }

.topbar { width: 100%; background: var(--white); border-top: 3px solid var(--teal); border-bottom: 1px solid var(--line); }
.topbar-inner { width: min(100%, 70rem); min-height: 4.25rem; margin: auto; padding: .5rem 1.35rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; text-decoration: none; color: var(--primary-dark); font-weight: 680; }
.brand img { display: block; width: 12rem; height: auto; }
.brand span { border-left: 1px solid var(--line); padding-left: .75rem; }
.apps { position: relative; }
.icon-button { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; margin: 0; padding: 0; list-style: none; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--primary-dark); cursor: pointer; }
.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover, .apps[open] .icon-button { background: var(--accent); border-color: var(--line); }
.app-menu { position: absolute; z-index: 2; top: calc(100% + .5rem); right: 0; display: grid; grid-template-columns: minmax(0, 1.22fr) repeat(2, minmax(0, 1fr)); gap: .25rem; width: min(18.5rem, calc(100vw - 1.7rem)); padding: .45rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 5px 19px #1630391c; }
.app-menu a, .app-menu button { display: grid; width: 100%; justify-items: center; align-content: center; gap: .35rem; min-height: 4.25rem; padding: .35rem .15rem; color: var(--primary-dark); border: 0; border-radius: 5px; background: transparent; text-align: center; text-decoration: none; overflow-wrap: anywhere; font-size: .875rem; font-weight: 550; cursor: pointer; }
.app-menu a:hover, .app-menu button:hover, .app-menu a[aria-current="page"] { background: var(--accent); }
.apps:not([open]) .app-menu { display: none; }

.shell { width: min(100%, 70rem); margin: auto; padding: 2.15rem 1.35rem; }
.dashboard-shell { width: 100%; }
.page-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .55rem .95rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.page-title h1 { font-size: 1.85rem; line-height: 1.2; font-weight: 680; }
.count { color: var(--muted); font-size: .94rem; }
.empty { display: grid; place-items: center; align-content: center; gap: .6rem; min-height: 14rem; margin-top: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.empty .icon { color: var(--primary); }
.add-form { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin: 1.3rem 0 1.15rem; }
.email-field { flex: 0 1 25rem; min-width: 0; display: grid; gap: .35rem; }
.access-list { width: 100%; table-layout: fixed; margin-top: 1.15rem; border-collapse: collapse; text-align: left; background: var(--white); }
.access-list th, .access-list td { padding: .72rem .88rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.access-list th { background: var(--table-head); color: var(--primary-dark); font-size: .9rem; font-weight: 630; }
.access-list th:last-child, .access-list td:last-child { width: 8.3rem; color: var(--muted); font-size: .9rem; }
.you { display: inline-block; margin-left: .2em; color: var(--primary-dark); font-size: .8rem; font-weight: 650; }

.vhost-section { margin-top: 1.45rem; }
:is(.database-section, .crontabs-section, .docker-section) { margin-top: 2rem; }
:is(.vhost-section-header, .database-section-header, .crontabs-section-header, .docker-section-header) { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem 1rem; margin-bottom: .7rem; }
:is(.vhost-section-header, .database-section-header, .crontabs-section-header, .docker-section-header) h2 { margin: 0; font-size: 1.13rem; font-weight: 670; }
:is(.vhost-section-header, .database-section-header, .crontabs-section-header, .docker-section-header) time, .database-summary, .docker-summary { color: var(--muted); font-size: .88rem; }
.database-summary { margin: 0 0 .65rem; }
:is(.vhost-scroll, .database-scroll) { max-width: 100%; overflow-x: auto; }
:is(.vhost-table, .database-table, .crontabs-table, .docker-table) { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; background: var(--white); }
.vhost-table { min-width: 66rem; }
.database-table { min-width: 35rem; }
:is(.vhost-table, .database-table, .crontabs-table, .docker-table) :is(td, th) { padding: .72rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; font-size: .9rem; }
:is(.vhost-table, .database-table, .crontabs-table, .docker-table) thead th { background: var(--table-head); color: var(--primary-dark); }
:is(.vhost-table, .database-table, .docker-table) thead th { padding: 0; }
.vhost-table thead th:nth-child(1) { width: 23%; }
.vhost-table thead th:nth-child(2) { width: 13%; }
.vhost-table thead th:nth-child(3) { width: 15%; }
.vhost-table thead th:nth-child(4) { width: 21%; }
.vhost-table thead th:nth-child(5) { width: 8.5%; }
.vhost-table thead th:nth-child(6) { width: 9.5%; }
.vhost-table thead th:nth-child(7) { width: 10%; }
.database-table thead th:nth-child(1) { width: 26%; }
.database-table thead th:nth-child(2) { width: 46%; }
.database-table thead th:nth-child(3) { width: 16%; }
.database-table thead th:nth-child(4) { width: 12%; }
:is(.vhost-table, .database-table, .docker-table) thead button { display: flex; align-items: center; justify-content: space-between; gap: .2rem; width: 100%; min-height: 2.75rem; padding: .55rem .65rem; border: 0; background: transparent; color: inherit; text-align: left; font-weight: 630; overflow-wrap: normal; text-wrap: balance; cursor: pointer; }
:is(.vhost-table, .database-table, .docker-table) thead button:hover { background: var(--accent); }
:is(.vhost-table, .database-table, .docker-table) thead button:focus-visible { outline-offset: -3px; }
:is(.vhost-table, .database-table, .docker-table) .metric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:is(.vhost-table, .database-table, .docker-table) .metric button { justify-content: flex-end; padding-inline: .43rem; text-align: right; white-space: normal; }
.database-users { margin: 0; padding: 0; list-style: none; }
.crontabs-table thead th { font-weight: 630; }
.crontabs-table thead th:nth-child(1) { width: 6.5rem; }
.crontabs-table thead th:nth-child(2) { width: 13rem; }
.crontabs-table code { display: block; white-space: pre-wrap; font-size: .85rem; }
.crontabs-schedule { display: block; margin-top: .16rem; color: var(--muted); font-size: .84rem; }
.sort-marker { display: grid; place-items: center; flex: none; width: .9rem; height: .9rem; color: var(--muted); }
.sort-active, th[aria-sort] .sort-idle { display: none; }
th[aria-sort] .sort-active { display: block; color: var(--primary-dark); }
th[aria-sort="descending"] .sort-active { transform: rotate(180deg); }
.vhost-domain { font-weight: 650; }
.vhost-aliases { display: block; margin-top: .16rem; color: var(--muted); font-size: .84rem; font-weight: 400; }
.vhost-identity { display: grid; grid-template-columns: .625rem minmax(0, 1fr); align-items: start; gap: .45rem; }
.vhost-status { display: grid; place-items: center; width: .625rem; height: .625rem; margin-top: .35rem; border-radius: 50%; background: #247849; }
.vhost-status.is-disabled { background: #b3323b; }
.vhost-status.is-disabled::after { content: ''; width: .32rem; height: 2px; border-radius: 1px; background: var(--white); }

.docker-summary { margin: 0 0 .9rem; }
.docker-project + .docker-project { margin-top: 1.35rem; }
.docker-project-title { margin: 0; padding: .45rem 0 .5rem; border-top: 1px solid var(--line); font-size: .95rem; font-weight: 670; color: var(--blue); }
.docker-table thead th:nth-child(3) { width: 8.75rem; }
.docker-table thead th:nth-child(4) { width: 6.25rem; }
.docker-table thead th:nth-child(5) { width: 6rem; }
.docker-table thead th:nth-child(6) { width: 4.75rem; }
.docker-table thead th:nth-child(7) { width: 7rem; }
.docker-table .docker-image { color: var(--muted); }
.docker-sub { display: block; margin-top: .12rem; color: var(--muted); font-size: .82rem; font-weight: 400; }
.docker-state { display: inline-flex; gap: .42rem; align-items: baseline; font-weight: 620; }
.docker-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: currentColor; align-self: center; }
.docker-state.is-running { color: #16623d; }
.docker-state.is-completed { color: var(--blue); }
.docker-state.is-error { color: #a33135; }
.docker-state.is-waiting { color: #865218; }
.docker-mobile-label { display: none; }

@media (max-width: 820px) {
    .docker-table, .docker-table tbody { display: block; }
    .docker-table thead { display: none; }
    .docker-table tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem .6rem; padding: .72rem .7rem; border-bottom: 1px solid var(--line); }
    .docker-table tbody :is(th, td) { padding: 0; border: 0; min-width: 0; }
    .docker-table .docker-name { grid-column: 1 / span 2; }
    .docker-table .docker-status-cell { grid-column: 3 / span 2; text-align: right; }
    .docker-table .docker-image { grid-column: 1 / -1; grid-row: 2; }
    .docker-table .metric { text-align: left; white-space: normal; }
    .docker-mobile-label { display: block; color: var(--muted); font-size: .82rem; }
}

@media (max-width: 540px) {
    .sign-in-inner { padding: 1.45rem; }
    .topbar-inner { padding: .45rem .85rem; }
    .brand { gap: .5rem; }
    .brand img { width: min(33vw, 9rem); }
    .brand span { padding-left: .5rem; }
    .shell { padding: 1.45rem .9rem; }
    .email-field { flex: 1 1 100%; }
    .access-list th, .access-list td { padding-inline: .65rem; }
    .access-list th:last-child, .access-list td:last-child { width: 6.6rem; }
    .crontabs-table :is(td, th) { padding-inline: .4rem; }
    .crontabs-table thead th:nth-child(1) { width: 3.25rem; }
    .crontabs-table thead th:nth-child(2) { width: 6.25rem; }
}
