/* Apply border-box globally */
*,
*::before,
*::after {
    box-sizing: border-box; /* Include padding and border in element's total size */
}

/* General Body Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff; /* Light blue background */
    color: #333; /* Dark gray text */
    font-size: 12px; /* Small-medium base font size */
}

/* HTML Element Styling */
html {
    height: 100%;
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Header Styling */
header {
    background-color: #004080; /* Dark blue */
    color: white;
    padding: 5px 10px;
    text-align: center;
}

header h1 {
    font-size: 14px; /* Slightly larger for the header title */
    margin: 0;
    font-weight: bold;
    text-transform: uppercase; /* Uppercase for header title */
}

/* Navigation Bar Styling */
.navbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px;
    background-color: #004080; /* Dark blue */
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background-color: #004080; /* Dark blue */
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px; /* Space between button and menu */
    border-radius: 4px; /* Rounded corners */
    font-weight: bold; /* Bold text for button */
    text-transform: uppercase; /* Uppercase for button text */
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #0059b3; /* Lighter blue */
    color: white;
    transition: background-color 0.3s ease;
}

/* Navigation Menu Styling */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    font-size: 12px; /* Small-medium size for links */
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: white;
    padding: 5px 15px;
    font-weight: bold; /* Bold text for links */
    text-transform: uppercase; /* Uppercase for links */
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.3s ease;
    font-size: 12px; /* Small-medium size for links */
}

.nav-link:hover {
    background-color: #0059b3; /* Lighter blue */
    color: white;
    transition: background-color 0.3s ease;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #004080; /* Dark blue */
    list-style: none;
    padding: 5px;
    margin: 5px 0 0 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap; /* Prevent text wrapping */
    transition: all 0.3s ease; /* Smooth transition */
    z-index: 1; /* Ensure dropdown is above other elements */
}

.nav-item:hover .dropdown-menu {
    display: block;
}

/* Disabled Dropdown Link */
.dropdown-link.disabled {
    pointer-events: none; /* Disable interaction */
    opacity: 0.5; /* Dim the link to indicate it's disabled */
    cursor: not-allowed; /* Show a "not allowed" cursor */
}

.dropdown-link {
    text-decoration: none;
    color: white;
    padding: 5px 10px;
    display: block;
    font-weight: bold; /* Bold text for links */
    text-transform: uppercase; /* Uppercase for links */
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: #0059b3; /* Lighter blue */
}

/* Sidebar Styling */
.sidebar {
    width: 0; /* Hidden by default */
    height: 100vh; /* Full height */
    background-color: #e6f2ff; /* Light blue */
    position: fixed; /* Fix to the left side */
    left: 0;
    overflow: hidden; /* Hide content when collapsed */
    transition: width 0.3s ease; /* Smooth transition for expanding */
    white-space: nowrap; /* Prevent text wrapping */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Expanded Sidebar */
.sidebar.expanded {
    width: auto; /* Expand to fit content */
    overflow: visible; /* Allow content to be visible */
}

/* Sidebar Menu */
.side-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease; /* Smooth fade-in effect */
}

/* Show links when sidebar is expanded */
.sidebar.expanded .side-menu {
    opacity: 1; /* Fully visible */
}

/* Sidebar Items */
.side-item {
    margin-bottom: 10px;
    font-weight: bold; /* Bold text for sidebar items */
    text-transform: uppercase; /* Uppercase for sidebar items */
    cursor: pointer; /* Pointer cursor for sidebar items */
    padding: 10px 15px; /* Padding for sidebar items */
}

/* Sidebar Links */
.side-link {
    text-decoration: none;
    color: #004080; /* Dark blue */
    display: block;
    font-weight: bold; /* Bold text for links */
    text-transform: uppercase; /* Uppercase for links */
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.3s ease;
}

.side-link:hover {
    background-color: #cce0ff; /* Lighter blue */
}

/* Main Content Styling */
main {
    margin-left: 0; /* Default margin when sidebar is hidden */
    padding: 20px;
    transition: margin-left 0.3s ease; /* Smooth transition when sidebar expands */
    background-color: #ffffff; /* White background for main content */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Main Content Shifted */
main.shifted {
    margin-left: 200px; /* Shifted margin when sidebar is expanded */
}

/* Breadcrumb Container */
.breadcrumb-container {
    padding: 10px 15px;
    background-color: #cce0ff; /* Light blue */
    border-bottom: 1px solid #004080; /* Dark blue border */
    font-size: 12px; /* Small-medium size for breadcrumbs */
    font-weight: bold;
    color: #004080; /* Dark blue text */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow if breadcrumbs are too long */
    text-overflow: ellipsis; /* Add ellipsis for long breadcrumbs */
}

/* Breadcrumb Text */
.breadcrumb {
    display: inline-block;
    text-transform: uppercase; /* Uppercase for breadcrumbs */
}

/* Container Styling */
.container {
    display: flex; /* Use flexbox for horizontal layout */
    flex-direction: row; /* Arrange children in a row */
    gap: 0px; /* Space between the form and table */
    align-items: flex-start; /* Align items to the top */
    justify-content: flex-start; /* Align items to the left */
}

.container2 {
    display: flex;
    flex-direction: column; /* Stack children vertically */
    gap: 20px;              /* Optional: space between form and table */
}

/* Form Container Styling */
.form-container {
    flex: 1; /* Allow the form to take up available space */
    max-width: fit-content; /* Fit the content width */
    background-color: #ffffff; /* White background */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    border: 1px solid #004080; /* Dark blue border */
    padding: 20px; /* Add padding inside the border */
    overflow-y: auto; /* Enable vertical scrolling if needed */
}

.form-container2 {
    flex: 1; /* Allow the form to take up available space */
    max-width: 100%; /* Fit the content width */
    background-color: #ffffff; /* White background */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    border: 1px solid #004080; /* Dark blue border */
    padding: 20px; /* Add padding inside the border */
    overflow-y: auto; /* Enable vertical scrolling if needed */
}

/* Login Container Styling */
.login-container {
    width: min(100%, 640px);
    max-width: 640px;
    margin: 24px auto;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 2rem;
}

.login-container .form-group {
    margin-bottom: 16px;
    padding: 12px 14px;
}

.login-container .form-group label {
    margin-bottom: 8px;
    font-size: 1rem;
}

.login-container input,
.login-container select,
.login-container .btn {
    font-size: 1rem;
}

.content-grid > .login-container {
    grid-column: 1 / -1;
    justify-self: center;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 1em;
}

input[type="file"] {
    padding: 0;
}

input:focus, select:focus {
    border-color: #004080; /* Dark blue */
    outline: none;
}

/* Button Styling */
.test-connection-btn {
    background-color: #004080; /* Dark blue */
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
    font-size: 10px;
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.3s ease;
}

.btn {
    width: 100%;
    padding: 10px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn:hover {
    background: #125ea2;
}

/* Webcam Styling */
#webcam {
    display: block;
    margin: 10px auto 0 auto;
    border-radius: 4px;
}

/* Status Indicator Styling */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: gray;
}

.status-indicator.green {
    background-color: green;
}

.status-indicator.red {
    background-color: red;
}

#certificate-status, #biometric-status {
    margin-top: 8px;
    font-size: 0.95em;
}

/* Table Container Styling */
.table-container {
    flex: 2; /* Allow the table to take up more space */
    max-width: 100%; /* Optional: Set a max width for the table */
    max-height: 100%; /* Optional: Set a max height for the table */
    background-color: #ffffff; /* White background */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    border: 1px solid #004080; /* Dark blue border */
    overflow-x: auto; /* Enable horizontal scrolling if needed */
}

.table-container2 {
    flex: 2; /* Allow the table to take up more space */
    max-width: 100%; /* Optional: Set a max width for the table */
    background-color: #ffffff; /* White background */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    border: 1px solid #004080; /* Dark blue border */
    overflow-x: auto; /* Enable horizontal scrolling if needed */
}

/* Add shadow to tables */
.table-container .table {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Device Table Styling */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 3px;
}

/* Center all table headers and cells */
.table th,
.table td {
    text-align: center;
    vertical-align: middle;
}

.table th, .table td {
    border: 1px solid #ddd;
    font-size: 10px; /* Small-medium size for table elements */
    color: #333; /* Dark gray text */
    font-weight: normal; /* Normal weight for table text */
    border-radius: 4px; /* Rounded corners */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
    text-align: center; /* Center align table text */
    vertical-align: middle; /* Center align vertically */
}

.table th {
    background-color: #004080; /* Dark blue */
    color: white;
    font-weight: bold; /* Bold text for table headers */
    font-size: 10px; /* Small-medium size for table headers */
    padding: 3px; /* Padding for table headers */
    text-align: center; /* Center align table headers */
}

/* Alternating row colors for the devices table */
.table tbody tr:nth-child(even) {
    background-color: #f2f2f2; /* Light gray for even rows */
}
.table tbody tr:nth-child(odd) {
    background-color: #c9ffd6; /* Light green for odd rows */
}

.table-actions {
    display: flex; /* Use flexbox for horizontal alignment */
    justify-content: flex-end; /* Align actions to the right */
    gap: 10px; /* Add spacing between buttons */
    font-size: 10px; /* Small-medium size for action buttons */
    color: #333; /* Dark gray text */
    font-weight: normal; /* Normal weight for action buttons */
    padding: 10px; /* Add padding around the action buttons */
    background-color: #ffffff; /* White background */
    border-bottom: 1px solid #ddd; /* Add a subtle border below */
    border-radius: 4px; /* Rounded corners */
}

/* Modal Dialog Styling */
.modal-dialog {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog .modal-content {
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    min-width: 300px;
    max-width: 90vw;
    position: relative;
}

.modal-dialog .modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }

    .container {
        flex-direction: column; /* Stack form and table vertically */
    }

    .form-container, .table-container {
        max-width: 100%; /* Allow full width on smaller screens */
    }

    .sidebar {
        width: 0; /* Hidden by default */
    }

    .sidebar.expanded {
        width: 150px; /* Smaller width for mobile */
    }

    main.shifted {
        margin-left: 150px; /* Adjusted margin for mobile */
    }

    body {
        font-size: 13px; /* Slightly smaller font size for smaller screens */
    }

    header h1 {
        font-size: 16px; /* Adjust header size for smaller screens */
    }
}

/* Links Styling */
.view-link, .connect-link, .edit-link, .remove-link {
    color: #004080; /* Dark blue */
    text-decoration: none;
    font-size: 10px;
}

.view-link:hover, .connect-link:hover, .edit-link:hover, .remove-link:hover {
    text-decoration: underline;
}

/* Device Connect Page Styles */
.connect-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}
.panel {
    flex: 1 1 300px;
    min-width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 16px;
    margin-bottom: 24px;
}
.panel h2 {
    margin-top: 0;
    font-size: 1.2em;
}
#ssh-terminal {
    background: #222;
    color: #0f0;
    font-family: monospace;
    height: 320px;
    overflow: auto;
    border-radius: 4px;
    padding: 8px;
}
#mqtt-telemetry {
    background: #f7f7fa;
    font-family: monospace;
    height: 320px;
    overflow: auto;
    border-radius: 4px;
    padding: 8px;
}
#node-red-frame {
    width: 100%;
    height: 320px;
    border: 1px solid #bbb;
    border-radius: 4px;
}
/* Shared helpers for pages migrated from inline styles */
.hidden-section {
    display: none;
}

.status-success {
    color: green;
}

.spaced-select {
    margin-bottom: 10px;
}

.webcam-preview {
    margin-top: 10px;
    border: 1px solid rgb(204, 204, 204);
}

.center-text {
    text-align: center;
}

.error-text {
    color: red;
}

.add-server-form {
    width: 141px;
}

.device-details-container {
    width: 230px;
}

.hardware-form-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    width: 965px;
    height: 306px;
}

.hardware-table-container {
    height: 71px;
}

html.iot-devices-page {
    position: absolute;
    left: 0;
    top: 0;
}

/* iot-rw/device-connect.html */
body.device-connect-page {
    min-height: 100vh;
    min-width: 100vw;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

.device-connect-page .login-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}

.device-connect-page .connect-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}

.device-connect-page .panel {
    flex: 1 1 0;
    min-width: 280px;
    max-width: 100%;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    padding: 12px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}

.device-connect-page .panel h2 {
    margin-top: 0;
    font-size: 1.2em;
}

.device-connect-page #ssh-terminal {
    background: #222;
    color: #0f0;
    font-family: monospace;
    font-size: 10px;
    height: 60px;
    min-width: 0;
    width: 100%;
    max-width: 320px;
    margin-bottom: 8px;
    border-radius: 4px;
    padding: 4px;
    overflow: hidden;
}

.device-connect-page #mqtt-live-telemetry,
.device-connect-page #node-red-live-data {
    height: 100px;
    min-width: 0;
    width: 100%;
    max-width: 320px;
    margin-bottom: 8px;
}

.device-connect-page #node-red-frame {
    width: 100%;
    height: 120px;
    border: 1px solid #bbb;
    border-radius: 4px;
}

.device-connect-page .live-console {
    background: #222;
    color: #0f0;
    font-family: monospace;
    height: 100px;
    overflow: auto;
    border-radius: 4px;
    padding: 8px;
}

/* client-rw pages */
.client-rw-main-page .layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.client-rw-main-page .panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.client-rw-main-page .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.client-rw-main-page .board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.client-rw-main-page .board-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 12px;
}

.client-rw-main-page .board-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.client-rw-main-page .muted,
.board-camera-views-page .feed-status {
    color: #555;
    font-size: 0.92rem;
}

.board-camera-views-page .camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.board-camera-views-page .camera-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.board-camera-views-page .camera-frame {
    width: 100%;
    height: 180px;
    border-radius: 6px;
    margin-bottom: 8px;
    object-fit: cover;
    background: #101010;
}


.board-camera-views-page .step-size-row {
    margin-top: 10px;
}

.board-camera-views-page .step-size-row label {
    display: block;
    margin-bottom: 6px;
}

.board-camera-views-page .step-size-row input[type="range"] {
    width: 100%;
}
.board-camera-views-page .top-actions,
.board-camera-views-page .ptz-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.camera-controls-page .controls-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 900px;
}

.camera-controls-page .feed-controls,
.camera-controls-page .status-box {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.camera-controls-page .ptz-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* nginx-debian.html */
html.nginx-welcome-page {
    color-scheme: light dark;
}

body.nginx-welcome-page {
    width: 35em;
    margin: 0 auto;
    font-family: Tahoma, Verdana, Arial, sans-serif;
}


.camera-controls-page .step-size-row {
    margin: 10px 0;
}

.camera-controls-page .step-size-row label {
    display: block;
    margin-bottom: 6px;
}

.camera-controls-page .step-size-row input[type="range"] {
    width: 100%;
}

/* Unified theme system */
:root {
    --theme-bg: #f0f8ff;
    --theme-surface: #ffffff;
    --theme-surface-alt: #e6f2ff;
    --theme-primary: #004080;
    --theme-primary-hover: #0059b3;
    --theme-accent: #cce0ff;
    --theme-accent-2: #c9ffd6;
    --theme-text: #333333;
    --theme-text-inverse: #ffffff;
    --theme-border: #004080;
    --theme-table-even: #f2f2f2;
    --theme-table-odd: #c9ffd6;
}

body[data-theme='schneider-ecostruxure-it'] {
    --theme-bg: #eef5fb;
    --theme-surface: #ffffff;
    --theme-surface-alt: #dbe9f5;
    --theme-primary: #005baa;
    --theme-primary-hover: #0071d4;
    --theme-accent: #d9edf7;
    --theme-accent-2: #e6f7ff;
    --theme-text: #1a2a36;
    --theme-border: #005baa;
    --theme-table-even: #f3f8fc;
    --theme-table-odd: #e8f2fb;
}

body[data-theme='sunbird-dctrack-power-iq'] {
    --theme-bg: #f7fafc;
    --theme-surface-alt: #edf3f9;
    --theme-primary: #1f4f7a;
    --theme-primary-hover: #2d6699;
    --theme-accent: #cfe0ef;
    --theme-accent-2: #dfebf5;
    --theme-text: #1b2a38;
    --theme-border: #1f4f7a;
    --theme-table-even: #f4f8fb;
    --theme-table-odd: #e4eef6;
}

body[data-theme='nlyte-dcim'] {
    --theme-bg: #f6f7fb;
    --theme-surface-alt: #edeffd;
    --theme-primary: #303f9f;
    --theme-primary-hover: #3f51b5;
    --theme-accent: #d1d9ff;
    --theme-accent-2: #e1e6ff;
    --theme-text: #1f2440;
    --theme-border: #303f9f;
    --theme-table-even: #f5f6ff;
    --theme-table-odd: #e7ebff;
}

body[data-theme='device42'] {
    --theme-bg: #f8faf7;
    --theme-surface-alt: #edf5e8;
    --theme-primary: #2e7d32;
    --theme-primary-hover: #399a3f;
    --theme-accent: #cfe7cc;
    --theme-accent-2: #def1dc;
    --theme-text: #1f3221;
    --theme-border: #2e7d32;
    --theme-table-even: #f4faf3;
    --theme-table-odd: #e4f2e2;
}

body[data-theme='vertiv-trellis-platform'] {
    --theme-bg: #f8f9fc;
    --theme-surface-alt: #eef1f8;
    --theme-primary: #6a1b9a;
    --theme-primary-hover: #7d29b2;
    --theme-accent: #dcc5ec;
    --theme-accent-2: #eadcf4;
    --theme-text: #2d2040;
    --theme-border: #6a1b9a;
    --theme-table-even: #f8f4fb;
    --theme-table-odd: #ede3f5;
}

body[data-theme='fnt-command-platform'] {
    --theme-bg: #f5faf9;
    --theme-surface-alt: #e7f3f1;
    --theme-primary: #00695c;
    --theme-primary-hover: #00897b;
    --theme-accent: #bde3dc;
    --theme-accent-2: #d4eee9;
    --theme-text: #173633;
    --theme-border: #00695c;
    --theme-table-even: #f1f9f8;
    --theme-table-odd: #dff1ee;
}

body[data-theme='cormant-cs-dcim'] {
    --theme-bg: #f7f7fa;
    --theme-surface-alt: #ededf3;
    --theme-primary: #5d4037;
    --theme-primary-hover: #795548;
    --theme-accent: #d9ccc7;
    --theme-accent-2: #e9dfdb;
    --theme-text: #332824;
    --theme-border: #5d4037;
    --theme-table-even: #f8f5f4;
    --theme-table-odd: #eee6e3;
}

body[data-theme='ekkosense'] {
    --theme-bg: #f6fbf5;
    --theme-surface-alt: #e8f6e8;
    --theme-primary: #558b2f;
    --theme-primary-hover: #689f38;
    --theme-accent: #d1e9bf;
    --theme-accent-2: #e2f2d4;
    --theme-text: #23331a;
    --theme-border: #558b2f;
    --theme-table-even: #f4faf1;
    --theme-table-odd: #e5f1dc;
}

body[data-theme='ibm-turbonomic'] {
    --theme-bg: #f2f6fb;
    --theme-surface-alt: #e5eef8;
    --theme-primary: #0f62fe;
    --theme-primary-hover: #2b75ff;
    --theme-accent: #c7dcff;
    --theme-accent-2: #d8e8ff;
    --theme-text: #15253b;
    --theme-border: #0f62fe;
    --theme-table-even: #f2f7ff;
    --theme-table-odd: #e1ecff;
}

body[data-theme='abb-ability-data-center-automation'] {
    --theme-bg: #f8f8f8;
    --theme-surface-alt: #efefef;
    --theme-primary: #d32f2f;
    --theme-primary-hover: #e34545;
    --theme-accent: #f5c9c9;
    --theme-accent-2: #f8dddd;
    --theme-text: #3a2222;
    --theme-border: #d32f2f;
    --theme-table-even: #fff5f5;
    --theme-table-odd: #ffe8e8;
}

body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

header,
.navbar,
.dropdown-menu {
    background-color: var(--theme-primary);
    color: var(--theme-text-inverse);
}

.nav-link,
.dropdown-link {
    color: var(--theme-text-inverse);
}

.nav-link:hover,
.dropdown-link:hover,
.sidebar-toggle:hover,
.btn:hover,
.test-connection-btn:hover {
    background-color: var(--theme-primary-hover);
}

.sidebar-toggle,
.btn,
.test-connection-btn,
.table th {
    background-color: var(--theme-primary);
    color: var(--theme-text-inverse);
}

.sidebar,
.breadcrumb-container {
    background-color: var(--theme-surface-alt);
}

.side-link,
.breadcrumb-container {
    color: var(--theme-primary);
}

.side-link:hover {
    background-color: var(--theme-accent);
}

main,
.form-container,
.form-container2,
.table-container,
.table-container2,
.login-container,
.modal-dialog .modal-content {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

input:focus,
select:focus {
    border-color: var(--theme-primary);
}

.table tbody tr:nth-child(even) {
    background-color: var(--theme-table-even);
}

.table tbody tr:nth-child(odd) {
    background-color: var(--theme-table-odd);
}

.theme-settings-panel {
    max-width: 640px;
}

.theme-current {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    background: var(--theme-accent);
}

.settings-links,
.settings-links li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.settings-links li {
    margin-bottom: 8px;
}

.settings-links a {
    color: var(--theme-primary);
    font-weight: bold;
    text-decoration: none;
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef3ff;
    --ink: #14213d;
    --ink-soft: #4d5c7b;
    --brand: #1c4fa1;
    --brand-strong: #12356d;
    --accent: #3ea0ff;
    --ring: rgba(62, 160, 255, 0.35);
}

html {
    height: 100%;
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background:
        radial-gradient(circle at 100% 0%, #dbe9ff 0%, transparent 30%),
        radial-gradient(circle at 0% 100%, #d8f6ff 0%, transparent 35%),
        var(--bg);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand-strong);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0 0.5rem 0;
}

.skip-link:focus {
    left: 0;
    z-index: 1100;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(145deg, #0f2f63, #1f5eb7 58%, #2d76d5);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 30px rgba(17, 43, 82, 0.25);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem 0.25rem;
    text-align: left;
}

.brand-logo {
    width: min(220px, 50vw);
    height: auto;
    display: block;
    flex-shrink: 0;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.eyebrow {
    margin: 0;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.86);
}

.app-header h1 {
    margin: 0;
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    font-weight: 650;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.2rem 1rem;
    background: transparent;
}

.sidebar-toggle {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(2px);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.nav-link,
.dropdown-link {
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

.nav-link:hover,
.dropdown-link:hover,
.nav-link:focus-visible,
.dropdown-link:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.dropdown-menu {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #1a4d99;
    padding: 0.4rem;
}

.app-shell {
    gap: 1rem;
    padding: 1rem;
    align-items: stretch;
}

.sidebar {
    position: sticky;
    top: 5.8rem;
    width: 280px;
    height: calc(100vh - 6.8rem);
    border-radius: 1rem;
    border: 1px solid #d8e4fb;
    background: linear-gradient(170deg, #f8fbff, #edf4ff);
}

.sidebar.sidebar-hidden {
    width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}

.breadcrumb-container {
    background: transparent;
    border-bottom: 1px solid #cfddf8;
    color: var(--brand-strong);
}

.side-item { text-transform: none; }

.submenu {
    display: none;
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0.2rem 0 0.4rem 0.85rem;
}

.submenu.active { display: block; }

.submenu-link {
    display: block;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 0.25rem 0;
}

.content-grid {
    margin-left: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-content: start;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.panel {
    grid-column: span 12;
    background: var(--surface);
    border: 1px solid #dce7fb;
    border-radius: 1rem;
    padding: 1.15rem;
    box-shadow: 0 10px 20px rgba(12, 50, 110, 0.08);
}

.hero {
    background: linear-gradient(130deg, #ffffff 0%, #eff5ff 75%);
}

.hero h2 {
    margin: 0.25rem 0 0.5rem;
    font-size: clamp(1.4rem, 2.3vw, 2rem);
    line-height: 1.25;
}

.metrics {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.metric-card {
    min-height: 150px;
    background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.feature-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ink-soft);
}

.main-fullwidth {
    width: 100%;
}


@media (max-width: 900px) {
    .brand-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .brand-logo {
        width: min(200px, 72vw);
    }


    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
    }
}


.nav-link.requires-auth::after,
.dropdown-link.requires-auth::after {
    content: " 🔒";
    font-size: 0.9em;
}

.nav-link.disabled,
.dropdown-link.disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

/* IoT provisioning page */
.iot-provisioning-page .container2 {
    padding: 20px;
}

.compact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
}

.form-group {
    border: 1px solid #b3ccff;
    border-radius: 6px;
    padding: 8px 12px;
}

.form-group label {
    display: block;
    margin-top: 6px;
}

#provisioning-status,
#provisioning-output {
    min-height: 120px;
    white-space: pre-wrap;
}

/* nginx-debian.html system status page */
.service-status-page {
    grid-column: 1 / -1;
}

.status-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.status-refresh-btn {
    width: auto;
    min-width: 180px;
}

.status-updated {
    margin: 0;
    color: var(--ink-soft);
}

.status-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1rem;
}

.status-card {
    grid-column: span 12;
}

.status-count {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.status-list {
    margin: 0;
    padding-left: 1rem;
}

.status-list li {
    margin-bottom: 0.3rem;
    word-break: break-word;
}

.status-diagnostics {
    margin: 0;
    padding: 1rem;
    min-height: 140px;
    border-radius: 0.6rem;
    border: 1px solid #dce7fb;
    background: #f7faff;
    overflow: auto;
}
