/* The company manager.
   Its own look, not the application's: this is a different product with one
   audience, and dressing it as Depot would suggest otherwise. */

:root {
	--ink: #1f2731;
	--navy: #2f3947;
	--gold: #fdb614;
	--paper: #f6f7f9;
	--card: #ffffff;
	--line: #dfe3e8;
	--muted: #6b7684;
	--ok: #1b7f4b;
	--warn: #9a6a00;
	--bad: #b3261e;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* No underline at rest. In a table of records the underline is heavier than the
   link, and colour plus the pointer is enough affordance. It comes back on
   hover so a link is still obviously a link. */
a { color: #1a5fb4; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid #8fa0b5; outline-offset: 2px; border-radius: 2px; }

/* Header */

.bar {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 0 20px;
	height: 56px;
	background: var(--navy);
	color: #fff;
}
.brand {
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: .01em;
	color: #fff;
	text-decoration: none;
}
.brand span { color: var(--gold); }
.bar nav { display: flex; gap: 18px; }
.bar nav a, .who a { color: #c9d1db; text-decoration: none; }
.bar nav a:hover, .who a:hover { color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #9aa5b1; font-size: .9rem; }

/* Layout */

/* Prose and forms want a measure. A line of text past about 90 characters is
   harder to read, and a form field stretched across a wide monitor is worse to
   use, not better. */
main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
main.centred { max-width: 380px; padding-top: 12vh; }

/* A table is the opposite: it has real columns to show and the width is what
   lets them be shown. Fluid, with a ceiling only so it does not become
   unreadable on an ultrawide. */
main.wide { max-width: min(2200px, 100%); }

h1 { font-size: 1.35rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; }

/* Cards and tables */

.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 22px;
}

table { width: 100%; border-collapse: collapse; }
.scroll { overflow-x: auto; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.name { font-weight: 600; }
td .host { color: var(--muted); font-size: .85rem; display: block; font-weight: 400; }

.packages { font-size: .9rem; }
/* Identifiers, not prose. Monospace so a database name is scannable and a typo
   in one is visible. */
td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.muted { color: var(--muted); }
/* A date is not worth wrapping to two lines to save a few pixels. */
td.nowrap { white-space: nowrap; }
.health-summary { display: inline-block; }

/* Filter bar */
.listbar { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.listbar .field { position: relative; flex: 1 1 26rem; max-width: 26rem; }
.listbar input[type=search] {
	padding-left: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 11px 50%;
	background-size: 16px 16px;
}
.listbar .count { font-size: .85rem; white-space: nowrap; }

/* Sortable headers. The arrow is always rendered so the row does not shift
   when one appears, which is distracting on a table this short. */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: '\2195'; opacity: .25; margin-left: 6px; font-size: .95em; }
th.sortable[aria-sort=ascending]::after  { content: '\2191'; opacity: 1; }
th.sortable[aria-sort=descending]::after { content: '\2193'; opacity: 1; }
th.sortable:focus-visible { outline: 2px solid #8fa0b5; outline-offset: -2px; border-radius: 3px; }

/* Status */

.pill {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 600;
	background: #eef1f4;
	color: var(--muted);
}
.pill.active { background: #e3f2e9; color: var(--ok); }
.pill.provisioning { background: #fdf3dd; color: var(--warn); }
.pill.suspended, .pill.retired { background: #fbe6e5; color: var(--bad); }

/* Health checks, filled in after the page loads */

.health { display: flex; gap: 6px; flex-wrap: wrap; }
.check {
	font-size: .72rem;
	padding: 2px 8px;
	border-radius: 4px;
	border: 1px solid var(--line);
	color: var(--muted);
	white-space: nowrap;
}
.check.pass { background: #e3f2e9; border-color: #bcdcc9; color: var(--ok); }
.check.fail { background: #fbe6e5; border-color: #f0c4c1; color: var(--bad); }
/* Could not be checked from here. Neutral on purpose: colouring it as a failure
   would train the reader to ignore the failures that matter. */
.check.skip { background: #f1f3f5; border-style: dashed; color: var(--muted); }
.check.pending { opacity: .55; }

/* Forms */

label { display: block; font-weight: 600; margin: 16px 0 5px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: 2px; }

input[type=text], input[type=email], input[type=password], input[type=search], select {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: 6px;
	font: inherit;
	color: var(--ink);
	background: #fff;
	transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder { color: #9aa5b1; }

/* A ring rather than a slab. The old rule was a 2px gold outline offset from
   the field, which read as a highlighter pen. */
input:focus, select:focus {
	outline: none;
	border-color: #8fa0b5;
	box-shadow: 0 0 0 3px rgba(47, 57, 71, .10);
}

/* Search inputs carry browser chrome of their own: an inner border in some,
   a decoration in others. */
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }

.field-error { color: var(--bad); font-size: .85rem; margin: 5px 0 0; }
input.bad, select.bad { border-color: var(--bad); }

fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin: 16px 0 0; }
legend { font-weight: 600; padding: 0 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 18px; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.checks input { margin-top: 3px; }

button {
	margin-top: 22px;
	padding: 10px 20px;
	border: 0;
	border-radius: 6px;
	background: var(--navy);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
button:hover { background: #3b4859; }

/* Notices and results */

.notice { padding: 11px 14px; border-radius: 6px; margin: 0 0 20px; }
.notice.error { background: #fbe6e5; color: #7d1b16; }
.notice.ok { background: #e3f2e9; color: #12613a; }
.notice.warn { background: #fdf3dd; color: #7a5400; }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.steps li:last-child { border-bottom: 0; }
.steps .mark { width: 1.2rem; flex: none; font-weight: 700; }
.steps .done .mark { color: var(--ok); }
.steps .failed .mark { color: var(--bad); }
.steps .skipped .mark { color: var(--muted); }
.steps .detail { color: var(--muted); }

.creds { background: #f2f5f8; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.creds dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.creds dt { color: var(--muted); }
.creds dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.empty { color: var(--muted); padding: 30px 0; text-align: center; }
