/* TAK Fusion — Dark theme UI
   Self-contained utility CSS with component classes.
   No build step required. */

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

/* =============================================
   Color palette
   ============================================= */
:root {
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-750: #2d3748;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;
    --white: #ffffff;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #1e3a5f;
    --green-300: #86efac;
    --green-500: #22c55e;
    --green-700: #15803d;
    --green-900: #14532d;
    --red-300: #fca5a5;
    --red-400: #f87171;
    --red-700: #b91c1c;
    --red-900: #7f1d1d;
    --yellow-300: #fde047;
    --yellow-500: #eab308;
    --yellow-900: #713f12;
    --purple-300: #d8b4fe;
    --purple-900: #581c87;
    --orange-300: #fdba74;
    --orange-900: #7c2d12;
    --amber-200: #fde68a;
    --amber-300: #fcd34d;
    --amber-800: #92400e;
    --amber-900: #78350f;

    /* Theme-overridable — injected via <style> in base.html */
    --color-primary: var(--blue-500);
    --color-primary-hover: var(--blue-700);
    --color-primary-light: var(--blue-400);
    --color-accent: var(--purple-300);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    background-color: var(--gray-900);
    color: var(--gray-100);
}

/* Custom scrollbar (matches TUMT) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-800); }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* =============================================
   Layout
   ============================================= */
.min-h-screen { min-height: 100vh; }
.flex-col { display: flex; flex-direction: column; }
.flex-grow { flex: 1; }
.container { width: 100%; max-width: 1200px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.hidden { display: none; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-end { display: flex; justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.text-right { text-align: right; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-y-0 > * + * { margin-top: 0; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.overflow-hidden { overflow: hidden; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Grid */
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
    .md\:grid-cols-7 { grid-template-columns: repeat(7, 1fr); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================
   Spacing
   ============================================= */
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pr-4 { padding-right: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* =============================================
   Typography
   ============================================= */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.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; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-w-xs { max-width: 20rem; }
.max-w-md { max-width: 28rem; }
.w-full { width: 100%; }
.w-0 { width: 0; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-28 { width: 7rem; }
.w-32 { width: 8rem; }
.w-36 { width: 9rem; }
.w-40 { width: 10rem; }
.w-44 { width: 11rem; }
.w-52 { width: 13rem; }

/* =============================================
   Colors
   ============================================= */
.bg-black { background-color: var(--black); }
.bg-gray-600 { background-color: var(--gray-600); }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-gray-750 { background-color: var(--gray-750); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-gray-900 { background-color: var(--gray-900); }
.bg-red-900 { background-color: var(--red-900); }
.bg-amber-900 { background-color: var(--amber-900); }
.bg-red-900.bg-opacity-20 { background-color: rgba(127, 29, 29, 0.2); }
.bg-amber-900.bg-opacity-20 { background-color: rgba(120, 53, 15, 0.2); }
/* Status dots (fleet/dashboard live-status via fleet-status.js setDot). This is a
   hand-curated sheet — Tailwind's *-500 weights aren't generated — so define the few
   the status JS needs, or the connection-status dot renders with no fill. */
.bg-green-500 { background-color: #22c55e; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-red-500 { background-color: #ef4444; }
.bg-gray-500 { background-color: #6b7280; }
.text-white { color: var(--white); }
.text-gray-100 { color: var(--gray-100); }
.text-gray-200 { color: var(--gray-200); }
.text-gray-300 { color: var(--gray-300); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-blue-400 { color: var(--blue-400); }
.text-red-300 { color: var(--red-300); }
.text-red-400 { color: var(--red-400); }
.text-green-300 { color: var(--green-300); }
.text-amber-200 { color: var(--amber-200); }
.text-amber-300 { color: var(--amber-300); }
.text-muted { color: var(--gray-400); }
.opacity-60 { opacity: 0.6; }
.font-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }

/* =============================================
   Borders
   ============================================= */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-gray-700 { border-color: var(--gray-700); }
.border-gray-800 { border-color: var(--gray-800); }
.border-red-800 { border-color: var(--red-700); }
.border-amber-800 { border-color: var(--amber-800); }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* =============================================
   Navigation
   ============================================= */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}
.nav-logo { height: 2.5rem; width: auto; }
/* The brand (logo + title) never shrinks or wraps; the links row absorbs the squeeze. */
.nav-brand { flex-shrink: 0; }
/* As the plugin/tool count grows the links row scrolls horizontally instead of pushing
   the user menu off-screen or wrapping the nav (backlog #10). min-w-0 (set in markup)
   lets the flex child shrink below its content width so overflow-x can take effect. */
.nav-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;          /* Firefox: hide the scrollbar, keep scrollability */
    -ms-overflow-style: none;       /* legacy Edge */
}
.nav-links::-webkit-scrollbar { display: none; } /* WebKit/Blink */
.nav-link {
    font-size: 0.9375rem;
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;            /* a single tool label never wraps mid-word */
}
.nav-link:hover { color: var(--white); }
.nav-link.active { color: var(--color-primary); font-weight: 600; }

/* User menu dropdown */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--gray-800);
    border: none;
    border-radius: 0.5rem;
    color: var(--gray-300);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
}
.user-menu-btn:hover { background-color: var(--gray-700); }
.user-icon { width: 1.25rem; height: 1.25rem; color: var(--gray-400); }
.chevron-icon { width: 1rem; height: 1rem; color: var(--gray-400); }
.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 12rem;
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    z-index: 50;
}
.user-menu:focus-within .user-dropdown { display: block; }
.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gray-300);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.15s;
}
.user-dropdown-link:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.user-dropdown-link:hover { background-color: var(--gray-700); }
.dropdown-link-icon { width: 1rem; height: 1rem; }
.user-dropdown-logout {
    border-top: 1px solid var(--gray-700);
}
.user-dropdown-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--red-400);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: background-color 0.15s;
}
.user-dropdown-logout-btn:hover { background-color: var(--gray-700); }
.logout-icon { width: 1rem; height: 1rem; }

/* =============================================
   Cards
   ============================================= */
.card {
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 0.5rem;
}
.card-xl { border-radius: 0.75rem; }

/* =============================================
   Buttons
   ============================================= */
button, .btn { cursor: pointer; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.btn-primary {
    background-color: var(--color-primary);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
}
.btn-danger {
    background-color: var(--red-700);
    color: var(--white);
}
.btn-danger:hover {
    background-color: var(--red-900);
}
.btn-secondary {
    background-color: var(--gray-700);
    color: var(--gray-100);
}
.btn-secondary:hover {
    background-color: var(--gray-600);
}
.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}
.btn-busy {
    cursor: progress;
}
.btn[disabled], .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================
   Forms
   ============================================= */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 0.25rem;
}
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--gray-700);
    border: 1px solid var(--gray-600);
    border-radius: 0.375rem;
    color: var(--white);
    font-size: 0.875rem;
    transition: border-color 0.15s;
    outline: none;
}
.input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.input::placeholder { color: var(--gray-400); }
.select {
    padding: 0.25rem 0.5rem;
    background-color: var(--gray-700);
    border: 1px solid var(--gray-600);
    border-radius: 0.375rem;
    color: var(--white);
    font-size: 0.875rem;
    outline: none;
}
.select:focus { border-color: var(--color-primary); }
.input:disabled, .select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.placeholder-upload {
    border: 2px dashed var(--gray-600);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    background-color: var(--gray-900);
}

/* =============================================
   Flash messages (matches TUMT)
   ============================================= */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid;
}
.flash-success {
    background-color: rgba(20, 83, 45, 0.5);
    border-color: var(--green-700);
    color: var(--green-300);
}
.flash-error {
    background-color: rgba(127, 29, 29, 0.5);
    border-color: var(--red-700);
    color: var(--red-300);
}

/* =============================================
   Badges
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background-color: rgba(20, 83, 45, 0.5); color: var(--green-300); border: 1px solid var(--green-700); }
.badge-error   { background-color: rgba(127, 29, 29, 0.5); color: var(--red-300); border: 1px solid var(--red-700); }
.badge-warning { background-color: rgba(113, 63, 18, 0.5); color: var(--yellow-300); border: 1px solid var(--yellow-500); }
.badge-info    { background-color: rgba(30, 58, 95, 0.5); color: var(--blue-300); border: 1px solid var(--blue-600); }
.badge-accent  { background-color: rgba(88, 28, 135, 0.5); color: var(--purple-300); border: 1px solid #7c3aed; }
.badge-orange  { background-color: rgba(124, 45, 18, 0.5); color: var(--orange-300); border: 1px solid #c2410c; }
.badge-muted   { background-color: var(--gray-700); color: var(--gray-400); border: 1px solid var(--gray-600); }

/* =============================================
   Links
   ============================================= */
a { text-decoration: none; color: inherit; }
.link { color: var(--blue-400); }
.link:hover { color: var(--blue-300); }

/* =============================================
   Data tables (matches TUMT)
   ============================================= */
table { border-collapse: collapse; }
.data-table { width: 100%; table-layout: fixed; font-size: 0.875rem; }
.data-table thead { background-color: var(--gray-750); }
.data-table th { padding: 0.75rem 1rem; font-weight: 500; color: var(--gray-300); text-align: left; }
.data-table tbody tr { border-top: 1px solid var(--gray-700); color: var(--gray-300); transition: background-color 0.1s; }
.data-table tbody tr:hover { background-color: var(--gray-750); }
.data-table td { padding: 0.5rem 1rem; text-align: left; }
.cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }
/* Audit-table specific: badges and inline text inside td.cell-truncate
   need their own bounds because the td uses table-layout fixed-column
   widths. Without max-width:100% the badge expands beyond its td and
   visually bleeds into the next column.
*/
.audit-table td .badge,
.audit-badge {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* =============================================
   Login page
   ============================================= */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-logo {
    height: 4rem;
    width: auto;
    margin: 0 auto 1rem auto;
    display: block;
}

/* =============================================
   Card grid layout (Connections, Multicast list)
   ============================================= */
.conn-grid {
    display: grid;
    grid-template-columns: minmax(8rem, 1.4fr) minmax(11rem, 1.6fr) minmax(10rem, 1.4fr) minmax(11rem, 1.6fr) 9rem;
    gap: 1rem;
    align-items: start;
}
.conn-cell { min-width: 0; }
.conn-cell-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}
.conn-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    word-break: break-word;
}
.conn-actions { display: flex; flex-direction: column; gap: 0.375rem; }
.conn-actions form { margin: 0; }
.conn-actions .btn { width: 100%; }
@media (max-width: 1024px) {
    .conn-grid { grid-template-columns: 1fr 1fr; }
    .conn-actions { grid-column: 1 / -1; flex-direction: row; }
    .conn-actions .btn { width: auto; flex: 1; }
}

/* Per-connection routing checkbox tile (multicast edit page). */
.conn-route-tile {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    gap: 0.625rem;
    align-items: start;
    padding: 0.625rem 0.75rem;
    background-color: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 0.375rem;
    cursor: pointer;
}
.conn-route-tile:hover { border-color: var(--gray-600); }
.conn-route-tile input[type="checkbox"] {
    margin: 0;
    margin-top: 0.125rem;
    align-self: start;
}
.conn-route-tile-body { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.conn-route-tile-name {
    font-size: 0.875rem;
    color: var(--gray-200);
    line-height: 1.25;
    word-break: break-word;
}
.conn-route-tile-host {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
    line-height: 1.25;
}

/* Helpers used inline by the cards (Tailwindish names retained so
   the templates stay readable without pulling in Tailwind itself). */
.break-words { word-break: break-word; }
.w-full { width: 100%; }
.text-green-300 { color: var(--green-300); }
.text-blue-300 { color: var(--blue-300); }
.text-yellow-300 { color: var(--yellow-300); }
.mr-1 { margin-right: 0.25rem; }
.ml-1 { margin-left: 0.25rem; }
.text-base { font-size: 1rem; }

/* =============================================
   Connection editor (chunk 12) — tab nav + grant matrix
   ============================================= */
.conn-tab {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: var(--gray-400);
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
}
.conn-tab:hover { color: var(--gray-200); }
.conn-tab.is-active {
    color: #fff;
    border-bottom-color: var(--blue-600);
}
.conn-matrix { border-collapse: collapse; }
.conn-matrix th, .conn-matrix td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--gray-700);
}
.conn-matrix input[type="checkbox"] { cursor: pointer; }
.conn-matrix input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.35; }

/* =============================================
   HTMX loading indicator
   ============================================= */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* =============================================
   TAK Fusion red accent — matches the Fusion logo (red on dark slate).
   Overrides the archive's blue/purple accent.
   ============================================= */
:root {
    --color-primary: #dc2626;        /* red-600 */
    --color-primary-hover: #b91c1c;  /* red-700 */
    --color-primary-light: #f87171;  /* red-400 */
    --color-accent: #f87171;
}
.nav-brand .nav-logo + span, .brand { color: #f87171; }
.link { color: #f87171; }
.link:hover { color: #fca5a5; }
.text-blue-400 { color: #f87171; }
.text-blue-300 { color: #fca5a5; }
.badge-accent { background-color: rgba(127, 29, 29, 0.5); color: #fca5a5; border: 1px solid #dc2626; }
.input:focus, .select:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
}

/* ── Non-admin plugin launcher tiles ───────────────────────────────────── */
.launcher-card { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.launcher-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.launcher-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.launcher-logo {
    width: 104px; height: 104px; object-fit: contain;
    margin: .5rem 0 .25rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}
.launcher-logo-fallback { opacity: .45; }        /* the generic Fusion mark when a plugin has no bundled logo */
.launcher-name {
    text-transform: uppercase; letter-spacing: .09em;
    font-weight: 700; font-size: .95rem; color: #e5e7eb;
    margin-top: .5rem;
}
.launcher-stats { min-height: 1.25rem; color: var(--gray-400); }
.launcher-stat-value { font-weight: 700; color: #f3f4f6; }
.launcher-stat-muted { color: var(--gray-500); }
.launcher-dot {
    display: inline-block; width: .5rem; height: .5rem; border-radius: 50%;
    margin-right: .4rem; vertical-align: middle;
}
.launcher-dot-online { background: var(--green-300); box-shadow: 0 0 6px var(--green-300); }
.launcher-dot-offline { background: var(--red-300); }

/* ── Admin dashboard host metrics (gauges + sparklines) ────────────────── */
.metric-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); }
.plugin-row-logo { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }

.gauge-card, .spark-card {
    background: var(--gray-900); border: 1px solid var(--gray-700);
    border-radius: .5rem; padding: 1rem;
    display: flex; flex-direction: column; align-items: center;
}
.gauge-card { position: relative; }
.gauge { width: 110px; height: 110px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 10; }
.gauge-fill {
    fill: none; stroke: #22c55e; stroke-width: 10; stroke-linecap: round;
    stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
    transition: stroke-dashoffset .5s ease, stroke .5s ease;
}
.gauge-center {
    position: absolute; top: 1rem; left: 0; right: 0; height: 110px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none;
}
.gauge-pct { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem; font-weight: 700; color: #f3f4f6; line-height: 1; }
.gauge-name { font-size: .64rem; text-transform: uppercase; letter-spacing: .09em; color: var(--gray-500); margin-top: .25rem; }
.gauge-sub { font-size: .72rem; color: var(--gray-500); margin-top: .6rem; text-align: center; }

.spark-card { justify-content: space-between; align-items: stretch; }
.spark-head { display: flex; justify-content: space-between; }
.spark { width: 100%; height: 56px; margin: .45rem 0; }
.spark-line { fill: none; stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.spark-a { stroke: #38bdf8; } /* read / in  */
.spark-b { stroke: #f472b6; } /* write / out */
.spark-vals { display: flex; justify-content: space-between; font-size: .74rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.spark-a-c { color: #7dd3fc; }
.spark-b-c { color: #f9a8d4; }
