﻿/* =========================================================
   Gold Clinics — admin panel
   Plain CSS, no build step. Loaded via asset('assets/admin/style.css').
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
    /* Brand + action colour. One green scale drives buttons, active nav,
       logo tiles, focus rings and the login glow. */
    --brand-100: #eef4e1;
    --brand-200: #dbe8c2;
    --brand-300: #c4d99a;
    --brand-400: #b5ce82;
    --brand-500: #a7c46a;
    --brand-600: #8aa84d;

    /* Same green as rgb triplets, for the translucent glows below. */
    --brand-rgb: 167, 196, 106;

    /* Text and icons sitting on a brand-coloured fill. */
    --on-brand: #000;

    --ink-900: #1f2227;
    --ink-800: #2a2e35;

    --bg: #f2f2f7;
    --surface: #ffffff;
    --surface-soft: #fafbfd;
    --border: #e8eaf0;
    --text: #2d3148;
    --muted: #8b90a8;

    --danger: #e0655b;
    --danger-bg: #fdf1f0;
    --success: #4f9d76;
    --success-bg: #eff8f3;

    --radius-sm: 10px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;

    --shadow-sm: 0 2px 8px rgba(30, 34, 41, 0.05);
    --shadow-md: 0 10px 40px rgba(30, 34, 41, 0.08);
    --shadow-lg: 0 20px 60px rgba(30, 34, 41, 0.12);

    --font: 'Inter', 'Noto Sans Georgian', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --surface: #1c1f25;
        --surface-soft: #23262d;
        --border: #2e323b;
        --text: #e7e9f0;
        --muted: #9096ab;
        --danger-bg: #2a1c1b;
        --success-bg: #17241e;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    }
}

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

* {
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

input,
button,
select,
textarea {
    font: inherit;
    color: inherit;
}

ul {
    list-style: none;
}

/* Component display rules (grid/flex) would otherwise beat the attribute. */
[hidden] {
    display: none !important;
}

a {
    color: var(--brand-600);
}

:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

/* ---------- Shared bits ---------- */
.muted {
    color: var(--muted);
}

.alert {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.alert svg {
    flex: none;
}

.alert--error {
    color: var(--danger);
    background: var(--danger-bg);
}

.alert--success {
    color: var(--success);
    background: var(--success-bg);
}

/* ---------- Form controls ---------- */
.field {
    display: grid;
    gap: 7px;
}

.field > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* Input with a leading icon and an optional trailing button. */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > .input-wrap__icon {
    position: absolute;
    inset-inline-start: 14px;
    display: grid;
    place-items: center;
    color: var(--muted);
    pointer-events: none;
}

.input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.input:focus {
    background: var(--surface);
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-400) 16%, transparent);
}

.input--has-affix {
    padding-inline-end: 44px;
}

.input[aria-invalid='true'] {
    border-color: color-mix(in srgb, var(--danger) 55%, transparent);
}

.input-wrap__toggle {
    position: absolute;
    inset-inline-end: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.input-wrap__toggle:hover {
    color: var(--brand-500);
    background: color-mix(in srgb, var(--muted) 10%, transparent);
}

.field__error {
    font-size: 12.5px;
    color: var(--danger);
}

/* Custom checkbox */
.checkbox {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    font-size: 13.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox__box {
    position: relative;
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.checkbox__box::after {
    content: '';
    width: 9px;
    height: 5px;
    border: 2px solid var(--on-brand);
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) scale(0.6);
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.checkbox input:checked + .checkbox__box {
    background: var(--brand-500);
    border-color: var(--brand-500);
}

.checkbox input:checked + .checkbox__box::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

.checkbox input:focus-visible + .checkbox__box {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-400) 22%, transparent);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease;
}

/* Links styled as controls never carry the underline. */
.btn,
.btn:hover,
.icon-btn,
.icon-btn:hover,
.pagination a,
.pagination a:hover,
.hero__action,
.hero__action:hover,
.stat,
.stat:hover,
.checklist__cta,
.checklist__cta:hover,
.shell__nav-link,
.shell__brand {
    text-decoration: none;
}

.btn--primary {
    color: var(--on-brand);
    background: var(--brand-500);
    box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--brand-500) 85%, transparent);
}

.btn--primary:hover {
    transform: translateY(-2px);
    background: var(--brand-600);
    box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--brand-500) 92%, transparent);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--primary:focus-visible {
    outline-color: var(--brand-500);
}

.btn--ghost {
    color: var(--text);
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
}

.btn--ghost:hover {
    border-color: var(--brand-400);
    color: var(--brand-600);
}

.btn--danger {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1.5px solid color-mix(in srgb, var(--danger) 26%, transparent);
}

.btn--danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn--block {
    width: 100%;
}

/* =========================================================
   Login
   ========================================================= */
.login {
    display: flex;
    min-height: 100dvh;
}

/* ---- Left: brand panel ---- */
.login__brand {
    position: relative;
    display: none;
    flex: 1 1 46%;
    max-width: 560px;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 48px 32px;
    overflow: hidden;
    color: #fff;
    background: var(--ink-900);
}

@media (min-width: 900px) {
    .login__brand {
        display: flex;
    }
}

.login__glow {
    position: absolute;
    top: -130px;
    inset-inline-end: -110px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.30), transparent 70%);
    pointer-events: none;
}

.login__glow::after {
    content: '';
    position: absolute;
    bottom: -290px;
    inset-inline-start: -160px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.18), transparent 70%);
}

.login__brand > * {
    position: relative;
    z-index: 1;
}

.login__logo {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.login__logo-img {
    position: relative;
    z-index: 1;
    display: block;
    height: 110px;
    width: auto;
    max-width: 100%;
    margin-top: -6px; /* the image has built-in transparent space above the tooth */
    object-fit: contain;
}

.login__copy {
    margin: 24px 0 20px;
}

.login__copy h1 {
    margin-bottom: 14px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.38;
}

.login__copy h1 span {
    color: var(--brand-300);
}

.login__copy p {
    max-width: 380px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #a7abbd;
}

.login__points {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login__points li {
    display: flex;
    gap: 11px;
    align-items: center;
    font-size: 14px;
    color: #d3d6e2;
}

.login__points li i {
    display: grid;
    flex: none;
    place-items: center;
    width: 27px;
    height: 27px;
    color: var(--brand-300);
    background: rgba(var(--brand-rgb), 0.16);
    border-radius: 50%;
}

/* ---- Right: form panel ---- */
.login__panel {
    display: flex;
    flex: 1 1 54%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 22px;
}

.login__card {
    width: 100%;
    max-width: 408px;
    padding: 30px 34px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

@media (max-width: 420px) {
    .login__card {
        padding: 30px 22px;
    }
}

.login__head {
    margin-bottom: 26px;
    text-align: center;
}

.login__head-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    color: var(--on-brand);
    background: var(--brand-500);
    border-radius: 16px;
    box-shadow: 0 10px 24px -12px var(--brand-500);
}

.login__head h2 {
    margin-bottom: 6px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
}

.login__head p {
    font-size: 13px;
    color: var(--muted);
}

.login__form {
    display: grid;
    gap: 18px;
}

.login__footer {
    margin-top: 22px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* =========================================================
   Signed-in shell
   ========================================================= */
.shell {
    display: grid;
    min-height: 100dvh;
}

@media (min-width: 1000px) {
    .shell {
        grid-template-columns: 272px 1fr;
    }
}

.shell__sidebar {
    position: fixed;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 272px;
    height: 100dvh;
    color: #c8ccda;
    background: var(--ink-900);
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.shell__nav-state:checked ~ .shell__sidebar {
    transform: translateX(0);
}

.shell__scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    background: rgba(31, 34, 39, 0.45);
}

.shell__nav-state:checked ~ .shell__scrim {
    display: block;
}

@media (min-width: 1000px) {
    .shell__sidebar {
        position: sticky;
        top: 0;
        transform: none;
    }

    .shell__scrim,
    .shell__burger {
        display: none !important;
    }
}

/* ---- Sidebar: brand ---- */
.shell__brand {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.shell__brand-img {
    display: block;
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ---- Sidebar: grouped nav ---- */
.shell__nav {
    display: grid;
    align-content: start;
    gap: 22px;
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.shell__nav::-webkit-scrollbar {
    width: 6px;
}

.shell__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}

.shell__group {
    display: grid;
    gap: 2px;
}

.shell__group-title {
    padding: 0 12px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #6d7285;
}

.shell__nav-link {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    color: #9ba0b5;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.16s ease, color 0.16s ease;
}

.shell__nav-link svg {
    flex: none;
    opacity: 0.75;
}

.shell__nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell__nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
}

.shell__nav-link:hover svg {
    opacity: 1;
}

.shell__nav-link.is-active {
    font-weight: 600;
    color: var(--on-brand);
    background: var(--brand-500);
}

.shell__nav-link.is-active svg {
    opacity: 1;
}

/* ---- Sidebar: user card ---- */
.shell__user {
    display: flex;
    flex: none;
    gap: 11px;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.shell__avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-300);
    background: rgba(var(--brand-rgb), 0.16);
    border-radius: 50%;
}

.shell__user-meta {
    display: grid;
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.shell__user-meta strong {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell__user-meta small {
    font-size: 11.5px;
    color: #7f8599;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell__logout {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #9ba0b5;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.shell__logout:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.shell__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shell__topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 12px;
    align-items: center;
    height: 68px;
    padding: 0 22px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.shell__burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.shell__title {
    font-size: 18px;
    font-weight: 700;
}

.shell__actions {
    margin-inline-start: auto;
}

.shell__content {
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 24px 22px 56px;
}

.page__intro {
    font-size: 14px;
}

/* =========================================================
   Dashboard
   ========================================================= */

/* ---- Greeting + quick actions ---- */
.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 26px 28px;
    overflow: hidden;
    position: relative;
    color: #fff;
    background: var(--ink-900);
    border-radius: var(--radius-xl);
}

.hero::after {
    content: '';
    position: absolute;
    top: -150px;
    inset-inline-end: -100px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.28), transparent 70%);
    pointer-events: none;
}

.hero__text {
    position: relative;
    z-index: 1;
    min-width: 260px;
}

.hero__text h2 {
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.hero__text p {
    max-width: 46ch;
    font-size: 13.5px;
    line-height: 1.65;
    color: #a7abbd;
}

.hero__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.hero__action {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding: 9px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.hero__action:hover {
    transform: translateY(-2px);
    color: var(--on-brand);
    background: var(--brand-500);
    border-color: var(--brand-500);
}

/* ---- Stat cards ---- */
/* Six cards, so the column count is always a divisor of six (1 / 2 / 3 / 6).
   auto-fill would land on 4 or 5 columns at some widths and leave an orphan
   card alone on the last row. */
.stats {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 520px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 760px) {
    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1500px) {
    .stats {
        gap: 14px;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.stat {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 24px 24px 20px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

/* Thin accent bar that slides in on hover. */
.stat::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: var(--brand-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.stat:hover::before {
    transform: scaleX(1);
}

.stat__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 14px;
}

.stat__count {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat__label {
    font-size: 15px;
    font-weight: 600;
}

.stat__hint {
    font-size: 12.5px;
    color: var(--muted);
}

.stat__link {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-600);
    border-top: 1px solid var(--border);
}

.stat__link svg {
    transition: transform 0.2s ease;
}

.stat:hover .stat__link svg {
    transform: translateX(4px);
}

/* Tighten the cards where six sit side by side. */
@media (min-width: 1500px) {
    .stat {
        padding: 20px 18px 16px;
    }

    .stat__icon {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }

    .stat__count {
        font-size: 34px;
    }

    .stat__label {
        font-size: 14px;
    }

    .stat__link {
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* ---- Panel + checklist ---- */
.panel {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.panel__head {
    margin-bottom: 16px;
}

.panel__head h3 {
    font-size: 16px;
    font-weight: 700;
}

.panel__head p {
    font-size: 13px;
}

.checklist {
    display: grid;
    gap: 8px;
}

.checklist__item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px 16px;
    font-size: 14px;
    background: var(--surface-soft);
    border-radius: var(--radius);
}

.checklist__mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--muted);
    background: color-mix(in srgb, var(--muted) 16%, transparent);
    border-radius: 50%;
}

.checklist__item.is-done .checklist__mark {
    color: var(--on-brand);
    background: var(--brand-500);
}

.checklist__item.is-done .checklist__label {
    color: var(--muted);
    text-decoration: line-through;
}

.checklist__label {
    flex: 1;
}

.checklist__cta {
    flex: none;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 999px;
    transition: background 0.16s ease, color 0.16s ease;
}

.checklist__cta:hover {
    color: var(--on-brand);
    background: var(--brand-500);
}

/* =========================================================
   List + form panels (used by every CRUD section)
   ========================================================= */

/* A panel whose header sits flush against a table or form. */
.panel--flush {
    padding: 0;
    overflow: hidden;
}

.panel__bar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.panel__bar h3 {
    font-size: 16px;
    font-weight: 700;
}

.panel__bar p {
    margin-top: 3px;
    font-size: 13px;
    color: var(--muted);
}

.pill {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    padding: 0 11px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 999px;
}

/* ---------- Table ---------- */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.table th {
    padding: 13px 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: var(--muted);
    background: var(--surface-soft);
}

.table td {
    padding: 16px 24px;
    font-size: 14px;
    border-top: 1px solid var(--border);
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: var(--surface-soft);
}

.table__end {
    text-align: right;
}

.table__empty {
    padding: 34px 24px;
    color: var(--muted);
    text-align: center;
}

.table__user {
    display: flex;
    gap: 11px;
    align-items: center;
    font-weight: 500;
}

.table__avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 50%;
}

.table__avatar--photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.tag {
    margin-inline-start: 6px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 999px;
}

/* Links inside table cells (photo counts, category chips). */
a.pill,
a.chip {
    text-decoration: none;
    transition: background 0.15s ease;
}

a.pill:hover,
a.chip:hover {
    background: rgba(var(--brand-rgb), 0.2);
}

a.pill {
    display: inline-grid;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 999px;
}

.row-actions {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    color: var(--on-brand);
    background: var(--brand-500);
    border-color: var(--brand-500);
}

.icon-btn--danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.icon-btn:disabled,
.icon-btn:disabled:hover {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.45;
}

/* ---------- Metric strip ---------- */
.metrics {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 680px) {
    .metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.metric {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.metric__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 13px;
}

.metric__icon--alt {
    color: var(--muted);
    background: var(--surface-soft);
}

.metric__body {
    display: grid;
    min-width: 0;
    line-height: 1.3;
}

.metric__body strong {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.metric__body small {
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- Search in a panel bar ---------- */
.search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 280px;
    flex: 1;
}

.search__icon {
    position: absolute;
    inset-inline-start: 13px;
    display: grid;
    place-items: center;
    color: var(--muted);
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.search input:focus {
    background: var(--surface);
    border-color: var(--brand-400);
}

/* ---------- Status pill ---------- */
.status {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
}

.status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status--ok {
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
}

.status--off {
    color: var(--muted);
    background: color-mix(in srgb, var(--muted) 14%, transparent);
}

/* ---------- Table image cell ---------- */
.table__thumb {
    display: grid;
    flex: none;
    place-items: center;
    width: 64px;
    height: 40px;
    object-fit: cover;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table__thumb--square {
    width: 44px;
    height: 44px;
}

/* ---------- Table user cell ---------- */
.table__user-meta {
    display: grid;
    min-width: 0;
    line-height: 1.35;
}

.table__user-meta strong {
    font-size: 14px;
    font-weight: 600;
}

.table__user-meta small {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--muted);
}

/* ---------- Empty state ---------- */
.empty {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 44px 20px;
    text-align: center;
    white-space: normal;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 8px;
    color: var(--muted);
    background: var(--surface-soft);
    border-radius: 50%;
}

.empty strong {
    font-size: 15px;
    font-weight: 600;
}

.empty p {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Two-column form layout ---------- */
.form-layout {
    display: grid;
    gap: 18px;
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
    .form-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

.profile {
    display: flex;
    gap: 13px;
    align-items: center;
    min-width: 0;
}

.profile__avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    font-size: 19px;
    font-weight: 700;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 50%;
}

.profile__meta {
    display: grid;
    min-width: 0;
    line-height: 1.35;
}

.profile__meta strong {
    font-size: 16px;
    font-weight: 700;
}

.profile__meta small {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Side card ---------- */
.side-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.side-card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 13px;
}

.side-card h4 {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
}

.side-card__list {
    display: grid;
    gap: 10px;
}

.side-card__list li {
    position: relative;
    padding-inline-start: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.side-card__list li::before {
    content: '';
    position: absolute;
    inset-inline-start: 4px;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-400);
}

.side-card__facts {
    display: grid;
    gap: 2px;
}

.side-card__facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.side-card__facts > div:last-child {
    border-bottom: 0;
}

.side-card__facts dt {
    font-size: 13px;
    color: var(--muted);
}

.side-card__facts dd {
    font-size: 13px;
    font-weight: 600;
}

.side-card__danger {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* ---------- Forms ---------- */
.form-body {
    padding: 24px;
}

.form-section + .form-section {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.form-section__head {
    margin-bottom: 16px;
}

.form-section__head h4 {
    font-size: 14.5px;
    font-weight: 700;
}

.form-section__head p {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--muted);
}

/* The card spans the full page; the fields inside stay at a readable
   two-column max so they don't stretch across a wide screen. */
.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.field__hint {
    font-size: 12.5px;
    color: var(--muted);
}

@media (min-width: 1000px) {
    .form-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Repeatable rows ---------- */
.repeater {
    display: grid;
    gap: 10px;
}

.repeater__list {
    display: grid;
    gap: 10px;
}

.repeater__row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.repeater__field {
    display: grid;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.repeater__field[hidden] {
    display: none;
}

/* Line the delete button up with the 48px input. */
.repeater__row > .icon-btn {
    flex: none;
    width: 48px;
    height: 48px;
}

.repeater__add {
    justify-self: start;
    border: 1.5px dashed var(--border);
}

.repeater__add:hover {
    color: var(--brand-600);
    border-color: var(--brand-400);
}

.repeater__add:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.field__control {
    display: flex;
    align-items: center;
    min-height: 48px;
}

/* Native select with a drawn chevron, same shell as .input. */
.input--select {
    padding-inline-end: 40px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%238b90a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* .input:focus resets the background shorthand, so restore the chevron. */
.input--select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%238b90a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* Index toolbar: filter select + search side by side. */
.filters {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.filters .search {
    flex: 1 1 200px;
}

.filters__select {
    height: 42px;
    min-width: 180px;
    padding: 0 38px 0 14px;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background: var(--surface-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%238b90a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
}

.filters__select:focus {
    border-color: var(--brand-400);
}

.input--textarea {
    height: auto;
    min-height: 110px;
    padding: 12px 14px;
    line-height: 1.55;
    resize: vertical;
}

/* ---------- Language tabs ---------- */
.lang-tabs {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.lang-tabs__bar {
    display: flex;
    gap: 4px;
    padding: 6px 6px 0;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.lang-tabs__tab {
    position: relative;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 9px 16px 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    background: none;
    border: 0;
    border-radius: 9px 9px 0 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.lang-tabs__tab:hover {
    color: var(--text);
}

.lang-tabs__tab[aria-selected='true'] {
    color: var(--brand-600);
    background: var(--surface);
    box-shadow: inset 0 -2px 0 var(--brand-500);
}

.lang-tabs__code {
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: inherit;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 5px;
}

.lang-tabs__alert {
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
}

.lang-tabs__panel {
    display: grid;
    gap: 18px;
    padding: 20px;
    background: var(--surface);
}

.lang-tabs__panel[hidden] {
    display: none;
}

/* ---------- Image upload ---------- */
.upload {
    display: grid;
    gap: 10px;
}

.upload [hidden] {
    display: none !important;
}

/* Visually hidden but still focusable and submittable. */
.upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload__drop {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 30px 20px;
    text-align: center;
    background: var(--surface-soft);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload__drop:hover,
.upload__drop.is-dragging,
.upload__input:focus-visible ~ .upload__drop {
    background: rgba(var(--brand-rgb), 0.06);
    border-color: var(--brand-400);
}

.upload__drop-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 6px;
    color: var(--brand-600);
    background: rgba(var(--brand-rgb), 0.12);
    border-radius: 50%;
}

.upload__drop strong {
    font-size: 14px;
    font-weight: 600;
}

.upload__drop small {
    font-size: 12.5px;
    color: var(--muted);
}

.upload__card {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.upload__image {
    flex: none;
    width: 160px;
    height: 90px;
    object-fit: cover;
    background: var(--surface);
    border-radius: 8px;
}

.upload__meta {
    display: grid;
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.upload__meta strong {
    font-size: 14px;
    font-weight: 600;
}

.upload__meta small {
    overflow: hidden;
    font-size: 12.5px;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload__actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 560px) {
    .upload__image {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* Square people photos: the thumb conversion crops to 400×400. */
.upload--portrait .upload__image {
    width: 110px;
    height: 110px;
    aspect-ratio: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ---------- Small button ---------- */
.btn--sm {
    height: 40px;
    padding: 0 16px;
    font-size: 13px;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pagination a,
.pagination span {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pagination a:hover {
    border-color: var(--brand-400);
    color: var(--brand-600);
}

.pagination .is-current span {
    color: var(--on-brand);
    background: var(--brand-500);
    border-color: var(--brand-500);
}

.pagination .is-disabled span {
    color: var(--muted);
    background: var(--surface-soft);
    opacity: 0.6;
}
