/* Persona — one stylesheet.
   Spartan by brief: no ornament, so the care goes into spacing, alignment,
   and legibility instead. */

:root {
  --ink:      #1a1a1a;
  --muted:    #6b6b6b;
  --rule:     #d4d4d4;
  --field:    #ffffff;
  --page:     #fbfbfa;
  --accent:   #1c4f8b;
  --danger:   #9b2226;
  --warnbg:   #fdf6e3;
  --noticebg: #eef2f7;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 1.5rem 1rem 4rem;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

main {
  max-width: 68rem;
  margin: 0 auto;
}

h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

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

/* Keyboard focus must stay obvious. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- messages ---------------------------------------------------------- */

.banner, .notice, .warn, .error {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--rule);
  background: var(--noticebg);
  font-size: 0.92rem;
}
.banner { border-left-color: var(--accent); font-weight: 500; }
.warn   { border-left-color: #b8860b; background: var(--warnbg); }
.error  { border-left-color: var(--danger); background: #fdf0f0; color: var(--danger); }

.empty  { color: var(--muted); padding: 1.25rem 0; }
.muted  { color: var(--muted); }

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

/* --- controls ---------------------------------------------------------- */

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type=text], input[type=password], input[type=url],
input[type=search], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.4rem 0.5rem;
  max-width: 100%;
}

textarea { width: 100%; resize: vertical; }

input:disabled, select:disabled, textarea:disabled {
  background: #f0f0ef;
  color: var(--muted);
}

button, a.button {
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, a.button:hover { background: #f2f2f1; }
button:disabled { color: var(--muted); cursor: not-allowed; }

button.danger { color: var(--danger); border-color: #e0b4b6; }
button.danger:hover { background: #fdf0f0; }

a.cancel {
  font-size: 0.9rem;
  margin-left: 0.75rem;
}

/* --- forms ------------------------------------------------------------- */

.stack { max-width: 34rem; }
.stack p { margin: 0 0 1rem; }
.stack label { display: block; margin-bottom: 0.2rem; }
.stack input[type=text],
.stack input[type=password],
.stack input[type=url],
.stack select { width: 100%; }
.stack p.check label { display: inline; color: var(--ink); font-size: 1rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.filters label { margin: 0; }


.actions {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.links {
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.logout { margin-top: 2.5rem; }

/* --- table ------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
thead th a { color: inherit; text-decoration: none; }
thead th a:hover { color: var(--ink); text-decoration: underline; }

tbody tr:hover { background: #f4f4f3; }

/* The create row sits above the data and stays put through sort and filter. */
tr.new { background: #f4f6f9; }
tr.new:hover { background: #f4f6f9; }
tr.new td { padding: 0.6rem; }
tr.new input, tr.new select { width: 100%; min-width: 5rem; }

/* Disabled alias, or an alias on a disabled domain. */
tr.off td { font-style: italic; color: var(--muted); }
tr.off a { color: var(--muted); }

tr.catchall td:first-child { white-space: nowrap; }

.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.05rem 0.3rem;
  font-style: normal;
}

td.empty { border-bottom: none; }

/* --- narrow screens ---------------------------------------------------- */
/* Four columns only: alias, domain, category, edit. The create row keeps its
   hidden inputs, which submit empty and are simply omitted. */

@media (max-width: 46rem) {
  body { padding: 1rem 0.75rem 3rem; }
  .wide { display: none; }
  table { font-size: 0.95rem; }
  th, td { padding: 0.55rem 0.4rem; }
  .filters input[type=search] { flex: 1 1 8rem; }
  .actions { flex-direction: column; gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
