/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Support safe areas for mobile browsers with notches */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile browsers */
    position: relative;
}

/* Login Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile browsers */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fuel Modal - Transparent Background */
#addFuelModal.modal,
#addTransportModal.modal,
#addBoilerModal.modal,
#boilerDetailsModal.modal {
    background: rgba(0, 0, 0, 0.5);
}

/* Make write-off modal overlay slightly transparent */
#writeoffModal.modal {
    background: rgba(0, 0, 0, 0.2);
}

#loginModal.modal {
    background: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)), url('dark_polygon_bg.png');
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Top banner title like screenshot */
.login-top-banner {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #ffffff;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 2.2rem;
    z-index: 1002;
    /* above modal backdrop, below modal content shadow */
}



.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0;
    border-radius: 12px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 420px;
    margin: 2rem auto;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

/* Two-sided Login Layout */
.login-split-container {
    display: flex;
    width: 90%;
    max-width: 1100px;
    height: auto;
    min-height: 600px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    /* animation: modalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1); */
}

.login-visual-side {
    flex: 1.2;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)),
        url('BG_premium.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: white;
}

.visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 126, 231, 0.3) 0%, transparent 100%);
}

.visual-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.visual-tag {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1e7ee7;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.visual-content h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.visual-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.login-form-side {
    flex: 0.8;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#loginModal .login-form-side.modal-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 3rem 2rem 2rem !important;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
    margin: 0;
    background: white;
    animation: none;
}

.login-form-side .login-top-banner {
    position: absolute;
    top: 15px;
    left: 25px;
    /* Move to left to stay away from the center logo area if needed, or just push it higher */
    transform: none;
    font-size: 0.75rem;
    letter-spacing: 2px;
    opacity: 0.4;
    color: #64748b;
    z-index: 10;
    text-transform: uppercase;
}

.login-mobile-navbar {
    display: none;
}

.login-subtitle {
    display: none;
}

.login-footer-links {
    display: none;

    text-align: center;
    position: relative;
    background: #f8f9fa;
    padding: 3.5rem 2rem 1.5rem;
    /* Increased top padding to accommodate banner if it sits above */
    border-bottom: 1px solid #e9ecef;
}

.login-header {
    position: relative;
}

.login-header h2 {
    color: #333;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-header h2 i {
    color: #1e7ee7;
    font-size: 1.2rem;
}

.login-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.login-header p {
    display: none;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 2rem 1rem 2rem;
}

.login-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.25rem;
    color: #333;
    font-weight: 400;
    margin: 0;
}

.language-selector {
    color: #666;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.language-selector::after {
    content: '▼';
    font-size: 0.7rem;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.login-form .form-group label {
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.login-form .form-group label i {
    display: none;
}

.login-form .form-group input {
    padding: 0.75rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    font-family: inherit;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #1e7ee7;
    box-shadow: 0 0 0 2px rgba(30, 126, 231, 0.2);
}

.login-form .form-group input:hover:not(:focus) {
    border-color: #b0b0b0;
}



.login-btn {
    background: #1e7ee7;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.login-btn:hover {
    background: #1a6cc7;
}

.login-btn:active {
    background: #165aa0;
}

.login-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.login-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}



.error-message {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #f1aeb5;
    font-size: 0.95rem;
    text-align: left;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
    animation: errorSlideIn 0.3s ease;
}

.error-message::before {
    content: '\f071';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #dc3545;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Auto Logout Message */
.auto-logout-message {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #b8daff;
    font-size: 0.95rem;
    text-align: left;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInFromTop 0.4s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.auto-logout-message i.fa-info-circle {
    color: #17a2b8;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.auto-logout-message #autoLogoutText {
    flex: 1;
    line-height: 1.5;
    font-weight: 500;
}

.auto-logout-message .dismiss-btn {
    background: none;
    border: none;
    color: #0c5460;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.6;
    flex-shrink: 0;
}

.auto-logout-message .dismiss-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for login on smaller screens */
@media (max-width: 768px) {
    #loginModal.modal {
        padding: 0;
        background: white !important;
        align-items: flex-start;
    }

    .login-split-container {
        flex-direction: column;
        width: 100%;
        max-width: none;
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        background: white;
        margin: 0;
    }

    .login-visual-side {
        display: none;
    }

    /* Use specific spacing to match reference pic airy feeling */
    .login-form-side {
        flex: 1;
        width: 100%;
        padding: 2rem 1.5rem;
        /* Restored normal spacing */
        background: white !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    #loginModal .login-form-side.modal-content {
        max-width: none;
        padding: 2rem 1.5rem;
        /* Restored padding here to ensure it applies */
        box-shadow: none;
        background: white;
        border-radius: 0;
        margin: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .login-mobile-navbar {
        display: block;
        font-family: 'Inter', system-ui, sans-serif;
        font-weight: 700;
        font-size: 1.3rem;
        color: #718096;
        /* Slate gray like pic */
        margin-bottom: 2.5rem;
        text-transform: uppercase;
        letter-spacing: -0.5px;
        text-align: left;
    }

    .login-header,
    .login-form-header,
    .login-top-banner {
        display: none !important;
    }

    .login-subtitle {
        display: block;
        text-align: center;
        font-size: 1.1rem;
        color: #2d3748;
        margin-bottom: 3rem;
        /* Large breathing room above inputs */
        font-weight: 500;
        width: 100%;
    }

    .login-form {
        padding: 0 !important;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .form-group {
        margin-bottom: 2rem;
    }

    .form-group label {
        display: block;
        font-size: 0.85rem;
        color: #4a5568;
        margin-bottom: 0.4rem;
        font-weight: 500;
    }

    .form-group input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #cbd5e0;
        border-radius: 2px;
        /* Sharper corners */
        font-size: 0.95rem;
        color: #1a202c;
        background: white;
        box-shadow: none;
        transition: all 0.2s;
    }

    .form-group input:focus {
        border-color: #3182ce;
        outline: none;
        box-shadow: none;
    }

    .login-footer-links {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 3rem;
    }

    .forgot-password-link {
        color: #3182ce;
        text-decoration: none;
        font-size: 0.95rem;
    }

    .login-btn {
        width: 100%;
        background: #006ce0;
        /* Bright blue */
        color: white;
        border: none;
        padding: 14px;
        border-radius: 3px;
        font-size: 1.1rem;
        font-weight: 600;
        transition: background 0.2s;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        box-shadow: none;
    }

    .login-btn i {
        display: none;
    }

    .auto-logout-message {
        margin-top: 2rem;
        border-radius: 8px;
    }
}

/* Specific small tweaks for tiny screens */
@media (max-width: 480px) {
    .login-form-side {
        padding: 1.5rem 1rem;
    }

    .login-subtitle {
        margin-bottom: 3rem;
    }
}

/* Change Password Modal Styles */
#changePasswordModal.modal {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    backdrop-filter: blur(8px);
    align-items: flex-start;
    padding-top: 80px;
}

/* Password change form header with better spacing */
#changePasswordForm .login-form-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#changePasswordForm .login-title {
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    color: #2c3e50;
}

.password-change-notice {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0;
    line-height: 1.6;
    text-align: left;
    padding: 0.65rem 0.9rem;
    background: #f8f9fa;
    border-left: 3px solid #1e7ee7;
    border-radius: 4px;
}

/* Password change form specific styling for better spacing */
#changePasswordForm .form-group {
    margin-bottom: 1.25rem;
}

#changePasswordForm .form-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.75rem;
}

.password-strength-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.password-strength-fill.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-fill.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-fill.strong {
    width: 100%;
    background: #28a745;
}

.password-strength-text {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.password-strength-text.weak {
    color: #dc3545;
}

.password-strength-text.medium {
    color: #ffc107;
}

.password-strength-text.strong {
    color: #28a745;
}

/* Password Requirements List */
.password-requirements {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.password-requirements p {
    margin: 0 0 0.6rem 0;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s ease;
}

.password-requirements li i {
    font-size: 0.65rem;
    color: #ccc;
    transition: all 0.2s ease;
}

.password-requirements li.valid {
    color: #28a745;
    font-weight: 500;
}

.password-requirements li.valid i {
    color: #28a745;
}

.password-requirements li.invalid {
    color: #dc3545;
}

.password-requirements li.invalid i {
    color: #dc3545;
}

/* Responsive adjustments for change password modal */
@media (max-width: 768px) {
    #changePasswordModal.modal {
        padding-top: 60px;
        background: white !important;
    }
}

@media (max-width: 480px) {
    #changePasswordModal.modal {
        padding-top: 40px;
        background: white !important;
    }
}

/* Large Modal Styles */

.large-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header.compact {
    padding: 1rem 1.5rem;
    margin-bottom: 0 !important;
}

.modal-header.compact h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

/* Form Grid Layout */
.fuel-form,
.transport-form,
.boiler-form {
    padding: 2rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

/* Transport Form Specific Styling */
.transport-form .form-grid {
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.transport-form .form-group {
    margin-bottom: 0.5rem;
}

.transport-form .form-group label {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.transport-form .form-group input,
.transport-form .form-group select,
.transport-form .form-group textarea {
    padding: 0.875rem;
    border-width: 1.5px;
    font-size: 0.95rem;
}

.transport-form .form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.transport-form .form-actions {
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

/* Large Modal Specific Adjustments */
.large-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.large-modal .modal-content {
    max-width: 900px;
    margin: 1rem auto;
}

.large-modal .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.large-modal .form-group.full-width {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.modal-content.medium-modal {
    max-width: 700px;
    max-height: 90vh;
    max-height: 90dvh;
    margin: 1rem auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content.medium-modal .modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-bottom: 1px solid #e9ecef;
}

.modal-content.medium-modal .fuel-form {
    padding: 1.5rem 2rem;
}

.modal-content.medium-modal .form-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Back to reports button - White override */
.btn-secondary.back-to-reports {
    background: white;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-secondary.back-to-reports:hover {
    background: #f8f9fa;
    color: #5a6268;
    border-color: #5a6268;
}

/* Checkbox Group Styles */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.checkbox-item:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-item input[type="checkbox"]:checked+.checkmark+span {
    color: #3498db;
    font-weight: 600;
}

.checkbox-item input[type="checkbox"]:checked {
    accent-color: #3498db;
}

/* Fuel Stocks Grid */
.fuel-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.fuel-stock-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fuel-stock-input-wrapper label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0 !important;
}

.fuel-stock-input-wrapper input {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
}

.fuel-stock-input-wrapper input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Boilers Grid Layout */
.boilers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* Boiler Card Styles */
.boiler-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.boiler-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #dee2e6;
}

.boiler-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.boiler-card-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.boiler-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boiler-card-name i {
    color: #007bff;
    font-size: 1rem;
}

.boiler-card-location {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.boiler-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.boiler-detail-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.boiler-detail-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.boiler-detail-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.boiler-detail-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #6c757d;
}

.boiler-detail-btn .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.25rem;
}

.boiler-detail-btn .btn-text {
    transition: opacity 0.2s ease;
}

.boiler-detail-btn.loading .btn-text {
    opacity: 0.7;
}

.boiler-card-actions .table-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.boiler-card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.boiler-card-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.boiler-card-section.full-width {
    grid-column: 1 / -1;
}

.boiler-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.boiler-info-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.boiler-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.boiler-fuel-level {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.boiler-fuel-level-bar {
    width: 100%;
    height: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e9ecef;
}

.boiler-fuel-level-fill {
    height: 100%;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    transition: width 0.6s ease;
    border-radius: 10px;
    position: relative;
}

.boiler-fuel-level-fill.low {
    background: linear-gradient(135deg, #f44336, #ff9800);
}

.boiler-fuel-level-fill.medium {
    background: linear-gradient(135deg, #ff9800, #ffc107);
}

.boiler-fuel-level-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.boiler-fuel-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.boiler-fuel-level-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.boiler-fuel-current {
    font-weight: 700;
    color: #2c3e50;
}

.boiler-fuel-capacity {
    color: #6c757d;
}

.boiler-fuel-types {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.boiler-fuel-types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.boiler-fuel-type-badge {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #90caf9;
    position: relative;
    overflow: hidden;
}

.boiler-fuel-type-badge.primary {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.boiler-fuel-type-badge.primary::before {
    content: '★';
    margin-right: 0.25rem;
}

.boiler-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.boiler-dates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.boiler-dates strong {
    color: #495057;
}

.boiler-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
}

.boiler-status-badge.active {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-color: #28a745;
}

.boiler-status-badge.inactive {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-color: #dc3545;
}

.boiler-status-badge.maintenance {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-color: #ffc107;
}

.boiler-notes {
    grid-column: 1 / -1;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    font-style: italic;
    color: #495057;
    margin-top: 1rem;
}

.boiler-heat-meter {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.boiler-heat-meter i {
    color: #6c757d;
    font-size: 0.8rem;
}

.boiler-heat-meter-value {
    font-weight: 400;
    color: #495057;
    font-size: 0.85rem;
}

/* Heat meters list in boiler cards */
.boiler-heat-meters-container {
    width: 100%;
}

.boiler-heat-meters-container .boiler-info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.boiler-heat-meters-container .boiler-info-label i {
    color: #17a2b8;
    font-size: 1rem;
}

.boiler-heat-meters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.boiler-heat-meter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #dee2e6;
    transition: all 0.2s ease;
}

.boiler-heat-meter-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.boiler-heat-meter-item.primary {
    border-left-color: #28a745;
    background: #f1f9f3;
}

.boiler-heat-meter-item.primary:hover {
    background: #e6f5e9;
}

.boiler-heat-meter-item.secondary {
    border-left-color: #6c757d;
}

.heat-meter-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.primary-badge-small {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: bold;
}

.heat-meter-reading {
    font-weight: 400;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Empty state */
.boilers-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.boilers-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.boilers-empty h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.boilers-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.boilers-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    color: #3498db;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .boilers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .boiler-card {
        padding: 1rem;
    }

    .boiler-card-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .boiler-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .boiler-card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .boiler-detail-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Boiler Details Modal Styles */
.boiler-details-modal {
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.boiler-details-content {
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.boiler-details-header {
    background: #ffffff;
    color: #2c3e50;
    padding: 2rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #e9ecef;
}

.boiler-details-title h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.boiler-details-location {
    font-size: 1rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boiler-details-header .modal-close {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.boiler-details-header .modal-close:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
}

.boiler-details-body {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.boiler-details-section {
    margin-bottom: 2.5rem;
}

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

.boiler-details-section h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.boiler-details-section h3 i {
    color: #007bff;
    font-size: 1.1rem;
}

/* Section header with filter */
.section-header-with-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header-with-filter h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.month-filter-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-filter-container label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.month-filter-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #ffffff;
    color: #495057;
    min-width: 140px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.month-filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.month-filter-select:hover {
    border-color: #adb5bd;
}

/* Loading and error states for fuel types */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading-spinner i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Overview Cards */
.boiler-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    clear: both;
}

.boiler-overview-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 80px;
    overflow: visible;
}

.boiler-overview-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.overview-card-icon {
    width: 50px;
    height: 50px;
    background: #007bff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.overview-card-content {
    flex: 1;
    min-width: 0;
    /* Allow content to shrink and wrap */
}

.overview-card-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.overview-card-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    min-height: 1.2em;
}

/* Specific styling for heat meter values that might be very long */
#detailsHeatMeter {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-all;
    white-space: normal;
}

/* Large Fuel Level Display */
.fuel-level-large {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fuel-level-large-bar {
    width: 100%;
    height: 40px;
    background: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.fuel-level-large-fill {
    height: 100%;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    transition: width 0.8s ease;
    border-radius: 18px;
    position: relative;
}

.fuel-level-large-fill.low {
    background: linear-gradient(135deg, #f44336, #ff9800);
}

.fuel-level-large-fill.medium {
    background: linear-gradient(135deg, #ff9800, #ffc107);
}

.fuel-level-large-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.fuel-level-large-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.fuel-level-large-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.fuel-amount-current,
.fuel-amount-capacity {
    text-align: center;
}

.fuel-amount-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.fuel-amount-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Fuel Types Details */
.fuel-types-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.fuel-types-details .boiler-fuel-type-badge {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fuel-types-details .boiler-fuel-type-badge.primary {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
}

/* Fuel type with quantity display */
.fuel-type-with-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-width: 200px;
}

.fuel-type-with-quantity:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fuel-type-with-quantity.primary {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border-color: #28a745;
}

.fuel-type-with-quantity.primary:hover {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.fuel-quantity-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

.fuel-type-with-quantity.primary .fuel-quantity-display {
    color: #155724;
}

/* Updated fuel types details layout */
.fuel-types-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Detailed fuel type cards */
.fuel-type-detailed-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.fuel-type-detailed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fuel-type-detailed-card.primary {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border-color: #28a745;
}

.fuel-type-detailed-card.low {
    border-left: 4px solid #dc3545;
}

.fuel-type-detailed-card.medium {
    border-left: 4px solid #ffc107;
}

.fuel-type-detailed-card.high {
    border-left: 4px solid #28a745;
}

.fuel-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fuel-current-stock {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.fuel-type-detailed-card.primary .fuel-current-stock {
    color: #155724;
}

/* Mini fuel level bar */
.fuel-level-mini-bar {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.fuel-level-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #34ce57);
    transition: width 0.6s ease;
    border-radius: 7px;
}

.fuel-level-mini-fill.low {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.fuel-level-mini-fill.medium {
    background: linear-gradient(90deg, #ffc107, #ffcd39);
}

.fuel-level-mini-fill.high {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.fuel-level-mini-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

/* Fuel statistics */
.fuel-statistics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    width: 100%;
}

.fuel-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.fuel-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #6c757d;
    transition: width 0.3s ease;
}

.fuel-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.15);
    border-color: #6c757d;
}

.fuel-stat-item:hover::before {
    width: 6px;
}

.fuel-stat-item:last-child {
    margin-bottom: 0;
}

.fuel-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fuel-stat-label::before {
    content: '●';
    color: #6c757d;
    font-size: 0.6rem;
}

.fuel-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
}

.fuel-stat-value.positive {
    color: #28a745;
}

.fuel-stat-value.negative {
    color: #dc3545;
}

.fuel-stat-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.fuel-type-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(108, 117, 125, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.fuel-type-stat:hover {
    background: rgba(108, 117, 125, 0.1);
    transform: translateX(3px);
}

.fuel-type-name {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
}

.fuel-type-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
}

/* Heat Meters Section Styles */
.heat-meters-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.heat-meters-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.filter-group .form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-group .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Heat meter form specific styles */
.form-help {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
}

#previousHeatMeterReading {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Heat meter modal form specific styling */
.modal-form {
    padding: 2rem;
}

.modal-form .form-row {
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.modal-form .form-group {
    margin-bottom: 1.5rem;
}

.modal-form .form-group label {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.modal-form .form-group input,
.modal-form .form-group select,
.modal-form .form-group textarea {
    padding: 0.875rem;
    border-width: 1.5px;
    font-size: 0.95rem;
}

.modal-form .form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.modal-form .modal-actions {
    padding-top: 1.75rem;
    margin-top: 1rem;
}

/* Heat meters table enhancements */
/* Heat meter table specific styling - only for heat meter tables */
#heatMetersTableBody th:nth-child(3),
#heatMetersTableBody th:nth-child(4),
#heatMetersTableBody th:nth-child(5) {
    text-align: right;
}

/* Heat meters table scrollable container */
.heat-meters-table-container {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.heat-meters-table-container .data-table {
    min-width: 1200px;
    margin: 0;
    border-radius: 0;
    border: none;
}

.heat-meters-table-container .data-table th,
.heat-meters-table-container .data-table td {
    white-space: nowrap;
    min-width: 120px;
}

/* Specific column widths for heat meters table */
.heat-meters-table-container .data-table th:nth-child(1),
/* Name */
.heat-meters-table-container .data-table td:nth-child(1) {
    min-width: 150px;
}

.heat-meters-table-container .data-table th:nth-child(2),
/* Location */
.heat-meters-table-container .data-table td:nth-child(2) {
    min-width: 150px;
}

.heat-meters-table-container .data-table th:nth-child(3),
/* Initial Reading */
.heat-meters-table-container .data-table td:nth-child(3) {
    min-width: 120px;
}

.heat-meters-table-container .data-table th:nth-child(4),
/* Current Reading */
.heat-meters-table-container .data-table td:nth-child(4) {
    min-width: 120px;
}

.heat-meters-table-container .data-table th:nth-child(5),
/* Consumption */
.heat-meters-table-container .data-table td:nth-child(5) {
    min-width: 100px;
}

.heat-meters-table-container .data-table th:nth-child(6),
/* Last Reading Date */
.heat-meters-table-container .data-table td:nth-child(6) {
    min-width: 120px;
}

.heat-meters-table-container .data-table th:nth-child(7),
/* Verification Date */
.heat-meters-table-container .data-table td:nth-child(7) {
    min-width: 120px;
}

.heat-meters-table-container .data-table th:nth-child(8),
/* Actions */
.heat-meters-table-container .data-table td:nth-child(8) {
    min-width: 150px;
}

#heatMetersTableBody td:nth-child(3),
#heatMetersTableBody td:nth-child(4),
#heatMetersTableBody td:nth-child(5) {
    text-align: right;
    font-weight: 600;
}

#heatMetersTableBody td:nth-child(5) {
    color: #28a745;
}

#heatMetersTableBody td:nth-child(5):empty::after {
    content: '-';
    color: #6c757d;
    font-weight: normal;
}

/* Heat meter consumption highlighting */
.consumption-high {
    color: #dc3545 !important;
    font-weight: 700;
}

.consumption-medium {
    color: #ffc107 !important;
    font-weight: 700;
}

.consumption-low {
    color: #28a745 !important;
    font-weight: 700;
}

/* Heat meter reading status indicators */
.reading-recent {
    position: relative;
}

.reading-recent::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #28a745;
    border-radius: 50%;
}

.reading-old {
    opacity: 0.7;
}

/* Heat meter modal styling */
#addHeatMeterModal,
#addReadingModal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    /* Hidden by default */
}

/* Existing Heat Meters Section */
.existing-heat-meters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.existing-heat-meters h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heat-meters-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.heat-meter-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.heat-meter-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.heat-meter-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.heat-meter-factory-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.heat-meter-specification {
    color: #6c757d;
    font-size: 0.9rem;
}

.heat-meter-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heat-meter-status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.heat-meter-status-badge.primary {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.heat-meter-status-badge.secondary {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.heat-meter-actions {
    display: flex;
    gap: 0.5rem;
}

.heat-meter-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.heat-meter-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.no-heat-meters {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    background: white;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
}

/* Grouped Heat Meters Display */
.boiler-group-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.boiler-header-cell {
    padding: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.boiler-group-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.boiler-group-info i {
    color: #007bff;
    font-size: 1.1rem;
}

.boiler-location {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.9rem;
}

.heat-meter-count {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
}

.heat-meter-row {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.heat-meter-row.primary-meter {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.02);
}

.heat-meter-row.secondary-meter {
    border-left-color: #6c757d;
    background: rgba(108, 117, 125, 0.02);
}

.heat-meter-row:hover {
    background: rgba(0, 123, 255, 0.05) !important;
    border-left-color: #007bff;
}

.heat-meter-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.primary-badge {
    background: #d4edda;
    color: #155724;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #c3e6cb;
    display: inline-block;
    margin-top: 0.25rem;
}

.secondary-badge {
    background: #e2e3e5;
    color: #383d41;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #d6d8db;
    display: inline-block;
    margin-top: 0.25rem;
}

.boiler-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
}

.boiler-name-cell i {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Filter Section Styles */
.section-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-header {
    background: #e9ecef;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.filter-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-content {
    padding: 1.5rem;
}

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

.filters-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-container .filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0;
    margin-right: 0.25rem;
}

.custom-select,
.filter-input {
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    transition: all 0.2s ease;
    min-width: 180px;
    /* Standardized width */
    font-family: inherit;
}

.custom-select:hover,
.filter-input:hover {
    border-color: #adb5bd;
}

.custom-select:focus,
.filter-input:focus {
    border-color: #4a9eff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Filter toggle button animation */
#toggleFuelReceiptFilters i,
#toggleFuelTransportFilters i {
    transition: transform 0.3s ease;
}

#toggleFuelReceiptFilters.active i,
#toggleFuelTransportFilters.active i {
    transform: rotate(180deg);
}

/* Status badges for fuel transports */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-vykdomas {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-užbaigtas {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-atšauktas {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive filter grid */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .section-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}

/* Heat Meters in Boiler Details */
.heat-meters-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.heat-meters-loading {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

.heat-meters-list-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.heat-meter-detail-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.heat-meter-detail-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.heat-meter-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heat-meter-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.heat-meter-detail-factory {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.heat-meter-detail-specification {
    color: #6c757d;
    font-size: 0.9rem;
}

.heat-meter-detail-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.heat-meter-detail-verification {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.heat-meter-detail-verification-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.heat-meter-detail-verification-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.heat-meter-detail-verification-value {
    font-weight: 600;
    color: #2c3e50;
}

.heat-meter-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.heat-meter-detail-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.no-heat-meters-details {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    background: white;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
}

#addHeatMeterModal .modal-content,
#addReadingModal .modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 2rem auto;
}

/* Form row styling for heat meter modal */
.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
}

.modal-form .form-group {
    margin-bottom: 1.25rem;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.modal-form .form-group input,
.modal-form .form-group select,
.modal-form .form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-form .form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    color: #6c757d;
}

.modal-form .form-help {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
    display: block;
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.75rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1.75rem;
}

/* Heat Meter Details Modal */
#heatMeterDetailsModal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
}

#heatMeterDetailsModal .modal-content {
    max-width: 900px;
    max-height: 95vh;
    max-height: 95dvh;
    overflow-y: auto;
    margin: 1rem auto;
    -webkit-overflow-scrolling: touch;
}

.heat-meter-details-modal {
    width: 100%;
}

/* Readings Graph Section */
.readings-graph-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.readings-graph-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.graph-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.graph-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.graph-filters label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.graph-container {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.graph-container canvas {
    max-width: 100%;
    height: auto;
}

.graph-loading,
.graph-error,
.graph-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
    text-align: center;
}

.graph-loading i,
.graph-error i,
.graph-no-data i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.graph-error {
    color: #dc3545;
}

.graph-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.graph-summary-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.graph-summary-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.graph-summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.heat-meter-details-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Heat Meter Info Section */
.heat-meter-info-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.heat-meter-info-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heat-meter-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.heat-meter-info-grid .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.heat-meter-info-grid .info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.heat-meter-info-grid .info-value {
    font-weight: 500;
    color: #2c3e50;
}

.heat-meter-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

/* Readings History Section */
.readings-history-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.readings-history-section h3 {
    margin: 0;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px 8px 0 0;
}

.readings-filters {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.readings-history-section .table-container {
    padding: 0 1.5rem;
    margin: 2rem 0;
}

.readings-history-section .data-table {
    margin: 0;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.readings-history-section .pagination-container {
    padding: 1.25rem 1.5rem;
    margin-top: 0;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Make readings history table scrollable */
.readings-history-section .table-container {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.readings-history-section .table-container::-webkit-scrollbar {
    height: 6px;
}

.readings-history-section .table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.readings-history-section .table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.readings-history-section .table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure table has minimum width for proper scrolling */
.readings-history-section .data-table {
    min-width: 600px;
}

/* Column width specifications for readings history table */
.readings-history-section .data-table th:nth-child(1),
.readings-history-section .data-table td:nth-child(1) {
    min-width: 100px;
    /* Data */
}

.readings-history-section .data-table th:nth-child(2),
.readings-history-section .data-table td:nth-child(2) {
    min-width: 120px;
    /* Rodmenys (MWh) */
}

.readings-history-section .data-table th:nth-child(3),
.readings-history-section .data-table td:nth-child(3) {
    min-width: 120px;
    /* Suvartojimas (MWh) */
}

.readings-history-section .data-table th:nth-child(4),
.readings-history-section .data-table td:nth-child(4) {
    min-width: 150px;
    /* Pastabos */
}

.readings-history-section .data-table th:nth-child(5),
.readings-history-section .data-table td:nth-child(5) {
    min-width: 120px;
    /* Veiksmai */
}

.readings-history-section .data-table th,
.readings-history-section .data-table td {
    padding: 1rem 0.75rem;
}

/* Specific styling for readings history action buttons */
.readings-history-section .action-buttons .btn {
    padding: 0.1rem 0.25rem;
    font-size: 0.6rem;
    min-width: auto;
    width: auto;
    border-radius: 3px;
}

.readings-history-section .action-buttons .btn i {
    font-size: 0.6rem;
}

.readings-history-section .action-buttons {
    gap: 0.15rem;
}

/* Heat meter details modal action buttons - make them smaller but not too small */
.heat-meter-details-modal .data-table .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 4px;
}

.heat-meter-details-modal .data-table .btn-sm i {
    font-size: 0.7rem;
}

.heat-meter-details-modal .data-table td {
    white-space: nowrap;
}

.heat-meter-details-modal .data-table td:last-child {
    text-align: center;
}

/* Mobile responsiveness for heat meter details modal */
@media (max-width: 768px) {
    .heat-meter-details-modal {
        padding: 0.5rem;
    }

    .heat-meter-details-content {
        padding: 1rem 0.5rem;
    }

    /* Make graph section more responsive on mobile */
    .readings-graph-section {
        margin: 1rem 0;
        padding: 1rem;
    }

    .graph-container {
        height: 300px;
        padding: 0.75rem;
    }

    .graph-container canvas {
        height: 250px !important;
        width: 100% !important;
    }

    .graph-filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .graph-filters .filter-group {
        min-width: 100%;
    }

    .graph-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .graph-summary-item {
        padding: 0.75rem;
    }

    .graph-summary-label {
        font-size: 0.75rem;
    }

    .graph-summary-value {
        font-size: 1rem;
    }
}

/* iPhone 16 Pro and similar devices (393px width) */
@media (max-width: 393px) {
    .readings-graph-section {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }

    .graph-container {
        height: 280px;
        padding: 0.5rem;
    }

    .graph-container canvas {
        height: 230px !important;
    }

    .graph-filters {
        gap: 0.5rem;
    }

    .graph-summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .graph-summary-item {
        padding: 0.5rem;
    }

    /* Mobile improvements for readings history table */
    .readings-history-section .table-container {
        margin: 0 -0.5rem;
        border-radius: 0;
    }

    .readings-history-section .data-table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    .readings-history-section .data-table th,
    .readings-history-section .data-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    /* Smaller mobile screens adjustments for boiler modal heat meters */
    .heat-meters-details .heat-meter-detail-item {
        padding: 0.75rem;
    }

    .heat-meters-details .heat-meter-detail-actions .btn {
        font-size: 0.7rem;
        padding: 0.45rem 0.25rem;
    }

    .heat-meters-details .heat-meter-detail-actions .btn i {
        font-size: 0.7rem;
    }
}

/* Extra small screens - show icon-only buttons */
@media (max-width: 400px) {
    .heat-meters-details .heat-meter-detail-item {
        padding: 0.75rem 0.5rem;
    }

    .heat-meters-details .heat-meter-detail-actions {
        gap: 0.35rem;
    }

    /* Icon-only buttons for very small screens */
    .heat-meters-details .heat-meter-detail-actions .btn {
        font-size: 0;
        padding: 0.5rem 0.25rem;
        min-width: 48px;
        flex: 1;
        justify-content: center;
    }

    .heat-meters-details .heat-meter-detail-actions .btn i {
        font-size: 0.9rem;
        display: inline-block;
        margin: 0;
    }
}

/* Add Reading Modal */
#addReadingModal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
}

#addReadingModal .modal-content {
    max-width: 500px;
}

.form-control-readonly {
    background-color: #f8f9fa;
    border: 1.5px solid #dee2e6;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #6c757d;
    cursor: not-allowed;
}

/* Consumption indicators */
.consumption-positive {
    color: #28a745;
    font-weight: 600;
}

.consumption-negative {
    color: #dc3545;
    font-weight: 600;
}

.consumption-zero {
    color: #6c757d;
}

/* Clickable heat meter */
.clickable-heat-meter {
    cursor: pointer;
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.clickable-heat-meter:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Heat meter action buttons styling */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    width: auto;
    border-radius: 4px;
}

.action-buttons .btn i {
    font-size: 0.75rem;
}

/* Ensure buttons stay in one row */
.data-table td .action-buttons {
    white-space: nowrap;
}

/* Responsive adjustments for heat meter modal */
@media (max-width: 768px) {

    #addHeatMeterModal .modal-content,
    #addReadingModal .modal-content {
        max-width: 95%;
        margin: 1rem;
        max-height: 95vh;
        max-height: 95dvh;
    }

    .modal-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-form .form-group {
        margin-bottom: 1.25rem;
    }

    .modal-form {
        padding: 1.5rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

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

    #heatMeterDetailsModal .modal-content {
        max-width: 95%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .heat-meter-details-content {
        padding: 1rem;
        gap: 1.5rem;
    }

    .heat-meter-info-grid {
        grid-template-columns: 1fr;
    }

    .heat-meter-actions {
        flex-direction: column;
    }

    .heat-meter-actions .btn {
        width: 100%;
    }

    .readings-filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Mobile adjustments for action buttons */
    .action-buttons {
        flex-direction: column;
        gap: 0.125rem;
    }

    .action-buttons .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-height: 44px;
        min-width: 44px;
    }

    .action-buttons .btn i {
        font-size: 0.7rem;
    }

    /* Prevent action buttons from taking full column width in heat meters table */
    .heat-meters-table-container .action-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.25rem;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .heat-meters-table-container .action-buttons .btn {
        flex: none !important;
        min-width: auto !important;
        width: auto !important;
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        min-height: 32px;
    }

    .heat-meters-table-container .action-buttons .btn i {
        font-size: 0.65rem;
    }

    /* Improve touch targets for all buttons on mobile */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .btn-sm {
        min-height: 40px;
        padding: 0.4rem 0.8rem;
    }

    .btn-xs {
        min-height: 36px;
        padding: 0.3rem 0.6rem;
    }

    /* Mobile adjustments for heat meters table */
    .heat-meters-table-container {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .heat-meters-table-container .data-table {
        min-width: 1000px;
        font-size: 0.8rem;
    }

    .heat-meters-table-container .data-table th,
    .heat-meters-table-container .data-table td {
        padding: 0.5rem 0.25rem;
        min-width: 100px;
    }

    /* Improve all table containers for mobile */
    .table-container {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .table-container .data-table {
        font-size: 0.8rem;
    }

    .table-container .data-table th,
    .table-container .data-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    /* Better mobile table scrolling */
    .table-container.scrollable {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .table-container.scrollable::-webkit-scrollbar {
        height: 6px;
    }

    .table-container.scrollable::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .table-container.scrollable::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .table-container.scrollable::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@media (max-width: 480px) {

    #addHeatMeterModal .modal-content,
    #addReadingModal .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .modal-form {
        padding: 1rem;
    }

    .modal-form .form-row {
        gap: 0.75rem;
    }

    .modal-form .form-group {
        margin-bottom: 1rem;
    }

    /* Extra small screen adjustments for heat meters table */
    .heat-meters-table-container .data-table {
        min-width: 900px;
        font-size: 0.75rem;
    }

    .heat-meters-table-container .data-table th,
    .heat-meters-table-container .data-table td {
        padding: 0.375rem 0.125rem;
        min-width: 80px;
    }

    /* Extra small screens - keep action buttons compact */
    .heat-meters-table-container .action-buttons {
        flex-direction: row !important;
        gap: 0.2rem;
    }

    .heat-meters-table-container .action-buttons .btn {
        flex: none !important;
        min-width: auto !important;
        width: auto !important;
        padding: 0.2rem 0.3rem;
        font-size: 0.6rem;
        min-height: 28px;
    }

    .heat-meters-table-container .action-buttons .btn i {
        font-size: 0.6rem;
    }
}

/* Verification status indicators */
.verification-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.verification-status.valid {
    background: #d4edda;
    color: #155724;
}

.verification-status.expiring {
    background: #fff3cd;
    color: #856404;
}

.verification-status.expired {
    background: #f8d7da;
    color: #721c24;
}

.verification-status.not-set {
    background: #e2e3e5;
    color: #6c757d;
}

/* Technical Information Grid */
.technical-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.technical-info-item {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.technical-info-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.technical-info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Recent Activity */
.recent-activity {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
    max-height: 400px;
    /* Limit height to fit 4 activities with scrolling if needed */
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    /* Enable vertical scrolling */
}

.activity-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
    border: 1px solid #e9ecef;
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #007bff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.activity-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.activity-details {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Activity status indicators */
.activity-item.completed {
    border-left-color: #28a745;
}

.activity-item.completed .activity-icon {
    background: #28a745;
}

.activity-item.in-progress {
    border-left-color: #ffc107;
}

.activity-item.in-progress .activity-icon {
    background: #ffc107;
}

.activity-item.rejected {
    border-left-color: #dc3545;
}

.activity-item.rejected .activity-icon {
    background: #dc3545;
}

/* Enhanced activity type indicators */
.activity-item.receipt {
    border-left-color: #17a2b8;
}

.activity-item.receipt .activity-icon {
    background: #17a2b8;
}

.activity-item.transport-in {
    border-left-color: #28a745;
}

.activity-item.transport-in .activity-icon {
    background: #28a745;
}

.activity-item.transport-out {
    border-left-color: #fd7e14;
}

.activity-item.transport-out .activity-icon {
    background: #fd7e14;
}

.activity-item.consumption {
    border-left-color: #dc3545;
}

.activity-item.consumption .activity-icon {
    background: #dc3545;
}

/* Notes Display */
.boiler-notes-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    font-style: italic;
    color: #856404;
    line-height: 1.6;
}

/* Boiler Actions */
.boiler-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.boiler-actions .btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.boiler-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.25);
}

/* Responsive Design for Details Modal */
@media (max-width: 768px) {
    .boiler-details-modal {
        padding: 1rem 0.5rem;
    }

    /* Mobile responsiveness for heat meters section in boiler details */
    .heat-meters-details {
        margin: 0 -0.5rem;
        padding: 1rem 0.5rem;
    }

    .heat-meters-details .heat-meter-detail-item {
        margin: 0 0 1rem 0;
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .heat-meters-details .heat-meter-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .heat-meters-details .heat-meter-detail-info {
        width: 100%;
    }

    .heat-meters-details .heat-meter-detail-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        margin-left: 0;
        margin-top: 1rem;
    }

    .heat-meters-details .heat-meter-detail-actions .btn {
        flex: 1;
        min-width: 0;
        max-width: none;
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .heat-meters-details .heat-meter-detail-actions .btn i {
        font-size: 0.75rem;
    }

    .boiler-details-content {
        max-height: 95vh;
        max-height: 95dvh;
    }

    .boiler-details-header {
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .boiler-details-header .modal-close {
        align-self: flex-end;
    }

    .boiler-details-body {
        padding: 1.5rem;
    }

    .boiler-overview-grid {
        grid-template-columns: 1fr;
    }

    .fuel-level-large-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .technical-info-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile responsive for month filter */
    .section-header-with-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .section-header-with-filter h3 {
        text-align: center;
    }

    .month-filter-container {
        justify-content: center;
    }

    .month-filter-select {
        min-width: 180px;
    }

    .boiler-actions {
        flex-direction: column;
    }

    .boiler-actions .btn {
        min-width: auto;
    }
}

.fuel-types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.fuel-type-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.fuel-type-badge.primary {
    background: #4caf50;
    color: white;
}

.fuel-level-bar {
    width: 100px;
    height: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #ddd;
}

.fuel-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.fuel-level-fill.low {
    background: linear-gradient(90deg, #f44336, #ff9800);
}

.fuel-level-fill.medium {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.fuel-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8);
}

/* Main Application */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: #ffffff;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease;
    position: relative;
    border-right: 1px solid #e9ecef;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle::before {
    content: '';
    transition: content 0.3s ease;
}

.sidebar-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.5rem;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .sidebar-header h3 {
    justify-content: center;
    width: 100%;
}

.sidebar.collapsed .sidebar-header h3 i {
    font-size: 1.5rem;
}

.sidebar.collapsed .sidebar-logo {
    width: 20px;
    height: 20px;
}

.sidebar.collapsed .sidebar-toggle {
    position: fixed;
    top: 1.5rem;
    left: 70px;
    transform: none;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    background: #ffffff;
    color: #6c757d;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle::before {
    content: '→';
    font-weight: bold;
    font-size: 0.9rem;
}

.sidebar.collapsed .sidebar-toggle i {
    display: none;
}

.sidebar.collapsed .sidebar-toggle:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 0.5rem 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-item {
    margin: 0.1rem 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .menu-item a {
    justify-content: center;
    padding: 0.6rem;
}

.sidebar.collapsed .menu-item a i {
    font-size: 1.2rem;
}

.menu-item:hover>a,
.menu-item.active>a {
    background: #f8f9fa;
    color: #495057;
    border-left-color: #007bff;
}

.menu-item.active>a {
    background: #e9ecef;
    font-weight: 600;
    color: #2c3e50;
    border-left-color: #007bff;
}

.sidebar-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e9ecef;
}

.logout-btn {
    width: 100%;
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .logout-btn {
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .logout-btn i {
    font-size: 1.1rem;
}

.logout-btn:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* Hide mobile toggle when any modal is open */
body.modal-open .mobile-toggle {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Prevent body scroll when modal is open on mobile */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Ensure modal can still scroll on mobile */
body.modal-open .modal {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* iOS Safari specific fixes for modal viewport */
@supports (-webkit-touch-callout: none) {
    .modal {
        height: 100%;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    body.modal-open {
        height: 100%;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    body.modal-open .modal {
        height: 100%;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .modal-content {
        max-height: calc(100vh - 2rem);
        max-height: calc(-webkit-fill-available - 2rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Safe area support for devices with notches */
@supports (padding: max(0px)) {
    .modal {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* iPhone specific adjustments */
@media (max-width: 428px) and (max-height: 926px) {
    .modal {
        padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    }

    .modal-content {
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        margin: 0.5rem;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-toggle {
    display: none;
}

.content-header {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Ensure user info stays on the right when page title is hidden */
.content-header .user-info {
    margin-left: auto;
}

.content-header h1 {
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Weather Widget Styles - Simple style matching page title */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
    margin-left: 0.5rem;
}

.weather-widget .weather-icon {
    font-size: 0.8rem;
    color: #2c3e50;
}

.weather-widget .weather-temp {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.weather-widget .weather-location {
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Custom Tooltip for Weather Widget */
.weather-widget {
    position: relative;
}

.weather-widget[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.weather-widget[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #2c3e50 transparent;
    margin-top: -2px;
    z-index: 1000;
}


.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.user-info i {
    font-size: 1.5rem;
    color: #6c757d;
}

/* User Profile Dropdown Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: none;
    border-radius: 0;
    cursor: pointer;
    transition: none;
    border: none;
    position: relative;
}

.user-profile:hover {
    background: none;
    border-color: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8rem;
    line-height: 1.2;
}


/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    min-width: 220px;
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: visible;
    /* allow tooltips to overflow */
}

.dropdown-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.dropdown-user-info {
    flex: 1;
}

.dropdown-user-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dropdown-detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6c757d;
    position: relative;
    /* anchor for custom tooltip positioning */
}

.dropdown-detail-item .detail-label {
    color: #6c757d;
    font-size: 0.8rem;
}

.dropdown-detail-item .detail-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8rem;
}


.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0;
}

.dropdown-menu {
    padding: 0.4rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.dropdown-item.logout-item {
    color: #495057;
}

.dropdown-item.logout-item:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.dropdown-item.logout-item i {
    color: #6c757d;
}

/* Mobile responsiveness for dropdown */
@media (max-width: 768px) {
    .user-dropdown {
        right: -1rem;
        left: -1rem;
        min-width: calc(100vw - 2rem);
        margin: 0.5rem 1rem 0 1rem;
    }

    .user-profile {
        padding: 0.4rem 0.8rem;
    }

    .user-name {
        font-size: 0.75rem;
    }

    .dropdown-user-name {
        font-size: 0.9rem;
    }
}

/* Content Sections */
.content-section {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: none;
    width: 100%;
    max-width: 100%;
}

.content-section.active {
    display: block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    /* 3 rows: 1st row for 2 cards, 2nd and 3rd rows for full-width cards */
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Large screens - better card spacing */
@media (min-width: 1201px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        margin-bottom: 2.5rem;
    }

    .dashboard-card {
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    }

    .card-content {
        padding: 2rem;
    }
}

.dashboard-grid .dashboard-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dashboard-grid .dashboard-card:nth-child(1) .card-content {
    display: block;
    padding: 1.5rem;
}

.dashboard-grid .dashboard-card:nth-child(1) .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.dashboard-grid .dashboard-card:nth-child(1) .stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #495057;
}

.dashboard-grid .dashboard-card:nth-child(1) .stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #495057;
    border-radius: 0 0 2px 2px;
}

.dashboard-grid .dashboard-card:nth-child(1) .stat-label {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-grid .dashboard-card:nth-child(1) .stat-value {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Expandable stat item styles */
.expandable-stat-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
    margin: 0.25rem 0;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.expandable-stat-item:hover {
    background: linear-gradient(145deg, #e9ecef, #f8f9fa);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

.expandable-stat-item .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 1;
}

.expandable-stat-item .stat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.expandable-stat-item .stat-header-left .fuel-stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.expandable-stat-item .stat-header-left .fuel-stat-value {
    color: #495057;
    font-size: 1rem;
    font-weight: 700;
}

.transport-count-inline {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.expandable-stat-item .expand-icon {
    font-size: 0.9rem;
    color: #6c757d;
    transition: transform 0.3s ease;
    padding: 0.25rem;
    border-radius: 50%;
    background: rgba(108, 117, 125, 0.1);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expandable-stat-item:hover .expand-icon {
    background: rgba(108, 117, 125, 0.2);
    color: #495057;
}

.expandable-stat-item.expanded .expand-icon {
    transform: rotate(180deg);
    background: #6c757d;
    color: white;
}

.expandable-stat-item.expanded {
    background: linear-gradient(145deg, #e9ecef, #f8f9fa);
    border: 1px solid #dee2e6;
}

.expandable-content {
    margin: 0;
    padding: 0;
    border-top: 1px solid #e9ecef;
    animation: slideDown 0.3s ease;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.active-transports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    background: #ffffff;
    margin: 0;
}

.active-transports-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.active-transports-header .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-color: #6c757d;
    color: #6c757d;
}

.active-transports-header .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.active-transports-header .btn i {
    font-size: 0.8rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

/* Active transports list styles */
.active-transports-list {
    max-height: 200px;
    /* Height for approximately 2 transport cards */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #e9ecef;
    padding: 0;
    margin: 0;
    width: 100%;
    position: relative;
}

.active-transports-list::-webkit-scrollbar {
    width: 6px;
}

.active-transports-list::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.active-transports-list::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.active-transports-list::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Scroll indicators for when there are more items */
.active-transports-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(#f8f9fa, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.active-transports-list::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, #f8f9fa);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.active-transports-list.has-scroll::before,
.active-transports-list.has-scroll::after {
    opacity: 1;
}

.active-transports-list.scrolled-to-top::before {
    opacity: 0;
}

.active-transports-list.scrolled-to-bottom::after {
    opacity: 0;
}

.loading-transports {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    background: #ffffff;
    width: 100%;
}

.loading-transports i {
    font-size: 1rem;
    color: #6c757d;
}

.transport-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    border-left: 4px solid #6c757d;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    min-height: 100px;
    /* Fixed height for consistent 2-item display */
    flex-shrink: 0;
}

.transport-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6c757d, #495057);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.transport-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.1);
    border-left-color: #495057;
}

.transport-item:hover::before {
    transform: scaleX(1);
}

.transport-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.transport-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.transport-main-info {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transport-main-info::before {
    content: '🚛';
    font-size: 0.8rem;
}

.transport-details {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.transport-details span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.transport-details i {
    font-size: 0.75rem;
    color: #6c757d;
}

.transport-weight {
    font-weight: 700;
    color: #495057;
    font-size: 1rem;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.transport-date {
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
}

.no-active-transports {
    text-align: center;
    padding: 2rem 1.5rem;
    color: #6c757d;
    font-style: italic;
    background: #ffffff;
    width: 100%;
}

.no-active-transports i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #adb5bd;
}

/* Complete Transport Modal Styles */
.transport-info-display {
    margin-bottom: 1.5rem;
}

.transport-summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-row:first-child {
    padding-top: 0;
}

.summary-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label i {
    width: 20px;
    text-align: center;
    color: #007bff;
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    text-align: right;
}

.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-area.drag-over {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.file-upload-prompt {
    text-align: center;
    cursor: pointer;
}

.file-upload-prompt i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.file-upload-prompt p {
    margin: 0.5rem 0;
    color: #495057;
    font-size: 1rem;
}

.file-upload-prompt small {
    color: #6c757d;
    font-size: 0.85rem;
}

.file-upload-preview {
    text-align: center;
}

.file-upload-preview img {
    margin-bottom: 1rem;
}

.file-upload-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 1rem;
}

.file-upload-info span {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

/* Form hint styling */
.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.form-hint strong {
    color: #007bff;
    font-weight: 600;
}

/* Complete Transport Modal - Responsive */
@media (max-width: 768px) {
    .modal-content.medium-modal {
        max-width: 95%;
        max-height: 95vh;
        max-height: 95dvh;
        margin: 0.5rem auto;
    }

    .modal-content.medium-modal .fuel-form {
        padding: 0.75rem 1rem;
    }

    .modal-content.medium-modal .form-actions {
        padding: 0.75rem 1rem;
    }

    .transport-summary-card {
        padding: 0.75rem;
    }

    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.4rem 0;
    }

    .summary-label {
        font-size: 0.8rem;
    }

    .summary-value {
        font-size: 0.9rem;
        text-align: left;
    }

    .file-upload-area {
        padding: 1rem;
    }

    .file-upload-prompt i {
        font-size: 2rem;
    }

    .file-upload-prompt p {
        font-size: 0.9rem;
    }

    .file-upload-prompt small {
        font-size: 0.75rem;
    }

    /* Additional mobile optimizations for complete transport modal */
    .modal-content.medium-modal .form-group {
        margin-bottom: 1rem;
    }

    .modal-content.medium-modal .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .modal-content.medium-modal .form-group input,
    .modal-content.medium-modal .form-group select,
    .modal-content.medium-modal .form-group textarea {
        font-size: 14px;
        /* Prevent zoom on iOS */
        padding: 0.6rem;
        min-height: 40px;
    }

    .modal-content.medium-modal .form-group textarea {
        min-height: 80px;
    }

    .modal-content.medium-modal .form-hint {
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }

    .transport-info-display {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .modal-content.medium-modal {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-content.medium-modal .fuel-form {
        padding: 0.75rem;
    }

    .modal-content.medium-modal .form-actions {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-content.medium-modal .form-actions .btn {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .transport-summary-card {
        padding: 0.5rem;
    }

    .summary-row {
        padding: 0.3rem 0;
        gap: 0.2rem;
    }

    .summary-label {
        font-size: 0.75rem;
    }

    .summary-value {
        font-size: 0.85rem;
    }

    .file-upload-area {
        padding: 0.75rem;
    }

    .file-upload-prompt i {
        font-size: 1.5rem;
    }

    .file-upload-prompt p {
        font-size: 0.8rem;
    }

    .file-upload-prompt small {
        font-size: 0.7rem;
    }

    /* Additional mobile optimizations for complete transport modal */
    .modal-content.medium-modal .form-group {
        margin-bottom: 0.75rem;
    }

    .modal-content.medium-modal .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    .modal-content.medium-modal .form-group input,
    .modal-content.medium-modal .form-group select,
    .modal-content.medium-modal .form-group textarea {
        font-size: 14px;
        /* Prevent zoom on iOS */
        padding: 0.5rem;
        min-height: 36px;
    }

    .modal-content.medium-modal .form-group textarea {
        min-height: 60px;
    }

    .modal-content.medium-modal .form-hint {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    .transport-info-display {
        margin-bottom: 1rem;
    }
}

/* Responsive styling for active transports */
@media (max-width: 768px) {
    .expandable-stat-item .stat-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .expandable-stat-item .stat-header-left .fuel-stat-value {
        font-size: 0.9rem;
    }

    .transport-count-inline {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .active-transports-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .active-transports-header h4 {
        font-size: 0.9rem;
    }

    .transport-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .transport-info {
        width: 100%;
    }

    .transport-weight,
    .transport-date {
        align-self: flex-end;
    }

    .transport-details {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .transport-item {
        padding: 0.75rem;
    }

    .transport-main-info {
        font-size: 0.9rem;
    }

    .transport-details {
        font-size: 0.75rem;
    }

    .transport-weight {
        font-size: 0.9rem;
        padding: 0.2rem 0.5rem;
    }

    .transport-date {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Responsive layout adjustments */
@media (min-width: 768px) {
    .dashboard-grid .dashboard-card:nth-child(1) .card-content {
        padding: 1.5rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-item {
        padding: 2rem 1.5rem;
    }
}

.dashboard-grid .dashboard-card:nth-child(2) {
    /* Kuro tipų pasiskirstymas */
    grid-column: 2;
    grid-row: 1;
}

.dashboard-grid .dashboard-card:nth-child(3) {
    /* Savaitės kuro gavimai */
    grid-column: 1 / -1;
    /* Full width */
    grid-row: 2;
}

.dashboard-grid .dashboard-card:nth-child(4) {
    /* Katilinių kuro suanudojimas */
    grid-column: 1 / -1;
    /* Full width */
    grid-row: 3;
}

.dashboard-grid .dashboard-card:nth-child(5) {
    /* Katilinių kuro likučiai */
    grid-column: 1 / -1;
    /* Full width */
    grid-row: 4;
}

.dashboard-grid .dashboard-card:nth-child(6) {
    /* Naujausia veikla */
    grid-column: 1 / -1;
    /* Full width */
    grid-row: 5;
}

.dashboard-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 2rem !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.dashboard-row .dashboard-card {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    max-width: none !important;
    width: 50% !important;
    overflow: visible !important;
}

.dashboard-row .dashboard-card * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .dashboard-row {
        flex-direction: column !important;
        gap: 1rem;
        margin-bottom: 1rem;
    }
}

/* Fuel Stock Card Styling */
.fuel-stock-loading,
.fuel-stock-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 2rem;
}

.fuel-stock-loading i,
.fuel-stock-error i {
    font-size: 1.5rem;
    color: #667eea;
}

.fuel-stock-error i {
    color: #e74c3c;
}

.fuel-stock-list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Custom scrollbar styling for webkit browsers */
.fuel-stock-list::-webkit-scrollbar {
    width: 6px;
}

.fuel-stock-list::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.fuel-stock-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.fuel-stock-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.fuel-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.fuel-stock-item:hover {
    background-color: #f8f9fa;
}

.fuel-stock-item:last-child {
    border-bottom: none;
}

/* Better separation between different boilers */
.fuel-stock-item.boiler-separator {
    border-top: 2px solid #dee2e6;
    margin-top: 0.5rem;
    background-color: #f8f9fa;
}

.fuel-stock-item.boiler-separator:first-child {
    border-top: none;
    margin-top: 0;
}

/* Group fuel types under the same boiler - only hide boiler name if it's empty */
.fuel-stock-item.boiler-group .fuel-stock-boiler:empty {
    color: transparent;
    font-size: 0;
}

.fuel-stock-item.boiler-group .fuel-stock-boiler:empty::before {
    content: "└─";
    color: #6c757d;
    font-size: 0.8rem;
}

.fuel-stock-boiler {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.fuel-stock-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.fuel-stock-type {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.fuel-stock-amount {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Primary fuel highlighting removed - all fuel types now have equal visual weight */

/* Responsive behavior for smaller screens */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto;
        /* 6 rows for mobile */
        gap: 1rem;
        /* Reduce gap for mobile */
        margin-bottom: 1rem;
        /* Reduce bottom margin for mobile */
    }

    .dashboard-grid .dashboard-card:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .dashboard-grid .dashboard-card:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .dashboard-grid .dashboard-card:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    .dashboard-grid .dashboard-card:nth-child(4) {
        grid-column: 1;
        grid-row: 4;
    }

    .dashboard-grid .dashboard-card:nth-child(5) {
        grid-column: 1;
        grid-row: 5;
    }

    .dashboard-grid .dashboard-card:nth-child(6) {
        grid-column: 1;
        grid-row: 6;
    }

    /* Improve mobile layout for Kuro statistika card */
    .dashboard-grid .dashboard-card:nth-child(1) .card-content {
        padding: 1rem;
        /* Reduce padding for mobile */
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-item {
        padding: 1rem;
        /* Reduce padding for mobile */
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-label {
        font-size: 0.8rem;
        /* Slightly smaller font for mobile */
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-value {
        font-size: 1.5rem;
        /* Slightly smaller font for mobile */
    }

    /* Improve mobile layout for all dashboard cards */
    .dashboard-card {
        margin-bottom: 0.5rem;
        /* Reduce margin between cards */
    }

    .card-header {
        padding: 1rem;
        /* Reduce header padding for mobile */
    }

    .card-header h3 {
        font-size: 1rem;
        /* Smaller header font for mobile */
    }

    /* Mobile responsive styles for fuel consumption card */
    .dashboard-grid .dashboard-card:nth-child(4) .fuel-chart-filters {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .dashboard-grid .dashboard-card:nth-child(4) .filter-group {
        width: 100%;
    }

    .dashboard-grid .dashboard-card:nth-child(4) .timeline-chart-container {
        height: 350px;
        /* Increased from 250px for better visibility */
        margin-bottom: 0.75rem;
    }

    /* Mobile responsive styles for pie chart */
    .dashboard-grid .dashboard-card:nth-child(2) .pie-chart-container {
        min-height: 280px;
        /* Increased from default 200px */
        padding: 1.5rem 1rem;
        /* More padding for tooltip space */
        margin-bottom: 1rem;
        /* Ensure proper spacing */
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-grid .dashboard-card:nth-child(2) .pie-chart-container canvas {
        width: 220px !important;
        /* Increased from default */
        height: 220px !important;
        max-width: calc(100vw - 4rem);
        /* Ensure it fits within viewport */
        max-height: calc(100vw - 4rem);
        margin: 0 auto;
        /* Center the canvas */
        aspect-ratio: 1 / 1;
        /* Ensure circular shape */
        object-fit: contain;
        /* Maintain aspect ratio */
    }

    /* Mobile responsive styles for timeline chart (weekly receipts) */
    .dashboard-grid .dashboard-card:nth-child(3) .timeline-chart-container {
        height: 350px;
        /* Increased from default for better visibility */
        margin-bottom: 0.75rem;
    }

    /* Mobile responsive styles for chart legends */
    .chart-legend {
        grid-template-columns: repeat(2, 1fr);
        /* Better mobile layout */
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .chart-legend-item {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .chart-legend-color {
        width: 12px;
        height: 12px;
    }

    /* Mobile responsive styles for fuel stock card */
    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list {
        max-height: 250px;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e0 #f7fafc;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar {
        width: 4px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar-track {
        background: #f7fafc;
        border-radius: 2px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 2px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-details {
        align-items: flex-start;
        width: 100%;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item.boiler-separator {
        border-top: 1px solid #dee2e6;
        margin-top: 0.25rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item.boiler-group .fuel-stock-boiler:empty::before {
        content: "└─";
        color: #6c757d;
        font-size: 0.7rem;
    }

    /* Mobile responsive styles for activity card */
    .dashboard-grid .dashboard-card:nth-child(6) .activity-list-container {
        max-height: 250px;
    }

    .card-content {
        padding: 1rem;
        /* Reduce content padding for mobile */
    }
}

/* Additional responsive rules for very small screens */
@media (max-width: 480px) {
    .dashboard-grid {
        gap: 0.75rem;
        /* Even smaller gap for very small screens */
        margin-bottom: 0.75rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .card-content {
        padding: 0.75rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-item {
        padding: 0.75rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.3px;
        line-height: 1.2;
        text-transform: none;
        /* Remove uppercase for better wrapping */
        font-weight: 600;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-value {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    /* Extra small screen adjustments for fuel consumption card */
    .dashboard-grid .dashboard-card:nth-child(4) .fuel-chart-filters {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .dashboard-grid .dashboard-card:nth-child(4) .timeline-chart-container {
        height: 300px;
        /* Increased from 200px for better visibility */
        margin-bottom: 0.5rem;
    }

    /* Extra small screen adjustments for pie chart */
    .dashboard-grid .dashboard-card:nth-child(2) .pie-chart-container {
        min-height: 260px;
        /* Increased for better visibility */
        padding: 1.5rem 0.75rem;
        /* More padding for tooltip space */
        margin-bottom: 0.75rem;
        /* Ensure proper spacing */
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-grid .dashboard-card:nth-child(2) .pie-chart-container canvas {
        width: 200px !important;
        /* Still larger than default */
        height: 200px !important;
        max-width: calc(100vw - 3rem);
        /* Ensure it fits within viewport */
        max-height: calc(100vw - 3rem);
        margin: 0 auto;
        /* Center the canvas */
        aspect-ratio: 1 / 1;
        /* Ensure circular shape */
        object-fit: contain;
        /* Maintain aspect ratio */
    }

    /* Extra small screen adjustments for timeline chart (weekly receipts) */
    .dashboard-grid .dashboard-card:nth-child(3) .timeline-chart-container {
        height: 300px;
        /* Increased for better visibility */
        margin-bottom: 0.5rem;
    }

    /* Extra small screen adjustments for chart legends */
    .chart-legend {
        grid-template-columns: 1fr;
        /* Single column for very small screens */
        gap: 0.4rem;
        margin-top: 0.5rem;
    }

    .chart-legend-item {
        font-size: 0.75rem;
        padding: 0.3rem;
    }

    .chart-legend-color {
        width: 10px;
        height: 10px;
    }

    /* Extra small screen adjustments for fuel stock card */
    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list {
        max-height: 200px;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e0 #f7fafc;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar {
        width: 3px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar-track {
        background: #f7fafc;
        border-radius: 1px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-list::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 1px;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item {
        padding: 0.4rem 0.5rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-boiler {
        font-size: 0.85rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-type {
        font-size: 0.75rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item.boiler-separator {
        border-top: 1px solid #dee2e6;
        margin-top: 0.2rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-item.boiler-group .fuel-stock-boiler:empty::before {
        content: "└─";
        color: #6c757d;
        font-size: 0.65rem;
    }

    .dashboard-grid .dashboard-card:nth-child(5) .fuel-stock-amount {
        font-size: 0.85rem;
    }

    /* Extra small screen adjustments for activity card */
    .dashboard-grid .dashboard-card:nth-child(6) .activity-list-container {
        max-height: 200px;
    }

    .card-content {
        padding: 0.75rem;
    }
}

/* iPhone 16 Pro and similar devices (393px and below) */
@media (max-width: 393px) {
    .dashboard-grid .dashboard-card:nth-child(1) .stat-item {
        padding: 0.5rem 0.4rem;
        gap: 0.25rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-label {
        font-size: 0.55rem;
        letter-spacing: -0.02em;
        line-height: 1.1;
        margin-bottom: 0.15rem;
        text-transform: none;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-value {
        font-size: 1rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .card-header h3 {
        font-size: 0.88rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .card-content {
        padding: 0.5rem;
    }

    /* Ensure stat item doesn't add extra margins */
    .dashboard-grid .dashboard-card:nth-child(1) .stat-item::before {
        width: 30px;
        height: 2px;
    }

    /* Fuel receipt amounts section (Šiandien gauta, Šį mėnesį gauta) */
    .fuel-stat-label {
        font-size: 0.72rem;
        letter-spacing: -0.01em;
        white-space: nowrap;
        gap: 0.25rem;
    }

    .fuel-stat-label::before {
        font-size: 0.45rem;
    }

    .fuel-stat-value {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .fuel-stat-breakdown {
        gap: 0.3rem;
    }

    .fuel-stat-item {
        margin-bottom: 0.5rem;
    }

    .fuel-type-stat {
        font-size: 0.75rem;
        padding: 0.2rem 0;
    }

    /* Active transports section */
    .expandable-stat-item .stat-header-left .fuel-stat-label {
        font-size: 0.72rem;
    }

    .expandable-stat-item .stat-header-left .fuel-stat-value {
        font-size: 0.8rem;
    }
}

/* Extra responsive rules for really small phones (360px and below) */
@media (max-width: 360px) {
    .dashboard-grid .dashboard-card:nth-child(1) .stat-item {
        padding: 0.5rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0;
        line-height: 1.1;
        margin-bottom: 0.25rem;
        text-transform: none;
        /* Remove uppercase for better wrapping */
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .stat-value {
        font-size: 0.95rem;
        line-height: 1.1;
    }

    .card-header h3 {
        font-size: 0.85rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) .card-content {
        padding: 0.5rem;
    }

    /* Fuel receipt amounts section - even smaller for tiny screens */
    .fuel-stat-label {
        font-size: 0.68rem;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }

    .fuel-stat-label::before {
        font-size: 0.4rem;
    }

    .fuel-stat-value {
        font-size: 0.75rem;
    }

    .expandable-stat-item .stat-header-left .fuel-stat-label {
        font-size: 0.68rem;
    }

    .expandable-stat-item .stat-header-left .fuel-stat-value {
        font-size: 0.75rem;
    }
}

.dashboard-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: visible;
    /* Changed from hidden to allow tooltips to display */
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: #f8f9fa;
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    padding: 1.5rem;
    overflow: visible;
    /* Ensure tooltips can display outside card content */
    position: relative;
    z-index: 1;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.fuel-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.fuel-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.fuel-type:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.fuel-type i {
    font-size: 1.25rem;
    color: #27ae60;
}

.fuel-type span {
    font-weight: 500;
    color: #2c3e50;
}

/* Weekly Fuel Receipt Timeline Styles */
.filters-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.week-filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.week-filter-container label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.week-filter-container input[type="week"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.week-filter-container input[type="week"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsive styling for filters */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .week-filter-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .week-filter-container input[type="week"] {
        width: 100%;
        max-width: 200px;
    }
}

/* Additional responsive rules for very small screens */
@media (max-width: 480px) {
    .filters-row {
        gap: 0.75rem;
    }

    .week-filter-container,
    .fuel-type-filter-container {
        gap: 0.25rem;
    }

    .week-filter-container input[type="week"],
    .fuel-type-filter-container select {
        max-width: 100%;
        font-size: 0.85rem;
        padding: 0.4rem;
    }

    .week-filter-container label,
    .fuel-type-filter-container label {
        font-size: 0.85rem;
    }
}

/* Fuel Type Filter Styles */
.fuel-type-filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.fuel-type-filter-container label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.fuel-type-filter-container select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 180px;
}

.fuel-type-filter-container select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsive styling for fuel type filter */
@media (max-width: 768px) {
    .fuel-type-filter-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .fuel-type-filter-container select {
        width: 100%;
        max-width: 200px;
    }
}

.timeline-chart-container {
    position: relative;
    height: 350px;
    /* Increased height for better visibility of multi-line charts */
    margin-bottom: 1rem;
}

/* Responsive adjustments for timeline chart */
@media (max-width: 768px) {
    .timeline-chart-container {
        height: 350px;
        /* Increased from 250px for better mobile visibility */
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .timeline-chart-container {
        height: 300px;
        /* Increased from 200px for better mobile visibility */
        margin-bottom: 0.5rem;
    }
}

.timeline-chart-container canvas {
    max-width: 100%;
    height: auto;
}

.timeline-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

/* Responsive adjustments for timeline summary */
@media (max-width: 768px) {
    .timeline-summary {
        gap: 0.75rem;
        padding-top: 0.75rem;
    }
}

@media (max-width: 480px) {
    .timeline-summary {
        gap: 0.5rem;
        padding-top: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
    }
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

/* Responsive adjustments for summary items */
@media (max-width: 480px) {
    .summary-item {
        align-items: flex-start;
        text-align: left;
        flex: none;
        width: 100%;
    }
}

.summary-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #004085;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #4e555b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.25);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.table-container.scrollable {
    overflow-x: auto;
    max-width: 100%;
}

.fuel-receipt-table {
    min-width: 1600px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
}

.fuel-transport-table {
    min-width: 1800px;
    font-size: 0.85rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto', sans-serif;
}

.data-table th {
    background: #f8f9fa;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    font-size: 0.85rem;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table th:last-child {
    border-right: none;
}

.data-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    color: #495057;
    text-align: center;
    vertical-align: middle;
    font-size: 0.85rem;
}

.data-table td:last-child {
    border-right: none;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

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

.data-table tbody tr:hover {
    background-color: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

/* Specific column styling */
.data-table td:nth-child(1) {
    /* Date */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 90px;
}

.data-table td:nth-child(2) {
    /* Fuel type */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 60px;
}

.data-table td:nth-child(3) {
    /* Supplier */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    padding: 0.75rem 0.5rem;
    min-width: 150px;
}

.data-table td:nth-child(4),
/* Initial weight */
.data-table td:nth-child(5),
/* Final weight */
.data-table td:nth-child(6) {
    /* Fuel weight */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 100px;
}

.data-table td:nth-child(7),
/* Receiver */
.data-table td:nth-child(8) {
    /* Deliverer */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 120px;
}

.data-table td:nth-child(9) {
    /* Vehicle info */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 140px;
}

.data-table td:nth-child(10) {
    /* Notes */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    padding: 0.75rem 0.5rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table td:nth-child(11) {
    /* Actions */
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
    min-width: 120px;
}

/* Action buttons in table */
.table-action-btn {
    padding: 0.375rem !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
    margin: 0 0.125rem !important;
    min-width: auto !important;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-action-btn i {
    font-size: 0.8rem;
    margin: 0;
}

.table-action-btn.btn-edit {
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: white !important;
}

.table-action-btn.btn-edit:hover {
    background: #138496 !important;
    border-color: #117a8b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3) !important;
}

.table-action-btn.btn-delete {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.table-action-btn.btn-delete:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

/* Header specific styling */
.data-table th:nth-child(1) {
    min-width: 90px;
}

.data-table th:nth-child(2) {
    min-width: 60px;
}

.data-table th:nth-child(3) {
    min-width: 150px;
}

.data-table th:nth-child(4),
.data-table th:nth-child(5),
.data-table th:nth-child(6) {
    min-width: 100px;
}

.data-table th:nth-child(7),
.data-table th:nth-child(8) {
    min-width: 120px;
}

.data-table th:nth-child(9) {
    min-width: 140px;
}

.data-table th:nth-child(10) {
    min-width: 150px;
}

.data-table th:nth-child(11) {
    min-width: 120px;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 3rem !important;
    background-color: white !important;
}

/* Boilers Grid */
.boilers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.boiler-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.boiler-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Transport Status Badges */
.status-badge.vykdomas {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.atliktas {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.atmesta {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.boiler-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.info-item .value {
    font-weight: 600;
    color: #2c3e50;
}

/* Login Modal Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .login-form {
        padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    }

    .login-form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .language-selector {
        align-self: flex-end;
    }

    .login-form .form-group input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

@media (max-width: 835px) {
    .modal-content {
        margin: 0.5rem;
        max-width: 90%;
    }

    /* Better mobile modal experience */
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e9ecef;
    }

    .modal-header h2 {
        font-size: 1.25rem;
        margin: 0;
    }

    .modal-close {
        font-size: 1.5rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-header {
        padding: 1rem 1.25rem 0.75rem;
    }

    .login-header h2 {
        font-size: 1.2rem;
    }

    .login-logo {
        width: 28px;
        height: 28px;
    }

    .login-form {
        padding: 1.25rem 1.25rem 0.75rem 1.25rem;
        gap: 1.25rem;
    }

    /* Override for boiler settings modal in remote boilers temperatures tab */
    #boilerSettingsModal .modal-content {
        max-width: 92%;
        margin: 10px auto;
        border-radius: 16px;
    }

    #boilerSettingsModal .login-form {
        padding: 1.5rem !important;
        gap: 1rem;
    }

    #boilerSettingsModal .form-group {
        margin-bottom: 1.25rem;
    }

    /* Target the div containing the checkbox inside form-group */
    #boilerSettingsModal .form-group>div {
        margin-top: 12px !important;
    }

    /* Target the divider for email group */
    #boilerSettingsModal .form-group[style*="border-top"] {
        margin-top: 1.5rem !important;
        padding-top: 1.5rem !important;
        border-top-color: #eee !important;
    }

    #boilerSettingsModal .login-btn {
        margin-top: 1.5rem;
        height: 52px;
        font-size: 1.05rem;
        border-radius: 12px;
    }

    #boilerSettingsModal .form-group label {
        margin-bottom: 0.6rem;
        font-weight: 500;
        color: #4a5568;
    }

    .login-title {
        font-size: 1rem;
    }

    .login-logo {
        width: 24px;
        height: 24px;
    }

    /* Hide hamburger icon when modal is open */
    body.modal-open #sidebarToggle {
        display: none !important;
    }

    /* Signalizacijos ir taisyklės modal responsiveness */
    #remoteBoilerAlarmsModal .modal-content {
        max-width: 95%;
        margin: 10px auto;
        border-radius: 12px;
    }

    #remoteBoilerAlarmsModal .alarm-tabs {
        flex-wrap: wrap;
        gap: 8px !important;
        padding-bottom: 15px !important;
    }

    #remoteBoilerAlarmsModal .alarm-tabs button {
        flex: 1;
        min-width: 140px;
        font-size: 0.9rem;
        padding: 0.6rem 0.4rem;
    }

    #remoteBoilerAlarmsModal .form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #remoteBoilerAlarmsModal .modal-body {
        padding: 1rem !important;
    }

    #alarmRuleForm {
        padding: 12px !important;
    }

    #alarmRuleForm h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    #alarmRuleForm .form-group {
        margin-top: 10px !important;
    }

    #alarmRuleForm label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    #alarmRuleForm .form-control {
        padding: 0.6rem;
        font-size: 0.95rem;
    }

    #alarmRuleForm div[style*="justify-content: flex-end"] {
        flex-direction: column;
        gap: 8px !important;
    }

    #alarmRuleForm div[style*="justify-content: flex-end"] button {
        width: 100%;
        margin: 0 !important;
    }

    /* Alarms table horizontal scroll */
    .rules-list,
    .alarms-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    .rules-list table {
        min-width: 600px;
    }
}

/* Responsive Design */

/* Portrait tablets - narrow width, single column layout */
@media (max-width: 834px) and (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-grid .dashboard-card:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .dashboard-grid .dashboard-card:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .dashboard-grid .dashboard-card:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    .dashboard-grid .dashboard-card:nth-child(4) {
        grid-column: 1;
        grid-row: 4;
    }

    .dashboard-grid .dashboard-card:nth-child(5) {
        grid-column: 1;
        grid-row: 5;
    }

    .dashboard-grid .dashboard-card:nth-child(6) {
        grid-column: 1;
        grid-row: 6;
    }

    /* Portrait tablet sidebar adjustments */
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
    }

    /* Portrait tablet content padding */
    .main-content {
        padding: 0 1rem 1.5rem;
    }

    .content-header {
        padding: 1rem 1.5rem;
    }

    /* Portrait tablet modal sizing */
    .modal-content {
        max-width: 95%;
        margin: 1rem auto;
    }

    .large-modal {
        max-width: 98%;
        margin: 0.5rem auto;
    }

    /* Portrait tablet boiler grid */
    .boilers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Portrait tablet filter grid */
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Portrait tablet reports menu */
    .reports-menu {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Portrait tablet fuel chart filters */
    .fuel-chart-filters {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    /* Portrait tablet card adjustments */
    .card-header {
        padding: 1rem 1.25rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    /* Portrait tablet form layouts */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Portrait tablet timeline chart */
    .timeline-chart-container {
        height: 280px;
    }

    /* Portrait tablet pie chart */
    .pie-chart-container canvas {
        width: 180px;
        height: 180px;
    }

    /* Portrait tablet dashboard card optimizations */
    .dashboard-card {
        min-height: auto;
        overflow: visible;
    }

    .dashboard-card .card-content {
        padding: 1rem 1.25rem;
    }

    /* Portrait tablet fuel stock list */
    .fuel-stock-list {
        max-height: 200px;
    }

    .fuel-stock-item {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .fuel-stock-details {
        width: 100%;
        justify-content: space-between;
    }

    /* Portrait tablet activity list */
    .activity-list-container {
        max-height: 200px;
    }

    .activity-item {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .activity-content {
        width: 100%;
    }

    .activity-time {
        align-self: flex-end;
    }

    /* Portrait tablet section headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .section-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Portrait tablet header layout - hamburger left, user icon right */
    .content-header {
        padding: 1rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    /* Show page title on portrait tablets */
    .content-header h1 {
        display: block;
        font-size: 0.8rem;
        margin: 0;
        flex: 1;
        text-align: center;
    }

    /* Portrait tablet mobile toggle - show on portrait tablets */
    .mobile-toggle {
        display: block;
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        z-index: 1001;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        background: #ffffff;
        color: #6c757d;
        border: 1px solid #e9ecef;
        padding: 0.5rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 1.1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        margin-right: auto;
    }

    .mobile-toggle:hover {
        background: #f8f9fa;
        border-color: #dee2e6;
        color: #495057;
    }

    /* User info on the right */
    .content-header .user-info {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Hide user name on portrait tablets for compact header */
    .content-header .user-details {
        display: none !important;
    }

    .content-header .user-name {
        display: none !important;
    }

    /* Make user avatar slightly larger when name is hidden */
    .content-header .user-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }

    /* Portrait tablet section header layout - buttons in one row */
    .section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .section-header h2 {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    .section-actions {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .section-actions .btn {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 0.85rem !important;
        padding: 0.6rem 0.8rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .section-actions .btn i {
        font-size: 0.8rem !important;
        margin-right: 0.4rem !important;
    }

    /* Portrait tablet user dropdown positioning */
    .user-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 1rem !important;
        left: auto !important;
        width: auto !important;
        max-width: calc(100vw - 2rem) !important;
        min-width: 280px !important;
        margin-top: 0 !important;
        z-index: 1050 !important;
        max-height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
    }

    /* Adjust dropdown items for portrait tablets */
    .dropdown-item {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 44px;
    }

    .dropdown-header {
        padding: 1rem !important;
    }

    /* Hide toggle button when sidebar is open on portrait tablets */
    .sidebar.mobile-open~.main-content .mobile-toggle {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Portrait tablet sidebar behavior */
    .sidebar {
        position: fixed;
        top: 0;
        left: -240px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        transform: translateX(0);
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Portrait tablet mobile overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }
}

/* Landscape tablets and small desktops - 835px to 1200px */
@media (min-width: 835px) and (max-width: 1200px) {

    /* Ensure proper app layout */
    .app {
        display: flex;
        flex-direction: row;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto auto !important;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    /* Explicitly set grid positions for dashboard cards */
    .dashboard-grid .dashboard-card:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .dashboard-grid .dashboard-card:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .dashboard-grid .dashboard-card:nth-child(3) {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
    }

    .dashboard-grid .dashboard-card:nth-child(4) {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
    }

    .dashboard-grid .dashboard-card:nth-child(5) {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
    }

    .dashboard-grid .dashboard-card:nth-child(6) {
        grid-column: 1 / -1 !important;
        grid-row: 5 !important;
    }

    .sidebar {
        width: 250px;
    }

    .main-content {
        padding: 0 1.5rem 1.5rem;
    }

    .content-wrapper {
        padding: 2rem;
    }

    .content-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-content {
        max-width: 90%;
        margin: 2rem auto;
    }

    .large-modal {
        max-width: 95%;
    }

    .reports-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .boilers-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }

    /* Ensure proper spacing for all content sections */
    .content-section {
        width: 100%;
        max-width: none;
    }

    .fuel-chart-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .section-actions {
        flex-direction: row;
        gap: 0.75rem;
    }

    /* Optimized touch targets and sizing */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 40px;
        min-width: 40px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        min-height: 48px;
        min-width: 48px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    /* Optimized form elements */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .dashboard-card {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.11);
    }

    .card-content {
        padding: 1.75rem;
    }

    .form-label {
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    /* Tablet-optimized modal sizing */
    .modal-content {
        max-width: 85%;
        margin: 2rem auto;
        border-radius: 12px;
    }

    .large-modal {
        max-width: 90%;
        margin: 1.5rem auto;
    }

    /* Tablet-optimized table sizing */
    .data-table,
    .table {
        font-size: 0.95rem;
    }

    .data-table th,
    .data-table td,
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        min-height: 44px;
    }

    /* Tablet-optimized card spacing */
    .card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .card-header {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    /* Tablet-optimized chart containers */
    .chart-container {
        min-height: 300px;
    }

    .timeline-chart-container {
        height: 320px;
    }

    /* Tablet-optimized sidebar */
    .sidebar {
        width: 260px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .sidebar .nav-link i {
        width: 20px;
        margin-right: 0.75rem;
    }

    /* Tablet-optimized content header */
    .content-header {
        padding: 1.5rem 2rem;
        border-bottom: 1px solid #e9ecef;
    }

    .content-header h1 {
        font-size: 0.8rem;
        font-weight: 600;
    }

    /* Tablet-optimized filters */
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .fuel-chart-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.25rem;
        align-items: center;
    }

    .filter-group {
        min-width: 200px;
    }

    /* Tablet-optimized activity list */
    .activity-item {
        padding: 1rem 1.25rem;
        min-height: 60px;
    }

    .activity-item .activity-content {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .activity-item .activity-time {
        font-size: 0.85rem;
    }

    /* Tablet-optimized fuel stock list */
    .fuel-stock-item {
        padding: 0.875rem 1rem;
        min-height: 50px;
    }

    .fuel-stock-boiler {
        font-size: 1rem;
        font-weight: 500;
    }

    .fuel-stock-type {
        font-size: 0.9rem;
    }

    .fuel-stock-amount {
        font-size: 1rem;
        font-weight: 600;
    }

    /* Tablet-optimized boiler cards */
    .boiler-card {
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .boiler-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    .boiler-card .card-header {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .boiler-card .card-body {
        padding: 1.5rem;
    }

    /* Tablet-optimized dropdown menus */
    .dropdown-menu {
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        border: none;
    }

    .dropdown-item {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .dropdown-item i {
        width: 18px;
        margin-right: 0.75rem;
    }

    /* Tablet-optimized pagination */
    .pagination .page-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        padding: 0.75rem;
    }

    /* Tablet-optimized alerts */
    .alert {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* Tablet-optimized badges */
    .badge {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
    }

    /* Tablet-optimized progress bars */
    .progress {
        height: 12px;
        border-radius: 6px;
    }

    .progress-bar {
        border-radius: 6px;
    }

    /* Tablet-optimized dashboard spacing */
    .dashboard-grid {
        gap: 1.75rem;
        margin-bottom: 2rem;
    }

    .dashboard-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }

    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    /* Tablet-optimized boiler grid */
    .boilers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Tablet-optimized section headers */
    .section-header {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

    /* Tablet-optimized refresh buttons */
    .refresh-btn {
        padding: 0.75rem;
        min-width: 48px;
        min-height: 48px;
        border-radius: 8px;
    }

    /* Tablet-optimized pie charts */
    .pie-chart-container canvas {
        width: 200px;
        height: 200px;
    }

    /* Tablet-optimized fuel consumption report */
    .fuel-consumption-report .report-header {
        padding: 1.5rem 2rem;
    }

    .fuel-consumption-report .report-title {
        font-size: 1.5rem;
        font-weight: 600;
    }

    /* Tablet-optimized reports menu */
    .reports-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }

    .report-card {
        border-radius: 12px;
        transition: all 0.3s ease;
        min-height: 120px;
    }

    .report-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    .report-card .card-body {
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .report-card .card-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .report-card .card-text {
        font-size: 0.95rem;
        color: #6c757d;
        line-height: 1.4;
    }

    /* Tablet-optimized form layouts */
    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .form-row.single-column {
        grid-template-columns: 1fr;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    /* Tablet-optimized modal forms */
    .modal-body {
        padding: 2rem;
    }

    .modal-header {
        padding: 1.5rem 2rem 1rem;
        border-bottom: 1px solid #e9ecef;
    }

    .modal-footer {
        padding: 1rem 2rem 2rem;
        border-top: 1px solid #e9ecef;
    }

    /* Tablet-optimized user dropdown */
    .user-dropdown {
        min-width: 200px;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

    .user-dropdown .dropdown-item {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }

    /* Tablet header layout for smaller tablets (835-1023px) */
    @media (max-width: 1023px) {
        .content-header {
            padding: 1rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
        }

        /* Show page title on smaller tablets */
        .content-header h1 {
            display: block;
            font-size: 0.8rem;
            margin: 0;
            flex: 1;
            text-align: center;
        }

        .mobile-toggle {
            display: block;
            position: relative;
            left: 0;
            top: 0;
            transform: none;
            background: #ffffff;
            color: #6c757d;
            border: 1px solid #e9ecef;
            padding: 0.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1.1rem;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            z-index: 1001;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            margin-right: auto;
        }

        .mobile-toggle:hover {
            background: #f8f9fa;
            border-color: #dee2e6;
            color: #495057;
        }

        /* User info on the right */
        .content-header .user-info {
            margin-left: auto !important;
            margin-right: 0 !important;
        }

        /* Hide user name on smaller tablets for compact header */
        .content-header .user-details {
            display: none !important;
        }

        .content-header .user-name {
            display: none !important;
        }

        /* Make user avatar slightly larger when name is hidden */
        .content-header .user-avatar {
            width: 36px !important;
            height: 36px !important;
            font-size: 0.85rem !important;
        }

        /* Tablet section header layout - buttons in one row */
        .section-header {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 1rem !important;
            margin-bottom: 1.5rem !important;
        }

        .section-header h2 {
            font-size: 1.25rem !important;
            margin-bottom: 0 !important;
            text-align: center !important;
        }

        .section-actions {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
            gap: 0.75rem !important;
            width: 100% !important;
        }

        .section-actions .btn {
            flex: 1 !important;
            min-width: 0 !important;
            font-size: 0.85rem !important;
            padding: 0.6rem 0.8rem !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .section-actions .btn i {
            font-size: 0.8rem !important;
            margin-right: 0.4rem !important;
        }

        /* Tablet user dropdown positioning */
        .user-dropdown {
            position: fixed !important;
            top: 60px !important;
            right: 1rem !important;
            left: auto !important;
            width: auto !important;
            max-width: calc(100vw - 2rem) !important;
            min-width: 300px !important;
            margin-top: 0 !important;
            z-index: 1050 !important;
            max-height: calc(100vh - 80px) !important;
            overflow-y: auto !important;
        }

        /* Adjust dropdown items for tablets */
        .dropdown-item {
            padding: 0.75rem 1rem !important;
            font-size: 0.9rem !important;
            min-height: 44px;
        }

        .dropdown-header {
            padding: 1rem !important;
        }

        /* Hide toggle button when sidebar is open on tablets */
        .sidebar.mobile-open~.main-content .mobile-toggle {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
    }

    /* Hide mobile toggle on larger screens within this range */
    @media (min-width: 1024px) {
        .mobile-toggle {
            display: none;
        }
    }

    /* Tablet-optimized content padding */
    .main-content {
        padding: 0 1.5rem 2rem;
    }

    /* Tablet-optimized scrollbars */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f3f4;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: #c1c8cd;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #a8b2ba;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease, width 0.3s ease;
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        left: 0;
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.collapsed.mobile-open {
        left: 0;
        width: 70px;
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    /* Mobile overlay for sidebar */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Make sidebar menu scrollable on mobile */
    .sidebar-menu {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure footer stays at bottom */
    .sidebar-footer {
        flex-shrink: 0;
        margin-top: auto;
        padding: 0.5rem 0.75rem;
    }

    .sidebar-logo {
        width: 20px;
        height: 20px;
    }

    /* Improve mobile sidebar scrolling */
    .sidebar-menu::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .sidebar-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    /* Improve mobile menu items - more compact */
    .menu-item a {
        padding: 0.7rem 1.25rem;
        min-height: 40px;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .menu-item a i {
        font-size: 1rem;
        width: 18px;
        text-align: center;
    }

    .menu-item a .menu-text {
        font-size: 0.9rem;
        font-weight: 500;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Safe area support for header */
    .content-header {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    /* Safe area support for content sections */
    .content-section {
        padding-left: max(2rem, calc(2rem + env(safe-area-inset-left)));
        padding-right: max(2rem, calc(2rem + env(safe-area-inset-right)));
        padding-bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
    }

    /* Ensure dashboard grid respects safe areas */
    .dashboard-grid {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .sidebar {
        width: 280px;
    }

    .sidebar.collapsed.mobile-open {
        width: 60px;
    }

    .sidebar-footer {
        padding: 0.5rem 0.75rem;
    }

    .logout-btn {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    /* Extra small screens header layout */
    .content-header {
        padding: 0.75rem 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }

    /* Extra small screens content sections */
    .content-section {
        padding-left: max(1rem, calc(1rem + env(safe-area-inset-left)));
        padding-right: max(1rem, calc(1rem + env(safe-area-inset-right)));
        padding-bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    }

    .mobile-toggle {
        font-size: 1rem;
        padding: 0.4rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {

    /* Mobile header layout - hamburger left, user icon right */
    /* Mobile header layout - compact row */
    .content-header {
        padding: 0.75rem 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        gap: 0.5rem;
    }

    /* Show page title on mobile */
    .content-header h1 {
        display: block;
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
        color: #2c3e50;
        margin: 0;
    }

    /* Adjust weather widget for mobile */
    .weather-widget {
        font-size: 0.7rem;
        margin-left: 0;
        padding: 0;
        flex-shrink: 0;
    }

    .weather-widget .weather-location {
        display: none;
    }

    .mobile-toggle {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        background: #ffffff;
        color: #6c757d;
        border: 1px solid #e9ecef;
        padding: 0.4rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 1rem;
        display: block !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        margin-right: 0;
        flex-shrink: 0;
    }

    .mobile-toggle:hover {
        background: #f8f9fa;
        border-color: #dee2e6;
        color: #495057;
    }

    /* User info on the right */
    .content-header .user-info {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Hide user name on mobile for compact header */
    .content-header .user-details {
        display: none !important;
    }

    .content-header .user-name {
        display: none !important;
    }

    /* Make user avatar slightly larger when name is hidden */
    .content-header .user-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }

    /* Mobile section header layout - buttons in one row */
    .section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .section-header h2 {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    .section-actions {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .section-actions .btn {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 0.85rem !important;
        padding: 0.6rem 0.8rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .section-actions .btn i {
        font-size: 0.8rem !important;
        margin-right: 0.4rem !important;
    }

    /* Mobile user dropdown positioning */
    .user-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 1rem !important;
        left: auto !important;
        width: auto !important;
        max-width: calc(100vw - 2rem) !important;
        min-width: 280px !important;
        margin-top: 0 !important;
        z-index: 1050 !important;
        max-height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
    }

    /* Position dropdown below user avatar */
    .user-info {
        position: relative;
    }

    /* Adjust dropdown items for mobile */
    .dropdown-item {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }

    .dropdown-item i {
        font-size: 1rem !important;
        width: 24px !important;
    }

    .dropdown-header {
        padding: 1rem !important;
    }

    .dropdown-user-name {
        font-size: 1rem !important;
    }

    .dropdown-detail-item {
        font-size: 0.85rem !important;
    }

    /* Smooth scrolling for dropdown */
    .user-dropdown {
        -webkit-overflow-scrolling: touch !important;
    }

    /* Hide toggle button when sidebar is open */
    .sidebar.mobile-open~.main-content .mobile-toggle {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Improve form elements for mobile */
    .form-control,
    .filter-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="week"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .fuel-types {
        grid-template-columns: 1fr;
    }

    .boilers-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Custom Dialog Styles */
.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.dialog-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    animation: dialogSlideIn 0.3s ease;
}

.dialog-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.dialog-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.dialog-body {
    padding: 1.5rem;
}

.dialog-body p {
    margin: 0;
    color: #495057;
    font-size: 1rem;
    line-height: 1.5;
}

.dialog-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.dialog-actions .btn {
    min-width: 100px;
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 2500;
    animation: toastSlideIn 0.3s ease;
}

.toast-content {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.success #toastIcon {
    color: #28a745;
}

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

.toast.error #toastIcon {
    color: #dc3545;
}

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

.toast.warning #toastIcon {
    color: #ffc107;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

.toast.info #toastIcon {
    color: #17a2b8;
}

#toastMessage {
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Animations */
@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Chart.js Tooltip Global Styles */
.chartjs-tooltip {
    opacity: 1 !important;
    position: absolute !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    max-width: 300px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* Pie Chart Styles */
.pie-chart-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 1rem;
    overflow: visible;
    /* Allow tooltips to show but will be clamped by Chart.js */
    padding: 0.5rem;
    isolation: isolate;
    /* Create new stacking context for proper z-index */
}

.pie-chart-container canvas {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    /* Ensure circular shape */
    object-fit: contain;
    /* Maintain aspect ratio */
    position: relative;
    z-index: 1;
}

.chart-loading,
.chart-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    z-index: 10;
}

.chart-loading i,
.chart-error i {
    font-size: 1.5rem;
    color: #667eea;
}

.chart-error i {
    color: #e74c3c;
}

.chart-no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    z-index: 10;
}

.chart-no-data i {
    font-size: 1.5rem;
    color: #17a2b8;
}

.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.legend-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.legend-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--legend-color, #007bff);
    transition: width 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.legend-item:hover::before {
    width: 6px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.legend-label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
}

.legend-percentage {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #007bff, #0056b3);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.legend-value {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

/* Legend text styling */
.legend-text-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.legend-text-item:last-child {
    border-bottom: none;
}

.legend-text-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-text-label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.legend-text-stats {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.card-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
}

/* Responsive adjustments for card headers and buttons */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .card-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .card-header-actions .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .refresh-btn {
        padding: 0.6rem;
        min-width: 44px;
        /* Ensure touch-friendly size */
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .refresh-btn {
        padding: 0.7rem;
        min-width: 48px;
        min-height: 48px;
    }
}

.refresh-btn:hover {
    background: #ffffff;
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments for pie chart */
@media (max-width: 768px) {
    .pie-chart-container {
        min-height: 280px;
        /* Increased for better mobile visibility */
        padding: 1.5rem 1rem;
        /* More top/bottom padding for tooltip space */
        margin-bottom: 1rem;
        /* Ensure proper spacing */
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pie-chart-container canvas {
        width: 220px !important;
        height: 220px !important;
        max-width: calc(100vw - 4rem);
        /* Ensure it fits within viewport with padding */
        max-height: calc(100vw - 4rem);
        margin: 0 auto;
        /* Center the canvas */
        aspect-ratio: 1 / 1;
        /* Ensure circular shape */
        object-fit: contain;
        /* Maintain aspect ratio */
    }

    /* Ensure dashboard cards respect viewport bounds on mobile */
    .dashboard-card {
        overflow: visible;
        /* Allow tooltips to show */
        max-width: 100%;
    }

    .dashboard-card .card-content {
        overflow: visible;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .pie-chart-container {
        min-height: 260px;
        /* Increased for better mobile visibility */
        padding: 1.5rem 0.75rem;
        /* More top/bottom padding for tooltip space */
        margin-bottom: 0.75rem;
        /* Ensure proper spacing */
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pie-chart-container canvas {
        width: 200px !important;
        height: 200px !important;
        max-width: calc(100vw - 3rem);
        /* Ensure it fits within viewport with padding */
        max-height: calc(100vw - 3rem);
        margin: 0 auto;
        /* Center the canvas */
        aspect-ratio: 1 / 1;
        /* Ensure circular shape */
        object-fit: contain;
        /* Maintain aspect ratio */
    }

    /* Ensure dashboard cards respect viewport bounds on smaller mobile */
    .dashboard-card {
        overflow: visible;
        /* Allow tooltips to show */
        max-width: 100%;
    }

    .dashboard-card .card-content {
        overflow: visible;
        max-width: 100%;
    }
}

/* Fuel chart filters styling */
.fuel-chart-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.fuel-chart-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.fuel-chart-filters .filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.fuel-chart-filters .filter-group .form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.85rem;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fuel-chart-filters .filter-group .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.fuel-chart-filters .filter-group input[type="week"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.85rem;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fuel-chart-filters .filter-group input[type="week"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive adjustments for fuel chart filters */
@media (max-width: 768px) {
    .fuel-chart-filters {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .fuel-chart-filters .filter-group {
        flex: none;
    }
}

/* Additional responsive rules for very small screens */
@media (max-width: 480px) {
    .fuel-chart-filters {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .fuel-chart-filters .filter-group {
        width: 100%;
    }
}

/* Responsive adjustments for transport form */
@media (max-width: 768px) {
    .large-modal {
        width: 98%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .large-modal .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .transport-form {
        padding: 1.5rem;
    }

    .transport-form .form-group {
        margin-bottom: 1rem;
    }

    .transport-form .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .transport-form .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .large-modal {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .transport-form {
        padding: 1rem;
    }

    .transport-form .form-grid {
        gap: 1rem;
    }
}

/* Activity List Styles */
.activity-list-container {
    position: relative;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Responsive adjustments for activity list */
@media (max-width: 768px) {
    .activity-list-container {
        min-height: 150px;
        max-height: 250px;
    }

    .activity-loading,
    .activity-error {
        padding: 1.5rem 0;
    }

    .activity-list {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .activity-list-container {
        min-height: 120px;
        max-height: 200px;
    }

    .activity-loading,
    .activity-error {
        padding: 1rem 0;
        font-size: 0.8rem;
    }

    .activity-list {
        gap: 0.4rem;
    }
}

.activity-loading,
.activity-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 2rem 0;
}

.activity-loading i,
.activity-error i {
    font-size: 1.5rem;
    color: #667eea;
}

.activity-error i {
    color: #e74c3c;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
    /* Add padding for scrollbar */
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: #ffffff;
}

.activity-icon.fuel-receipt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-icon.fuel-transfer {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.activity-icon.fuel_consumption {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
}

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

.activity-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.activity-details {
    color: #7f8c8d;
    font-size: 0.8rem;
    line-height: 1.4;
}

.activity-time {
    color: #95a5a6;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.activity-amount {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    margin-left: auto;
    text-align: right;
    min-width: 60px;
}

/* Responsive adjustments for activity list */
@media (max-width: 768px) {
    .activity-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .activity-amount {
        margin-left: 0;
        text-align: left;
    }

    .activity-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Custom scrollbar styling for activity list */
.activity-list-container::-webkit-scrollbar {
    width: 6px;
}

.activity-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.activity-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.activity-list-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* All Activities Modal Styles */
.modal-filters {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.filters-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filters-row:last-child {
    margin-bottom: 0;
}

.filters-row .form-group {
    flex: 1;
    min-width: 220px;
}

.filters-row .form-group label {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    text-align: left !important;
    margin-bottom: 0.5rem;
    margin-left: 0 !important;
    margin-right: auto !important;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    width: auto !important;
}

.filters-row .form-group:last-child {
    flex: none;
    display: flex;
    gap: 12px;
    align-items: center;
}

.activities-table {
    width: 100%;
    font-size: 14px;
}

.activity-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.activity-type.fuel_receipt {
    background-color: #e3f2fd;
    color: #1976d2;
}

.activity-type.fuel_transfer {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.activity-type.fuel_consumption {
    background-color: #fff3e0;
    color: #f57c00;
}

.activities-loading,
.activities-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 24px;
    text-align: center;
    color: #666;
}

/* Pagination container in modal */
#activitiesPaginationContainer {
    padding: 0 24px 24px 24px;
}

/* Custom styling for activities rows per page dropdown */
#activitiesRowsPerPage {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    min-width: 120px;
}

#activitiesRowsPerPage:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    background: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%);
}

#activitiesRowsPerPage:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: #ffffff;
}

/* Style the dropdown options */
#activitiesRowsPerPage option {
    padding: 8px 12px;
    background: #ffffff;
    color: #495057;
    font-weight: 500;
}

#activitiesRowsPerPage option:hover,
#activitiesRowsPerPage option:checked {
    background: #007bff;
    color: #ffffff;
}

/* Enhance pagination controls styling */
#activitiesPaginationContainer .pagination-controls {
    gap: 8px;
    align-items: center;
}

#activitiesPaginationContainer .pagination-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 6px 10px;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#activitiesPaginationContainer .pagination-btn:hover:not(:disabled) {
    border-color: #007bff;
    background: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%);
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

#activitiesPaginationContainer .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #e9ecef;
}

#activitiesPaginationContainer .page-info {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    min-width: 60px;
    text-align: center;
}

.activities-error {
    color: #dc3545;
}

.activities-loading i,
.activities-error i {
    font-size: 20px;
}

/* Modal content body improvements */
.modal-content-body {
    padding: 0 24px;
}

.modal-content-body .table-container {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    /* On desktop, let content expand naturally */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    -webkit-overflow-scrolling: touch;
}

.modal-content-body .table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content-body .table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content-body .table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-content-body .table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.activities-table {
    position: relative;
}

.activities-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 16px 12px;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Make sure sticky headers work in mobile modal */
@media (max-width: 480px) {
    .large-modal .activities-table th {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: #f8f9fa;
    }
}

.activities-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

.activities-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive styles for activities modal */
@media (max-width: 768px) {
    .modal-filters {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .filters-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .filters-row .form-group {
        min-width: 100%;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .filters-row .form-group:last-child {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-bottom: 0;
    }

    .filters-row .form-group:last-child .btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .filters-row .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .filters-row .form-group select,
    .filters-row .form-group input {
        font-size: 14px;
        /* Prevent zoom on iOS */
        padding: 0.5rem;
        height: auto;
        min-height: 36px;
    }

    .modal-content-body {
        padding: 0 0.75rem;
    }

    /* Make table scrollable on mobile - only horizontal scroll, let modal handle vertical */
    .modal-content-body .table-container {
        overflow-x: auto;
        overflow-y: visible;
        /* Let modal handle vertical scrolling */
        -webkit-overflow-scrolling: touch;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        max-width: 100%;
    }

    .activities-table {
        font-size: 12px;
        width: auto;
        /* Allow table to be wider than viewport */
        min-width: 100%;
        /* At least full width */
        table-layout: auto;
        /* Auto layout for content-based sizing */
        border-collapse: collapse;
    }

    .activities-table thead {
        width: 100%;
    }

    .activities-table tbody {
        width: 100%;
    }

    .activities-table tr {
        width: 100%;
        border-bottom: 1px solid #dee2e6;
    }

    .activities-table tbody tr {
        background-color: #fff;
        transition: background-color 0.2s ease;
    }

    .activities-table tbody tr:nth-child(even) {
        background-color: #f8f9fa;
    }

    .activities-table tbody tr:active {
        background-color: #e9ecef;
    }

    .activities-table th,
    .activities-table td {
        padding: 10px 8px;
        white-space: normal;
        /* Allow text wrapping by default */
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 11px;
        vertical-align: middle;
        line-height: 1.4;
    }

    /* Better text alignment for mobile */
    .activities-table th:nth-child(1),
    .activities-table td:nth-child(1) {
        text-align: center;
        /* Date centered */
    }

    .activities-table th:nth-child(2),
    .activities-table td:nth-child(2) {
        text-align: left;
        /* Type left-aligned for badge */
        padding-left: 4px;
    }

    .activities-table th:nth-child(3),
    .activities-table td:nth-child(3) {
        text-align: left;
        /* Boiler name left-aligned */
    }

    .activities-table th:nth-child(4),
    .activities-table td:nth-child(4) {
        text-align: left;
        /* Fuel type left-aligned */
    }

    .activities-table th:nth-child(5),
    .activities-table td:nth-child(5) {
        text-align: right;
        /* Amount right-aligned */
        padding-right: 8px;
    }

    .activities-table th:nth-child(6),
    .activities-table td:nth-child(6) {
        text-align: center;
        /* Actions centered */
    }

    /* Specific column widths for mobile - use min-width for better content fit */
    .activities-table th:nth-child(1),
    /* Data */
    .activities-table td:nth-child(1) {
        min-width: 85px;
        white-space: nowrap;
    }

    .activities-table th:nth-child(2),
    /* Tipas */
    .activities-table td:nth-child(2) {
        min-width: 110px;
    }

    .activities-table th:nth-child(3),
    /* Katilinė */
    .activities-table td:nth-child(3) {
        min-width: 100px;
    }

    .activities-table th:nth-child(4),
    /* Kuro rūšis */
    .activities-table td:nth-child(4) {
        min-width: 95px;
    }

    .activities-table th:nth-child(5),
    /* Kiekis */
    .activities-table td:nth-child(5) {
        min-width: 70px;
        white-space: nowrap;
    }

    .activities-table th:nth-child(6),
    /* Detalės */
    .activities-table td:nth-child(6) {
        min-width: 45px;
        white-space: nowrap;
    }

    /* Stack activity type badges vertically if needed */
    .activity-type {
        font-size: 10px;
        padding: 3px 6px;
        display: inline-block;
        white-space: nowrap;
    }

    /* Better touch targets for action buttons */
    .activities-table .btn-sm {
        min-width: 32px;
        min-height: 32px;
        padding: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .activities-table .btn-sm i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-filters {
        padding: 0.5rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }

    .filters-row {
        gap: 0.4rem;
    }

    .filters-row .form-group {
        margin-bottom: 0.4rem;
    }

    .filters-row .form-group:last-child {
        margin-bottom: 0;
    }

    .filters-row .form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    .filters-row .form-group select,
    .filters-row .form-group input {
        font-size: 14px;
        /* Prevent zoom on iOS */
        padding: 0.4rem;
        min-height: 32px;
    }

    .filters-row .form-group:last-child .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .modal-content-body {
        padding: 0 0.5rem;
    }

    .modal-content-body .table-container {
        overflow-y: visible;
        /* Let modal handle vertical scrolling */
        max-height: none;
        /* Remove height restriction */
    }

    .activities-table {
        font-size: 10px;
        width: auto;
        /* Allow table to be wider than viewport */
        min-width: 100%;
        /* At least full width */
        table-layout: auto;
        /* Auto layout for content-based sizing */
        border-collapse: collapse;
    }

    .activities-table thead {
        width: 100%;
    }

    .activities-table tbody {
        width: 100%;
    }

    .activities-table tr {
        width: 100%;
    }

    .activities-table th,
    .activities-table td {
        padding: 8px 5px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 10px;
        vertical-align: middle;
        line-height: 1.3;
    }

    /* Better text alignment for very small screens */
    .activities-table th:nth-child(1),
    .activities-table td:nth-child(1) {
        text-align: center;
    }

    .activities-table th:nth-child(2),
    .activities-table td:nth-child(2) {
        text-align: left;
        padding-left: 3px;
    }

    .activities-table th:nth-child(3),
    .activities-table td:nth-child(3) {
        text-align: left;
    }

    .activities-table th:nth-child(4),
    .activities-table td:nth-child(4) {
        text-align: left;
    }

    .activities-table th:nth-child(5),
    .activities-table td:nth-child(5) {
        text-align: right;
        padding-right: 6px;
    }

    .activities-table th:nth-child(6),
    .activities-table td:nth-child(6) {
        text-align: center;
    }

    /* Adjust column widths for very small screens */
    .activities-table th:nth-child(1),
    .activities-table td:nth-child(1) {
        min-width: 75px;
        white-space: nowrap;
    }

    .activities-table th:nth-child(2),
    .activities-table td:nth-child(2) {
        min-width: 100px;
    }

    .activities-table th:nth-child(3),
    .activities-table td:nth-child(3) {
        min-width: 90px;
    }

    .activities-table th:nth-child(4),
    .activities-table td:nth-child(4) {
        min-width: 85px;
    }

    .activities-table th:nth-child(5),
    .activities-table td:nth-child(5) {
        min-width: 60px;
        white-space: nowrap;
    }

    .activities-table th:nth-child(6),
    .activities-table td:nth-child(6) {
        min-width: 40px;
        white-space: nowrap;
    }

    .activity-type {
        font-size: 9px;
        padding: 2px 5px;
        white-space: nowrap;
    }

    /* Additional mobile optimizations for activities modal */
    .large-modal {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .large-modal .modal-content {
        height: auto;
        /* Let content determine height */
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        border-radius: 0;
        overflow-y: visible;
        /* Modal wrapper handles scrolling */
    }

    .large-modal .modal-header {
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
        flex-shrink: 0;
    }

    .large-modal .modal-content-body {
        flex: 1;
        overflow-y: visible;
        /* Allow content to expand */
        display: flex;
        flex-direction: column;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .large-modal .table-container {
        overflow-x: auto;
        /* Only horizontal scroll */
        overflow-y: visible;
        /* Vertical scroll handled by modal */
        margin-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure pagination is visible on mobile */
    .pagination-container {
        flex-shrink: 0;
        padding: 0.75rem 0.5rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        background: #f8f9fa;
        border-top: 1px solid #dee2e6;
    }

    /* Adjust card header on very small screens */
    .card-header h3 {
        font-size: 1rem;
    }

    .card-header-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .card-header-actions .btn i {
        font-size: 0.85rem;
    }
}

/* Reports Section Styles */
.reports-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.report-menu-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.report-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.report-menu-item:hover::before {
    opacity: 0.05;
}

.report-menu-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.report-menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.report-menu-item[data-report="heat-energy"] .report-menu-icon {
    background: #007bff;
}

.report-menu-item[data-report="fuel-consumption"] .report-menu-icon {
    background: #28a745;
}

.report-menu-item[data-report="fuel-stock-writeoff"] .report-menu-icon {
    background: #e67e22;
}

.report-menu-item[data-report="fuel-consumption-monthly"] .report-menu-icon {
    background: #17a2b8;
}

.report-menu-item[data-report="heat-meter-consumption"] .report-menu-icon {
    background: #9b59b6;
}

.report-menu-content {
    flex: 1;
    z-index: 1;
    position: relative;
}

.report-menu-content h3 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}



.report-menu-arrow {
    color: #cbd5e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.report-menu-item:hover .report-menu-arrow {
    color: #007bff;
    transform: translateX(4px);
}

/* Report Content Styles */
.report-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.report-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.report-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.back-to-reports {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-reports:hover {
    border-color: #cbd5e0;
    background: #f8fafc;
    color: #475569;
}

/* Report Filters */
.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Narrower filter for fuel stock write-off report */
#fuel-stock-writeoff-report .report-filters {
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 1rem;
}

#fuel-stock-writeoff-report .filter-group {
    min-width: 200px;
    max-width: 250px;
}

/* Fuel Consumption Monthly Report Styles */
.fuel-consumption-report {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.fuel-consumption-report .report-header {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 1.5rem 2rem;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}

.fuel-consumption-report .report-header h3 {
    color: inherit;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.fuel-consumption-report .report-header i {
    color: #6c757d;
    margin-right: 0.5rem;
}

/* Fuel Consumption Summary Cards */
.fuel-consumption-summary {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

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

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.summary-card .summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
    background: #6c757d;
}

.summary-card .summary-content {
    flex: 1;
}

.summary-card .summary-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.summary-card .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    line-height: 1.2;
}

/* Fuel Consumption Report Button */
#fuel-consumption-monthly-report .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

#fuel-consumption-monthly-report .btn-success {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Fuel Consumption Table */
.fuel-consumption-table {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fuel-consumption-table .data-table {
    margin: 0;
    border-radius: 0;
    border: none;
    min-width: 800px;
}

.fuel-consumption-table .data-table thead {
    background: #f8fafc;
}

.fuel-consumption-table .data-table thead th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.fuel-consumption-table .data-table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
}

.fuel-consumption-table .data-table tbody tr:hover {
    background: #f8fafc;
}

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

.fuel-consumption-table .number-cell {
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

/* Responsive Design for Fuel Consumption Report */
@media (max-width: 768px) {
    .fuel-consumption-report .report-header {
        padding: 1rem 1.5rem;
    }

    .fuel-consumption-report .report-header h3 {
        font-size: 1.25rem;
    }

    .fuel-consumption-summary {
        padding: 1rem 1.5rem;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-card .summary-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .summary-card .summary-value {
        font-size: 1.25rem;
    }

    .fuel-consumption-table .data-table thead th,
    .fuel-consumption-table .data-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .fuel-consumption-table .data-table {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .fuel-consumption-report .report-header {
        padding: 0.75rem 1rem;
    }

    .fuel-consumption-summary {
        padding: 0.75rem 1rem;
    }

    .summary-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .summary-card .summary-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .summary-card .summary-value {
        font-size: 1.1rem;
    }

    .fuel-consumption-table .data-table thead th,
    .fuel-consumption-table .data-table tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Heat Meter Consumption Report Styles */
#heat-meter-consumption-report .report-filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

#heat-meter-consumption-report .filter-group {
    flex: 0 0 auto;
    min-width: 200px;
}

.heat-meter-consumption-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.heat-meter-consumption-table-wrapper .data-table {
    margin: 0;
    border-radius: 0;
    border: none;
    min-width: 800px;
}

.heat-meter-consumption-table-wrapper .data-table thead {
    background: #f8fafc;
}

.heat-meter-consumption-table-wrapper .data-table thead th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.heat-meter-consumption-table-wrapper .data-table tbody td {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
}

.heat-meter-consumption-table-wrapper .data-table tbody tr:hover {
    background: #f8fafc;
}

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

.heat-meter-consumption-table-wrapper .number-cell {
    text-align: right;
    font-weight: 500;
    color: #2c3e50;
}

/* Heat Meter Reading Input Styles */
.heat-meter-reading-input {
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.heat-meter-reading-input:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.heat-meter-reading-input::placeholder {
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
}

.consumption-cell {
    font-weight: 600;
    color: #16a34a;
    font-family: 'Courier New', monospace;
}

/* Saved reading value styling (matches NUO column) */
.saved-reading-value {
    font-weight: 500;
    color: #2c3e50;
}

/* Heat Meter Consumption Report Actions */
#heat-meter-consumption-report .report-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
}

#heat-meter-consumption-report .btn-success {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #374151;
    font-weight: 600;
}

#heat-meter-consumption-report .btn-success:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Design for Heat Meter Consumption Report */
@media (max-width: 768px) {
    #heat-meter-consumption-report .report-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    #heat-meter-consumption-report .filter-group {
        min-width: 100%;
        width: 100%;
    }

    #heat-meter-consumption-report .filter-group .btn {
        width: 100%;
    }

    .heat-meter-consumption-table-wrapper .data-table thead th,
    .heat-meter-consumption-table-wrapper .data-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .heat-meter-reading-input {
        min-width: 100px;
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    #heat-meter-consumption-report .report-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    #heat-meter-consumption-report .report-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .heat-meter-consumption-table-wrapper .data-table thead th,
    .heat-meter-consumption-table-wrapper .data-table tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .heat-meter-reading-input {
        min-width: 90px;
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.filter-group .form-control {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-group .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#generateHeatReport,
#generateFuelReport,
#generateFuelConsumptionReport,
#exportHeatReport {
    align-self: end;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#exportHeatReport,
#exportFuelReport,
#exportFuelConsumptionReport {
    margin-left: 0.75rem;
}



/* Report Results */
.report-results {
    min-height: 200px;
}

.report-loading,
.report-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    color: #64748b;
}

.report-loading i {
    font-size: 2rem;
    color: #667eea;
}

.report-error i {
    font-size: 2rem;
    color: #ef4444;
}

.report-loading span,
.report-error span {
    font-size: 1.1rem;
    font-weight: 500;
}

.report-data {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Report Summary and Details */
.report-summary {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.report-summary h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.summary-stat .stat-label {
    font-weight: 500;
    color: #64748b;
}

.summary-stat .stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Fuel Type Summary */
.fuel-type-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.fuel-type-summary h5 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.fuel-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.fuel-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.fuel-type-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.fuel-type-item .fuel-type-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.fuel-type-item .fuel-type-amount {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

/* Fuel type text list styling */
.fuel-type-text-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fuel-type-text-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.fuel-type-text-item:last-child {
    border-bottom: none;
}

.fuel-type-text-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.fuel-type-text-amount {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.report-details {
    padding: 1.5rem;
}

.report-details h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.report-details h4:not(:first-child) {
    margin-top: 2rem;
}

.boiler-consumption-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.boiler-consumption-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.boiler-consumption-item .boiler-name {
    font-weight: 500;
    color: #2c3e50;
}

.boiler-consumption-item .boiler-consumption {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    color: #64748b;
}

.no-data-message i {
    font-size: 2rem;
    color: #94a3b8;
}

.no-data-message p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive Design for Reports */
@media (max-width: 768px) {
    .reports-menu {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .fuel-type-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .fuel-type-item {
        padding: 0.5rem;
    }

    .fuel-type-item .fuel-type-name {
        font-size: 0.85rem;
    }

    .fuel-type-item .fuel-type-amount {
        font-size: 0.9rem;
    }

    .fuel-type-text-name {
        font-size: 0.85rem;
    }

    .fuel-type-text-amount {
        font-size: 0.85rem;
    }

    .report-menu-item {
        padding: 1.5rem;
        gap: 1rem;
    }

    .report-menu-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .report-menu-content h3 {
        font-size: 1.1rem;
    }

    .report-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    /* Specific mobile styling for fuel stock write-off report */
    #fuel-stock-writeoff-report .report-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    #fuel-stock-writeoff-report .filter-group {
        min-width: unset;
        max-width: unset;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .report-header h3 {
        font-size: 1.25rem;
    }

    /* Mobile styling for stock list table */
    .stock-list-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stock-list-row {
        display: grid;
        grid-template-columns: 1.5fr 1.5fr 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9ecef;
        min-width: 500px;
        font-size: 0.8rem;
    }

    .stock-list-row.header {
        background: #f8f9fa;
        font-weight: 600;
        font-size: 0.75rem;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stock-list-row.boiler-separator {
        border-top: 2px solid #007bff;
        margin-top: 0.5rem;
    }

    .stock-list-row.primary {
        background: #fff3cd;
    }

    .boiler-name {
        font-weight: 500;
        color: #495057;
        font-size: 0.8rem;
    }

    .fuel-type {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        color: #495057;
    }

    .stock-amount {
        font-weight: 600;
        color: #28a745;
        font-size: 0.8rem;
        text-align: right;
    }

    .last-updated {
        font-size: 0.75rem;
        color: #6c757d;
        text-align: right;
    }

    .primary-badge {
        background: #ffc107;
        color: #212529;
        padding: 0.1rem 0.3rem;
        border-radius: 3px;
        font-size: 0.6rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Mobile styling for report actions */
    .report-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

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

    /* Mobile responsive styling for all report tables */
    .report-data .table-container {
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .report-data .data-table {
        min-width: 600px;
        font-size: 0.8rem;
    }

    .report-data .data-table th,
    .report-data .data-table td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
    }

    .report-data .data-table th {
        font-size: 0.75rem;
        font-weight: 600;
    }

    .report-data .data-table td {
        font-size: 0.75rem;
    }

    /* Mobile responsive styling for report summaries */
    .report-summary {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .report-summary h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .summary-stats {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .summary-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
    }

    .summary-stat .stat-label {
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
    }

    .summary-stat .stat-value {
        font-size: 0.9rem;
        font-weight: 600;
        color: #2c3e50;
    }

    /* Mobile responsive styling for fuel type summaries */
    .fuel-type-summary {
        margin-top: 1rem;
    }

    .fuel-type-summary h5 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        color: #495057;
    }

    .fuel-type-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .fuel-type-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 6px;
    }

    .fuel-type-item .fuel-type-name {
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
    }

    .fuel-type-item .fuel-type-amount {
        font-size: 0.85rem;
        font-weight: 600;
        color: #2c3e50;
    }

    /* Mobile responsive styling for boiler consumption summary */
    .boiler-consumption-summary {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .boiler-consumption-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        background: #f8f9fa;
        border-radius: 6px;
        border: 1px solid #e9ecef;
    }

    .boiler-consumption-item .boiler-name {
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
    }

    .boiler-consumption-item .boiler-consumption {
        font-size: 0.85rem;
        font-weight: 600;
        color: #2c3e50;
    }

    /* Mobile responsive styling for report details sections */
    .report-details {
        margin-top: 1.5rem;
    }

    .report-details h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        color: #495057;
        padding: 0 1rem;
    }

    .report-details .table-container {
        margin-bottom: 1.5rem;
    }

    /* Mobile responsive styling for fuel stock write-off report */
    .fuel-stock-list {
        margin: 0 -1rem;
        background: white;
        border-radius: 0;
    }

    .stock-list-header {
        padding: 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }

    /* Mobile responsive styling for fuel consumption monthly report */
    .fuel-consumption-report {
        margin: 0 -1rem;
        border-radius: 0;
    }

    .fuel-consumption-report .report-header {
        padding: 1rem;
        margin: 0;
    }

    .fuel-consumption-summary {
        padding: 1rem;
    }

    .fuel-consumption-table {
        margin: 0 -1rem;
    }

    .fuel-consumption-table .data-table {
        font-size: 0.8rem;
        min-width: 600px;
    }

    .fuel-consumption-table .data-table thead th,
    .fuel-consumption-table .data-table tbody td {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    /* Mobile button styling for fuel consumption report */
    #fuel-consumption-monthly-report .btn-primary,
    #fuel-consumption-monthly-report .btn-success {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }

    .stock-list-header h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #495057;
    }

    .stock-list-header p {
        font-size: 0.85rem;
        color: #6c757d;
        margin: 0;
    }

    .stock-list-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stock-list-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9ecef;
        min-width: 600px;
    }

    .stock-list-row.header {
        background: #f8f9fa;
        font-weight: 600;
        font-size: 0.8rem;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stock-list-row.boiler-separator {
        border-top: 2px solid #007bff;
        margin-top: 0.5rem;
    }

    .stock-list-row.primary {
        background: #fff3cd;
    }

    .boiler-name {
        font-weight: 500;
        color: #495057;
    }

    .fuel-type {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.85rem;
        color: #495057;
    }

    .fuel-type i {
        font-size: 0.7rem;
    }

    .primary-badge {
        background: #007bff;
        color: white;
        padding: 0.125rem 0.375rem;
        border-radius: 12px;
        font-size: 0.65rem;
        font-weight: 500;
        margin-left: 0.25rem;
    }

    .stock-amount {
        text-align: right;
        font-weight: 600;
        color: #2c3e50;
    }

    .last-updated {
        font-size: 0.8rem;
        color: #6c757d;
        text-align: right;
    }

    /* Mobile responsive styling for report action buttons */
    .report-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        margin-top: 1rem;
    }

    .report-actions .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .report-actions .btn i {
        font-size: 0.9rem;
    }

    /* Ensure all report tables are scrollable on mobile */
    .report-data .table-container {
        position: relative;
    }
}

/* Portrait tablet and mobile styles */
@media (min-width: 769px) and (max-width: 835px) {
    .sidebar.mobile-open~.main-content .mobile-toggle {
        display: none;
    }

    .content-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
    }

    .mobile-toggle {
        display: block;
        position: static;
        /* Let flexbox handle positioning */
        transform: none;
        background: #ffffff;
        color: #6c757d;
        border: 1px solid #e9ecef;
        padding: 0.5rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 1.1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .mobile-toggle:hover {
        background: #f8f9fa;
        border-color: #dee2e6;
        color: #495057;
    }

    .content-header h1 {
        margin: 0;
    }
}

/* Landscape tablet responsive styles - 835px to 1200px */
@media (min-width: 835px) and (max-width: 1200px) {
    .reports-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .report-data .data-table {
        min-width: 800px;
        font-size: 0.85rem;
    }

    .report-data .data-table th,
    .report-data .data-table td {
        padding: 0.6rem 0.5rem;
    }

    .summary-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .fuel-type-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Responsive styling for report action buttons */
    .report-actions {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        margin-top: 1rem;
        justify-content: center;
    }

    .report-actions .btn {
        flex: 1;
        max-width: 200px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .report-actions .btn i {
        font-size: 0.9rem;
    }

    /* Responsive styling for report tables */
    .report-data .table-container {
        margin: 0 -0.5rem;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Additional mobile styling for very small screens */
@media (max-width: 480px) {
    .report-filters {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .filter-group .form-control {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    .report-header h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .stock-list-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .stock-list-header h3 {
        font-size: 1rem;
    }

    .stock-list-header p {
        font-size: 0.8rem;
    }

    .stock-list-row {
        padding: 0.75rem;
    }

    .boiler-consumption-card {
        margin-bottom: 1rem;
    }

    .boiler-header {
        padding: 0.75rem 1rem;
    }

    .boiler-header h4 {
        font-size: 1rem;
    }

    .fuel-types-container {
        padding: 0.75rem 1rem;
    }

    .fuel-type-row {
        padding: 0.5rem 0;
    }

    .fuel-type-name {
        font-size: 0.9rem;
    }

    .fuel-current-stock {
        font-size: 0.8rem;
    }

    .writeoff-input {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Extra small screen adjustments for report tables */
    .report-data .data-table {
        min-width: 500px;
        font-size: 0.7rem;
    }

    .report-data .data-table th,
    .report-data .data-table td {
        padding: 0.375rem 0.25rem;
    }

    .report-data .data-table th {
        font-size: 0.7rem;
    }

    .report-data .data-table td {
        font-size: 0.7rem;
    }

    /* Extra small screen adjustments for report summaries */
    .report-summary {
        padding: 0.75rem;
    }

    .report-summary h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .summary-stat {
        padding: 0.5rem;
    }

    .summary-stat .stat-label {
        font-size: 0.8rem;
    }

    .summary-stat .stat-value {
        font-size: 0.85rem;
    }

    /* Extra small screen adjustments for fuel type items */
    .fuel-type-item {
        padding: 0.5rem;
    }

    .fuel-type-item .fuel-type-name {
        font-size: 0.8rem;
    }

    .fuel-type-item .fuel-type-amount {
        font-size: 0.8rem;
    }

    .fuel-type-text-name {
        font-size: 0.8rem;
    }

    .fuel-type-text-amount {
        font-size: 0.8rem;
    }

    /* Extra small screen adjustments for boiler consumption items */
    .boiler-consumption-item {
        padding: 0.375rem 0.5rem;
    }

    .boiler-consumption-item .boiler-name {
        font-size: 0.8rem;
    }

    .boiler-consumption-item .boiler-consumption {
        font-size: 0.8rem;
    }
}

/* Write-off modal list */
#writeoffBoilersList {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Boiler consumption card */
.boiler-consumption-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.boiler-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.boiler-header h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boiler-header h4 i {
    color: #e67e22;
}

.boiler-location {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.fuel-types-container {
    padding: 1rem 1.5rem;
}

.fuel-type-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.fuel-type-row:last-child {
    border-bottom: none;
}

.fuel-type-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fuel-type-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.fuel-current-stock {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.fuel-consumption-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fuel-consumption-input label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.writeoff-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.writeoff-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Responsive design for modal */
@media (max-width: 768px) {
    .fuel-type-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .boiler-header {
        padding: 0.75rem 1rem;
    }

    .fuel-types-container {
        padding: 0.75rem 1rem;
    }
}

/* Fuel stock write-off report styles */
.fuel-stock-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    margin-top: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Custom scrollbar styling for fuel stock list in reports */
.fuel-stock-list::-webkit-scrollbar {
    width: 6px;
}

.fuel-stock-list::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.fuel-stock-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.fuel-stock-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.stock-list-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stock-list-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-list-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.stock-list-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Fuel Consumptions Section Styles */
.fuel-consumptions-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.fuel-consumptions-section .section-header {
    margin-bottom: 1.5rem;
}

.fuel-consumptions-section .section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Scrollable table wrapper */
.fuel-consumptions-table-wrapper {
    max-height: 600px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Custom scrollbar for the table */
.fuel-consumptions-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fuel-consumptions-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.fuel-consumptions-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.fuel-consumptions-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.fuel-consumptions-section .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 800px;
    /* Ensure horizontal scroll on small screens */
}

.fuel-consumptions-section .data-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fuel-consumptions-section .data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.fuel-consumptions-section .data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.fuel-consumptions-section .data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.fuel-consumptions-section .text-center {
    text-align: center;
}

.fuel-consumptions-section .error-text {
    color: #dc3545;
}

/* Pagination container styling */
.fuel-consumptions-section .pagination-container {
    margin-top: 1rem;
}

.fuel-consumptions-section .pagination-container .pagination-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fuel-consumptions-section .pagination-container .pagination-size label {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
    white-space: nowrap;
}

.fuel-consumptions-section .pagination-container .pagination-size select {
    width: auto;
    min-width: 80px;
}

/* Readonly input styling */
.readonly-input {
    background-color: #e9ecef !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Grey button styles for consumption actions */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-sm i {
    font-size: 0.875rem;
}

.btn-sm.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-sm.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Fuel stock list in overview card */
.overview-card-stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
}

.stock-item-primary {
    background: linear-gradient(135deg, #fff7e6 0%, #fff3d9 100%);
    border-left: 3px solid #ffc107;
}

.stock-item-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-item-icon {
    color: #6c757d;
    font-size: 0.75rem;
}

.stock-item-primary .stock-item-icon {
    color: #ffc107;
}

.stock-item-name {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
}

.stock-item-amount {
    font-size: 0.875rem;
    color: #212529;
    font-weight: 600;
}

.stock-item-loading,
.stock-item-empty,
.stock-item-error {
    padding: 0.5rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

.stock-item-error {
    color: #dc3545;
}

/* Make the stock card wider to accommodate list */
.boiler-overview-stock-card {
    grid-column: span 2;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fuel-consumptions-section {
        padding: 1rem;
        margin: 0 -0.5rem;
    }

    .fuel-consumptions-table-wrapper {
        max-height: 400px;
    }

    .fuel-consumptions-section .data-table {
        font-size: 0.85rem;
    }

    .fuel-consumptions-section .data-table th,
    .fuel-consumptions-section .data-table td {
        padding: 0.5rem;
    }

    /* Stock card takes full width on mobile */
    .boiler-overview-stock-card {
        grid-column: span 1;
    }

    .stock-item-name {
        font-size: 0.8rem;
    }

    .stock-item-amount {
        font-size: 0.8rem;
    }
}

.stock-list-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid #dee2e6;
    align-items: center;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    position: relative;
}

.stock-list-row:nth-child(even) {
    background-color: #f8f9fa;
}

.stock-list-row:nth-child(odd) {
    background-color: white;
}

/* Add visual separation between different boilers */
.stock-list-row.boiler-separator {
    border-top: 3px solid #e9ecef;
    margin-top: 0;
    background-color: #f8f9fa !important;
}

.stock-list-row.boiler-separator:first-child {
    border-top: none;
    margin-top: 0;
}

.stock-list-row:hover {
    background-color: #e3f2fd !important;
}

.stock-list-row.primary {
    border-left: 4px solid #1e7ee7;
}

.stock-list-row.header {
    background-color: #f8f9fa !important;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 0.4rem 1rem;
    text-align: center;
}

.stock-list-row.header:hover {
    background-color: #f8f9fa !important;
}

/* Consistent styling for all header column names */
.stock-list-row.header .boiler-name,
.stock-list-row.header .fuel-type,
.stock-list-row.header .stock-amount,
.stock-list-row.header .last-updated {
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    transition: none;
    cursor: default;
}

/* Override specific fuel-type styling for header */
.stock-list-row.header .fuel-type {
    display: block !important;
    align-items: unset !important;
    gap: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    transition: none !important;
    cursor: default !important;
}

/* Prevent hover effects on fuel-type within stock list rows */
.stock-list-row .fuel-type:hover {
    transform: none !important;
    background: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.boiler-name {
    font-weight: 500;
    color: #495057;
    text-align: center;
}

.fuel-type {
    display: block;
    font-weight: 500;
    color: #495057;
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    cursor: default;
}

.fuel-type i {
    color: #e67e22;
    font-size: 0.9rem;
}

.primary-badge {
    background: #e67e22;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

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

.quantity {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.stock-list-row .last-updated {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    display: block;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .stock-list-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .stock-list-row.header {
        display: none;
    }

    /* Only apply labels to stock list table, not fuel type cards */
    .stock-list-row .boiler-name::before {
        content: "Katilinė: ";
        font-weight: 600;
        color: #6c757d;
    }

    .stock-list-row .fuel-type::before {
        content: "Kuro tipas: ";
        font-weight: 600;
        color: #6c757d;
    }

    .stock-list-row .stock-amount::before {
        content: "Likutis: ";
        font-weight: 600;
        color: #6c757d;
    }

    .stock-list-row .last-updated::before {
        content: "Atnaujinta: ";
        font-weight: 600;
        color: #6c757d;
    }

    /* Mobile styling for fuel type detailed cards */
    .fuel-type-detailed-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .fuel-type-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .fuel-current-stock {
        font-size: 1rem;
        align-self: flex-end;
    }

    .fuel-level-mini-bar {
        height: 12px;
        margin-bottom: 0.75rem;
    }

    .fuel-level-mini-text {
        font-size: 0.65rem;
    }

    .fuel-statistics {
        flex-direction: column;
        gap: 0.5rem;
    }

    .fuel-stat-item {
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.5rem;
    }

    .fuel-stat-item:last-child {
        margin-bottom: 0;
    }

    .fuel-stat-label {
        font-size: 0.85rem;
    }

    .fuel-stat-value {
        font-size: 0.9rem;
    }
}

/* Additional mobile styling for very small screens */
@media (max-width: 480px) {
    .fuel-type-detailed-card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .fuel-type-header {
        margin-bottom: 0.5rem;
    }

    .fuel-current-stock {
        font-size: 0.9rem;
    }

    .fuel-level-mini-bar {
        height: 10px;
        margin-bottom: 0.5rem;
    }

    .fuel-level-mini-text {
        font-size: 0.6rem;
    }

    .fuel-stat-item {
        padding: 0.5rem 0.6rem;
        margin-bottom: 0.375rem;
    }

    .fuel-stat-item:last-child {
        margin-bottom: 0;
    }

    .fuel-stat-label {
        font-size: 0.8rem;
    }

    .fuel-stat-value {
        font-size: 0.85rem;
    }
}

#generateFuelConsumptionReport {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .fuel-consumption-report .report-header {
        padding: 1rem 1.5rem;
    }

    #generateFuelConsumptionReport {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .fuel-consumption-report .report-header {
        padding: 0.75rem 1rem;
    }
}

/* Documents Section Styles */
.documents-container {
    padding: 2rem;
}

/* Loading and empty states */
.documents-loading,
.no-documents-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.documents-loading i,
.no-documents-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #007bff;
}

.no-documents-message h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Boiler documents container */
.boiler-documents-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.boiler-section {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
}

.boiler-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.boiler-header {
    background: #f8f9fa;
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.boiler-header:hover {
    background: #e9ecef;
}

.boiler-info {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
    order: 1 !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
}

.boiler-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    order: 2;
}

.boiler-header i {
    font-size: 1.25rem;
    color: #495057;
}

.boiler-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.boiler-header .boiler-location {
    font-size: 0.9rem;
    color: #6c757d;
}

.boiler-chevron {
    color: #6c757d;
    font-size: 1rem;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.boiler-chevron.collapsed {
    transform: rotate(-90deg);
}

.document-count {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.boiler-documents {
    padding: 1.5rem;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 800px;
    /* Ensure minimum width for proper display */
}

/* Table container with horizontal scroll */
.boiler-documents {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.boiler-documents::-webkit-scrollbar {
    height: 8px;
}

.boiler-documents::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.boiler-documents::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.boiler-documents::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.documents-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
}

.documents-table td {
    padding: 1rem;
    border-bottom: 1px solid #f8f9fa;
    vertical-align: middle;
}

.documents-table tbody tr {
    transition: all 0.3s ease;
}

.documents-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* Document row styling */
.document-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.document-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.document-icon.pdf {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.document-icon.excel {
    background: linear-gradient(135deg, #28a745, #218838);
}

.document-icon.image {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.document-icon.other {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.document-category {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.document-size {
    color: #6c757d;
    font-size: 0.8rem;
}

.document-date {
    color: #6c757d;
    font-size: 0.8rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.document-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.document-actions .btn:hover {
    transform: translateY(-1px);
}

.btn-view {
    background: linear-gradient(135deg, #1e7ee7, #1565c0);
    color: white;
    border: none;
    font-weight: 500;
}

.btn-view:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    box-shadow: 0 2px 8px rgba(30, 126, 231, 0.3);
    transform: translateY(-1px);
}

.btn-download {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    font-weight: 500;
}

.btn-download:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    font-weight: 500;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px);
}

/* Document viewer modal styling */
.document-viewer-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
}

.document-viewer-content {
    display: flex;
    flex-direction: column;
    height: 80vh;
    /* Increased height for more content space */
}

.document-viewer-info {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    /* Reduced padding */
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.document-viewer-info h3 {
    color: #2c3e50;
    font-size: 1rem;
    /* Reduced font size */
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    /* Reduced margin */
}

.document-viewer-info p {
    color: #6c757d;
    margin: 0.1rem 0;
    /* Reduced margin */
    font-style: italic;
    font-size: 0.8rem;
    /* Reduced font size */
    line-height: 1.3;
}

.document-viewer-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.document-viewer-meta span {
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.document-viewer-container {
    flex: 1;
    padding: 0.5rem;
    /* Reduced padding for more content space */
    background: #ffffff;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#documentViewerContent {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#documentViewerContent img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#documentViewerContent iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.document-viewer-unsupported {
    text-align: center;
    color: #6c757d;
    padding: 3rem;
}

.document-viewer-unsupported i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.document-viewer-actions {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Document modal form styling */
#addDocumentForm {
    padding: 2rem;
}

#addDocumentForm .form-group {
    margin-bottom: 1.5rem;
}

#addDocumentForm .form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

#addDocumentForm .form-group input,
#addDocumentForm .form-group select,
#addDocumentForm .form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background-color: #fff;
}

#addDocumentForm .form-group input:focus,
#addDocumentForm .form-group select:focus,
#addDocumentForm .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#addDocumentForm .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#addDocumentForm .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* File upload styles */
.file-upload-container {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-container:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.file-upload-container.dragover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-display i {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.file-upload-display p {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-weight: 500;
}

.file-upload-display small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Responsive design for documents */
@media (max-width: 768px) {
    .documents-container {
        padding: 1rem;
    }

    .boiler-documents-container {
        gap: 1.5rem;
    }

    .boiler-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .boiler-info {
        order: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        justify-content: flex-start;
    }

    .boiler-toggle {
        order: 2;
        align-self: flex-end;
    }

    .boiler-header .boiler-location {
        margin-left: 0;
        font-size: 0.85rem;
    }

    .boiler-header h3 {
        font-size: 1rem;
    }

    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .document-card {
        padding: 1rem;
    }

    /* Document modal responsive */
    #addDocumentForm {
        padding: 1.5rem;
    }

    #addDocumentForm .form-group {
        margin-bottom: 1.25rem;
    }

    #addDocumentForm .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    #addDocumentForm .modal-actions .btn {
        width: 100%;
    }

    /* Documents table responsive */
    .documents-table {
        font-size: 0.9rem;
    }

    .documents-table th,
    .documents-table td {
        padding: 0.75rem 0.5rem;
    }

    .document-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .document-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .documents-container {
        padding: 0.75rem;
    }

    .boiler-documents {
        padding: 1rem;
    }

    .document-card {
        padding: 0.75rem;
    }

    .document-actions {
        flex-direction: column;
    }

    /* Document modal extra small screens */
    #addDocumentForm {
        padding: 1rem;
    }

    #addDocumentForm .form-group {
        margin-bottom: 1rem;
    }

    #addDocumentForm .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    #addDocumentForm .form-group input,
    #addDocumentForm .form-group select,
    #addDocumentForm .form-group textarea {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .file-upload-container {
        padding: 1.5rem;
    }

    .file-upload-display i {
        font-size: 1.5rem;
    }

    .file-upload-display p {
        font-size: 0.9rem;
    }

    .file-upload-display small {
        font-size: 0.75rem;
    }

    /* Document viewer responsive */
    .document-viewer-modal {
        max-width: 95vw;
        max-height: 95vh;
        width: 100%;
    }

    .document-viewer-content {
        height: 60vh;
    }

    .document-viewer-info {
        padding: 1rem;
    }

    .document-viewer-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .document-viewer-container {
        padding: 1rem;
    }

    .document-viewer-actions {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .document-viewer-actions .btn {
        width: 100%;
    }

    /* Documents table mobile responsive */
    .documents-table {
        font-size: 0.8rem;
    }

    .documents-table th,
    .documents-table td {
        padding: 0.5rem 0.25rem;
    }

    .documents-table th:nth-child(3),
    .documents-table th:nth-child(4),
    .documents-table th:nth-child(5) {
        display: none;
    }

    .documents-table td:nth-child(3),
    .documents-table td:nth-child(4),
    .documents-table td:nth-child(5) {
        display: none;
    }

    .document-actions {
        flex-direction: row;
        gap: 0.25rem;
        justify-content: center;
    }

    .document-actions .btn {
        padding: 0.25rem;
        font-size: 0.7rem;
        min-width: 32px;
    }

    .document-actions .btn i {
        margin: 0;
    }
}

/* Delete warning styling */
.delete-warning {
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Delete modal specific styling */
#deleteDocumentModal .modal-content {
    max-width: 500px;
    margin: 2rem auto;
}

#deleteDocumentModal .modal-body {
    padding: 1.5rem;
}

#deleteDocumentModal .modal-body p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

#deleteDocumentModal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

#deleteDocumentModal .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#deleteDocumentModal .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

#deleteDocumentModal .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

#deleteDocumentModal .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

#deleteDocumentModal .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Custom Tooltip Styles */
.custom-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 200px;
    margin-top: 8px;
}

.custom-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.tooltip-content {
    padding: 12px 16px;
}

.tooltip-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #ecf0f1;
}

.tooltip-users {
    font-size: 13px;
    line-height: 1.4;
    color: #bdc3c7;
}

.tooltip-users .user-item {
    margin-bottom: 4px;
    padding: 2px 0;
}

.tooltip-users .user-item:last-child {
    margin-bottom: 0;
}

/* Tooltip arrow */
.custom-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #2c3e50;
}

/* Make the company count clickable and show tooltip on hover */
#companyCount {
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

#companyCount:hover {
    color: #007bff;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 15px;
    visibility: visible;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rows-per-page label {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

.rows-per-page .form-select {
    min-width: 70px;
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.rows-per-page .form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.pagination-stats {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 10px;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
}

.pagination-number:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.pagination-number.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination-number.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #6c757d;
    font-size: 14px;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .pagination-info {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .pagination-controls {
        justify-content: center;
    }

    .pagination-numbers {
        margin: 0 5px;
    }

    .pagination-btn,
    .pagination-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Form validation messages for heat meter reading dates */
.form-validation-message {
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.form-validation-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.form-validation-message.error {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.form-validation-message.success {
    background-color: #d1e7dd;
    border: 1px solid #28a745;
    color: #0f5132;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BOILER HISTORY MODAL STYLES ===== */

/* History Modal Base */
.boiler-history-modal {
    align-items: flex-start;
    padding: 1rem;
    overflow-y: auto;
}

.boiler-history-content {
    width: 100%;
    max-width: 1200px;
    max-height: 95vh;
    overflow-y: auto;
    margin: 0 auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.boiler-history-header {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.boiler-history-title h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.boiler-history-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boiler-history-header .modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.boiler-history-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.boiler-history-body {
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    padding: 0;
}

/* Filter Controls */
.history-filters {
    background: white;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-quick-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-filter {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-filter:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #6c757d;
}

.quick-filter.active {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Tab Navigation */
.history-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #6c757d;
    background: #f8f9fa;
}

.tab-button.active {
    color: #6c757d;
    border-bottom-color: #6c757d;
    background: #f8f9fa;
}

.tab-button i {
    font-size: 1rem;
}

/* Tab Content */
.history-content {
    padding: 2rem;
    min-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Overview Stats */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Timeline Styles */
.history-timeline {
    position: relative;
    padding-left: 2rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #6c757d, #e9ecef);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.timeline-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.75rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #6c757d;
}

.timeline-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.timeline-icon.receipt {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.timeline-icon.transport-in {
    background: linear-gradient(135deg, #5a6268, #495057);
}

.timeline-icon.transport-out {
    background: linear-gradient(135deg, #868e96, #6c757d);
}

.timeline-icon.consumption {
    background: linear-gradient(135deg, #495057, #343a40);
}

.timeline-icon.maintenance {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.timeline-icon.heat-reading {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.timeline-details {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f8f9fa;
}

.timeline-date {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

.timeline-amount {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.timeline-amount.positive {
    background: #d4edda;
    color: #155724;
}

.timeline-amount.negative {
    background: #f8d7da;
    color: #721c24;
}

/* History Sections */
.fuel-history-section,
.heat-history-section,
.maintenance-history-section {
    margin-bottom: 2rem;
}

/* Heat Meter Groups */
.heat-meter-group {
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.heat-meter-group-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.heat-meter-group-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heat-meter-group-header i {
    color: #6c757d;
}

.reading-count {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.heat-meter-timeline {
    padding: 1.5rem;
    position: relative;
}

.heat-meter-timeline::before {
    content: '';
    position: absolute;
    left: 2.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #6c757d, #e9ecef);
}

.heat-meter-timeline .timeline-item {
    padding-left: 1rem;
}

.heat-meter-timeline .timeline-item::before {
    left: -1.25rem;
}

/* Charts Section */
.charts-section {
    margin-bottom: 3rem;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.chart-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-title i {
    color: #6c757d;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-download-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.chart-download-btn:hover {
    background: #495057;
    transform: translateY(-1px);
}

.chart-download-btn i {
    font-size: 0.9rem;
}

.chart-canvas {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

.fuel-history-section h4,
.heat-history-section h4,
.maintenance-history-section h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.fuel-history-section h4 i,
.heat-history-section h4 i,
.maintenance-history-section h4 i {
    color: #6c757d;
}

/* Loading and Empty States */
.history-loading,
.history-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.history-loading .loading-spinner i,
.history-empty .empty-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #6c757d;
}

.empty-message h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.empty-message p {
    color: #6c757d;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .boiler-history-modal {
        padding: 0.5rem;
    }

    .boiler-history-content {
        max-height: 100vh;
        border-radius: 8px;
    }

    .boiler-history-header {
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .boiler-history-header .modal-close {
        align-self: flex-end;
    }

    .history-filters {
        padding: 1rem;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-quick-buttons {
        justify-content: center;
    }

    .quick-filter {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .history-tabs {
        overflow-x: auto;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .history-content {
        padding: 1rem;
    }

    .overview-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .history-timeline {
        padding-left: 1.5rem;
    }

    .history-timeline::before {
        left: 0.75rem;
    }

    .timeline-item {
        padding: 1rem;
    }

    .timeline-item::before {
        left: -2.25rem;
        top: 1rem;
        width: 10px;
        height: 10px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .timeline-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .timeline-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Heat meter groups mobile */
    .heat-meter-group-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .heat-meter-timeline {
        padding: 1rem;
    }

    .heat-meter-timeline::before {
        left: 2rem;
    }

    .heat-meter-timeline .timeline-item::before {
        left: -1rem;
    }

    /* Charts mobile responsive */
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-item {
        padding: 1rem;
    }

    .chart-canvas {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .boiler-history-header {
        padding: 1rem;
    }

    .boiler-history-title h2 {
        font-size: 1.5rem;
    }

    .filter-quick-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .quick-filter {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .tab-button {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .timeline-item {
        padding: 0.75rem;
    }

    .timeline-title {
        font-size: 1rem;
    }

    .timeline-description {
        font-size: 0.9rem;
    }
}

/* Large screen adjustments for history modals - 27" monitors and larger */
@media (min-width: 1600px) {
    .boiler-history-content {
        max-width: 900px;
        max-height: 80vh;
    }

    .boiler-history-header {
        padding: 1.5rem;
    }

    .boiler-history-title h2 {
        font-size: 1.5rem;
    }

    .history-content {
        padding: 1.5rem;
    }

    .chart-canvas {
        height: 300px;
    }
}

/* Limited User View (for role='user') */
.limited-user-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.limited-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.limited-user-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.limited-user-header h2 i {
    color: #6c757d;
}

.limited-transports-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.limited-transports-list .loading-transports {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
    gap: 0.75rem;
}

.limited-transports-list .loading-transports i {
    font-size: 2rem;
}

.limited-transports-list .no-active-transports {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
    gap: 1rem;
}

.limited-transports-list .no-active-transports i {
    font-size: 3rem;
    color: #cbd5e0;
}

.limited-transport-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.limited-transport-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #6c757d;
}

.limited-transport-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f5;
}

.limited-transport-title {
    flex: 1;
}

.limited-transport-fuel {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.limited-transport-route {
    font-size: 0.95rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.limited-transport-route i {
    color: #6c757d;
}

.limited-transport-date {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #495057;
    white-space: nowrap;
}

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

.limited-transport-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.limited-transport-detail-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limited-transport-detail-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
}

.limited-transport-detail-value.weight {
    color: #6c757d;
    font-weight: 600;
}

.limited-transport-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f3f5;
}

.limited-transport-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.limited-transport-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.limited-transport-meta-item i {
    color: #95a5a6;
}

.limited-transport-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.95rem;
}

.limited-transport-action i {
    transition: transform 0.3s ease;
}

.limited-transport-card:hover .limited-transport-action i {
    transform: translateX(4px);
}

/* Limited User Weight Editing Styles */
.limited-weight-edit-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weight-edit-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

.weight-edit-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.weight-edit-form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.weight-input {
    width: 90px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #6c757d;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

.weight-input:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.1);
}

.weight-save-btn,
.weight-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

.weight-save-btn {
    color: #28a745;
}

.weight-save-btn:hover {
    background: #d4edda;
    color: #155724;
}

.weight-cancel-btn {
    color: #dc3545;
}

.weight-cancel-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .limited-user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .limited-user-header h2 {
        font-size: 1.5rem;
    }

    .limited-transport-header {
        flex-direction: column;
        gap: 1rem;
    }

    .limited-transport-date {
        align-self: flex-start;
    }

    .limited-transport-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .limited-transport-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .limited-transport-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .limited-user-view {
        padding: 0.5rem;
    }

    .limited-transport-card {
        padding: 1rem;
    }

    .limited-transport-fuel {
        font-size: 1.1rem;
    }

    .limited-transport-route {
        font-size: 0.85rem;
    }
}

/* Weather Forecast Cards */
.weather-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    padding: 0 30px;
}

.forecast-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.forecast-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Removed special styling for today - all cards now look the same
.forecast-card-today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.forecast-card-today .forecast-day-name,
.forecast-card-today .forecast-day-date,
.forecast-card-today .forecast-condition,
.forecast-card-today .temp-max,
.forecast-card-today .temp-min,
.forecast-card-today .temp-separator,
.forecast-card-today .forecast-detail-item {
    color: white !important;
}
*/

.forecast-day-header {
    width: 100%;
    margin-bottom: 8px;
}

.forecast-day-name {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
}

.forecast-day-date {
    font-size: 10px;
    color: #6c757d;
    margin-top: 1px;
}

.forecast-icon-section {
    margin: 8px 0;
}

.forecast-condition {
    font-size: 10px;
    color: #6c757d;
    margin-top: 4px;
    font-weight: 500;
}

.forecast-temp-section {
    margin: 6px 0;
}

.forecast-temp-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 20px;
    font-weight: 600;
}

.temp-max {
    color: #dc3545;
}

.temp-min {
    color: #6c757d;
}

.temp-separator {
    color: #dee2e6;
    font-weight: 400;
}

.forecast-details {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Removed - no longer needed since today card is same as others
.forecast-card-today .forecast-details {
    border-top-color: rgba(255, 255, 255, 0.3);
}
*/

.forecast-detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: #495057;
}

.forecast-detail-item i {
    font-size: 10px;
    width: 12px;
}

/* Responsive adjustments for forecast cards */
@media (max-width: 768px) {
    .weather-forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
        padding: 0 15px;
    }

    .forecast-card {
        padding: 8px;
    }

    .forecast-icon-section i {
        font-size: 32px !important;
    }

    .forecast-temp-range {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .weather-forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Historical Comparison Toggle Styles */
.historical-comparison-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.comparison-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    user-select: none;
    transition: color 0.3s ease;
}

.comparison-toggle-label:hover {
    color: #2c3e50;
}

/* Hide default checkbox */
.comparison-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Toggle Switch Container */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #dee2e6;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

/* Toggle Slider */
.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* When checkbox is checked */
.comparison-checkbox:checked+.toggle-switch {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.comparison-checkbox:checked+.toggle-switch .toggle-slider {
    transform: translateX(24px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.4);
}

/* Toggle Text */
.toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.toggle-text i {
    color: #6c757d;
    font-size: 16px;
    transition: color 0.3s ease;
}

.comparison-checkbox:checked~.toggle-text i {
    color: #007bff;
}

/* Loading Indicator */
.comparison-loading {
    display: none;
    margin-left: auto;
    color: #007bff;
    font-size: 14px;
}

.comparison-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Hover effect on toggle switch */
.comparison-toggle-label:hover .toggle-switch {
    background: #ced4da;
}

.comparison-toggle-label:hover .comparison-checkbox:checked+.toggle-switch {
    background: linear-gradient(135deg, #0069d9, #0056b3);
}

/* Focus state for accessibility */
.comparison-checkbox:focus+.toggle-switch {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Active/pressed state */
.comparison-toggle-label:active .toggle-slider {
    width: 24px;
}

.comparison-toggle-label:active .comparison-checkbox:checked+.toggle-switch .toggle-slider {
    transform: translateX(22px);
}


/* Global Responsive Layout Fixes */
.section-actions {
    flex-wrap: wrap;
    /* Allow items to wrap if space is tight */
}

/* Prevent components from shrinking too much */
.section-actions .btn,
.section-actions .filters-container,
.section-actions label.btn {
    flex-shrink: 0;
    white-space: nowrap;
    /* Keep text on one line for desktop */
}

.filters-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Allow filters themselves to wrap */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .comparison-toggle-label {
        font-size: 14px;
    }

    .toggle-text {
        font-size: 14px;
    }
}


/* Responsive Styles for Suvestinės (Reports) */
@media (max-width: 768px) {

    /* Layout Adjustments */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-actions button,
    .section-actions .btn,
    .section-actions label.btn,
    .section-actions .file-upload-wrapper,
    .section-actions .filters-container {
        width: 100%;
        margin-left: 0 !important;
        display: flex;
        /* Ensure labels behave like flex containers if needed */
    }

    /* Button Responsiveness */
    .btn {
        width: 100%;
        /* Make all buttons full width on mobile for easier tapping */
        justify-content: center;
        margin-bottom: 0.5rem;
        /* Add spacing between stacked buttons */
        white-space: normal;
        /* Allow text to wrap if too long */
        height: auto;
        /* Allow height to grow with wrapped text */
        padding: 0.75rem;
        /* Ensure generous touch target */
    }

    /* Remove bottom margin from last button in a group to avoid extra space */
    .btn:last-child {
        margin-bottom: 0;
    }

    /* Ensure form actions stack their buttons */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
        margin-left: 0;
    }

    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    /* Table Scrolling */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        box-shadow: none;
        /* Simplify on mobile */
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        /* Prevent wrapping inside cells causing huge rows */
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack cards */
    }

    /* Modals */
    .large-modal {
        width: 98%;
        max-width: 98%;
        margin: 0.5rem auto;
        border-radius: 8px;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        /* Stack charts */
        padding: 1rem !important;
        gap: 1rem !important;
    }

    .chart-wrapper {
        height: 350px !important;
        /* Override hardcoded inline heights */
        padding: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .suvestines-header h2 {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

/* Documentation Page Styles */
.docs-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.docs-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    color: #2c3e50;
}

.docs-title h1 {
    margin: 0;
    font-size: 24px;
}

.upload-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.file-list-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
}

.docs-table th,
.docs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.docs-table th {
    font-weight: 500;
    color: #666;
    background-color: #f9f9f9;
}

.docs-table tr:hover {
    background-color: #f8f9fa;
}

.file-icon {
    color: var(--primary-color, #3498db);
    margin-right: 10px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    font-size: 1.1em;
}

.delete-btn {
    color: #dc3545;
}

.delete-btn:hover {
    color: #bd2130;
}

.download-btn {
    color: var(--primary-color, #3498db);
}

.download-btn:hover {
    color: var(--secondary-color, #2980b9);
}

/* Custom file input style */
.upload-section input[type="file"] {
    display: none;
}

.custom-file-upload {
    border: 1px solid #ccc;
    display: inline-block;
    padding: 8px 16px;
    cursor: pointer;
    background-color: var(--primary-color, #3498db);
    color: white;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 500;
}

.custom-file-upload:hover {
    background-color: var(--secondary-color, #2980b9);
    border-color: var(--secondary-color, #2980b9);
}

.upload-status {
    margin-left: 10px;
    font-size: 0.9em;
}

.status-success {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

.status-loading {
    color: #007bff;
}

/* ========================================================================
   SHELLY DEVICES SECTION STYLES  
   ======================================================================== */

/* Shelly devices grid */
.shelly-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-top: 24px;
}


/* Loading overlay */
.shelly-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.loading-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.loading-content i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 16px;
    display: block;
}

.loading-content p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Error overlay */
.shelly-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.error-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

.error-content i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 16px;
    display: block;
}

.error-content p {
    color: #721c24;
    font-size: 16px;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Device card */
.shelly-device-card {
    background: var(--card-background, #fff);
    border-radius: 16px;
    border: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: visible;
    /* Changed from hidden to allow tooltips to show outside boundaries */
}

.shelly-device-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Device card header */
.device-card-header {
    padding: 20px 24px;
    background: #f8f9fa;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}



.relay-state.has-live-tooltip::after,
.relay-state.has-live-tooltip::before {
    margin-bottom: 5px;
    /* Adjust for relay state toggle height */
}

.device-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-title i {
    font-size: 24px;
    color: #6c757d;
}

.device-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

/* Status badge */
.device-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #e9ecef;
    color: #6c757d;
}

.device-status-badge.online {
    background: #d4edda;
    color: #155724;
}

.device-status-badge.online i {
    color: #28a745;
}

.device-status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

.device-status-badge.offline i {
    color: #dc3545;
}

.device-status-badge i {
    font-size: 10px;
}

/* Device card body */
.device-card-body {
    padding: 24px;
}

.device-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

.device-location i {
    color: #6c757d;
}

/* Device metrics */
.device-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
    background: #e9ecef;
    color: #6c757d;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
    display: inline;
}

.metric-unit {
    font-size: 14px;
    color: var(--text-secondary, #666);
    margin-left: 4px;
    font-weight: 500;
}

/* Relay state */
.relay-state {
    display: flex;
    align-items: center;
    gap: 8px;
}

.state-indicator {
    font-size: 20px;
}

.state-indicator.on {
    color: #28a745;
}

.state-indicator.off {
    color: #6c757d;
}

.state-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    display: none;
    /* Hide text, only show icon */
}

/* Channels grid (for Pro 4 PM) */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.channel-card {
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.channel-card:hover {
    background: #e9ecef;
}

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

.channel-label {
    font-size: 13px;
    color: var(--text-secondary, #666);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-state {
    display: flex;
    align-items: center;
}

.channel-state .state-indicator {
    font-size: 14px;
}

.channel-power {
    display: flex;
    align-items: baseline;
}

.power-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
}

.power-unit {
    font-size: 13px;
    color: var(--text-secondary, #666);
    margin-left: 4px;
    font-weight: 500;
}

/* Device card footer */
.device-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    gap: 8px;
    flex-wrap: wrap;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-updated i {
    font-size: 12px;
    flex-shrink: 0;
}

.device-card-footer .btn {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shelly-devices-grid {
        grid-template-columns: 1fr;
    }

    .device-metrics {
        grid-template-columns: 1fr;
    }

    .channels-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 22px;
    }
}

/* Temperature Sparkline */
.temperature-sparkline-container {
    margin-top: 16px;
    padding: 12px;
    background: transparent;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.sparkline-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#plus1TempSparkline {
    width: 100% !important;
    height: 120px !important;
}

/* Flatpickr Customization - Compact but Flexible */
.flatpickr-calendar {
    font-family: 'Inter', sans-serif !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    /* Increased padding slightly */
    width: auto !important;
    /* Allow natural width */
    max-width: 90vw !important;
    /* Safety for mobile */
    z-index: 99999 !important;
}

.flatpickr-calendar.arrowTop:before,
/* Modern Arrow Styling */
.flatpickr-current-month .numInputWrapper span.arrowUp:after,
.flatpickr-current-month .numInputWrapper span.arrowDown:after,
.flatpickr-time .numInputWrapper span.arrowUp:after,
.flatpickr-time .numInputWrapper span.arrowDown:after {
    border: solid #adb5bd !important;
    border-width: 0 2px 2px 0 !important;
    display: inline-block !important;
    padding: 2px !important;
    content: '' !important;
    top: 35% !important;
    left: 35% !important;
    transition: border-color 0.2s ease !important;
    border-top-color: transparent !important;
    border-left-color: transparent !important;
    border-right-color: #adb5bd !important;
    border-bottom-color: #adb5bd !important;
    transform-origin: center !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

/* Up Arrow (Rotate -135deg) */
.flatpickr-current-month .numInputWrapper span.arrowUp:after,
.flatpickr-time .numInputWrapper span.arrowUp:after {
    transform: rotate(-135deg) !important;
    top: 40% !important;
}

/* Down Arrow (Rotate 45deg) */
.flatpickr-current-month .numInputWrapper span.arrowDown:after,
.flatpickr-time .numInputWrapper span.arrowDown:after {
    transform: rotate(45deg) !important;
    top: 30% !important;
}

/* Hover State */
.flatpickr-current-month .numInputWrapper span.arrowUp:hover:after,
.flatpickr-current-month .numInputWrapper span.arrowDown:hover:after,
.flatpickr-time .numInputWrapper span.arrowUp:hover:after,
.flatpickr-time .numInputWrapper span.arrowDown:hover:after {
    border-color: #3498db !important;
    border-right-color: #3498db !important;
    border-bottom-color: #3498db !important;
}

.flatpickr-month {
    height: 45px !important;
    /* Increased height from 35px */
    margin-bottom: 5px !important;
}

.flatpickr-current-month {
    font-size: 95% !important;
    /* Slightly larger font */
    padding-top: 10px !important;
}

.flatpickr-current-month input.cur-year {
    font-size: inherit !important;
}

.flatpickr-weekday {
    font-size: 11px !important;
    /* Reduced font */
    height: 28px !important;
    /* Increased height */
    line-height: 28px !important;
}

.flatpickr-day {
    height: 36px !important;
    /* Increased day height from 30px */
    line-height: 36px !important;
    font-size: 13px !important;
    /* Slightly larger font */
    border-radius: 6px !important;
    margin-top: 2px !important;
}

.flatpickr-day.selected,
/* ... keep extensive selector list ... */
.flatpickr-day.endRange.nextMonthDay {
    background: #eef2ff !important;
    color: #3498db !important;
    border-color: transparent !important;
    font-weight: 600 !important;
}

/* Today's date */
.flatpickr-day.today {
    border-color: transparent !important;
    background: #f8f9fa !important;
    color: #3498db !important;
}

.flatpickr-day.today:hover,
.flatpickr-day:hover {
    background: #eef2ff !important;
    color: #3498db !important;
}

/* Time picker styling - Compact */
.flatpickr-time {
    border-top: 1px solid #eee !important;
    padding-top: 10px !important;
    /* Increased */
    margin-top: 5px !important;
    max-height: none !important;
    /* Allow natural expansion */
    height: auto !important;
    white-space: nowrap !important;
    /* Prevent wrapping */
}

.flatpickr-time input {
    font-size: 13px !important;
    /* Increased */
    height: auto !important;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-am-pm {
    font-size: 13px !important;
}

/* Responsive Flatpickr for Mobile Devices */
@media screen and (max-width: 480px) {
    .flatpickr-calendar {
        width: 280px !important;
        transform: scale(0.95) !important;
        transform-origin: top center !important;
    }

    .flatpickr-innerContainer,
    .flatpickr-rContainer,
    .flatpickr-days,
    .dayContainer {
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
    }

    .flatpickr-day {
        max-width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        margin: 1px !important;
    }

    .flatpickr-time {
        font-size: 14px !important;
        padding: 5px 0 !important;
    }

    .flatpickr-current-month {
        font-size: 1rem !important;
        padding-top: 5px !important;
    }

    .flatpickr-month {
        height: 40px !important;
    }
}

/* Remote Boilers Styles */
.boilers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.boiler-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.boiler-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.boiler-card.online {
    border-left: 5px solid #28a745;
}

.boiler-card.offline {
    border-left: 5px solid #dc3545;
}

.boiler-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.boiler-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.boiler-icon {
    width: 48px;
    height: 48px;
    background: #f1f3f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: 1.5rem;
}

.boiler-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.boiler-location {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.boiler-status-ind {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.online .status-dot {
    background: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.offline .status-dot {
    background: #dc3545;
}

.boiler-main-stats {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.main-stat .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.main-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #343a40;
}

.main-stat .unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: #868e96;
}

.stat-sub {
    font-size: 0.75rem;
    color: #6c757d;
}

.boiler-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.detail-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 50%;
    color: #495057;
    font-size: 0.9rem;
}

.detail-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #343a40;
}

.boiler-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Helpers */
.text-primary {
    color: #007bff !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #17a2b8 !important;
}

/* Custom Modal Styles for Remote Boilers */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
    display: flex;
    opacity: 1;
}


.custom-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.custom-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.custom-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #dc3545;
}

.custom-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remote Boilers Tabs & Schematic */
.boiler-tabs-container {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.boiler-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.boiler-tab {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #f8f9fa;
    color: #7f8c8d;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.875rem;
}

.boiler-tab:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.boiler-tab.active {
    background: #fff;
    color: #3498db;
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.15);
}

.tab-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.boiler-tab.active .tab-status-dot {
    background: #2ecc71;
    /* Simulate online/active */
}

.last-updated-info {
    font-size: 0.85rem;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boiler-schematic-container {
    background: #F8F9FA;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.schematic-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.boiler-schematic-svg {
    width: 100%;
    height: auto;
    max-height: 80vh;
    font-family: 'Inter', sans-serif;
}

/* Large monitors (27" and above) */
@media (min-width: 1920px) {
    .boiler-schematic-container {
        min-height: 600px;
        padding: 3rem;
    }

    .schematic-wrapper {
        max-width: 1400px;
    }

    .boiler-schematic-svg {
        max-height: 70vh;
    }
}

@media (min-width: 2560px) {
    .boiler-schematic-container {
        min-height: 700px;
        padding: 4rem;
    }

    .schematic-wrapper {
        max-width: 1800px;
    }
}

/* Ensure SVG text is legible */
.boiler-schematic-svg text {
    user-select: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .boiler-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .boiler-tab {
        white-space: nowrap;
    }

    /* Mobile responsive schematic */
    .boiler-schematic-container {
        padding: 0.5rem;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        background: #F8F9FA;
        justify-content: flex-start !important;
        /* Force align to left instead of center */
        align-items: flex-start !important;
        /* Force align to top instead of center */
        height: auto;
        min-height: 350px;
    }

    .schematic-wrapper {
        width: max-content;
    }

    .boiler-schematic-svg {
        min-width: 600px;
        height: auto;
    }
}

/* Remote Boiler Alarms Styling */
#remoteBoilerAlarmsModal {
    align-items: flex-start !important;
    padding-top: 40px;
    padding-bottom: 40px;
}

#remoteBoilerAlarmsModal .modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin: auto;
    /* Ensure horizontal centering */
}

.alarm-tabs {
    border-bottom: 2px solid #f1f3f5 !important;
}

.alarm-tabs .btn-outline {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-weight: 600;
    color: #6c757d;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
}

.alarm-tabs .btn-outline:hover {
    background: transparent;
    color: #007bff;
}

.alarm-tabs .btn-outline.active {
    background: transparent;
    color: #007bff;
    border-bottom-color: #007bff;
}

#manageAlarmsBtn {
    position: relative;
    transition: all 0.3s ease;
}

#manageAlarmsBtn.has-active-alarms {
    color: #e53e3e !important;
    border-color: #e53e3e !important;
    background: rgba(229, 62, 62, 0.05);
    font-weight: 700;
}

.alarm-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 5px rgba(229, 62, 62, 0.3);
    border: 2px solid #fff;
}

.alarm-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alarm-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.1);
}

.rules-list {
    margin-top: 10px;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #e9ecef;
    color: #495057;
}

#alarmRuleForm {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#alarmRuleForm .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

#alarmRuleForm .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

#alarmRuleForm .form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.btn-icon {
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-icon.text-danger:hover {
    background: rgba(229, 62, 62, 0.1);
    color: #c53030;
}

@media (max-width: 768px) {
    #alarmRuleForm .form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Refined Spacing for Remote Boiler Alarms Modal */
#remoteBoilerAlarmsModal .modal-body {
    padding: 1.5rem 2rem;
}

#remoteBoilerAlarmsModal .alarm-tabs {
    margin-bottom: 25px !important;
    padding-bottom: 5px !important;
}

.alarms-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.alarm-item {
    padding: 1.25rem !important;
    margin-bottom: 5px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.rules-list {
    margin-top: 20px;
}

.rules-list .data-table {
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
}

.rules-list .data-table thead th {
    background: transparent;
    border: none;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0 15px 10px 15px;
}

.rules-list .data-table tbody tr {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease;
}

.rules-list .data-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.rules-list .data-table tbody td {
    padding: 15px;
    border: none;
    background: white;
}

.rules-list .data-table tbody td:first-child {
    border-radius: 8px 0 0 8px;
}

.rules-list .data-table tbody td:last-child {
    border-radius: 0 8px 8px 0;
}

#alarmRuleForm {
    margin-top: 25px !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    background: #fdfdfe !important;
    border: 1px solid #eef0f2 !important;
}

#ruleFormTitle {
    margin-bottom: 20px;
    font-weight: 700;
    color: #2d3436;
}

/* Overview Container - ensures vertical stacking */
.overview-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Fuel Efficiency Dashboard */
.efficiency-dashboard-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    width: 100%;
    clear: both;
    display: block;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.dashboard-section-header h2 {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-section-header h2 i {
    color: #3182ce;
}

.refresh-indicator {
    font-size: 0.75rem;
    color: #a0aec0;
    font-style: italic;
}

.fuel-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.fuel-stats-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.fuel-stats-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e0;
}

.fuel-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fuel-stats-header h4 {
    margin: 0;
    font-size: 0.875rem;
    color: #000000;
    font-weight: 600;
}

.fuel-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.fuel-stats-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fuel-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: #000000;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000000;
}

.dashboard-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #718096;
}

@media (max-width: 576px) {
    #remoteBoilerAlarmsModal .modal-body {
        padding: 1rem;
    }

    .alarm-tabs .btn-outline {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Fleet Overview Dashboard Styles */
.overview-container .boiler-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 420px);
    gap: 32px;
    padding: 32px;
    width: 100%;
    justify-content: center;
    align-items: start;
}

.overview-container .boiler-overview-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    width: 420px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.overview-container .boiler-overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    border-color: #3182ce;
}

.overview-container .overview-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 2px solid #f7fafc;
    padding-bottom: 4px;
    margin-bottom: 0px;
    position: relative;
}

.overview-container .overview-card-header>div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

.overview-container .overview-card-header h3 {
    font-size: 1.25rem !important;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
    font-weight: 800;
    flex: 1;
}

.overview-container .overview-card-header h3 i {
    color: #3182ce;
    font-size: 1.15rem;
    margin-right: 10px;
}

.overview-container .overview-card-header .location-text {
    font-size: 0.85rem;
    color: #a0aec0;
    font-weight: 500;
    position: absolute;
    top: 45px;
    right: 0;
}

.overview-container .overview-card-status {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.overview-container .status-normal {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.overview-container .status-warning {
    background: #feebc8;
    color: #744210;
    border: 1px solid #fbd38d;
}

.overview-container .status-danger {
    background: #fed7d7;
    color: #822727;
    border: 1px solid #feb2b2;
}

.overview-container .status-off {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.overview-container .overview-card-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 30px !important;
    margin-bottom: 48px;
    flex: 1;
}

.overview-container .overview-metric {
    display: flex;
    flex-direction: column !important;
    gap: 6px;
}

.overview-container .overview-metric-label {
    font-size: 0.85rem;
    color: #718096;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.overview-container .overview-metric-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2d3748;
    line-height: 1.2;
}

.overview-container .overview-card-footer {
    padding: 16px 0 0 0;
    border-top: 2px solid #f7fafc;
    display: flex;
    justify-content: flex-end;
    font-size: 1rem;
    color: #a0aec0;
    margin-top: auto;
}

@media (max-width: 640px) {
    .overview-container .boiler-overview-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .overview-container .boiler-overview-card {
        width: 100%;
        max-width: 100%;
        min-height: 380px;
    }
}

.overview-container .boiler-overview-card.has-alarm {
    border: 2px solid #e53e3e !important;
    box-shadow: 0 0 15px rgba(229, 62, 62, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.overview-container .boiler-overview-card.has-alarm:hover {
    box-shadow: 0 0 20px rgba(229, 62, 62, 0.25), 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

/* User Settings Page Styles */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* History Loading Styles */
.history-loading {
    padding: 60px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin: 20px 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary, #94a3b8);
    font-size: 1.1rem;
}

.loading-spinner i {
    font-size: 2.5rem;
    color: var(--primary-color, #3498db);
    text-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

/* User Settings Page Styles */
.settings-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.settings-header {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-header-title h1 {
    margin: 0;
    font-size: 1.85rem;
    color: #2c3e50;
    font-weight: 600;
}

.settings-header-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-left: 47px;
}

.settings-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group-title {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.settings-group-title i {
    color: var(--primary-color, #1e7ee7);
}

.settings-form-group {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.settings-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-input-number {
    width: 130px !important;
    padding: 0.75rem !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

.settings-input-number:focus {
    border-color: var(--primary-color, #1e7ee7) !important;
    box-shadow: 0 0 0 3px rgba(30, 126, 231, 0.1) !important;
    outline: none !important;
}

.settings-unit-label {
    color: #718096;
    font-size: 1rem;
    font-weight: 500;
}

.settings-info-text {
    background: #f7fafc;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #cbd5e0;
    margin-bottom: 2rem;
}

.settings-info-text p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

.settings-info-text i {
    color: #718096;
    margin-right: 8px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #edf2f7;
}

@media (max-width: 600px) {
    .settings-container {
        padding: 0 1rem;
        margin-top: 1rem;
    }

    .settings-card {
        padding: 1.5rem;
    }

    .settings-header-title h1 {
        font-size: 1.5rem;
    }

    .settings-header-subtitle {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Global Custom Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1e293b;
    z-index: 10000;
    pointer-events: none;
}

/* Custom Datepicker Styling */
.custom-datepicker {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    padding-right: 2.5rem;
    /* Space for icon */
    font-size: 0.9rem;
    color: #2d3748;
    width: 100%;
    min-width: 200px;
    height: 42px;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-datepicker:hover {
    border-color: #cbd5e0;
}

.custom-datepicker:focus {
    outline: none;
    border-color: #009FDF;
    box-shadow: 0 0 0 3px rgba(0, 159, 223, 0.1);
}

.custom-datepicker::placeholder {
    color: #a0aec0;
}

/* Ensure Flatpickr stays above other elements */
.flatpickr-calendar {
    z-index: 9999 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e2e8f0 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day:focus,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
    color: #fff !important;
}

/* Gas period selector styling to match */
#gas-period-selector {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Schematic Tooltip Targets */
.schematic-value {
    font-family: 'Inter', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: visible !important;
    white-space: nowrap;
    line-height: 1.2;
    /* Hide scrollbars but keep functionality */
    scrollbar-width: none !important;
    /* Firefox */
    -ms-overflow-style: none !important;
    /* IE/Edge */
}

.schematic-value::-webkit-scrollbar {
    display: none !important;
    /* Chrome, Safari, Opera */
}

.schematic-value.align-left {
    justify-content: flex-start;
    padding-left: 10px;
}

.schematic-value.clickable-value {
    cursor: pointer;
}

.schematic-value.clickable-value:hover {
    color: #3498db !important;
}

foreignObject {
    overflow: visible;
}

.boiler-schematic-svg {
    overflow: visible !important;
}

/* Elevate Overview cards on hover to prevent tooltip overlaps */
.boiler-overview-card:hover {
    z-index: 100;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Energy Prices Analysis Styles */
.mini-stat {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-stat .label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-stat .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   AI INSIGHTS & SMART MONITORING STYLES
   ========================================================================== */

.ai-insights-dashboard {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(56, 189, 248, 0.05);
    position: relative;
    overflow: hidden;
    color: #f8fafc;
    animation: aiDashboardFadeIn 0.8s ease-out;
}

.ai-insights-dashboard::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    animation: aiPulse 15s linear infinite;
    pointer-events: none;
}

@keyframes aiPulse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes aiDashboardFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes brainGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.4));
        transform: scale(1);
    }

    to {
        filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
        transform: scale(1.1);
    }
}

.ai-brain-icon {
    font-size: 1.5rem;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    animation: brainGlow 2s ease-in-out infinite alternate;
}


.ai-status-badge {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.ai-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ai-insight-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-insight-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.ai-insight-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-insight-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f8fafc;
}

.ai-insight-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.ai-health-score-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.ai-health-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 1s ease-out;
}

/* Individual Boiler Card AI Enhancements - REFINED */
.boiler-overview-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.boiler-overview-card.ai-optimized {
    border-top: 2px solid #38bdf8;
}

.ai-card-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}

.ai-mini-health {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
}

.ai-mini-health-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 1s ease-in-out;
}

.ai-report-trigger {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-size: 0.75rem;
}

.ai-report-trigger:hover {
    background: #38bdf8;
    color: white;
    transform: scale(1.1);
}

/* AI Toggle Switch */
.ai-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(56, 189, 248, 0.05);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.ai-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #38bdf8;
}

input:focus+.slider {
    box-shadow: 0 0 1px #38bdf8;
}

input:checked+.slider:before {
    transform: translateX(14px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.ai-anomaly-tag {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* AI Modal Styles */
.ai-modal {
    max-width: 600px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #f8fafc;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
}

.ai-modal-header {
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    padding: 20px;
}

.ai-modal-title {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #38bdf8;
}

.ai-modal-title i {
    font-size: 1.5rem;
}

.ai-modal-body {
    padding: 24px;
    line-height: 1.6;
}

.ai-report-section {
    margin-bottom: 20px;
}

.ai-report-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.ai-report-text {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #38bdf8;
    font-size: 0.95rem;
}

.anomaly-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anomaly-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 8px;
}

.anomaly-item i {
    color: #f43f5e;
}

.anomaly-boiler-name {
    font-weight: 700;
    color: #f8fafc;
    margin-right: 5px;
}

.ai-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    display: flex;
    justify-content: flex-end;
}

.ai-show-anomalies-btn {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #f43f5e;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-show-anomalies-btn:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: #f43f5e;
}

.ai-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-recommendation-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px 15px;
    transition: transform 0.2s;
}

.ai-recommendation-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.ai-rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ai-rec-header i {
    color: #38bdf8;
    width: 20px;
    text-align: center;
}

.ai-rec-param {
    font-weight: 600;
    font-size: 0.9rem;
    color: #f1f5f9;
}

.ai-rec-current {
    margin-left: auto;
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.ai-rec-action {
    font-size: 0.85rem;
    color: #cbd5e1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 30px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FOR AI INSIGHTS
   ========================================================================== */

@media (max-width: 768px) {

    /* Dashboard header - stack vertically */
    .dashboard-section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    /* Full-width toggle for easier interaction */
    .ai-toggle-wrapper {
        align-self: stretch;
        justify-content: space-between;
    }

    /* Reduce padding on mobile */
    .ai-insights-dashboard {
        padding: 16px;
    }

    /* Force single column on mobile */
    .ai-insights-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Remove fixed heights */
    .ai-insight-card {
        min-height: auto;
    }
}

/* Boiler Sparkline Graph */
.boiler-sparkline-container {
    height: 160px;
    width: 100%;
    margin-top: 0px;
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    padding-top: 0;
}

/* Overview Alarms Table */
.overview-alarms-section {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.overview-alarms-section .dashboard-section-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    margin-bottom: 0;
}

.overview-alarms-section .dashboard-section-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Alarms Time Filter Controls */
.alarms-time-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.alarms-time-filter .filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.alarms-time-filter label {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.alarms-time-filter label i {
    color: #718096;
}

.alarms-time-filter input[type="text"].alarms-datepicker {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2d3748;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 150px;
}

.alarms-time-filter input[type="text"].alarms-datepicker:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.alarms-time-filter input[type="text"].alarms-datepicker:hover {
    border-color: #cbd5e0;
}

@media (max-width: 768px) {
    .alarms-time-filter {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }

    .alarms-time-filter .filter-group {
        width: auto;
    }

    .alarms-time-filter input[type="text"].alarms-datepicker {
        width: 140px;
    }

    .overview-alarms-section .dashboard-section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
}

.alarms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.alarms-table thead {
    background: #f7f9fc;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.alarms-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.alarms-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #475569;
    font-size: 0.875rem;
}

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

.alarms-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status icon column */
.alarms-table .status-icon-cell {
    width: 40px;
    text-align: center;
}

.alarms-table .status-icon-active {
    color: #f59e0b;
}

.alarms-table .status-icon-resolved {
    color: #10b981;
}

/* Blue pill badges for parameters and boiler names */
.alarm-condition-badge,
.alarm-param-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alarm-value-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.alarms-table .boiler-name-link {
    display: inline-block;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alarms-table .boiler-name-link:hover {
    background: #bfdbfe;
    text-decoration: none;
}

/* Date/time styling */
.alarms-table .datetime-cell {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Action buttons */
.alarms-table .action-cell {
    text-align: center;
}

.alarms-table .action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.alarms-table .action-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Responsive Alarms Table */
@media (max-width: 1024px) {

    .alarms-table th,
    .alarms-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }

    .alarms-table th,
    .alarms-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .alarm-condition-badge {
        padding: 1px 4px;
        font-size: 0.75rem;
    }
}

/* Status Badges */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.status-badge-red {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb7d7;
}

.status-badge-green {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
}

.row-resolved {
    opacity: 0.8;
}

.row-resolved td {
    color: #718096 !important;
}

.row-resolved .alarm-condition-badge {
    background: #f7fafc;
    color: #a0aec0;
    border-color: #edf2f7;
}

.row-resolved .alarm-value-badge {
    color: #a0aec0;
}

/* Horizontal Scrolling for Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .alarms-table {
        min-width: 650px;
        /* Force scrolling on smaller screens */
    }
}

/* Metric Label & Value Tooltips - Moved to bottom for priority */
.has-live-tooltip {
    position: relative;
    cursor: help;
    display: inline-block;
}

.has-live-tooltip[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px);
    display: block !important;
    text-align: center;
    padding: 10px 14px !important;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    border-radius: 10px !important;
    white-space: pre-line !important;
    width: max-content !important;
    max-width: 240px !important;
    box-sizing: border-box !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
    z-index: 99999 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.has-live-tooltip[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px);
    border: 5px solid transparent !important;
    border-top-color: rgba(15, 23, 42, 0.98) !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
    z-index: 99999 !important;
}

.has-live-tooltip[data-tooltip]:hover::after,
.has-live-tooltip[data-tooltip]:hover::before {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}

/* DIGE Sandbox Simulation Styles */
.sandbox-modal-content {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 0 !important;
    overflow: hidden;
}

.sandbox-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sandbox-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.sandbox-body {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .sandbox-body {
        grid-template-columns: 1fr;
    }
}

.sandbox-controls-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sandbox-control-group {
    margin-bottom: 24px;
}

.sandbox-control-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.sandbox-slider-wrapper {
    position: relative;
    padding: 10px 0;
}

.sandbox-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    outline: none;
}

.sandbox-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #38bdf8;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    border: 2px solid white;
}

.sandbox-results-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.simulation-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sim-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sim-metric-label {
    font-size: 0.85rem;
    color: #94a3b8;
}

.sim-metric-values {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-val-current {
    font-size: 0.9rem;
    color: #64748b;
    text-decoration: line-through;
}

.sim-val-predicted {
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
}

.sim-val-predicted.negative {
    color: #f43f5e;
}

.sim-val-predicted.neutral {
    color: #38bdf8;
}

.stability-prediction {
    text-align: center;
    padding: 20px;
}

.stability-gauge-container {
    position: relative;
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.stability-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #f43f5e, #f59e0b, #10b981);
    width: 100%;
    transition: width 0.5s ease-out;
}

.stability-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    display: inline-block;
}

.ai-recommendation-bubble {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #bae6fd;
}

.ai-brain-pulse {
    animation: brainPulse 2s infinite;
}

@keyframes brainPulse {
    0% {
        filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.8));
    }

    100% {
        filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.5));
    }
}

.sandbox-trigger-btn {
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: #38bdf8 !important;
    transition: all 0.2s ease !important;
}

.sandbox-trigger-btn:hover {
    background: #38bdf8 !important;
    color: #0f172a !important;
    transform: scale(1.1);
}

/* ==========================================================================
   SHELLY CONTROL MODAL STYLES
   ========================================================================== */

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.modal-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.modal-tab:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.modal-tab.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

/* Scripts List */
.scripts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.script-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.script-item:hover {
    background: #e9ecef;
}

.script-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.script-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.script-status {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.script-status i {
    font-size: 0.7rem;
}

.script-status.running {
    color: #198754;
}

.script-status.stopped {
    color: #dc3545;
}

/* Script Toggle Switch */
.script-toggle-wrapper {
    display: flex;
    align-items: center;
}

.script-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.script-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.script-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.script-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.script-toggle input:checked+.script-slider {
    background-color: #0d6efd;
}

.script-toggle input:disabled+.script-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.script-toggle input:checked+.script-slider:before {
    transform: translateX(20px);
}

/* KVS Styles */
.kvs-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kvs-key {
    font-family: monospace;
    font-weight: 600;
    color: #d63384;
    background: rgba(214, 51, 132, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.kvs-value {
    font-family: monospace;
    color: #0d6efd;
    word-break: break-all;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-icon-only.btn-edit:hover {
    color: #0d6efd;
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

/* Sync Banner Styles */
.sync-banner {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.sync-banner.success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #c6f6d5;
}

.sync-banner.warning {
    background: #fffaf0;
    color: #9c4221;
    border: 1px solid #feebc8;
}

.sync-banner i {
    font-size: 1.1rem;
}

/* M-Bus / TRB143 Heat Meter Tab Styles — Compact Version */
.mbus-tab-container {
    padding: 0;
    width: 100%;
    align-self: stretch;
}

.mbus-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.mbus-tab-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mbus-tab-title i {
    color: var(--primary-color, #3182ce);
    font-size: 1.2rem;
}

.mbus-tab-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
}

.mbus-tab-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 835px) {
    .mbus-tab-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    .mbus-tab-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mbus-tab-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .mbus-tab-actions .btn .btn-text {
        display: inline;
        /* Ensure text is visible when stacked */
    }
}

/* Remove or override the 380px icon-only logic if it exists */
@media (max-width: 380px) {
    .mbus-tab-actions {
        width: 100% !important;
        justify-content: center !important;
    }

    .mbus-tab-actions .btn {
        width: 100% !important;
        height: auto !important;
    }
}

/* Cards grid */
.mbus-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 380px);
    justify-content: start;
    gap: 1.25rem;
    padding: 0 1.25rem 1.5rem;
    width: 100%;
}

@media (max-width: 600px) {
    .mbus-cards-grid {
        grid-template-columns: 1fr;
        padding: 0 0.75rem 0.75rem;
    }
}

/* Device card */
.mbus-device-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.mbus-device-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.mbus-card-header {
    padding: 0.8rem 1rem 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mbus-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mbus-card-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #1a202c);
}

.mbus-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted, #718096);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mbus-card-actions {
    display: flex;
    gap: 0.25rem;
}

.mbus-card-actions .btn-icon {
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: 0.2s;
}

.mbus-card-actions .btn-icon:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Accounting block — Exact screenshot style */
.mbus-accounting-block {
    padding: 0.4rem 1rem 0.8rem;
    cursor: pointer;
}

.mbus-accounting-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.mbus-metrics-table {
    border: 1px solid #f1f5f9;
    border-radius: 5px;
    background: #fcfdfe;
}

.mbus-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mbus-metric-row:last-child {
    border-bottom: none;
}

.mbus-metric-row:hover {
    background: #f8fafc;
}

.mbus-metric-label {
    font-size: 0.82rem;
    color: #64748b;
}

.mbus-metric-value {
    font-size: 0.88rem;
    color: #334155;
    text-align: right;
}

.mbus-metric-value strong {
    font-weight: 800;
    font-style: italic;
    color: #334155;
}

.mbus-card-footer {
    border-top: 1px solid #f1f5f9;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mbus-last-updated {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-link {
    background: none;
    border: none;
    color: #3182ce;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Modal Styling Refinements */
#mbusDeviceModal .modal-body {
    padding: 1.5rem 2rem 0.5rem;
}

#mbusDeviceModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

#mbusDeviceModal .form-group.full-width {
    grid-column: span 2;
}

#mbusDeviceModal .form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

#mbusDeviceModal .form-group input,
#mbusDeviceModal .form-group select {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#mbusDeviceModal .form-group input:focus {
    border-color: #3182ce;
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

#mbusDeviceModal .modal-footer {
    padding: 1rem 2rem 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-top: 1px solid #edf2f7;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.mbus-history-chart-container {
    height: 350px;
    margin-bottom: 1.5rem;
}

.mbus-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: block;
}

.mbus-status-dot.online {
    background: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.15);
}

.mbus-status-dot.no-data {
    background: #ed8936;
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.15);
}

.mbus-status-dot.offline {
    background: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

/* M-Bus Delete Confirmation Modal Styling */
#mbusDeleteConfirmModal {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

#mbusDeleteConfirmModal .modal-content {
    border: 1px solid rgba(229, 62, 62, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

#mbusDeleteConfirmModal .modal-header {
    background: #fff5f5;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #fed7d7;
}

#mbusDeleteConfirmModal .modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

#mbusDeleteConfirmModal .modal-body {
    padding: 2rem 1.5rem;
}

#mbusDeleteConfirmModal .modal-body p {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

#mbusDeleteConfirmModal .modal-footer {
    padding: 1rem 1.5rem;
    background: #fdfdfd;
    border-top: 1px solid #edf2f7;
}

#mbusDeleteConfirmModal .btn-danger {
    background: #e53e3e;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

#mbusDeleteConfirmModal .btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#mbusDeleteConfirmModal .btn-secondary {
    font-weight: 500;
}

/* ============================================================
   CONNECTIONS MONITORING TAB
   ============================================================ */

.connections-monitoring-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.connections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.connections-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.connections-header h2 i {
    color: #3498db;
}

.connections-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connections-updated-at {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: italic;
}

.connections-loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 0.95rem;
}

/* ---- Summary Pills ---- */
.conn-summary-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.conn-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.conn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.conn-pill-count {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.conn-pill i {
    font-size: 1rem;
    opacity: 0.8;
}

.conn-pill-total {
    border-left: 4px solid #64748b;
}

.conn-pill-total .conn-pill-count {
    color: #334155;
}

.conn-pill-total i {
    color: #64748b;
}

.conn-pill-ok {
    border-left: 4px solid #22c55e;
}

.conn-pill-ok .conn-pill-count {
    color: #15803d;
}

.conn-pill-ok i {
    color: #22c55e;
}

.conn-pill-stale {
    border-left: 4px solid #f59e0b;
}

.conn-pill-stale .conn-pill-count {
    color: #b45309;
}

.conn-pill-stale i {
    color: #f59e0b;
}

.conn-pill-old {
    border-left: 4px solid #ef4444;
}

.conn-pill-old .conn-pill-count {
    color: #b91c1c;
}

.conn-pill-old i {
    color: #ef4444;
}

.conn-pill-nodata {
    border-left: 4px solid #94a3b8;
}

.conn-pill-nodata .conn-pill-count {
    color: #475569;
}

.conn-pill-nodata i {
    color: #94a3b8;
}

/* ---- Table Container ---- */
.connections-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    background: #fff;
}

.connections-monitoring-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.connections-monitoring-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.connections-monitoring-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    white-space: nowrap;
}

.connections-monitoring-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.connections-monitoring-table tbody tr:last-child {
    border-bottom: none;
}

.connections-monitoring-table tbody tr:hover {
    background: #f8fafc;
}

.connections-monitoring-table tbody td {
    padding: 12px 14px;
    color: #374151;
    vertical-align: middle;
    white-space: nowrap;
}

/* Row tint on different statuses */
.conn-row.conn-too-old {
    background: rgba(239, 68, 68, 0.03);
}

.conn-row.conn-too-old:hover {
    background: rgba(239, 68, 68, 0.07);
}

.conn-row.conn-stale {
    background: rgba(245, 158, 11, 0.03);
}

.conn-row.conn-stale:hover {
    background: rgba(245, 158, 11, 0.07);
}

/* ---- Status Dot ---- */
.conn-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: connPulse 2.5s ease-in-out infinite;
}

@keyframes connPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ---- Status Badge ---- */
.conn-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* ---- Points per hour ---- */
.conn-points {
    font-weight: 700;
    color: #2d3748;
}

.conn-points-zero {
    color: #ef4444;
}

/* ---- Age cells ---- */
.conn-age {
    font-size: 0.875rem;
    color: #475569;
}

.conn-age.conn-too-old {
    color: #ef4444;
    font-weight: 700;
}

.conn-age.conn-stale {
    color: #f59e0b;
    font-weight: 700;
}

/* ---- Datetime cell ---- */
.conn-datetime {
    color: #64748b;
    font-size: 0.82rem;
}

/* ---- Group Separator ---- */
.conn-group-separator {
    background: #f1f5f9 !important;
}

.conn-group-separator td {
    padding: 10px 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    color: #475569;
    background: #f1f5f9 !important;
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
}

.conn-group-separator i {
    margin-right: 6px;
    color: #3498db;
}



/* Mobile responsive */
@media (max-width: 768px) {
    .conn-summary-pills {
        gap: 8px;
    }

    .conn-pill {
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .conn-pill-count {
        font-size: 1.1rem;
    }

    .connections-monitoring-table thead th,
    .connections-monitoring-table tbody td {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}

/* M-Bus Day Averages Section */
.mbus-day-averages-section {
    margin: 2rem 1.25rem 3rem;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.mbus-day-averages-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #f8fafc;
}

.mbus-day-averages-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mbus-day-averages-title i {
    font-size: 1.25rem;
    color: var(--primary-color, #3182ce);
}

.mbus-day-averages-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.mbus-day-averages-filters {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.mbus-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mbus-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.mbus-filter-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    background-color: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.mbus-filter-group select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.mbus-day-averages-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.mbus-day-averages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
    background: #fff;
}

.mbus-day-averages-table th {
    background: #f8fafc;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    letter-spacing: 0.025em;
}

.mbus-day-averages-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    white-space: nowrap;
}

.mbus-day-averages-table tr:last-child td {
    border-bottom: none;
}

.mbus-avg-date {
    font-weight: 600;
    color: #1e293b;
}

.mbus-today-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.mbus-avg-row-today {
    background: #f0fdf4;
}

.mbus-avg-row-nodata td {
    color: #94a3b8;
}

.mbus-avg-count {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.mbus-avg-empty {
    text-align: center;
    padding: 3rem !important;
    color: #64748b;
    font-style: italic;
}

@media (max-width: 768px) {
    .mbus-day-averages-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .mbus-day-averages-filters {
        width: 100%;
        gap: 1rem;
    }

    .mbus-filter-group {
        width: 100%;
    }

    .mbus-filter-group select {
        flex: 1;
    }
}

/* ========================================================================
   ECL210 SCADA PAGE STYLES
   ======================================================================== */

/* ── SVG Schematic wrapper ─────────────────────────────────────────────── */
.ecl210-scada-wrap {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 24px;
    border-radius: 14px;
    overflow: visible; /* Allowing tooltips to display without clipping */
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
/* ── Grid Layout ───────────────────────────────────────────────────────── */
.ecl210-grid-layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1.3fr) minmax(0, 1fr);
    grid-auto-rows: min-content;
    gap: 16px;
    padding: 16px;
}

.ecl210-area-schematic {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
    display: flex;
    justify-content: center;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 10px;
}

.ecl210-area-heatmeter {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.ecl210-area-controls {
    grid-column: 1 / 2;
    grid-row: 2 / 5;
}

.ecl210-area-curve {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.ecl210-area-comfort {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.ecl210-area-schedules {
    grid-column: 2 / 4;
    grid-row: 3 / 5;
    max-width: 100%;
    overflow: hidden;
}

.ecl210-schedule-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1100px) {
    .ecl210-grid-layout {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
        overflow-x: hidden;
        max-width: 100%;
    }

    .ecl210-area-controls,
    .ecl210-area-schematic,
    .ecl210-area-curve,
    .ecl210-area-comfort,
    .ecl210-area-schedules {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .ecl210-area-schematic {
        padding: 5px;
    }
}

@media (max-width: 600px) {
    .ecl210-grid-layout {
        padding: 8px;
        gap: 8px;
    }

    .ecl210-scada-wrap {
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: hidden;
        max-width: 100%;
    }
}

.ecl210-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.ecl210-btn-grid-span {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

@media (max-width: 600px) {
    .ecl210-btn-grid {
        grid-template-columns: 1fr;
    }
}

.ecl210-scada-wrap.ecl210-scada-light {
    background: #ffffff;
}

/* Suppress global CSS tooltips within SCADA view to avoid duplicates with JS overlay */
.ecl210-scada-wrap [data-tooltip]::after,
.ecl210-scada-wrap [data-tooltip]::before {
    display: none !important;
}

.ecl210-scada-wrap.ecl210-alarm {
    box-shadow: 0 0 0 3px #e74c3c, 0 4px 24px rgba(231, 76, 60, 0.3);
    animation: ecl210AlarmPulse 1.5s infinite;
}

@keyframes ecl210AlarmPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px #e74c3c, 0 4px 24px rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.5), 0 4px 32px rgba(231, 76, 60, 0.4);
    }
}

.ecl210-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Pump styles ────────────────────────────────────────────────────────── */
[id^="svgPump"][fill="#00b894"] {
    filter: drop-shadow(0 0 4px rgba(0, 184, 148, 0.4));
}

/* ── Mode badge ────────────────────────────────────────────────────────── */
.ecl210-mode-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    margin-right: 12px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* ── Sensor cards grid ────────────────────────────────────────────────── */
.ecl210-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ecl210-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ecl210-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ecl210-card-icon {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.ecl210-card-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.ecl210-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace, sans-serif;
    color: #334155;
}

/* Removed specific card accent colors to unify with #334155 */
.ecl210-card .ecl210-card-icon {
    background: #f1f5f9;
    color: #334155;
}

/* ── Status row ───────────────────────────────────────────────────────── */
.ecl210-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ecl210-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.ecl210-status-item strong {
    color: #1e293b;
    font-size: 0.9rem;
}

.ecl210-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
    transition: background 0.3s;
}

/* ── Chart section ────────────────────────────────────────────────────── */
.ecl210-chart-section {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 18px 20px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ecl210-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ecl210-chart-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.ecl210-hist-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ecl210-hist-btn:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}

.ecl210-hist-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: #ffffff;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ecl210-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ecl210-status-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ecl210-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .ecl210-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Device Selection Grid ────────────────────────────────────────────── */
.ecl210-device-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ecl210-device-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.ecl210-device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.ecl210-device-card .device-icon {
    width: 60px;
    height: 60px;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    transition: all 0.25s;
}

.ecl210-device-card:hover .device-icon {
    background: #3498db;
    color: #ffffff;
}

.ecl210-device-card .device-info {
    flex: 1;
}

.ecl210-device-card .device-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.ecl210-device-card .device-desc {
    font-size: 0.85rem;
    color: #64748b;
}

.ecl210-device-card .device-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.25s;
}

.ecl210-device-card:hover .device-action {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 640px) {
    .ecl210-device-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Readings Table Section ─────────────────────────────────────────── */
.ecl210-table-section {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 18px 20px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 24px;
}

.ecl210-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ecl210-table-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.ecl210-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.ecl210-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.ecl210-data-table th {
    background: #f8fafc;
    padding: 10px 12px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.ecl210-data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.ecl210-data-table tr:hover td {
    background: #f8fafc;
}

.ecl210-data-table .row-timestamp {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
}

.ecl210-data-table .status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ecl210-table-hist-btn, .ecl210-chart-hist-btn, .ecl210-hist-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ecl210-table-hist-btn:hover, .ecl210-chart-hist-btn:hover, .ecl210-hist-btn:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}

.ecl210-table-hist-btn.active, .ecl210-chart-hist-btn.active, .ecl210-hist-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

@media (max-width: 768px) {
    .ecl210-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-quick-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
    }

    .ecl210-table-hist-btn {
        flex: 1;
        min-width: 70px;
        padding: 8px 10px;
        font-size: 0.8rem;
        text-align: center;
    }

    .ecl210-chart-section {
        padding: 12px 15px;
    }

    .ecl210-table-section {
        padding: 12px 15px;
    }
}

/* ── Pagination ────────────────────────────────────────────────────── */
.ecl210-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

.pagination-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-left select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pagination-left select:hover {
    border-color: #cbd5e1;
}

.pagination-center {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-info {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
}

/* ── Common Utilities ────────────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .ecl210-table-header h3 {
        font-size: 0.9rem;
    }

    .filter-quick-buttons {
        gap: 6px;
    }

    .ecl210-table-hist-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: 60px;
    }

    .ecl210-data-table {
        font-size: 0.75rem;
    }

    .ecl210-data-table th,
    .ecl210-data-table td {
        padding: 6px 8px;
    }

    .ecl210-pagination {
        flex-direction: column;
        gap: 20px;
        padding: 1.5rem 1rem;
        align-items: center;
        text-align: center;
    }

    .pagination-left {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .pagination-select-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination-center {
        width: 100%;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .ecl210-pagination .pagination-info {
        font-size: 0.8rem;
        font-weight: 700;
        margin: 5px 0;
    }

    #ecl210CurveTableContainer {
        width: 100% !important;
        min-width: 100% !important;
        margin-top: 15px;
    }
}

/* ========================================================================
   ECL210 MONITORING TABLE (device selection screen)
   ======================================================================== */

.ecl-mon-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.ecl-mon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.ecl-mon-table thead tr {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

.ecl-mon-table thead th {
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.78rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

/* ── Column widths ──────────────────────────────────────────────────────── */
.ecl-col-toggle  { width: 42px; text-align: center; }
.ecl-col-name    { min-width: 180px; }
.ecl-col-num     { width: 100px; text-align: center; }
.ecl-col-dt      { width: 130px; font-size: 0.78rem; color: #64748b; white-space: nowrap; }
.ecl-col-actions { width: 80px; text-align: center; white-space: nowrap; }

/* ── Main device rows ───────────────────────────────────────────────────── */
.ecl-mon-row-main {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}

.ecl-mon-row-main:hover {
    background: #f8fafc;
}

.ecl-mon-row-main td {
    padding: 10px 12px;
    vertical-align: middle;
    color: #334155;
}

.ecl-mon-row-alarm {
    background: #fff5f5 !important;
}

/* ── Expand button ──────────────────────────────────────────────────────── */
.ecl-expand-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}

.ecl-expand-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
}

.ecl-expand-btn i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

/* ── Device name cell ───────────────────────────────────────────────────── */
.ecl-dev-name {
    font-size: 0.77rem;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
    font-weight: normal !important;
}

.ecl-dev-loc {
    font-weight: 700 !important;
    color: #1e293b;
    display: block;
    font-size: 0.9rem;
}

/* ── Detail rows ────────────────────────────────────────────────────────── */
.ecl-mon-row-detail > .ecl-detail-cell {
    padding: 0;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.ecl-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ecl-detail-table thead th {
    padding: 7px 10px;
    background: #eef2f7;
    color: #64748b;
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.ecl-detail-table tbody td {
    padding: 7px 10px;
    color: #475569;
    border-bottom: 1px solid #e9eef4;
    white-space: nowrap;
}

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

.ecl-detail-table tbody tr:hover td {
    background: #edf2f7;
}

/* ── Action buttons ─────────────────────────────────────────────────────── */
.ecl-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.15s;
    margin: 0 2px;
}

.ecl-action-open:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

.ecl-action-refresh:hover {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* ── State badges ───────────────────────────────────────────────────────── */
.ecl-state-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.ecl-state-comfort {
    background: #dcfce7;
    color: #166534;
}

.ecl-state-saving {
    background: #fef9c3;
    color: #854d0e;
}

.ecl-state-off {
    background: #f1f5f9;
    color: #64748b;
}

.ecl-state-auto {
    background: #e0f2fe;
    color: #0369a1;
}

/* ── Heat Meter (in SCADA) ───────────────────────────────────────────────── */
.ecl210-hm-metric {
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ecl210-hm-metric:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ecl-col-num { width: 70px; }
    .ecl-mon-table { font-size: 0.78rem; }
}

/* --- Premium ECL Enhancements --- */
.ecl210-heartbeat {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    position: relative;
    vertical-align: middle;
}

.ecl210-heartbeat::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    animation: heartPulse 2s infinite;
}

@keyframes heartPulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.ecl210-heartbeat.online { background: #10b981; }
.ecl210-heartbeat.online::after { background: #10b981; }

.ecl210-heartbeat.warning { background: #f59e0b; }
.ecl210-heartbeat.warning::after { background: #f59e0b; }

.ecl210-heartbeat.stale { background: #ef4444; }
.ecl210-heartbeat.stale::after { background: #ef4444; }


#ecl210HistoryModal .quick-filter {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}