:root {
    --ink: #0f172a;
    --muted: #6b7280;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-warm: #c6a062;
    --background: #f7f8fb;
    --panel: #ffffff;
    --panel-soft: #f2f4f8;
    --border: #e5e7eb;
    --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    --sidebar: #0f172a;
    --sidebar-contrast: #f8fafc;
    --footer-height: 56px;
}

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

body.app-body {
    font-family: "Space Grotesk", "Segoe UI", "Tahoma", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #e9f2f1 0%, #f7f8fb 60%, #f6efe6 100%);
    min-height: 100vh;
    font-size: 13.5px;
    overflow-x: hidden;
}

main h2.text-2xl.font-semibold.text-slate-900 {
    display: none;
}

/* Bootstrap layout wrappers with custom cosmetics */
.app-navbar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.app-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: var(--sidebar-contrast);
}

.app-sidebar .accordion-item,
.app-sidebar .accordion-body {
    background: transparent;
    color: inherit;
}

.app-sidebar .accordion-button {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(248, 250, 252, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.app-sidebar .accordion-button:not(.collapsed) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-sidebar .accordion-button::after {
    filter: invert(1);
}

.app-sidebar .nav-link {
    color: rgba(248, 250, 252, 0.85);
    border-radius: 12px;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(248, 250, 252, 0.7);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-group-toggle.is-open {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.nav-group-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-group-toggle.is-open .nav-group-icon {
    transform: rotate(180deg);
}

.nav-group-items {
    margin-top: 8px;
    display: block;
}

body.sidebar-collapsed #sidebar {
    width: 84px !important;
    overflow: visible;
}

body.sidebar-collapsed #appMain {
    padding-left: 84px !important;
}

body.sidebar-collapsed #sidebar .sidebar-brand,
body.sidebar-collapsed #sidebar .nav-group-label,
body.sidebar-collapsed #sidebar .nav-link-label,
body.sidebar-collapsed #sidebar .nav-group-icon {
    display: none;
}

body.sidebar-collapsed #sidebar .nav-group-items {
    display: block !important;
}

body.sidebar-collapsed #sidebar .nav-group-items.hidden {
    display: block !important;
}

body.sidebar-collapsed #sidebar .flex-1 {
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.sidebar-collapsed #sidebar .flex-1::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body.sidebar-collapsed #sidebar .nav-group-toggle {
    display: none;
}

body.sidebar-collapsed #sidebar .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed #sidebar .nav-link {
    position: relative;
}

body.sidebar-collapsed #sidebar .nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(10px, -50%);
    background: #0f172a;
    color: #f8fafc;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 60;
}

body.sidebar-collapsed #sidebar .nav-link:hover::after {
    opacity: 1;
    transform: translate(16px, -50%);
}


.app-navbar .container-fluid {
    padding-top: 6px;
    padding-bottom: 6px;
}

.app-footer {
    padding: 8px 20px;
    font-size: 11px;
}

.app-sidebar .accordion-button {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(248, 250, 252, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.app-sidebar .accordion-button:not(.collapsed) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-sidebar .accordion-button::after {
    filter: invert(1);
}

.app-sidebar .nav-link {
    color: rgba(248, 250, 252, 0.85);
    border-radius: 12px;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.input-with-status {
    position: relative;
}

.input-with-status .form-control {
    padding-right: 32px;
}

.path-status {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.path-status.is-valid {
    color: #22c55e;
    opacity: 1;
}

.path-status.is-invalid {
    color: #ef4444;
    opacity: 1;
}

.path-status.is-warning {
    color: #f59e0b;
    opacity: 1;
}

/* File manager cosmetics (layout via Bootstrap utilities) */
.file-manager {
    gap: 16px;
}

.file-manager-topbar {
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 165, 160, 0.12), rgba(15, 23, 42, 0.08));
}

.file-manager-brand {
    font-weight: 600;
}

.file-manager-tabs .btn.is-active {
    background: #0ea5a0;
    color: #fff;
    border-color: #0ea5a0;
}

 .file-manager-search {
    position: relative;
    max-width: 520px;
    width: 100%;
}

.file-manager-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(15, 23, 42, 0.45);
}

.file-manager-search input {
    padding-left: 36px;
    border-radius: 999px;
}

 .file-manager-toolbar {
    gap: 12px;
}

.file-manager-tree {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 12px;
    min-height: 420px;
}

.file-manager-tree-header {
    font-weight: 600;
    margin-bottom: 8px;
}

.file-manager-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.file-manager-breadcrumb button {
    border: 0;
    background: rgba(14, 165, 160, 0.12);
    color: #0b4f4a;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.file-manager-breadcrumb span {
    color: rgba(15, 23, 42, 0.5);
}

.file-manager-table {
    margin: 0;
}

.file-manager-table tbody tr:hover {
    background: rgba(14, 165, 160, 0.08);
    cursor: pointer;
}

.file-manager-table th.fm-sort {
    cursor: pointer;
    user-select: none;
}

.file-manager-table th.fm-sort:after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.35);
    transform: translateY(-1px);
}

.file-manager-table th.fm-sort.desc:after {
    border-top-color: transparent;
    border-bottom-color: rgba(15, 23, 42, 0.35);
    transform: translateY(1px);
}

.file-manager-backup-panel {
    display: none;
}

.file-manager-backup-panel.is-active {
    display: block;
}

.file-manager-backup-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 12px;
}

.file-manager-backup-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.file-manager-backup-result {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(15, 23, 42, 0.7);
    overflow-wrap: anywhere;
    word-break: break-word;
}


.backup-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.backup-result-exact {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.backup-result-closest {
    background: rgba(249, 115, 22, 0.14);
    color: #c2410c;
}

/* File manager loading uses Bootstrap utilities */

/* App loading now uses Bootstrap utility classes */

.file-manager-table td:first-child {
    font-weight: 600;
}

.file-manager-table th,
.file-manager-table td {
    vertical-align: middle;
}

.file-manager-table th:first-child,
.file-manager-table td:first-child {
    white-space: normal;
    word-break: break-word;
}

.file-manager-table th:not(:first-child),
.file-manager-table td:not(:first-child) {
    white-space: nowrap;
}

.file-manager-table th:last-child,
.file-manager-table td:last-child {
    min-width: 140px;
}

.file-manager-table .fm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.fm-entry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fm-entry-row span {
    min-width: 0;
    word-break: break-word;
    display: block;
}


.file-entry-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-entry-icon i {
    color: #0ea5a0;
}

.file-manager-meta {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.6);
}

.file-manager-message {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.7);
    margin-bottom: 8px;
}

.file-manager-editor textarea {
    min-height: 220px;
    font-family: \"Space Grotesk\", sans-serif;
}

/* File manager editor visibility is handled via Bootstrap utility classes */

.file-manager-editor .CodeMirror {
    border: 1px solid var(--border);
    border-radius: 10px;
}

.file-manager-editor .CodeMirror-scroll {
    min-height: 220px;
}

.file-manager-code pre {
    margin: 0;
    background: #0b1220;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 10px;
    min-height: 220px;
    overflow: auto;
}

@media (max-width: 900px) {
    .file-manager-search {
        max-width: 100%;
    }
}

/* Sidebar link styling is handled by .app-sidebar */

.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.12);
    font-size: 11px;
}

/* Legacy layout classes removed in favor of Bootstrap utilities */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--panel-soft);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #f8fafc;
}

.table-tight {
    font-size: 13px;
    line-height: 1.35;
}

.table-tight thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(15, 23, 42, 0.5);
    padding: 10px 12px;
}

.table-tight tbody td {
    padding: 10px 12px;
    color: #1e293b;
}

.table-tight tbody tr + tr {
    border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.table-tight tbody tr:nth-child(even) {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.06), rgba(15, 118, 110, 0.02));
}

.hostname-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
}

.hostname-both-ok {
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
}

.hostname-ping-ok {
    color: #b45309;
    background: rgba(245, 158, 11, 0.18);
}

.hostname-ping-bad {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.18);
}

.device-hostname-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.device-hostname-btn:focus {
    outline: none;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 8px 10px;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 160, 0.2);
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e, #2f9e94);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #115e59, #0f766e);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    border: none;
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569, #64748b);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    border: none;
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #10b981);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border: none;
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border: none;
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    border: none;
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.btn-outline-secondary {
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #475569;
}

.btn-outline-secondary:hover {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.5);
    color: #334155;
}

.btn-outline-light {
    border-radius: 12px;
}

.btn-link {
    color: #0f766e;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-link:hover {
    color: #115e59;
    text-decoration: underline;
}

#fm-load-more {
    display: none;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 12px;
}

.dataTables_wrapper .dataTables_length select {
    padding-right: 32px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: none !important;
    margin: 0 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: #fff !important;
}

.dataTables_wrapper,
.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollBody {
    width: 100% !important;
}

.dataTables_wrapper {
    overflow-x: auto;
}

.dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto;
    transform: rotateX(180deg);
}

.dataTables_scrollBody table {
    transform: rotateX(180deg);
}
.dataTables_wrapper table.dataTable {
    min-width: 640px;
}

/* Dashboard backdrop styling (cosmetic) */
.dashboard-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: radial-gradient(circle at top left, #edf5f4 0%, #f7f8fb 60%, #f5efe7 100%);
}

.dashboard-shell::before,
.dashboard-shell::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    opacity: 0.35;
    z-index: 0;
}

.dashboard-shell::before {
    top: -120px;
    right: -120px;
    background: linear-gradient(135deg, #0f766e, #2f9e94);
}

.dashboard-shell::after {
    bottom: -140px;
    left: -140px;
    background: linear-gradient(135deg, #d4a056, #e6c089);
}

.dashboard-inner {
    position: relative;
    z-index: 1;
}

.dash-live-pill {
    background: rgba(14, 165, 160, 0.15) !important;
    color: #0f766e !important;
}

.dashboard-table-scroll {
    max-height: 280px;
    min-height: 280px;
}

.table-scroll {
    max-height: 360px;
}

.table-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    margin-bottom: 6px;
}

.table-scroll-top .table-scroll-top-inner {
    height: 1px;
}

@media (max-width: 767px) {
    .table-scroll-top {
        height: 10px;
    }
}

@media (max-width: 767px) {
    .table-scroll {
        max-height: 280px;
    }
}

.scroll-top-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    z-index: 1055;
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dashboard-hero h2 {
    font-size: 24px;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-status {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.dashboard-pill {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(14, 165, 160, 0.15);
    color: #0f766e;
    font-weight: 600;
}

/* Dashboard cards are Bootstrap cards; keep animation on card if desired */
.card {
    animation: lift 0.6s ease both;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-box--sm {
    height: 220px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

@keyframes lift {
    from {
        transform: translateY(8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stats-grid .stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--panel-soft);
}

.stat-card h3 {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #fff;
}

.icon-teal { background: linear-gradient(135deg, #0ea5a0, #22d3ee); }
.icon-green { background: linear-gradient(135deg, #22c55e, #4ade80); }
.icon-blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.icon-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.section-title .linkish {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.system-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13px;
}

.system-info .info-row:last-child {
    border-bottom: none;
}

.system-info .info-row span {
    color: var(--muted);
}

.progress-track {
    background: #e2e8f0;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-track .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0ea5a0, #22d3ee);
}

.action-grid .action-btn {
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.action-grid .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.badge-soft {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-teal { background: rgba(14, 165, 160, 0.15); color: #0f766e; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #b45309; }

/* Login/empty states now use Bootstrap cards */

.app-footer {
    position: static;
    padding: 8px 24px;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

@media (min-width: 1024px) {
    .app-footer {
        margin-left: 18rem;
        width: calc(100% - 18rem);
    }
}

.app-footer a {
    color: var(--accent-strong);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}


.badge-action {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.col-time {
    white-space: nowrap;
    width: 1%;
}

.col-wrap {
    white-space: nowrap;
    width: 1%;
}

#audit-logs-table {
    width: 100%;
    table-layout: auto;
}

#audit-logs-table th,
#audit-logs-table td {
    padding: 8px 10px;
    white-space: nowrap;
}

#audit-logs-table td:last-child,
#audit-logs-table th:last-child {
    white-space: normal;
}

#audit-logs-table td:last-child {
    line-height: 1.4;
}

.action-create { background: rgba(34, 197, 94, 0.2); color: #15803d; }
.action-update { background: rgba(14, 165, 160, 0.2); color: #0f766e; }
.action-delete { background: rgba(239, 68, 68, 0.2); color: #b91c1c; }
.action-import { background: rgba(37, 99, 235, 0.2); color: #1d4ed8; }
.action-export { background: rgba(245, 158, 11, 0.2); color: #b45309; }
.action-backup { background: rgba(99, 102, 241, 0.2); color: #4338ca; }
.action-default { background: rgba(100, 116, 139, 0.2); color: #334155; }

/* Removed legacy responsive layout classes in favor of Bootstrap */

/* Dashboard 2 Specific Styles */
.dashboard-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.dashboard-pill.refreshing {
    animation: pulse-green 1.5s ease-in-out;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6);
        transform: scale(1.05);
    }
}

.dashboard-pill i {
    animation: spin-slow 3s linear infinite;
}

.dashboard-pill.refreshing i {
    animation: spin-fast 1s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-fast {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dash2-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dash2-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.dash2-metric-card .metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.metric-primary .metric-icon {
    background: linear-gradient(135deg, #0ea5a0, #22d3ee);
}

.metric-success .metric-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.metric-warning .metric-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.metric-info .metric-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.dash2-metric-card .metric-content {
    flex: 1;
}

.dash2-metric-card .metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 4px;
}

.dash2-metric-card .metric-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.dash2-metric-card .metric-trend {
    font-size: 12px;
    color: var(--muted);
}

.dash2-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.dash2-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.dash2-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dash2-legend .legend-label {
    flex: 1;
    color: var(--muted);
}

.dash2-legend .legend-value {
    font-weight: 700;
    color: var(--ink);
}

.dash2-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.dash2-table {
    margin: 0;
}

.dash2-table thead {
    position: sticky;
    top: 0;
    background: var(--panel-soft);
    z-index: 10;
}

.dash2-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}

.dash2-table tbody tr {
    transition: background 0.2s ease;
}

.dash2-table tbody tr:hover {
    background: rgba(14, 165, 160, 0.05);
}

.dash2-table tbody td {
    padding: 10px 12px;
    font-size: 13px;
}

.dash2-pop-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dash2-pop-status.status-good {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.dash2-pop-status.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.dash2-pop-status.status-critical {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.dash2-pop-table {
    width: 100%;
    table-layout: fixed;
}

.dash2-pop-table th,
.dash2-pop-table td {
    overflow-wrap: anywhere;
}

.dash2-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

#dash2-timeline-chart,
#dash2-status-doughnut,
#dash2-vendor-bar,
#dash2-type-bar,
#dash2-user-roles-chart,
#ping-history-chart,
#access-history-chart {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#dash2-live-pill i {
    animation: none;
}

#dash2-live-pill.refreshing i {
    animation: spin-fast 1s linear infinite;
}

.dash2-activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.dash2-activity-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateX(4px);
}

.dash2-activity-item.activity-create .dash2-activity-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.dash2-activity-item.activity-update .dash2-activity-icon {
    background: rgba(14, 165, 160, 0.15);
    color: #0f766e;
}

.dash2-activity-item.activity-delete .dash2-activity-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.dash2-activity-item.activity-import .dash2-activity-icon {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

#dash2-backup-files-list {
    max-height: 260px;
    overflow-y: auto;
}

.dash2-activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash2-activity-content {
    flex: 1;
    min-width: 0;
}

.dash2-activity-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dash2-activity-meta {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
}

.dash2-user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.user-stat-item {
    padding: 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    text-align: center;
}

.user-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.user-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
}

.dash2-quick-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.quick-stat-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.quick-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.quick-stat-icon.bg-primary {
    background: linear-gradient(135deg, #0ea5a0, #22d3ee);
}

.quick-stat-icon.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.quick-stat-icon.bg-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.quick-stat-icon.bg-info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.quick-stat-content {
    flex: 1;
}

.quick-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.quick-stat-label {
    font-size: 11px;
    color: var(--muted);
}

.dash2-alerts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash2-alert {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border-left: 4px solid;
}

.dash2-alert.alert-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: #10b981;
}

.dash2-alert.alert-info {
    background: rgba(37, 99, 235, 0.08);
    border-color: #3b82f6;
}

.dash2-alert.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: #f59e0b;
}

.dash2-alert.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.dash2-alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.dash2-alert.alert-success .dash2-alert-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.dash2-alert.alert-info .dash2-alert-icon {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

.dash2-alert.alert-warning .dash2-alert-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.dash2-alert.alert-danger .dash2-alert-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.dash2-alert-content {
    flex: 1;
}

.dash2-alert-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.dash2-alert-message {
    font-size: 13px;
    color: var(--muted);
}

/* Dashboard 2 Countdown Timer */
#dash2-countdown {
    display: inline-block;
    min-width: 50px;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

#dash2-refresh-rate {
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: white;
    color: #0f766e;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#dash2-refresh-rate:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

#dash2-refresh-rate:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
    outline: none;
}

.dashboard-status {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .dashboard-status {
        width: 100%;
        justify-content: space-between;
    }
    
    #dash2-refresh-rate {
        order: -1;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* === Modern Tailwind-inspired refresh (layout + component overrides) === */
:root {
    --brand-50: #f2fbfb;
    --brand-100: #d4f2f1;
    --brand-200: #a7e3e0;
    --brand-300: #6ecfca;
    --brand-400: #39b5af;
    --brand-500: #0f766e;
    --brand-600: #0d5f59;
    --ink: #0f172a;
    --muted: #64748b;
    --panel: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
}

.card {
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--panel);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
    font-weight: 600;
}

.card-body {
    padding: 18px;
}

.table {
    color: var(--ink);
}

.table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.table td, .table th {
    padding: 12px 14px;
    border-color: #eef2f7;
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
}

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

.btn-primary:hover {
    background: var(--brand-600);
    border-color: var(--brand-600);
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--ink);
    background: #fff;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
}

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.btn-info {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}

.icon-btn--danger {
    border-color: #fecaca;
    background: #fff5f5;
    color: #ef4444;
}

.icon-btn--danger:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-link {
    color: var(--brand-500);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: 4px 10px;
    font-size: 11px;
}

.badge.bg-success {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #15803d !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #b91c1c !important;
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #b45309 !important;
}

.badge.bg-secondary {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #475569 !important;
}

.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.dropdown-menu {
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--brand-500) !important;
    color: #fff !important;
}

.app-footer {
    margin-top: 24px;
    padding: 8px 24px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.app-footer a {
    color: #0f766e;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.tab-toggle.is-active {
    background: var(--brand-500);
    color: #fff;
    border-color: var(--brand-500);
}

.form-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.form-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
}

.form-check-label {
    font-size: 13px;
    color: var(--ink);
}

.spinner-border {
    width: 20px;
    height: 20px;
    border: 3px solid #cbd5f5;
    border-top-color: var(--brand-500);
    border-radius: 999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-group {
    display: inline-flex;
    gap: 6px;
}

.tab-pane {
    display: none;
}

.tab-pane.show.active {
    display: block;
}

.fade {
    transition: opacity 0.2s ease;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.access-popover {
    position: absolute;
    z-index: 60;
    width: 260px;
    max-width: 70vw;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    font-size: 12px;
}

.access-reason-text {
    line-height: 1.5;
}

.access-reason-copy {
    width: 100%;
}

.btn-secondary {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.btn-secondary:hover {
    background: #1e293b;
    border-color: #1e293b;
}

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Toastr overrides (Tailwind-aligned) */
#toast-container > div,
#toast-container > .toast {
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px) saturate(1.3);
    color: #0f172a;
    font-family: 'Manrope', ui-sans-serif, system-ui;
    font-size: 13px;
    line-height: 1.4;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

#toast-container.navbar-offset-toast {
    top: 74px;
}

#toast-container > div:hover {
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}

#toast-container .toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

#toast-container .toast-message {
    color: rgba(15, 23, 42, 0.78);
}

#toast-container .toast-success {
    border-left: 4px solid #22c55e;
}

#toast-container .toast-error {
    border-left: 4px solid #ef4444;
}

#toast-container .toast-info {
    border-left: 4px solid #38bdf8;
}

#toast-container .toast-warning {
    border-left: 4px solid #f59e0b;
}
