:root {
    --bg: #020617;
    --bg-alt: #020617;
    --surface: #020617;
    --card-bg: #020617;
    --accent: #ef4444;            /* brand red */
    --accent-soft: rgba(239, 68, 68, 0.14);
    --accent-strong: rgba(239, 68, 68, 0.4);
    --border-subtle: rgba(148, 163, 184, 0.2);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #ef4444;
}

body.app-body.theme-light {
    --bg: #f9fafb;              /* almost pure white */
    --bg-alt: #ffffff;
    --surface: #f9fafb;
    --card-bg: #ffffff;
    --text-head: #ffffff;
    --text-main: #5e5e5e;
    --text-muted: #6b7280;
    --border-subtle: rgba(209, 213, 219, 1);
    --button-edit: #f97316;

    --badge-green-color: #034d00;
    --badge-red-color: #ffffff;
}

body.app-body.theme-dark {
    --button-edit: #f97316;

    --badge-green-color: #ffffff;
    --badge-red-color: #ffffff;
}

body.app-body.theme-dark .ui-btn-secondary {
    background: var(--button-edit);
    color: #ffffff;
}

.ui-card__body {
    margin-top: 46px;
}

.ui-card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    padding: 18px 20px 18px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.65);
    margin-bottom: 16px;
}

.ui-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ui-card__title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ui-card__actions {
    display: flex;
    gap: 8px;
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ui-table th,
.ui-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.ui-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ui-table tr:hover {
    color: red !important;
}

.ui-table tr:hover td {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff !important;
}

.ui-table tr:hover td * {
    color: #ffffff !important;
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.ui-badge--green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--badge-green-color);
}

.ui-badge--red {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

.ui-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.ui-modal-backdrop.active {
    display: flex;
}

.ui-modal {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    padding: 20px 20px 18px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.85);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    position: relative;
}

.ui-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ui-modal__title {
    font-size: 16px;
    font-weight: 600;
}

.ui-modal__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    position: relative;
    overflow: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.ui-modal__inner {
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
}

/* Basisstijl voor scroll-hint-elementen in modals */
.ui-modal-scroll-hint {
    display: none;

    position: sticky;
    bottom: 20px;
    width: 22px;
    height: 22px;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(15, 23, 42, 0.55);
    pointer-events: none;
    z-index: 5;
}

.ui-modal-scroll-hint--body {
    margin-left: auto;
    margin-right: auto;
}

.ui-modal__body--scrollable + .ui-modal-scroll-hint--body {
    display: flex;
}

.ui-modal__body--at-bottom + .ui-modal-scroll-hint--list {
    display: none;
}

.category-modal .ui-modal-scroll-hint {
    background: linear-gradient(90deg, #16f959, #20956e);
}

.ui-modal-scroll-hint--list {
    margin-left: 0;
}

.ui-modal.product-scroll-hint .ui-modal-scroll-hint,
.ui-modal.invoice-scroll-hint .ui-modal-scroll-hint,
#client-modal .ui-modal.client-modal-has-scroll .ui-modal-scroll-hint {
    display: flex;
}

.ui-modal__body .form-group {
    margin-bottom: 6px;
}

.ui-modal__body .form-group:last-of-type {
    margin-bottom: 0;
}

.ui-modal__footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.ui-modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.ui-modal-close:hover {
    color: var(--text-main);
}

/* ------------------------------------------------------------------ */
/* Global Button System                                               */
/* ------------------------------------------------------------------ */

/* Base button styles */
.ui-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.ui-btn:hover {
    filter: brightness(1.1);
}

.ui-btn:active {
    transform: scale(0.98);
}

/* Primary button (default - blue) */
.ui-btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}

.ui-btn-primary:hover {
    filter: brightness(1.1);
}

/* Secondary button (orange - for restart/reload) */
.ui-btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #f97316, #ea580c);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(249, 115, 22, 0.4);
}

body.app-body.theme-light .ui-btn-secondary:hover {
    filter: brightness(1.05);
}

/* Success button (green - for start/add/save) */
.ui-btn-success {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.4);
}

.ui-btn-success:hover {
    filter: brightness(1.1);
}

/* Danger button (red - for stop/delete) */
.ui-btn-danger {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.4);
}

.ui-btn-danger:hover {
    filter: brightness(1.1);
}

/* Warning button (yellow/amber - for configtest/warning actions) */
.ui-btn-warning {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #eab308, #ca8a04);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(234, 179, 8, 0.4);
}

.ui-btn-warning:hover {
    filter: brightness(1.1);
}

/* Info button (cyan/teal - for info/details) */
.ui-btn-info {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(6, 182, 212, 0.4);
}

.ui-btn-info:hover {
    filter: brightness(1.1);
}

/* Neutral/Ghost button (gray - for cancel/secondary actions) */
.ui-btn-neutral {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.ui-btn-neutral:hover {
    background: rgba(148, 163, 184, 0.1);
}

.dns-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dns-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dns-bulk-bar select[data-bulk-ttl] {
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    padding: 6px 10px;
    font-size: 13px;
}

.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.table-action-btn:hover {
    background: rgba(148, 163, 184, 0.14);
}

.table-action-btn--primary {
    border-color: rgba(59, 130, 246, 0.35);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.14));
    color: #6698db;
}

.table-action-btn--primary:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(59, 130, 246, 0.55);
}

.table-action-btn--danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.14), rgba(220, 38, 38, 0.14));
    color: #d09199;
}

.table-action-btn--danger:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    border-color: rgba(239, 68, 68, 0.55);
}

.dns-bulk-bar [data-multi-add-toggle] {
    min-width: 150px;
}

.multi-add-table {
    border-collapse: collapse;
    border-spacing: 0;
}

.multi-add-table tbody tr {
    background: transparent;
}

.multi-add-table td {
    padding: 6px 8px;
    vertical-align: middle;
}

.multi-add-table .dns-field {
    border: 1px solid var(--border-subtle);
    background: rgba(148, 163, 184, 0.05);
    padding: 6px 10px;
    height: 32px;
    border-radius: 8px;
}

.multi-add-table select.dns-field {
    background: rgba(148, 163, 184, 0.08);
}

.multi-add-table [data-new-remove] {
    border-radius: 10px;
    padding: 6px 12px !important;
    height: 32px;
    display: inline-flex;
    align-items: center;
}

.dns-field {
    width: 100%;
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: var(--text-main);
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dns-field:hover {
    border-color: var(--border-subtle);
    background: rgba(148, 163, 184, 0.05);
}

.dns-field:focus {
    outline: none;
    border-color: var(--accent);
}

/* Edit button (purple - for edit/modify) */
.ui-btn-edit {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
}

.ui-btn-edit:hover {
    filter: brightness(1.1);
}

/* Small button variant */
.ui-btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* Large button variant */
.ui-btn-lg {
    padding: 10px 18px;
    font-size: 14px;
}

/* Legacy support */
.ui-green-button {
    background: linear-gradient(90deg, #22c55e, #16a34a) !important;
}

.lang-switcher__item {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text-main);
}

.lang-switcher__item:hover {
background: rgba(248, 113, 113, 0.24);
color: var(--text-main);
}

.lang-switcher__menu {
font-size: 12px;
opacity: 0.8;
background: #ffffff;
border-color: rgba(148, 163, 184, 0.5);
}

.lang-switcher__button {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
border-radius: 999px;
border: 1px solid rgba(148, 163, 184, 0.6);
background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.3), transparent 55%),
radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.3), transparent 55%),
rgba(15, 23, 42, 0.98);
color: var(--text-main);
font-size: 11px;
cursor: pointer;
box-shadow: 0 10px 22px rgba(15, 23, 42, 0.9);
}

body.app-body.theme-light .lang-switcher__button {
background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.08), transparent 55%),
radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 55%),
#ffffff;
color: #111827;
}

.lang-switcher__item {
text-decoration: none;
}

.lang-switcher__item:hover {
text-decoration: none;
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-main) !important;
    text-decoration: none !important;
    gap: 8px;
}

.lang-switcher__item-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lang-switcher__item-code {
    font-weight: 600;
    letter-spacing: 0.06em;
    font-size: 11px;
}

.lang-switcher__item-name {
    font-size: 11px;
    opacity: 0.8;
}

.lang-switcher__item-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.logs-date-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 10px;
  font-size: 11px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
}

/* ------------------------------------------------------------------ */
/* Live Dashboard Gauges                                               */
/* ------------------------------------------------------------------ */

.live-pulse {
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.gauge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 20px 0;
}

@media (max-width: 900px) {
    .gauge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .gauge-grid {
        grid-template-columns: 1fr;
    }
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.gauge-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: rgba(148, 163, 184, 0.2);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.gauge-fill--cpu { stroke: #3b82f6; }
.gauge-fill--ram { stroke: #8b5cf6; }
.gauge-fill--disk { stroke: #22c55e; }
.gauge-fill--swap { stroke: #f59e0b; }

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.gauge-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.gauge-info {
    text-align: center;
}

.gauge-info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.gauge-info-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.gauge-fill.gauge-warning { stroke: #f59e0b !important; }
.gauge-fill.gauge-danger { stroke: #ef4444 !important; }

.load-average-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.load-average-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    text-align: center;
}

.load-average-values {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.load-avg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.load-avg-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.load-avg-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    width: 0%;
}

.load-avg-fill--1 { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.load-avg-fill--5 { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.load-avg-fill--15 { background: linear-gradient(90deg, #06b6d4, #0891b2); }

.load-avg-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.gauge-ring.gauge-glow-warning .gauge-fill {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.gauge-ring.gauge-glow-danger .gauge-fill {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}