/* ----------------------------------------------------------------- fonts -- */
@font-face {
    font-family: 'Instrument Sans';
    src: url('/fonts/instrument-sans-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Instrument Sans';
    src: url('/fonts/instrument-sans-500.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Instrument Sans';
    src: url('/fonts/instrument-sans-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

/* ---------------------------------------------------------------- tokens -- */
:root {
    --radius: 0.625rem;

    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.97 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --accent: oklch(0.97 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.985 0 0);
    --success: oklch(0.596 0.145 163.225);
    --warning: oklch(0.646 0.16 70.08);
    --border: oklch(0.922 0 0);
    --input: oklch(0.922 0 0);
    --ring: oklch(0.708 0 0);
    --chart-1: oklch(0.646 0.222 41.116);
    --overlay: oklch(0 0 0 / 50%);
    --shadow: 0 1px 2px 0 oklch(0 0 0 / 5%);
}

.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --destructive-foreground: oklch(0.985 0 0);
    --success: oklch(0.696 0.17 162.48);
    --warning: oklch(0.828 0.189 84.429);
    --border: oklch(1 0 0 / 12%);
    --input: oklch(1 0 0 / 18%);
    --ring: oklch(0.556 0 0);
    --chart-1: oklch(0.696 0.17 162.48);
    --shadow: 0 1px 2px 0 oklch(0 0 0 / 40%);
}

/* ------------------------------------------------------------------ base -- */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
}

* {
    margin: 0;
}

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

body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

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

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

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}

/* ---------------------------------------------------------------- layout -- */
.layout__backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--overlay);
    display: none;
}

.layout__backdrop.is-open {
    display: block;
}

.sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 40;
    display: flex;
    width: 16rem;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--card);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

.sidebar.is-open {
    transform: none;
}

.sidebar__brand {
    display: flex;
    height: 4rem;
    flex-shrink: 0;
    align-items: center;
    gap: 0.625rem;
    border-bottom: 1px solid var(--border);
    padding-inline: 1.5rem;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar__footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.5rem 0.75rem;
    min-width: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: background-color 0.15s, color 0.15s;
    width: 100%;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.nav-link:hover {
    background: var(--accent);
    color: var(--foreground);
    text-decoration: none;
}

.nav-link.is-active {
    background: var(--accent);
    color: var(--foreground);
}

.nav-link svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.layout__main {
    padding-left: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 4rem;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--background) 85%, transparent);
    backdrop-filter: blur(8px);
    padding-inline: 1rem;
}

.topbar__titles {
    flex: 1;
    min-width: 0;
}

.topbar__title {
    font-size: 1rem;
    font-weight: 600;
}

.topbar__subtitle {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .topbar { padding-inline: 1.5rem; }
    .content { padding: 1.5rem; }
}

@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .layout__main { padding-left: 16rem; }
    /* Two class selectors, so this beats .btn's display regardless of the
       order the two rules appear in. */
    .btn.sidebar__toggle { display: none; }
    .layout__backdrop { display: none !important; }
}

/* ------------------------------------------------------------------ card -- */
.card {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--card);
    box-shadow: var(--shadow);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.card__title {
    font-size: 0.875rem;
    font-weight: 600;
}

.card__desc {
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.card__action {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
}

.card__body {
    padding: 1.25rem 1.5rem;
}

.card__body--flush {
    padding: 0;
}

/* ---------------------------------------------------------------- button -- */
.btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid transparent;
    height: 2.25rem;
    padding-inline: 1rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--primary);
    color: var(--primary-foreground);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn svg {
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

.btn--secondary {
    background: var(--secondary);
    color: var(--foreground);
}

.btn--outline {
    background: var(--background);
    color: var(--foreground);
    border-color: var(--border);
}

.btn--outline:hover,
.btn--ghost:hover {
    background: var(--accent);
    opacity: 1;
}

.btn--ghost {
    background: transparent;
    color: var(--foreground);
}

.btn--destructive {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

.btn--danger-ghost {
    background: transparent;
    color: var(--destructive);
}

.btn--danger-ghost:hover {
    background: color-mix(in oklab, var(--destructive) 12%, transparent);
    opacity: 1;
}

.btn--sm {
    height: 2rem;
    gap: 0.375rem;
    padding-inline: 0.75rem;
    font-size: 0.75rem;
}

.btn--icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

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

/* ----------------------------------------------------------------- badge -- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid transparent;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--secondary);
    color: var(--foreground);
}

.badge--primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.badge--outline {
    background: transparent;
    border-color: var(--border);
}

.badge--success {
    background: color-mix(in oklab, var(--success) 15%, transparent);
    color: var(--success);
}

.badge--warning {
    background: color-mix(in oklab, var(--warning) 20%, transparent);
    color: var(--warning);
}

.badge--destructive {
    background: color-mix(in oklab, var(--destructive) 15%, transparent);
    color: var(--destructive);
}

/* ----------------------------------------------------------------- forms -- */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.field__label {
    font-weight: 500;
}

.field__hint {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.field__error {
    font-size: 0.75rem;
    color: var(--destructive);
}

.input,
.select {
    display: block;
    width: 100%;
    height: 2.25rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--input);
    background: var(--background);
    padding: 0.25rem 0.75rem;
    transition: border-color 0.15s;
}

.select {
    width: auto;
}

.input::placeholder {
    color: var(--muted-foreground);
}

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

.input--invalid {
    border-color: var(--destructive);
}

.input--code {
    text-align: center;
    letter-spacing: 0.5em;
    font-variant-numeric: tabular-nums;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    accent-color: var(--primary);
}

/* A checkbox and its explanation, as one clickable block. */
.option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    padding: 0.75rem;
    cursor: pointer;
}

.option:hover {
    background: var(--accent);
}

.option__title {
    display: block;
    font-weight: 500;
}

.option__desc {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.option__mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ----------------------------------------------------------------- table -- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

.table thead {
    border-bottom: 1px solid var(--border);
}

.table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:first-child td {
    border-top: 0;
}

.table tbody tr:hover {
    background: color-mix(in oklab, var(--muted) 50%, transparent);
}

.table .is-right {
    text-align: right;
}

/* ------------------------------------------------------------------ stat -- */
.stat {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--card);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.stat__label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
}

.stat__value {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stat__value--empty {
    color: var(--muted-foreground);
}

.stat__hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ----------------------------------------------------------------- alert -- */
.alert {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--card);
    padding: 0.75rem 1rem;
}

.alert--success {
    border-color: color-mix(in oklab, var(--success) 30%, transparent);
    background: color-mix(in oklab, var(--success) 10%, transparent);
}

.alert--warning {
    border-color: color-mix(in oklab, var(--warning) 40%, transparent);
    background: color-mix(in oklab, var(--warning) 10%, transparent);
}

.alert--destructive {
    border-color: color-mix(in oklab, var(--destructive) 30%, transparent);
    background: color-mix(in oklab, var(--destructive) 10%, transparent);
}

.alert__title {
    font-weight: 500;
}

.alert__body {
    color: var(--muted-foreground);
}

.alert__title + .alert__body {
    margin-top: 0.25rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

/* ----------------------------------------------------------------- empty -- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty__title {
    font-weight: 500;
}

.empty__desc {
    max-width: 28rem;
    color: var(--muted-foreground);
}

/* ---------------------------------------------------------------- avatar -- */
.avatar {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.avatar--sm {
    width: 1.75rem;
    height: 1.75rem;
}

/* ----------------------------------------------------------------- chart -- */
.chart {
    display: flex;
    height: 12rem;
    align-items: stretch;
    gap: 0.375rem;
}

.chart__col {
    display: flex;
    flex: 1;
    height: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chart__track {
    display: flex;
    width: 100%;
    flex: 1;
    align-items: flex-end;
}

.chart__bar {
    width: 100%;
    border-radius: 2px 2px 0 0;
    background: var(--chart-1);
}

.chart__col:hover .chart__bar {
    opacity: 0.8;
}

.chart__count {
    font-size: 0.625rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

.chart__axis {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* -------------------------------------------------------------- activity -- */
.activity {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

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

/* ----------------------------------------------------------------- login -- */
.login {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login__inner {
    width: 100%;
    max-width: 24rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.login__title {
    font-size: 1.125rem;
    font-weight: 600;
}

.login__note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ------------------------------------------------------------- utilities -- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack--sm { gap: 0.75rem; }
.stack--xs { gap: 0.5rem; }

.row { display: flex; align-items: center; gap: 0.5rem; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--end { align-items: flex-end; }
.row--start { align-items: flex-start; }

.grid { display: grid; gap: 1rem; }

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

@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid--3 > .span-2 { grid-column: span 2 / span 2; }
    .grid--sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid--sidebar > .span-2 { grid-column: span 2 / span 2; }
}

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

.grid--gap-lg { gap: 1.5rem; }

.muted { color: var(--muted-foreground); }
.small { font-size: 0.75rem; }
.strong { font-weight: 500; }
.semibold { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }
.grow { flex-grow: 1; }
.center { text-align: center; }
.hidden { display: none; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.dl { display: grid; gap: 1rem; }

@media (min-width: 640px) {
    .dl--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-field { flex: 1; min-width: 12rem; }
}

.dl dt {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.dl dd {
    margin: 0;
    font-weight: 500;
}

.link:hover { text-decoration: underline; }

/* --------------------------------------------------- card sections & rows -- */
/* A filter bar or pagination strip inside a flush card. */
.card__strip {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.card__strip--bottom {
    border-bottom: 0;
    border-top: 1px solid var(--border);
}

.row--md { gap: 0.75rem; }

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Right-aligned action buttons in a table cell. */
.cell-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.cell-actions form {
    display: contents;
}

/* Pagination rendered by Laravel's default view. */
.card__strip nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.card__strip nav svg { width: 1rem; height: 1rem; }

.message {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.message__body { min-width: 0; flex: 1; }

.message__meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.message__text { overflow-wrap: anywhere; }

.form-narrow { max-width: 42rem; }

/* A vertical list of rows inside a flush card (members, bans, messages). */
.list { list-style: none; margin: 0; padding: 0; }

.list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.list__item--top { align-items: flex-start; padding-block: 1rem; }
.list__item:last-child { border-bottom: 0; }
.list__actions { display: flex; flex-shrink: 0; gap: 0.25rem; }
.dl--rows { display: flex; flex-direction: column; gap: 0.75rem; }

/* Sticker packs: a wall of small pictures, each with what it is for and a way
   to take it out again. */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.75rem;
}

.sticker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    text-align: center;
}

.sticker__image {
    width: 100%;
    height: 5rem;
    object-fit: contain;
}

.sticker__meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
}
