/* ktyt-voice-admin — one stylesheet, no build step.
   Bump the ?v= in includes/helpers.php when this changes. */

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --ink: #1d2027;
    --muted: #6a707c;
    --line: #dfe2e8;
    --accent: #e94560;
    --ok: #2e9e5b;
}

* { box-sizing: border-box; }

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

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

/* ---- top bar ---- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    padding: 12px 20px;
    background: #1d2027;
    color: #fff;
}
.topbar .brand {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
}
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.topbar nav a { color: #cfd3da; text-decoration: none; font-size: 0.92em; }
.topbar nav a:hover { color: #fff; }
.topbar .logout { margin: 0; }
.topbar .logout button {
    background: none;
    border: 0;
    color: #cfd3da;
    cursor: pointer;
    font: inherit;
    font-size: 0.92em;
    padding: 0;
}
.topbar .logout button:hover { color: var(--accent); }

/* ---- layout ---- */
main { max-width: 900px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 1.5em; margin: 0 0 8px; }
h2 { font-size: 1.1em; margin: 0 0 8px; }
.subtitle { color: var(--muted); font-size: 0.92em; margin: 0 0 20px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px 20px;
    margin: 0 0 20px;
}
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid .card { margin: 0; }

/* ---- text bits ---- */
.blurb { color: var(--muted); font-size: 0.9em; margin: 0 0 10px; }
.hint  { color: var(--muted); font-size: 0.85em; margin: 4px 0 0; }
.meta  { color: var(--muted); font-size: 0.78em; margin: 4px 0 0; }
.keyname { color: var(--muted); font-weight: 400; margin-left: 6px; }

.status { font-size: 0.9em; margin: 0 0 6px; }
.status.on  { color: var(--ok); }
.status.off { color: var(--muted); }

.keylist { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.85em; }
.keylist li { margin-bottom: 3px; }
.keylist .yes { color: var(--ok); }
.keylist .no  { color: var(--muted); }

.flash { border-radius: 4px; padding: 10px 14px; margin: 0 0 18px; font-size: 0.92em; }
.flash.ok  { background: #e7f6ed; color: #1c6c3d; }
.flash.bad { background: #fdecef; color: #a32338; }

/* ---- forms ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; }

input[type=text], input[type=password], input[type=number], textarea, select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.del { background: none; color: var(--muted); padding: 4px 8px; font-size: 1.1em; }
button.del:hover { color: var(--accent); }

.rowbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.rowbar button[type=button] { background: #565d6b; }

/* ---- repeatable rows ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 6px 5px 0; vertical-align: top; }
th { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr + tr td { border-top: 1px solid var(--line); }
.col-actions { width: 96px; text-align: right; white-space: nowrap; padding-right: 0; }
.col-actions button { padding: 4px 7px; font-size: 0.85em; background: #565d6b; }
.col-actions button.del { background: none; }
.col-label { width: 34%; }
.col-ok { width: 78px; }
.col-ok input { width: auto; }

.factgroup table { margin-top: 4px; }

/* ---- login ---- */
.login { max-width: 360px; }
.login label { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; }
.login input { margin-bottom: 14px; }

@media (max-width: 620px) {
    .col-label { width: auto; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tbody tr { border-top: 1px solid var(--line); padding-top: 10px; }
    tbody tr + tr td { border-top: 0; }
    .col-actions { width: auto; text-align: left; }
}
