@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #121212; /* Neutral dark background */
    --color-surface: #1e1e1e; /* Neutral surface */
    --color-surface-2: #2d2d2d; /* Slightly lighter for cards/inputs */
    --color-border: #333333;
    --color-primary: #86e000; /* Brightened for contrast */
    --color-primary-hover: #7ccf00;
    --color-text: #ececec; /* Off-white to reduce glare */
    --color-text-muted: #a0a0a0;
    --color-danger: #f87171;
    --color-success: #4ade80;
    --color-warning: #fbbf24;

    --sidebar-width: 240px;
    --topbar-height: 56px;
    --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 14px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ── Light Theme ───────────────────────────────────────────────────────────── */
[data-theme="light"] {
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-surface-2: #f0f2f5;
    --color-border: #e5e7eb;
    --color-primary: #7ccf00;
    --color-primary-hover: #63a600;
    --color-text: #101828;
    --color-text-muted: #6a7282;
    --color-danger: #ef4444;
    --color-success: #2e7d32;
    --color-warning: #f5f17;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── System default: apply light when OS prefers light and no override set ── */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --color-bg: #f9fafb;
        --color-surface: #ffffff;
        --color-surface-2: #f0f2f5;
        --color-border: #e5e7eb;
        --color-primary: #7ccf00;
        --color-primary-hover: #63a600;
        --color-text: #101828;
        --color-text-muted: #6a7282;
        --color-danger: #ef4444;
        --color-success: #2e7d32;
        --color-warning: #f5f17;
        --shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── App Shell ─────────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    transition: width 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text);
    letter-spacing: 0.3px;
}

.brand-icon {
    width: 40px;
    height: 40px;
}

/* ── Nav Menu ──────────────────────────────────────────────────────────────── */
.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 2px 0;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    color: var(--color-text);
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    font-size: 16px;
    font-weight: 500;
    margin: 0px 16px;
}

.nav-link:hover {
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 10px;
}

.nav-link.active {
    background: var(--color-primary);
    color: var(--color-surface);
    border-radius: 10px;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* ── Main Area ─────────────────────────────────────────────────────────────── */
.main-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.sidebar-toggle:hover {
    color: var(--color-text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.user-name {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
}

.role-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(79, 142, 247, 0.15);
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(79, 142, 247, 0.3);
    letter-spacing: 0.3px;
}

.logout-link {
    font-size: 13px;
    color: var(--color-text-muted);
    transition: color 0.15s;
}

.logout-link:hover {
    color: var(--color-danger);
    text-decoration: none;
}

/* ── Theme Toggle ──────────────────────────────────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

/* ── Content ───────────────────────────────────────────────────────────────── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    transition: margin-left 0.2s ease;
}

/* ── Page Typography ───────────────────────────────────────────────────────── */
h1 {
    font-size: 30px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
    outline: none;
}

.page-subtitle {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.page-error {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ── Auth Pages ────────────────────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-width: 860px;
    width: 100%;
    display: flex;
    flex-direction: row;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-card-left {
    flex: 1 1 0;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-right {
    flex: 1 1 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 48px 40px;
    background: var(--color-bg);
}

.auth-brand-logo {
    width: 180px;
    height: auto;
    flex-shrink: 0;
    /*filter: invert(1);*/
}

[data-theme="light"] .auth-brand-logo {
    filter: none;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .auth-brand-logo {
        filter: none;
    }
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-brand-sub {
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-brand-name {
    font-size: 42px;
    font-weight: 900;
    color: #4caf20;
    line-height: 1;
    letter-spacing: -1px;
}

.auth-brand-desc {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.5;
}

.auth-brand-tagline {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.auth-title {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 32px;
    color: var(--color-text);
}

.auth-card-left input[type="text"],
.auth-card-left input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 14px;
    font-family: var(--font);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.auth-card-left input[type="text"]:focus,
.auth-card-left input[type="password"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-block {
    display: flex;
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
}

.auth-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.auth-card p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .auth-card {
        flex-direction: column;
    }

    .auth-card-right {
        border-top: 1px solid var(--color-border);
        padding: 32px 24px;
    }

    .auth-card-left {
        padding: 40px 24px;
    }
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
    color: #fff;
}

/* ── Responsive — tablet ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }
}

/* ── Responsive — mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-area {
        width: 100%;
    }

    .content {
        padding: 20px 16px;
    }

    .brand-name,
    .nav-label {
        display: block;
    }
}

/* -- Page Header ------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.page-header .page-subtitle {
    margin-bottom: 0;
}

/* -- Card -------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* -- Data Table -------------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(46,50,80,0.5);
    color: var(--color-text);
    vertical-align: middle;
}

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

.data-table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
}

.data-table--compact td,
.data-table--compact th {
    padding: 7px 12px;
}

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

.actions-cell {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.actions-cell-inner {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.tenant-name {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
}

.tenant-name:hover {
    text-decoration: underline;
}

.hierarchy-indent {
    color: var(--color-text-muted);
    margin-right: 4px;
}

/* -- Badges ------------------------------------------------------------------ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(74,222,128,0.12);
    color: var(--color-success);
    border: 1px solid rgba(74,222,128,0.25);
}

.badge-danger {
    background: rgba(224,82,82,0.12);
    color: var(--color-danger);
    border: 1px solid rgba(224,82,82,0.25);
}

.badge-warning {
    background: rgba(251,191,36,0.12);
    color: var(--color-warning);
    border: 1px solid rgba(251,191,36,0.25);
}

.badge-type {
    background: rgba(79,142,247,0.12);
    color: var(--color-primary);
    border: 1px solid rgba(79,142,247,0.25);
}

.badge-role {
    background: rgba(167,139,250,0.12);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,0.25);
}

/* -- Alerts ------------------------------------------------------------------ */
.alert {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.alert-danger {
    background: rgba(224,82,82,0.1);
    color: var(--color-danger);
    border: 1px solid rgba(224,82,82,0.25);
}

/* -- Loading ----------------------------------------------------------------- */
.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* -- Pagination -------------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
}

.page-info {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* -- Modal ------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* -- Forms ------------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 13.5px;
    font-family: var(--font);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.required {
    color: var(--color-danger);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}

/* -- Detail Grid ------------------------------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

/* -- Temp Password ----------------------------------------------------------- */
.temp-password {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 700;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--color-success);
    letter-spacing: 1px;
    text-align: center;
    margin-top: 8px;
    user-select: all;
}

/* -- Utility ----------------------------------------------------------------- */
.mt-2 { margin-top: 8px; }

/* -- Btn additional variants ------------------------------------------------- */
.btn-secondary {
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

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

.btn-danger:hover {
    background: #c94444;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

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

/* -- Drawer ------------------------------------------------------------------ */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 900;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 480px;
    max-width: 95vw;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 901;
    animation: drawer-slide-in 0.22s ease;
}

@keyframes drawer-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    gap: 12px;
}

.drawer-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* -- Drawer Tabs ------------------------------------------------------------ */
.drawer-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    flex-shrink: 0;
    padding: 0 24px;
}

.drawer-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.15s, border-color 0.15s;
}

.drawer-tab:hover {
    color: var(--color-text);
}

.drawer-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.drawer-section {
    margin-bottom: 28px;
}

.drawer-section:last-child {
    margin-bottom: 0;
}

/* -- Readings tab meta bar --------------------------------------------------- */
.readings-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.readings-utc-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.readings-utc-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* -- Filter Bar -------------------------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
}

.search-input {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

/* -- Status dot -------------------------------------------------------------- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.status-dot--online    { background: var(--color-success); box-shadow: 0 0 4px rgba(74,222,128,0.6); }
.status-dot--offline   { background: var(--color-danger); }
.status-dot--pending   { background: var(--color-warning); }
.status-dot--disabled  { background: var(--color-text-muted); }

/* -- Hardware Manifests page ------------------------------------------------- */
.upload-panel {
    margin-bottom: 24px;
    padding: 20px 24px;
}

.upload-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.upload-panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.upload-format-tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    padding: 4px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.tab-btn-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.upload-hint {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.upload-hint code {
    background: var(--color-surface-2);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    color: var(--color-text);
}

.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: default;
    margin-bottom: 12px;
}

.drop-zone-active {
    border-color: var(--color-primary);
    background: rgba(79,142,247,0.06);
}

.drop-zone-icon {
    font-size: 28px;
}

.drop-zone-text {
    font-size: 14px;
    color: var(--color-text-muted);
}

.drop-zone-browse {
    cursor: pointer;
}

.drop-zone-filename {
    font-size: 13px;
    color: var(--color-primary);
    word-break: break-all;
}

.manual-entry-details {
    margin-bottom: 12px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.manual-entry-details summary {
    cursor: pointer;
    padding: 6px 0;
    user-select: none;
}

.manual-textarea {
    margin-top: 8px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
    resize: vertical;
}

.upload-result {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 12px;
}

.upload-result-summary {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.badge-warning {
    background: rgba(251,191,36,0.15);
    color: var(--color-warning);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

.duplicates-details {
    font-size: 13px;
    color: var(--color-text-muted);
}

.duplicates-details summary {
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

.duplicates-list {
    margin: 6px 0 0 16px;
    line-height: 1.8;
}

.duplicates-list li code {
    background: var(--color-surface);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    color: var(--color-warning);
}

.upload-panel-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.section-title-row {
    margin: 8px 0 12px;
}

.section-title-row h2 {
    font-size: 16px;
    font-weight: 600;
}

/* -- Equipment page ---------------------------------------------------------- */
.equipment-sensor-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.equipment-sensor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-size: 0.875rem;
}

    .equipment-sensor-item span:first-child {
        flex: 1;
        font-weight: 500;
    }

/* -- Audit Log page ---------------------------------------------------------- */
.audit-ts {
    white-space: nowrap;
    font-size: 12.5px;
}

.audit-entity-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-mono {
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    word-break: break-all;
}

.audit-details-pre {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow-y: auto;
    color: var(--color-text);
}

.audit-date-input {
    width: 150px;
}

/* Audit action badge variants */
.badge-tenant   { background: rgba(134, 224, 0,  0.15); color: #86e000; }
.badge-user     { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-gateway  { background: rgba(96,  165, 250, 0.15); color: #60a5fa; }
.badge-sensor   { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.badge-backup   { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.badge-firmware { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-info     { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* ── Farm Map ──────────────────────────────────────────────────────────────── */
.farm-map-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
}

#farm-map {
    width: 100%;
    height: 100%;
}

/* ── Satellite / Street layer toggle ─────────────────────────────────────── */
.farm-map-layer-toggle {
    position: absolute;
    top: 12px;
    left: 52px;
    z-index: 1000;
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow);
}

.farm-map-layer-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.farm-map-layer-btn .material-icons {
    font-size: 1rem;
}

.farm-map-layer-btn:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.farm-map-layer-btn--active {
    background: var(--color-primary);
    color: #000;
}

.farm-map-layer-btn--active:hover {
    background: var(--color-primary-hover);
}

/* ── Drawer container (handles slide + back-button overflow) ─────────────── */
.farm-drawer-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 340px;
    height: 100%;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    pointer-events: none;
}

.farm-drawer-container--open {
    transform: translateX(0);
    pointer-events: auto;
}

/* ── Back tab button (sibling of inner drawer, outside scroll) ───────────── */
.farm-drawer__back {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 48px;
    border-radius: 8px 0 0 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    box-shadow: -2px 0 6px rgba(0,0,0,.08);
    transition: color 0.15s, background 0.15s;
    pointer-events: auto;
}

.farm-drawer__back:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

.farm-drawer__back .material-icons {
    font-size: 1.2rem;
}

/* ── Inner drawer (scrollable content) ──────────────────────────────────── */
.farm-drawer {
    flex: 1;
    height: 100%;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    border-radius: 0 var(--radius) var(--radius) 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow);
}
.farm-drawer__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.farm-drawer__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.farm-drawer__icon--warning { background: rgba(245,158,11,.15); color: var(--color-warning); }
.farm-drawer__icon--danger  { background: rgba(239,68,68,.12);  color: var(--color-danger);  }
.farm-drawer__icon--success { background: rgba(34,197,94,.12);  color: var(--color-success); }
.farm-drawer__icon--offline { background: var(--color-surface-2); color: var(--color-text-muted); }

.farm-drawer__title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
}

.farm-drawer__subtitle {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.farm-drawer__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.farm-drawer__status--warning { color: var(--color-warning); }
.farm-drawer__status--success { color: var(--color-success); }
.farm-drawer__status--danger  { color: var(--color-danger);  }

.farm-drawer__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

.farm-drawer__status-dot--warning { color: var(--color-warning); }
.farm-drawer__status-dot--success { color: var(--color-success); }
.farm-drawer__status-dot--danger  { color: var(--color-danger);  }

.farm-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Status-colored action buttons ─────────────────────────────────────── */
.farm-drawer__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, opacity 0.15s;
    border: 2px solid transparent;
}

.farm-drawer__action-btn .material-icons { font-size: 1.1rem; }

.farm-drawer__action-btn:hover { filter: brightness(1.08); }
.farm-drawer__action-btn:active { filter: brightness(0.95); }

/* Solid (Send Worker) */
.farm-drawer__action-btn--solid.farm-drawer__action-btn--warning {
    background: var(--color-warning);
    border-color: var(--color-warning);
    color: #fff;
}
.farm-drawer__action-btn--solid.farm-drawer__action-btn--danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #fff;
}
.farm-drawer__action-btn--solid.farm-drawer__action-btn--success {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}
.farm-drawer__action-btn--solid.farm-drawer__action-btn--offline {
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
    color: #fff;
}

/* Outline (Confirm Check) */
.farm-drawer__action-btn--outline.farm-drawer__action-btn--warning {
    background: transparent;
    border-color: var(--color-warning);
    color: var(--color-warning);
}
.farm-drawer__action-btn--outline.farm-drawer__action-btn--danger {
    background: transparent;
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.farm-drawer__action-btn--outline.farm-drawer__action-btn--success {
    background: transparent;
    border-color: var(--color-success);
    color: var(--color-success);
}
.farm-drawer__action-btn--outline.farm-drawer__action-btn--offline {
    background: transparent;
    border-color: var(--color-text-muted);
    color: var(--color-text-muted);
}

.btn--full { width: 100%; justify-content: center; }

.farm-drawer__section-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}

.farm-drawer__event-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.farm-drawer__sensor-header {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}

.farm-drawer__sensor-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

.farm-drawer__sensor-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color-text);
}

.farm-drawer__sensor-icon {
    font-size: 1rem;
    color: var(--color-primary);
}

.farm-drawer__sensor-status { font-weight: 600; }
.farm-drawer__sensor-status--warning { color: var(--color-warning); }
.farm-drawer__sensor-status--success { color: var(--color-success); }
.farm-drawer__sensor-status--danger  { color: var(--color-danger);  }

.farm-drawer__sensor-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ── Silobag Map Markers ───────────────────────────────────────────────────── */

/*
  Normal wrapper: 90×95 px. SVG = 52×78 px.
  Wifi-box centre at left≈45px, top≈29px.

  Offline wrapper: 90×110 px. SVG = 78×96 px.
  Wifi-box centre at left≈45px, top≈32px.
*/

@keyframes sbm-ring-expand {
    0%   { transform: translate(-50%, -50%) scale(0.35); opacity: 0.75; }
    100% { transform: translate(-50%, -50%) scale(1.9);  opacity: 0.3;    }
}

@keyframes sbm-glow-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.5; }
    50%       { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}

/* Offline blink: colored frame visible for 0.5s, then gray for 0.5s */
@keyframes sbm-offline-colored {
    0%, 49.9% { opacity: 1; }
    50%, 100%  { opacity: 0; }
}
@keyframes sbm-offline-gray {
    0%, 49.9% { opacity: 0; }
    50%, 100%  { opacity: 1; }
}

.sbm-wrapper {
    position: relative;
    width: 90px;
    height: 95px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sbm-wrapper--offline {
    height: 110px;
}

.sbm-svg-holder {
    position: relative;
    z-index: 2;
    line-height: 0;
}

/* Two frames stacked; each animates independently */
.sbm-offline-frame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    line-height: 0;
}

.sbm-offline-frame--colored {
    animation: sbm-offline-colored 1s steps(1, end) infinite;
}

.sbm-offline-frame--gray {
    animation: sbm-offline-gray 1s steps(1, end) infinite;
}

/* Rings and glow centred on wifi-box for normal icons */
/*
  White circle centre calculation:
  - SVG rendered size: 52×78 px
  - Wrapper: 90×95 px, SVG aligned to bottom
  - SVG top in wrapper: 95 - 78 = 17px
  - White box centre in SVG (viewBox 26×39 → 2× scale): y = 25px
  - White box centre in wrapper: top = 17 + 25 = 42px, left = (90-52)/2 + 26 = 45px
*/
.sbm-ring,
.sbm-glow-ring {
    position: absolute;
    left: 45px;
    top: 42px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.sbm-ring {
    animation: sbm-ring-expand 1.8s ease-out infinite;
}

.sbm-glow-ring {
    animation: sbm-glow-breathe 2.6s ease-in-out infinite;
}

/* ── Silo View ─────────────────────────────────────────────────────────────── */

.silo-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.silo-banner--warning {
    background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface));
    border: 1px solid var(--color-danger);
}

.silo-banner__icon {
    font-size: 2rem;
    color: var(--color-danger);
    flex-shrink: 0;
}

.silo-banner__content {
    flex: 1;
}

.silo-banner__content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.silo-banner__content p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.silo-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.silo-selector {
    margin-bottom: 1.5rem;
}

.silo-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.silo-summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.silo-summary-card .material-icons {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.silo-summary-card__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.silo-summary-card__value {
    font-size: 2rem;
    font-weight: 700;
}

.silo-summary-card--success .silo-summary-card__value { color: var(--color-success); }
.silo-summary-card--warning .silo-summary-card__value { color: var(--color-warning); }
.silo-summary-card--danger .silo-summary-card__value { color: var(--color-danger); }

.silobag-diagram {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.silobag-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.silobag-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.silobag-legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.silobag-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.silobag-sensor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.silobag-sensor-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.15s;
}

.silobag-sensor-label:hover {
    background: var(--color-border);
}

.silobag-sensor-label__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── Sensor View ───────────────────────────────────────────────────────────── */

.sensor-header-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sensor-header-card__info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.sensor-battery {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sensor-battery__bar {
    flex: 1;
    height: 10px;
    background: var(--color-surface-2);
    border-radius: 5px;
    overflow: hidden;
}

.sensor-battery__fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 5px;
    transition: width 0.3s;
}

.sensor-battery__pct {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 3ch;
    text-align: right;
}

.time-range-selector {
    display: inline-flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.time-range-btn {
    padding: 0.4rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s, color 0.15s;
}

.time-range-btn:hover {
    background: var(--color-surface-2);
}

.time-range-btn--active {
    background: var(--color-primary);
    color: #fff;
}

.sensor-readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sensor-reading-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.sensor-reading-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sensor-reading-card__param {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

.sensor-reading-card__value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.sensor-reading-card__unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.sensor-reading-card__status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-success);
}

/* Clickable sensor rows in drawer */
.farm-drawer__sensor-row--clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.farm-drawer__sensor-row--clickable:hover {
    background: var(--color-surface-2);
}

/* Primary action button variant */
.farm-drawer__action-btn--primary {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
}

.farm-drawer__action-btn--primary:hover {
    background: var(--color-primary-hover) !important;
}

/* Status badges for sensor statuses */
.status-badge--active {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.status-badge--warning {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-warning);
}

.status-badge--critical {
    background: color-mix(in srgb, var(--color-danger) 15%, transparent);
    color: var(--color-danger);
}

.status-badge--inactive {
    background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
    color: var(--color-text-muted);
}

/* ── TelemetrySparkCard ────────────────────────────────────────────────────── */

.spark-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s;
}

.spark-card:hover {
    box-shadow: var(--shadow);
}

/* ── Top row ── */
.spark-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.spark-card__param {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}

.spark-card__icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spark-card__icon-badge .material-icons {
    font-size: 1.2rem;
    color: var(--color-primary);
}

/* ── Value row ── */
.spark-card__value-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
}

.spark-card__value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.spark-card__value--loading {
    color: var(--color-text-muted);
    font-size: 1.8rem;
}

.spark-card__unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1;
}

/* ── Subtitle ── */
.spark-card__subtitle {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

/* ── Chart area ── */
.spark-card__chart {
    /* Negative horizontal margin lets the chart bleed to the card edges */
    margin: 0 -1.25rem;
    height: 80px;
    flex-shrink: 0;
}

/* Suppress ApexCharts wrapper padding inside the card */
.spark-card__chart .apexcharts-canvas,
.spark-card__chart svg {
    overflow: visible !important;
}

/* ── Trend badge ── */
.spark-card__trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0 0.1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

.spark-card__trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
}

.spark-card__trend-badge .material-icons {
    font-size: 0.9rem;
}

.spark-card__trend-badge--up {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-warning);
}

.spark-card__trend-badge--down {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.spark-card__trend-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

