/* ==================== CSS Variables ==================== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;

    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: var(--font-family);
    background: var(--dark);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

/* ==================== Utilities ==================== */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-4 {
    padding: 1rem;
}

/* ==================== App Container ==================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== Login Page ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: radial-gradient(ellipse at top, #1e3a5f 0%, #0f172a 50%, #0a0f1a 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--gray-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-light);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group input::placeholder {
    color: var(--gray);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    display: none;
}

.error-message.show {
    display: block;
}

/* ==================== Header ==================== */
.header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title .logo {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.header-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
}

/* ==================== Map Container ==================== */
.map-container {
    height: 45vh;
    min-height: 280px;
    position: relative;
    background: var(--dark-light);
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 500;
}

.map-btn {
    padding: 0.625rem 1rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-btn:hover {
    background: rgba(59, 130, 246, 0.9);
}

.map-btn.active {
    background: var(--primary);
}

/* ==================== Device List ==================== */
.device-section {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-light);
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.device-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.device-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.device-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.device-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.device-name {
    font-size: 1rem;
    font-weight: 600;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-weight: 500;
}

.device-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.device-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.device-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.device-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-light);
}

.info-item .icon {
    font-size: 0.875rem;
    opacity: 0.7;
}

.info-item .value {
    color: var(--white);
    font-weight: 500;
}

.device-address {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    color: var(--gray-light);
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
}

.device-address .icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ==================== Device Card Enhanced ==================== */
.device-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}

.action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.device-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.device-timestamp {
    font-size: 0.75rem;
    color: var(--gray);
}

.device-location {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    color: var(--gray-light);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.device-location .coord-text {
    color: var(--primary-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-location .coord-text:hover {
    color: var(--primary);
    text-decoration: underline;
}

.device-extra {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.extra-item {
    display: inline-block;
    margin-right: 0.75rem;
}

/* ==================== Refresh Status ==================== */
.refresh-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.refresh-status .status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.refresh-status .status-text {
    font-size: 0.875rem;
    color: var(--primary-light);
}

/* ==================== Modal Enhanced ==================== */
.modal-sm {
    max-width: 360px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.text-secondary {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==================== Loading ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.875rem 1.25rem;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
}

.modal-content {
    padding: 1.25rem;
    overflow-y: auto;
}

/* ==================== Responsive ==================== */
@media (min-width: 768px) {
    .main-content {
        flex-direction: row;
    }

    .map-container {
        flex: 1;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .device-section {
        width: 400px;
        max-width: 400px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        height: calc(100vh - 60px);
    }

    .modal-overlay {
        align-items: center;
    }

    .modal {
        border-radius: var(--radius-xl);
    }
}

@media (min-width: 1024px) {
    .device-section {
        width: 450px;
        max-width: 450px;
    }

    .device-info {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== Leaflet Custom Styles ==================== */
.leaflet-popup-content-wrapper {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--white);
}

.leaflet-popup-content {
    margin: 0.75rem 1rem;
}

.leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.95);
}

.marker-popup {
    min-width: 180px;
}

.marker-popup h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.marker-popup p {
    font-size: 0.8125rem;
    color: var(--gray-light);
    margin: 0.25rem 0;
}

.marker-popup .status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.marker-popup .status.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.marker-popup .status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Custom marker */
.custom-marker {
    background: var(--primary);
    border: 3px solid var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.custom-marker.offline {
    background: var(--danger);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

/* ==================== Large Modal (for iframe) ==================== */
.modal-lg {
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
}

.modal-lg .modal-content {
    height: calc(90vh - 60px);
    padding: 0;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.iframe-container {
    width: 100%;
    height: 100%;
    background: var(--dark);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--white);
}

/* Primary action button style */
.action-btn-primary {
    background: rgba(59, 130, 246, 0.2);
}

.action-btn-primary:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ==================== Desktop iframe modal improvements ==================== */
@media (min-width: 768px) {
    .modal-lg {
        max-width: 1200px;
        width: 90vw;
    }

    .modal-lg .modal-content {
        height: 70vh;
    }
}

/* ==================== Mobile Menu Styles ==================== */
.mobile-menu-container {
    position: relative;
}

.hamburger-btn {
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
}

.mobile-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-menu-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.mobile-menu-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Default: Hide mobile, show desktop */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Mobile view: Show mobile menu, hide desktop buttons */
@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .header-title .logo {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ==================== Medium Modal ==================== */
.modal-md {
    max-width: 500px;
}

.modal-md .modal-content {
    max-height: 70vh;
    overflow-y: auto;
}

/* ==================== Settings Styles ==================== */
.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-light);
    margin-bottom: 0.75rem;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.settings-item .label {
    font-size: 0.875rem;
    color: var(--white);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-warning:hover {
    background: #d97706;
}

/* ==================== Switch Toggle ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: var(--primary);
}

.switch input:checked+.slider:before {
    transform: translateX(22px);
}

/* ==================== Select Input ==================== */
.select-input {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 100px;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary);
}

.select-input option {
    background: var(--dark-light);
    color: var(--white);
}

/* ==================== Info Grid ==================== */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.info-row .label {
    color: var(--gray-light);
    font-size: 0.8125rem;
}

.info-row .value {
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* ==================== Details Sections ==================== */
.details-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.details-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

/* ==================== Loading Inline ==================== */
.loading-inline {
    color: var(--gray-light);
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
}

.error {
    color: var(--danger);
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
}

/* ==================== Toast Warning ==================== */
.toast.warning {
    border-color: var(--warning);
}

/* ==================== Status Text ==================== */
.status-text {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.8;
}

.status-text.status-on {
    color: var(--success);
}

.status-text.status-off {
    color: var(--danger);
}

.status-text.status-unknown {
    color: var(--warning);
}

/* ==================== Label with Status ==================== */
.label-with-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.label-with-status .label {
    font-size: 0.875rem;
    color: var(--white);
}

.label-with-status .status-text {
    margin-left: 0;
}