:root {
  --bg: #0b0d0c;
  --panel: #111412;
  --panel-2: #151816;
  --line: #252925;
  --muted: #7d857f;
  --text: #eef2ed;
  --green: #9af5b2;
  --green-dark: #163c22;
  --amber: #f1cc83;
  --blue: #8ebbf6;
  --red: #ee8e88;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.shell { width: min(1180px, calc(100% - 40px)); margin: auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 13px; letter-spacing: .14em; }
.brand-mark { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #3b443d; border-radius: 50%; }
.brand-mark span { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 13px var(--green); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-right: 8px; }
.live i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 9px var(--green); }
button { border: 0; color: inherit; }
.primary { height: 40px; padding: 0 16px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: #092310; font-weight: 720; font-size: 13px; transition: transform .16s, filter .16s; }
.primary:hover { filter: brightness(.94); transform: translateY(-1px); }
.primary svg, .icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); }
.icon-button:hover { border-color: #404640; }
.icon-button.spinning svg { animation: spin .75s linear infinite; }
.hero { min-height: 305px; display: grid; grid-template-columns: 1fr 370px; align-items: center; gap: 80px; padding: 44px 0 35px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; line-height: 1; font-weight: 780; letter-spacing: .2em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(38px, 5vw, 65px); letter-spacing: -.055em; line-height: .98; font-weight: 650; }
h1 span { color: #7f8781; }
.intro { color: var(--muted); font-size: 14px; }
.intro strong { color: #bdc4be; font-weight: 600; }
.host-card { padding: 24px; background: linear-gradient(145deg, #141815, #0f1210); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 80px #0004; }
.host-card-head { display: flex; align-items: baseline; justify-content: space-between; }
.host-card-head span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.host-card-head strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.meter { height: 4px; margin: 15px 0 23px; background: #272c28; border-radius: 10px; overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width .5s; }
.host-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.host-details div { display: flex; flex-direction: column; gap: 6px; }
.host-details span { color: var(--muted); font-size: 10px; }
.host-details strong { font-size: 12px; font-weight: 650; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 54px; }
.summary-grid article { min-height: 78px; padding: 17px 20px; display: flex; align-items: center; gap: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.summary-icon { width: 36px; height: 36px; display: grid; place-items: center; background: #18221a; border-radius: 9px; font-size: 9px; }
.summary-icon.green { color: var(--green); }.summary-icon.amber { color: var(--amber); background: #292319; }.summary-icon.blue { color: var(--blue); background: #18222d; }
.summary-grid article div { display: flex; flex-direction: column; }
.summary-grid strong { font-size: 19px; line-height: 1.15; }
.summary-grid article div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.section-block { margin-bottom: 62px; }
.section-title { min-height: 57px; margin-bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-title h2, .dialog-head h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.tools { display: flex; align-items: center; gap: 14px; }
.updated, .docker-state { color: var(--muted); font-size: 10px; }
.select-wrap select, dialog select, dialog input { height: 39px; padding: 0 34px 0 12px; color: #cfd5d0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.service-card { min-height: 186px; padding: 20px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .18s, transform .18s; }
.service-card:hover { border-color: #394039; transform: translateY(-2px); }
.service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.service-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.type-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #1a211c; color: #aeb6b0; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.service-name { overflow: hidden; }
.service-name strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.service-name span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.status-pill { padding: 5px 8px; display: flex; align-items: center; gap: 5px; border-radius: 20px; background: #17271b; color: var(--green); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.status-pill::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status-pill.offline { background: #2b1a19; color: var(--red); }.status-pill.degraded { background: #2b2518; color: var(--amber); }
.service-url { margin: 24px 0 19px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #9ea6a0; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.service-meta { margin-top: auto; padding-top: 13px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.card-actions { display: flex; align-items: center; gap: 7px; }
.open-link, .delete-binding { color: var(--muted); background: none; text-decoration: none; font-size: 10px; }
.open-link:hover, .delete-binding:hover { color: var(--text); }
.empty-state { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); font-size: 13px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { height: 40px; padding: 0 18px; color: #687069; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
td { height: 68px; padding: 10px 18px; border-bottom: 1px solid #202420; color: #aeb5af; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
.container-name { min-width: 170px; }
.container-name strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 12px; }
.container-name span, .resource-sub { display: block; max-width: 270px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 9px; }
.state-label { display: inline-flex; align-items: center; gap: 7px; text-transform: capitalize; }
.state-label::before { content: ''; width: 6px; height: 6px; background: var(--green); border-radius: 50%; }.state-label.stopped::before { background: var(--red); }.state-label.paused::before { background: var(--amber); }
.resource-main { color: #d9ded9; }
.port-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.port-tag { padding: 4px 7px; background: #1d211e; border-radius: 5px; color: #abb2ac; font: 9px ui-monospace, monospace; }
.row-action { min-width: 60px; padding: 7px 10px; color: #cbd1cc; background: #1d211e; border: 1px solid #292f2a; border-radius: 7px; font-size: 10px; }
.row-action:hover { border-color: #495049; }.row-action.stop:hover { color: var(--red); }.row-action:disabled { opacity: .5; cursor: wait; }
.table-empty { height: 100px; color: var(--muted); text-align: center; }
footer { height: 70px; display: flex; align-items: center; justify-content: space-between; color: #565e58; border-top: 1px solid var(--line); font-size: 10px; }
dialog { width: min(500px, calc(100% - 28px)); padding: 0; color: var(--text); background: #111412; border: 1px solid #303630; border-radius: 17px; box-shadow: 0 30px 100px #000b; }
dialog::backdrop { background: #030403c9; backdrop-filter: blur(5px); }
dialog form { padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; }
.close-button { width: 34px; height: 34px; color: var(--muted); background: #1b1f1c; border-radius: 8px; font-size: 22px; line-height: 1; }
.dialog-copy { margin: 10px 0 23px; color: var(--muted); font-size: 12px; }
dialog label { margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px; color: #929a94; font-size: 10px; }
dialog input, dialog select { width: 100%; height: 43px; padding: 0 12px; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 100px; gap: 12px; }.form-row label { margin: 0; }
.form-error { min-height: 16px; margin: 10px 0 0; color: var(--red); font-size: 10px; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.secondary { height: 40px; padding: 0 15px; color: #b7beb8; background: #1b1f1c; border-radius: 9px; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; padding: 12px 16px; color: #dfe5df; background: #202521; border: 1px solid #353c36; border-radius: 10px; box-shadow: 0 12px 35px #0008; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }.toast.error { color: #ffd1ce; border-color: #593532; }
.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; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 55px 0 38px; }
  .host-card { max-width: 500px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { height: 68px; }.live { display: none; }.primary { padding: 0 12px; }.header-actions .primary svg { display: none; }
  .hero { min-height: auto; padding: 45px 0 30px; }.intro { line-height: 1.6; }
  .summary-grid { grid-template-columns: 1fr; padding-bottom: 44px; }.summary-grid article { min-height: 66px; }
  .service-grid { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; }.tools { flex-direction: column; align-items: flex-end; }.updated { display: none; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding-left: 12px; padding-right: 12px; }
  footer { height: 58px; }.form-row { grid-template-columns: 1fr; }.port-field { margin-top: 0; }
}

.header-secondary { height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); }
.header-secondary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Docker engine controls */
.docker-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.docker-controls .secondary { height: 34px; display: inline-flex; align-items: center; gap: 7px; }
.docker-controls .secondary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.docker-controls .secondary:hover:not(:disabled) { color: var(--text); }
.docker-controls .secondary:disabled { opacity: .45; cursor: not-allowed; }
.docker-controls .secondary.busy { cursor: wait; }

.engine-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 11px; white-space: nowrap; }
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background .2s, box-shadow .2s; }
.engine-pill.on { color: var(--green); border-color: #244a30; }
.engine-pill.on .engine-dot { background: var(--green); box-shadow: 0 0 9px var(--green); }
.engine-pill.off { color: var(--red); border-color: #4a2b2a; }
.engine-pill.off .engine-dot { background: var(--red); }

.danger-button { color: #e9a9a4 !important; border: 1px solid #492f2d !important; }
.danger-button:hover:not(:disabled) { color: #ffd1ce !important; border-color: #6a403d !important; background: #241b1a !important; }

.three-columns { grid-template-columns: repeat(3, 1fr); }
.forward-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action.remove:hover { color: var(--red); }
.public-warning { padding: 12px; flex-direction: row; align-items: flex-start; gap: 10px; color: var(--amber); background: #292319; border: 1px solid #4a3b21; border-radius: 9px; line-height: 1.45; }
dialog .public-warning input { width: 15px; height: 15px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--amber); }
.public-warning span { display: flex; flex-direction: column; gap: 2px; }
.public-warning strong { color: #f4d99e; font-size: 11px; }
@media (max-width: 620px) {
  .header-secondary { width: 40px; padding: 0; font-size: 0; }
  .three-columns { grid-template-columns: 1fr 1fr; }
  .three-columns label:last-child { grid-column: 1 / -1; }
  .forwards-section th:nth-child(3), .forwards-section td:nth-child(3) { display: none; }
}
