/*
 * Admin design system.
 * Values mirror the reference panel's compiled Tailwind build so the two
 * installations look the same.
 */

:root {
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;

    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0f172a;

    --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --radius-card: 1rem;
    --radius-ctl: .5rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--slate-900);
    background: linear-gradient(to bottom right, var(--slate-50), #fff 50%, var(--brand-50));
}

a { color: inherit; }

/* ---------- layout ---------- */

.shell { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.shell-narrow { max-width: 820px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.logo-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: .75rem;
    background: var(--brand-600);
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
}
.logo-tile-lg { height: 3.5rem; width: 3.5rem; border-radius: 1rem; font-size: 1.5rem; }

.brand-name { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.brand-sub   { font-size: .75rem; color: var(--slate-500); }

.page-title { font-size: 1.5rem; font-weight: 600; margin: 0 0 4px; }
.page-sub   { font-size: .875rem; color: var(--slate-500); margin: 0 0 20px; }

/* ---------- card ---------- */

.card {
    border-radius: var(--radius-card);
    border: 1px solid var(--slate-200);
    background: #fff;
    box-shadow: var(--shadow-card);
}
.card-body { padding: 1.5rem; }
.card + .card { margin-top: 16px; }

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

.label {
    display: block;
    margin-bottom: .25rem;
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .025em;
    color: var(--slate-500);
}

.input {
    width: 100%;
    border-radius: var(--radius-ctl);
    border: 1px solid var(--slate-200);
    background: #fff;
    padding: .5rem .75rem;
    font-size: .875rem;
    line-height: 1.25rem;
    font-family: inherit;
    color: var(--slate-900);
}
.input:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea.input { min-height: 84px; resize: vertical; }

.field + .field { margin-top: 1rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.field-wide { grid-column: 1 / -1; }

.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: 1rem; height: 1rem; accent-color: var(--brand-600); }
.check label { font-size: .875rem; color: var(--slate-700); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: var(--radius-ctl);
    padding: .5rem .875rem;
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--brand-700); }

.btn-outline { border-color: var(--slate-200); background: #fff; color: var(--slate-700); }
.btn-outline:hover { background: var(--slate-50); }

.btn-ghost { color: var(--slate-700); background: transparent; }
.btn-ghost:hover { background: var(--slate-100); }

.btn-danger { background: #dc2626; color: #fff; box-shadow: var(--shadow-card); }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: .3125rem .625rem; font-size: .8125rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-row-end { justify-content: flex-end; }

/* ---------- badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 9999px;
    padding: .125rem .625rem;
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-green { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px #a7f3d0; }
.badge-blue  { background: #f0f9ff; color: #0369a1; box-shadow: inset 0 0 0 1px #bae6fd; }
.badge-slate { background: var(--slate-100); color: var(--slate-600); box-shadow: inset 0 0 0 1px var(--slate-200); }
.badge-amber { background: #fffbeb; color: #92400e; box-shadow: inset 0 0 0 1px #fde68a; }
.badge-red   { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { border-radius: var(--radius-card); border: 1px solid var(--slate-200); background: #fff; box-shadow: var(--shadow-card); padding: 1.25rem 1.5rem; }
.stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .025em; color: var(--slate-500); margin-top: .25rem; }

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

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid var(--slate-200);
    background: #fff;
    box-shadow: var(--shadow-card);
}
table.table { width: 100%; border-collapse: collapse; }
table.table th {
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .025em;
    font-weight: 500;
    color: var(--slate-500);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-50);
    white-space: nowrap;
}
table.table td { padding: .875rem 1rem; border-bottom: 1px solid var(--slate-200); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: var(--slate-50); }
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--slate-500); font-size: .8125rem; }
.cell-actions { white-space: nowrap; }

/* ---------- notices ---------- */

.notice { border-radius: var(--radius-ctl); padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1rem; }
.notice-ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.notice-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--slate-500); }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--slate-700); margin-bottom: .25rem; }

.footnote { text-align: center; font-size: .75rem; color: var(--slate-400); margin-top: 1.5rem; }

/* ---------- read-only field (delete confirmation) ---------- */

.static-field {
    border-radius: var(--radius-ctl);
    border: 1px solid var(--slate-200);
    background: var(--slate-50);
    padding: .5rem .75rem;
    font-size: .875rem;
    min-height: 2.25rem;
    word-break: break-word;
}

/* ---------- login ---------- */

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-shell { width: 100%; max-width: 28rem; }
.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-head h1 { font-size: 1.5rem; font-weight: 600; margin: .75rem 0 0; }
.login-head p { font-size: .875rem; color: var(--slate-500); margin: .25rem 0 0; }

@media (max-width: 640px) {
    .card-body { padding: 1.25rem; }
    .shell { padding: 16px 12px 32px; }
}
