/* ---------------------------------------------------------------------------
   XyroBot — site stylesheet

   The colours come from the logo itself: the violet gradient #9E89E3 → #644BBE.
   The whole site is built on those variables, so rebranding means changing six
   values instead of combing through the file.
   --------------------------------------------------------------------------- */

:root {
    --violet-light: #9e89e3;
    --violet: #7861d0;
    --violet-mid: #6c53c7;
    --violet-dark: #644bbe;

    --bg: #0b0912;
    --bg-alt: #100d1b;
    --panel: #171327;
    --panel-high: #1e1932;

    --text: #eae7f6;
    --text-soft: #a49dc0;
    --text-dim: #746c94;

    --border: rgba(158, 137, 227, 0.14);
    --border-strong: rgba(158, 137, 227, 0.28);

    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;

    --radius: 14px;
    --radius-s: 9px;
    --width: 1140px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Fixed, very faint violet glow behind the whole site. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(58% 42% at 50% -8%, rgba(120, 97, 208, 0.22), transparent 70%),
        radial-gradient(42% 32% at 92% 8%, rgba(158, 137, 227, 0.1), transparent 70%);
    pointer-events: none;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 0.6em;
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

a {
    color: var(--violet-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: #b9a9ee; }

img { max-width: 100%; display: block; }

code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9em;
    background: rgba(158, 137, 227, 0.1);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.12em 0.42em;
}

pre {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 16px 18px;
    overflow-x: auto;
}

pre code { background: none; border: 0; padding: 0; }

.container {
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 22px;
}

.narrow { max-width: 760px; }

/* -- Header --------------------------------------------------------------- */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 9, 18, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.header__row {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 1.16rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    color: var(--text-soft);
    padding: 8px 13px;
    border-radius: var(--radius-s);
    font-size: 0.94rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
}

.nav a:hover { color: var(--text); background: rgba(158, 137, 227, 0.08); }
.nav a.active { color: var(--text); background: rgba(158, 137, 227, 0.13); }

.nav__divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.menu-button {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    color: var(--text);
    padding: 7px 11px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: auto;
}

/* -- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 24px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    font-size: 0.97rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition),
                background var(--transition), border-color var(--transition);
}

.btn--primary {
    background: linear-gradient(135deg, var(--violet-light), var(--violet-dark));
    color: #fff;
    box-shadow: 0 6px 22px rgba(108, 83, 199, 0.36);
}

.btn--primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(108, 83, 199, 0.5);
}

.btn--secondary {
    background: rgba(158, 137, 227, 0.07);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn--secondary:hover {
    background: rgba(158, 137, 227, 0.14);
    color: var(--text);
}

.btn--large { padding: 15px 32px; font-size: 1.04rem; }
.btn--full { width: 100%; }

/* -- Hero ----------------------------------------------------------------- */

.hero {
    padding: 92px 0 76px;
    text-align: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 999px;
    background: rgba(158, 137, 227, 0.11);
    border: 1px solid var(--border-strong);
    color: var(--violet-light);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 26px;
}

.hero__badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 9px var(--success);
}

.hero h1 { margin-bottom: 20px; }

.gradient {
    background: linear-gradient(120deg, var(--violet-light), #c3b4f2 55%, var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__text {
    max-width: 640px;
    margin: 0 auto 34px;
    font-size: 1.14rem;
    color: var(--text-soft);
}

.hero__actions {
    display: flex;
    gap: 13px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero__note {
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--text-dim);
}

/* -- Sections ------------------------------------------------------------- */

.section { padding: 72px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section__title { text-align: center; margin-bottom: 52px; }
.section__title h2 { margin-bottom: 12px; }

.section__title p {
    color: var(--text-soft);
    max-width: 580px;
    margin: 0 auto;
}

.label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--violet-light);
    margin-bottom: 12px;
}

/* -- Grids and cards ------------------------------------------------------ */

.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: transform var(--transition), border-color var(--transition);
}

.card--link:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-soft); margin-bottom: 0; font-size: 0.96rem; }

.card__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(158, 137, 227, 0.22), rgba(100, 75, 190, 0.14));
    border: 1px solid var(--border-strong);
    font-size: 1.25rem;
    margin-bottom: 16px;
}

/* -- Screenshots ---------------------------------------------------------- */

.shots {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.shot {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.shot img { width: 100%; }

.shot__caption {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-soft);
}

/* Fake window frame, to show the interface without a real screenshot. */
.mockup {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.mockup__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 15px;
    background: var(--panel-high);
    border-bottom: 1px solid var(--border);
}

.mockup__dot { width: 10px; height: 10px; border-radius: 50%; background: #372f52; }

.mockup__title {
    margin-left: 8px;
    font-size: 0.84rem;
    color: var(--text-dim);
    font-weight: 600;
}

.mockup__body { padding: 22px; }

.mockup__tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.mockup__tab {
    padding: 8px 16px;
    font-size: 0.87rem;
    color: var(--text-dim);
    border-bottom: 2px solid transparent;
}

.mockup__tab.active {
    color: var(--text);
    border-bottom-color: var(--violet-light);
    font-weight: 600;
}

.mockup__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
    color: var(--text-soft);
}

.mockup__row:last-child { border-bottom: 0; }

.toggle {
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--violet-light), var(--violet-dark));
    position: relative;
}

.toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
}

.toggle--off { background: #2f2848; }
.toggle--off::after { right: auto; left: 2px; background: #6b6392; }

/* -- Plans ---------------------------------------------------------------- */

.plans {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
    align-items: start;
    /* Room for the featured plan's ribbon, which sticks out above it. */
    padding-top: 12px;
}

.plan {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan--featured {
    border-color: var(--border-strong);
    background: linear-gradient(180deg, rgba(120, 97, 208, 0.12), var(--panel) 42%);
    box-shadow: var(--shadow);
}

.plan__ribbon {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--violet-light), var(--violet-dark));
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 4px 13px;
    border-radius: 999px;
    white-space: nowrap;
}

.plan__name {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--violet-light);
    margin-bottom: 14px;
}

.plan__price {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.plan__period { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 20px; }

.plan__list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
    font-size: 0.94rem;
    color: var(--text-soft);
}

.plan__list li {
    padding: 7px 0 7px 25px;
    position: relative;
}

.plan__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--violet-light);
    font-weight: 700;
}

/* -- Forms ---------------------------------------------------------------- */

.form {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
}

.field { margin-bottom: 19px; }

.field label {
    display: block;
    font-size: 0.89rem;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text-soft);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    color: var(--text);
    font-size: 0.97rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(120, 97, 208, 0.2);
}

.field textarea { resize: vertical; min-height: 130px; }

.field__help { font-size: 0.83rem; color: var(--text-dim); margin-top: 6px; }

.form__footer {
    margin-top: 22px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-soft);
}

/* -- Notices -------------------------------------------------------------- */

.notice {
    display: flex;
    gap: 11px;
    padding: 13px 17px;
    border-radius: var(--radius-s);
    border: 1px solid;
    margin-bottom: 20px;
    font-size: 0.94rem;
}

.notice--success { background: rgba(74, 222, 128, 0.09); border-color: rgba(74, 222, 128, 0.32); color: #86efac; }
.notice--error   { background: rgba(248, 113, 113, 0.09); border-color: rgba(248, 113, 113, 0.32); color: #fca5a5; }
.notice--info    { background: rgba(158, 137, 227, 0.09); border-color: var(--border-strong); color: var(--violet-light); }

/* -- Account dashboard ---------------------------------------------------- */

.license {
    background: linear-gradient(135deg, rgba(120, 97, 208, 0.17), rgba(100, 75, 190, 0.07));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 24px;
}

.license__days {
    font-size: 3.1rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.license__key {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.02rem;
    letter-spacing: 0.09em;
    color: var(--violet-light);
}

.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge--active  { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.badge--expired { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.badge--pending { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }

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

.table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.table tr:last-child td { border-bottom: 0; }

/* -- Blog ----------------------------------------------------------------- */

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: 100%;
    transition: transform var(--transition), border-color var(--transition);
}

.post-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }

.post-card h3 { color: var(--text); margin-bottom: 9px; }
.post-card p { color: var(--text-soft); font-size: 0.94rem; flex: 1; }

.post-card__meta {
    font-size: 0.82rem;
    color: var(--text-dim);
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 13px;
}

.post { font-size: 1.05rem; }
.post h2 { margin-top: 1.7em; }
.post h3 { margin-top: 1.4em; }
.post ul, .post ol { color: var(--text-soft); padding-left: 1.3em; }
.post li { margin-bottom: 0.45em; }
.post img { border-radius: var(--radius-s); border: 1px solid var(--border); margin: 1.4em 0; }

.post blockquote {
    margin: 1.5em 0;
    padding: 2px 20px;
    border-left: 3px solid var(--violet);
    color: var(--text-soft);
}

/* -- FAQ ------------------------------------------------------------------ */

.faq {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    margin-bottom: 11px;
    overflow: hidden;
}

.faq summary {
    padding: 17px 22px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--violet-light); font-size: 1.3rem; line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq__body { padding: 0 22px 18px; color: var(--text-soft); font-size: 0.95rem; }

/* -- Footer --------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    padding: 52px 0 30px;
    margin-top: 72px;
}

.footer__grid {
    display: grid;
    gap: 34px;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    margin-bottom: 38px;
}

.footer h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 15px;
}

.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 9px; }
.footer li a { color: var(--text-soft); font-size: 0.93rem; }
.footer li a:hover { color: var(--violet-light); }
.footer__text { color: var(--text-dim); font-size: 0.92rem; max-width: 320px; }

.footer__legal {
    border-top: 1px solid var(--border);
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: 0.87rem;
}

/* -- Utilities ------------------------------------------------------------ */

.center { text-align: center; }
.muted { color: var(--text-soft); }
.dim { color: var(--text-dim); font-size: 0.88rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* -- Small screens -------------------------------------------------------- */

@media (max-width: 900px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .menu-button { display: block; }

    .nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 14px 22px 20px;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
    }

    .nav.open { display: flex; }
    .nav__divider { display: none; }
    .nav .btn { margin-top: 8px; }

    .hero { padding: 62px 0 52px; }
    .section { padding: 54px 0; }
    .form { padding: 26px 20px; }
    .footer__grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Administration panel

   Built on the same variables as the rest of the site, so it looks like the
   product and not like a separate tool: same violet, same panels, same radii.
   The differences are deliberate — denser spacing, smaller headings, flat
   tables — because this is a working screen, not a landing page.
   --------------------------------------------------------------------------- */

.admin {
    background: var(--bg-alt);
}

/* The decorative glow of the public site is distracting behind dense tables. */
.admin::before { display: none; }

/* -- Top bar -------------------------------------------------------------- */

/* The bar spans the window so its border does, but its contents line up with
   the page below it: anything else reads as a misaligned header. */
.admin-bar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.admin-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    max-width: var(--width);
    margin: 0 auto;
    padding: 14px 26px;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.admin-brand:hover { color: var(--text); }

.admin-brand span {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--violet-light), var(--violet-dark));
    color: #fff;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.admin-nav a {
    padding: 7px 13px;
    border-radius: var(--radius-s);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: background var(--transition), color var(--transition);
}

.admin-nav a:hover {
    background: rgba(158, 137, 227, 0.08);
    color: var(--text);
}

.admin-nav a.current {
    background: rgba(158, 137, 227, 0.14);
    color: var(--text);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.admin-user form { display: inline; margin: 0; }

.admin-user button {
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.85rem;
    padding: 5px 12px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.admin-user button:hover { background: rgba(158, 137, 227, 0.1); color: var(--text); }

/* -- Page ----------------------------------------------------------------- */

.admin-main {
    max-width: var(--width);
    margin: 0 auto;
    padding: 30px 26px 80px;
}

/* The display-sized headings of the site would waste half the screen here. */
.admin-main h1 {
    font-size: 1.55rem;
    margin: 0 0 6px;
}

.admin-main h2 {
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 38px 0 14px;
}

.admin-note {
    color: var(--text-soft);
    font-size: 0.92rem;
    margin: 0 0 22px;
    max-width: 68ch;
}

.admin-note strong { color: var(--text); }

/* -- Figures -------------------------------------------------------------- */

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 22px 0 8px;
}

.admin-card {
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.admin-card strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.admin-card span {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* -- Tables --------------------------------------------------------------- */

/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.admin-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    margin-bottom: 22px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 620px;
}

.admin-table th,
.admin-table td {
    padding: 13px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.admin-table thead th {
    background: var(--panel-high);
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: rgba(158, 137, 227, 0.04); }

.admin-table .muted { color: var(--text-dim); font-size: 0.86rem; }

.admin-key {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.88rem;
    white-space: nowrap;
}

/* Status carries its meaning in colour, not only in the word. */
.admin-state {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.admin-state--active { background: rgba(74, 222, 128, 0.14); color: var(--success); }
.admin-state--expired { background: rgba(251, 191, 36, 0.14); color: var(--warning); }
.admin-state--revoked { background: rgba(248, 113, 113, 0.14); color: var(--danger); }

/* -- Forms ---------------------------------------------------------------- */

.admin-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin: 0 0 26px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.admin-form label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.admin-form input,
.admin-form select {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    color: var(--text);
    padding: 10px 13px;
    font: inherit;
    font-size: 0.94rem;
    min-width: 190px;
    transition: border-color var(--transition);
}

.admin-form input:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--violet);
}

/* The browser's own file button comes in white and breaks the panel apart. */
.admin-form input[type="file"] {
    padding: 7px 10px;
    min-width: 260px;
    color: var(--text-soft);
    font-size: 0.88rem;
    cursor: pointer;
}

.admin-form input[type="file"]::file-selector-button {
    margin-right: 11px;
    padding: 6px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    background: rgba(158, 137, 227, 0.1);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.admin-form input[type="file"]::file-selector-button:hover {
    background: rgba(158, 137, 227, 0.2);
}

.admin-form button {
    background: linear-gradient(135deg, var(--violet-light), var(--violet-dark));
    border: 1px solid transparent;
    border-radius: var(--radius-s);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 0.94rem;
    padding: 10px 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--transition), box-shadow var(--transition);
}

.admin-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(108, 83, 199, 0.4);
}

.admin-form button.danger {
    background: none;
    border-color: rgba(248, 113, 113, 0.4);
    color: var(--danger);
    box-shadow: none;
}

.admin-form button.danger:hover {
    background: rgba(248, 113, 113, 0.12);
    transform: none;
    box-shadow: none;
}

/* Actions inside a table cell: no panel, no margins, nothing that stretches
   the row out of shape. */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.admin-actions form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}

.admin-actions input {
    min-width: 0;
    width: 112px;
    padding: 6px 10px;
    font: inherit;
    font-size: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    color: var(--text);
}

.admin-actions input:focus { outline: none; border-color: var(--violet); }

.admin-actions button {
    padding: 6px 12px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-s);
    border: 1px solid var(--border-strong);
    background: rgba(158, 137, 227, 0.08);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
}

.admin-actions button:hover { background: rgba(158, 137, 227, 0.16); }

.admin-actions button.danger {
    border-color: rgba(248, 113, 113, 0.35);
    background: none;
    color: var(--danger);
}

.admin-actions button.danger:hover { background: rgba(248, 113, 113, 0.12); }

/* -- Second factor -------------------------------------------------------- */

.admin-secret {
    display: inline-block;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 1.12rem;
    letter-spacing: 0.14em;
    word-break: break-all;
    background: var(--panel-high);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    padding: 13px 18px;
    margin: 0 0 22px;
    color: var(--text);
}

.admin-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 7px;
}

/* Setup, verify and sudo are single-purpose screens: narrow reads better. */
.admin-main--narrow { max-width: 620px; }

/* -- Notices and empty states --------------------------------------------- */

.notice {
    padding: 13px 17px;
    border-radius: var(--radius-s);
    margin: 0 0 22px;
    font-size: 0.93rem;
    border: 1px solid transparent;
}

.notice-error {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.32);
    color: #fca5a5;
}

.notice-success {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.32);
    color: #86efac;
}

/* -- Activity filters ------------------------------------------------------ */

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 22px;
}

.admin-filters a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text-soft);
    font-size: 0.86rem;
    transition: border-color var(--transition), color var(--transition);
}

.admin-filters a:hover { border-color: var(--border-strong); color: var(--text); }

.admin-filters a.current {
    border-color: var(--violet);
    background: rgba(158, 137, 227, 0.12);
    color: var(--text);
}

.admin-filters span {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-dim);
}

/* -- Support threads ------------------------------------------------------- */

/* Shared by the panel and the customer's account: a conversation reads the same
   from both ends, which is the point. */
.thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 26px;
}

.thread__msg {
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-s);
}

/* Ours stands out, so a long thread can be skimmed for who said what. */
.thread__msg--staff {
    background: var(--panel-high);
    border-left-color: var(--violet);
}

.thread__msg header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.86rem;
}

.thread__msg header .muted { color: var(--text-dim); }
.thread__msg p { margin: 0; font-size: 0.94rem; line-height: 1.6; }

.thread-list { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; }

.thread-list__item {
    display: block;
    padding: 15px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    color: var(--text);
    transition: border-color var(--transition);
}

.thread-list__item:hover { border-color: var(--border-strong); color: var(--text); }
.thread-list__item strong { display: block; margin-bottom: 4px; }
.thread-list__item span { font-size: 0.85rem; color: var(--text-dim); }

/* A reply box needs the full width, not a row of inline fields. */
.admin-form--stacked { flex-direction: column; align-items: stretch; }
.admin-form__wide { width: 100%; }

.admin-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    color: var(--text);
    padding: 11px 13px;
    font: inherit;
    font-size: 0.94rem;
    line-height: 1.6;
    resize: vertical;
}

.admin-form textarea:focus { outline: none; border-color: var(--violet); }
.admin-form--stacked button { align-self: flex-start; }

.admin-empty {
    padding: 34px 26px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.93rem;
    background: var(--panel);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: 22px;
}

@media (max-width: 640px) {
    .admin-bar__inner { padding: 12px 16px; }
    .admin-main { padding: 22px 16px 60px; }
    .admin-nav { order: 3; width: 100%; }
    .admin-user { margin-left: auto; }
    .admin-form { padding: 16px; }
    .admin-form > div { width: 100%; }
    .admin-form input, .admin-form select { min-width: 0; width: 100%; }
}
