:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #111827;
    --muted: #64748b;
    --border: #dbe3ef;
    --accent: #0f766e;
    --accent-strong: #0f5f59;
    --accent-soft: #d9f5ef;
    --blue: #2563eb;
    --amber: #b45309;
}

.dark {
    --bg: #0d1117;
    --surface: #141a23;
    --surface-soft: #1b2430;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #263241;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #123832;
    --blue: #60a5fa;
    --amber: #fbbf24;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
dt {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--text);
    letter-spacing: 0;
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.app-surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.app-panel {
    background: color-mix(in srgb, var(--surface) 94%, var(--surface-soft));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.app-muted {
    color: var(--muted);
}

.app-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.app-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 600;
    gap: 0.45rem;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.5rem 0.8rem;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 1px 1px rgba(15, 23, 42, .03);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

.btn-danger {
    color: #b91c1c;
}

.dark .btn-danger {
    color: #fca5a5;
}

.btn-link {
    color: var(--blue);
    padding-left: 0;
    padding-right: 0;
    text-decoration: none;
}

.btn-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.nav-link {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    font-size: 0.9rem;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    transition: background 120ms ease, color 120ms ease;
}

.nav-link:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.nav-link-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.05rem;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.metric-card::before {
    background: var(--accent);
    border-radius: 8px 8px 0 0;
    content: "";
    height: 3px;
    inset: -1px -1px auto -1px;
    position: absolute;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.data-table {
    min-width: 100%;
    text-align: left;
}

.data-table thead {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
}

.status-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.status-disabled {
    background: #fee2e2;
    color: #991b1b;
}

.dark .status-disabled {
    background: #3b1d1d;
    color: #fca5a5;
}

/* Local production utility subset used by the PHP templates. */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
pre { white-space: pre-wrap; }
[data-lucide] { display: none; }
.modal-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, .48);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 50;
}
.modal-backdrop.is-open { display: flex; }
.modal-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    max-height: min(82vh, 760px);
    max-width: 860px;
    overflow: hidden;
    width: 100%;
}
.modal-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}
.modal-body {
    max-height: 66vh;
    overflow: auto;
    padding: 1rem 1.1rem;
}
.modal-body pre {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: .82rem;
    line-height: 1.55;
    margin: 0;
    padding: 1rem;
    white-space: pre-wrap;
}
.h-full { height: 100%; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-64 { width: 16rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-2 { height: .5rem; }
.h-4 { height: 1rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.max-w-28 { max-width: 7rem; }
.max-w-48 { max-width: 12rem; }
.max-w-md { max-width: 28rem; }
.max-w-xs { max-width: 20rem; }
.max-w-7xl { max-width: 80rem; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.min-h-0 { min-height: 0; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all { word-break: break-all; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.relative { position: relative; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.rounded { border-radius: .25rem; }
.rounded-sm { border-radius: .125rem; }
.rounded-md { border-radius: .375rem; }
.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.bg-zinc-200 { background: #e4e4e7; }
.text-white { color: #fff; }
.text-zinc-500 { color: #71717a; }
.text-red-600 { color: #dc2626; }
.text-emerald-800 { color: #065f46; }
.bg-emerald-50 { background: #ecfdf5; }
.border-emerald-200 { border-color: #a7f3d0; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.p-2 { padding: .5rem; }
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-1\.5 { padding-top: .375rem; padding-bottom: .375rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-7 { padding-top: 1.75rem; }
.pl-0 { padding-left: 0; }
.pr-0 { padding-right: 0; }
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-7 { margin-bottom: 1.75rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.max-w-none { max-width: none; }

aside {
    box-shadow: 1px 0 0 rgba(15, 23, 42, .02);
}

header {
    min-height: 4.1rem;
}

main {
    width: 100%;
}

select.app-input {
    appearance: auto;
}

textarea.app-input {
    min-height: 6rem;
    resize: vertical;
}

pre.overflow-auto {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

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

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:col-span-3 { grid-column: span 3 / span 3; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-6 { grid-column: span 6 / span 6; }
}

.dark .dark\:bg-zinc-800 { background: #27272a; }
