        /* --- Base Styles --- */
        :root {
            /* Modern blue -> indigo gradient backdrop (default/light theme). */
            --primary-bg: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 40%, #dbeafe 100%);
            --app-accent: #4f46e5;       /* indigo */
            --app-accent-2: #2563eb;     /* blue */
            --app-accent-grad: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
            --primary-text: #1e293b;
            --table-header-bg: #6f7b87;
            --table-header-text: black;
            --table-row-border: #ccc;
            --editable-bg: #ffeeba;
            --input-bg: #ffffff;
            --input-text: black;
            --input-text-focus: black;
            --input-text-svg-fill: '000000';
            --popup-bg: gray;
            --popup-text: white;
            --modal-bg: white;
            --modal-text: black;
            --overlay-bg: rgba(0, 0, 0, 0.6);
            --button-primary-bg: #007bff;
            --button-primary-text: white;
            --button-secondary-bg: #6c757d;
            --button-secondary-text: white;

            --button-submit-bg: #90EE90;
            --button-submit-hover-bg: #7ACD7A;
            --button-logout-bg: #F08080;
            --button-logout-hover-bg: #E07070;
            --button-grey-bg: #D3D3D3;
            --button-grey-hover-bg: #BEBEBE;
            --button-text-dark: black;
            --info-button-bg: #FFD700;
            --info-button-text: black;
            --info-modal-header-bg: #4a5568;

            /* Professional Popup Colors */
            --popup-success-bg: #28a745;
            --popup-error-bg: #dc3545;
            --popup-warning-bg: #ffc107;
            --popup-warning-text: #212529;
            --popup-info-bg: #17a2b8;
            --popup-text-light: #ffffff;
        }

        .theme-blue {
            --primary-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
            --primary-text: #0277bd;
            --table-header-bg: #29b6f6;
            --table-header-text: white;
            --table-row-border: #4fc3f7;
            --editable-bg: #e1f5fe;
            --input-bg: #f0f8ff;
            --input-text: #01579b;
            --input-text-focus: #01579b;
            --input-text-svg-fill: '01579b';
            --popup-bg: #29b6f6;
            --popup-text: white;
            --modal-bg: rgba(250, 250, 250, 0.95);
            --modal-text: #0277bd;
            --overlay-bg: rgba(41, 182, 246, 0.2);
            --info-modal-header-bg: #0288d1;
        }

        .theme-light-blue {
            --primary-bg: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 50%, #cce7ff 100%);
            --primary-text: #1565c0;
            --table-header-bg: #42a5f5;
            --table-header-text: white;
            --table-row-border: #90caf9;
            --editable-bg: #f0f8ff;
            --input-bg: #fafcff;
            --input-text: #0d47a1;
            --input-text-focus: #0d47a1;
            --input-text-svg-fill: '0d47a1';
            --popup-bg: #42a5f5;
            --popup-text: white;
            --modal-bg: rgba(250, 250, 250, 0.95);
            --modal-text: #1565c0;
            --overlay-bg: rgba(66, 165, 245, 0.2);
            --info-modal-header-bg: #1976d2;
        }

        .theme-grey {
            --primary-bg: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 50%, #e0e0e0 100%);
            --primary-text: #424242;
            --table-header-bg: #757575;
            --table-header-text: white;
            --table-row-border: #bdbdbd;
            --editable-bg: #f8f8f8;
            --input-bg: #fafafa;
            --input-text: #212121;
            --input-text-focus: #212121;
            --input-text-svg-fill: '212121';
            --popup-bg: #757575;
            --popup-text: white;
            --modal-bg: rgba(250, 250, 250, 0.95);
            --modal-text: #424242;
            --overlay-bg: rgba(117, 117, 117, 0.2);
            --info-modal-header-bg: #616161;
        }



        .dark-mode {
            /* Keep for backward compatibility */
            --primary-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
            --primary-text: #0277bd;
            --table-header-bg: #29b6f6;
            --table-header-text: white;
            --table-row-border: #4fc3f7;
            --editable-bg: #e1f5fe;
            --input-bg: #f0f8ff;
            --input-text: #01579b;
            --input-text-focus: #01579b;
            --input-text-svg-fill: '01579b';
            --popup-bg: #29b6f6;
            --popup-text: white;
            --modal-bg: rgba(250, 250, 250, 0.95);
            --modal-text: #0277bd;
            --overlay-bg: rgba(41, 182, 246, 0.2);
            --info-modal-header-bg: #0288d1;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                         'Helvetica Neue', Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background: var(--primary-bg);
            background-attachment: fixed;
            color: var(--primary-text);
            transition: all 0.3s ease;
            -webkit-font-smoothing: antialiased;
        }

        /* Soft radial glows layered over the gradient for depth (modern feel). */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            z-index: -1;
            pointer-events: none;
            background:
                radial-gradient(1100px 500px at 12% -5%, rgba(79,70,229,0.16), transparent 60%),
                radial-gradient(900px 480px at 100% 0%, rgba(37,99,235,0.14), transparent 55%);
        }

        #zoom-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }

        #zoom-wrapper.login-mode {
            justify-content: center;
            min-height: 100vh;
        }

        @keyframes glitter {
            0% {
                background-position: -100% 0;
            }

            100% {
                background-position: 100% 0;
            }
        }

        .main-heading {
            text-align: center;
            font-size: 2.4rem;
            font-weight: 700;
            padding: 20px 25px;
            background: linear-gradient(145deg, var(--table-header-bg) 0%, color-mix(in srgb, var(--table-header-bg) 60%, white 40%) 30%, var(--table-header-bg) 70%, color-mix(in srgb, var(--table-header-bg) 80%, black 20%) 100%);
            color: var(--table-header-text);
            border-radius: 16px;
            margin: 0 auto 15px auto;
            border: 2px solid rgba(255, 255, 255, 0.3);
            box-sizing: border-box;
            width: 96%;
            max-width: 1600px;
            position: relative;
            box-shadow:
                0 12px 35px rgba(0, 0, 0, 0.2),
                0 6px 15px rgba(0, 0, 0, 0.1),
                inset 0 3px 12px rgba(255, 255, 255, 0.3),
                inset 0 -3px 12px rgba(0, 0, 0, 0.15);
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
            transform: translateZ(10px);
        }

        .main-heading::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            right: 3px;
            bottom: 3px;
            border: 1px solid black;
            border-radius: 5px;
            pointer-events: none;
            z-index: -1;
        }

        @media (max-width: 768px) {
            .main-heading {
                font-size: 1.8rem;
            }
        }


        #authContainer,
        .container {
            width: 96%;
            max-width: 1600px;
            padding: 0;
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
            color: var(--modal-text);
            border-radius: 20px;
            box-shadow:
                0 25px 50px rgba(0, 0, 0, 0.15),
                0 15px 35px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            overflow: hidden;
        }

        #authContainer {
            max-width: 600px;
            width: 90%;
            text-align: center;
            margin: 0 auto;
            position: relative;
        }

        .container {
            margin: 0 auto 20px auto;
            padding: 25px;
        }

        .auth-header {
            background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
            color: white;
            padding: 25px 30px;
            margin: 0;
            border-radius: 18px 18px 0 0;
            position: relative;
            overflow: hidden;
            text-align: center;
            font-size: 1.4rem;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.2), inset 0 -2px 6px rgba(0, 0, 0, 0.1);
        }

        .auth-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% {
                left: -100%;
            }

            100% {
                left: 100%;
            }
        }

        /* Elevated 3D Grey Background */
        .network-background {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -2;
            background:
                linear-gradient(135deg, #f8f9fa 0%, #e9ecef 25%, #dee2e6 50%, #ced4da 75%, #adb5bd 100%);
            overflow: hidden;
        }

        .network-background::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.4) 0%, transparent 30%);
            box-shadow:
                inset 0 1px 3px rgba(255, 255, 255, 0.8),
                inset 0 -1px 3px rgba(0, 0, 0, 0.1);
        }

        .network-background::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                repeating-linear-gradient(45deg,
                    rgba(255, 255, 255, 0.05) 0px,
                    rgba(255, 255, 255, 0.05) 1px,
                    transparent 1px,
                    transparent 20px),
                repeating-linear-gradient(-45deg,
                    rgba(0, 0, 0, 0.02) 0px,
                    rgba(0, 0, 0, 0.02) 1px,
                    transparent 1px,
                    transparent 20px);
        }

        .auth-content {
            padding: 30px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 0 0 18px 18px;
        }


        .auth-button {
            background: linear-gradient(145deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-weight: 600;
            text-align: center;
            cursor: pointer;
            user-select: none;
            padding: 15px 30px;
            font-size: 1.1rem;
            line-height: 1.5;
            border-radius: 12px;
            transition: all 0.3s ease;
            margin-top: 20px;
            box-shadow:
                0 8px 20px rgba(30, 64, 175, 0.3),
                0 4px 10px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            position: relative;
            overflow: hidden;
        }

        .auth-button:hover {
            transform: translateY(-2px);
            box-shadow:
                0 12px 25px rgba(30, 64, 175, 0.4),
                0 6px 15px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
        }

        .auth-button:active {
            transform: translateY(0);
            box-shadow:
                0 4px 10px rgba(30, 64, 175, 0.3),
                0 2px 5px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
        }


        .header-table {
            width: 100%;
            margin-bottom: 20px;
            border-collapse: collapse;
            table-layout: fixed;
        }

        .header-table th {
            background: linear-gradient(145deg, var(--table-header-bg) 0%, color-mix(in srgb, var(--table-header-bg) 80%, white 20%) 50%, var(--table-header-bg) 100%);
            color: var(--table-header-text);
            text-align: center;
            padding: 12px 8px;
            font-size: 0.85rem;
            font-weight: bold;
            border: 1px solid var(--table-row-border);
            border-radius: 8px 8px 0 0;
            box-shadow:
                0 4px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 3px rgba(255, 255, 255, 0.2),
                inset 0 -1px 3px rgba(0, 0, 0, 0.1);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            transform: translateZ(5px);
        }

        .header-table td {
            padding: 8px 5px;
            font-size: 0.85rem;
            border: 1px solid var(--table-row-border);
            text-align: center;
            vertical-align: middle;
            background: linear-gradient(145deg, var(--modal-bg) 0%, color-mix(in srgb, var(--modal-bg) 95%, white 5%) 100%);
            box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.05);
        }

        .header-table input,
        .header-table select {
            background-color: var(--input-bg) !important;
            color: var(--input-text) !important;
            border: 1px solid var(--table-row-border) !important;
            border-radius: 4px !important;
            padding: 0.3rem 0.5rem !important;
            width: 100% !important;
            box-sizing: border-box !important;
            font-size: 0.85rem;
            height: auto;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        .header-table select {
            /* background-image is set by JS */
            background-repeat: no-repeat;
            background-position: right .7em top 50%;
            background-size: .65em auto;
            padding-right: 2.5em !important;
        }

        .header-table select:disabled {
            background-color: var(--input-bg) !important;
            opacity: 0.65;
            cursor: not-allowed;
        }

        /* --- START: FIX FOR LOCKED DATE INPUT --- */
        #dateInput[readonly] {
            pointer-events: none;
        }

        /* --- END: FIX FOR LOCKED DATE INPUT --- */

        .header-table th:nth-child(1),
        .header-table td:nth-child(1) {
            width: 12%;
        }

        /* Date */
        .header-table th:nth-child(2),
        .header-table td:nth-child(2) {
            width: 10%;
        }

        /* Country */
        .header-table th:nth-child(3),
        .header-table td:nth-child(3) {
            width: 15%;
        }

        /* Region */
        .header-table th:nth-child(4),
        .header-table td:nth-child(4) {
            width: 15%;
        }

        /* SRM */
        .header-table th:nth-child(5),
        .header-table td:nth-child(5) {
            width: 13%;
        }

        /* RD */
        .header-table th:nth-child(6),
        .header-table td:nth-child(6) {
            width: 15%;
        }

        /* Location */
        .header-table th:nth-child(7),
        .header-table td:nth-child(7) {
            width: 20%;
        }

        /* User Name */

        .button-container {
            display: flex;
            justify-content: space-between;
            gap: 8px;
            margin: 2px 0;
            flex-wrap: nowrap;
            width: 100%;
        }

        .button-container button {
            padding: 0.4rem 0.8rem;
            font-size: 0.85rem;
            line-height: 1.4;
            border-radius: 8px;
            border: 1px solid transparent;
            box-sizing: border-box;
            width: 100%;
            flex: 1;
            font-weight: bold;
            text-align: center;
            vertical-align: middle;
            cursor: pointer;
            user-select: none;
            position: relative;
            box-shadow: 0 3px 2px rgba(0, 0, 0, 0.2);
            transition: all 0.1s ease-out;
            color: var(--button-text-dark);
        }

        .button-container .auth-button {
            margin-top: 0;
            border-radius: 8px;
            background-color: var(--button-logout-bg);
            border-color: var(--button-logout-bg);
            color: var(--button-text-dark);
        }

        .button-container .auth-button:hover:not(:disabled) {
            background-color: var(--button-logout-hover-bg);
            border-color: var(--button-logout-hover-bg);
        }

        .button-container button:hover:not(:disabled) {
            box-shadow: 0 5px 4px rgba(0, 0, 0, 0.25);
            transform: translateY(-2px);
        }

        .button-container button:active:not(:disabled) {
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
            transform: translateY(1px);
        }

        .button-container button:disabled {
            background-color: #ccc;
            color: #666;
            cursor: not-allowed;
            border-color: #999;
            box-shadow: none;
            transform: none;
            opacity: 0.7;
        }

        .button-container .action-button#mainSubmitButton {
            background-color: var(--button-submit-bg);
            border-color: var(--button-submit-bg);
        }

        .button-container .action-button#mainSubmitButton:hover:not(:disabled) {
            background-color: var(--button-submit-hover-bg);
            border-color: var(--button-submit-hover-bg);
        }

        .button-container .clear-button {
            background-color: var(--button-grey-bg);
            border-color: var(--button-grey-bg);
        }

        .button-container .clear-button:hover:not(:disabled) {
            background-color: var(--button-grey-hover-bg);
            border-color: var(--button-grey-hover-bg);
        }

        .button-container .theme-switch,
        .button-container .view-toggle-button {
            background-color: var(--button-grey-bg);
            border-color: var(--button-grey-bg);
        }

        .button-container .theme-switch:hover:not(:disabled),
        .button-container .view-toggle-button:hover:not(:disabled) {
            background-color: var(--button-grey-hover-bg);
            border-color: var(--button-grey-hover-bg);
        }

        .button-container #retrieveDataButton.action-button {
            background-color: var(--button-grey-bg);
            border-color: var(--button-grey-bg);
            color: var(--button-text-dark);
        }

        .button-container #retrieveDataButton.action-button:hover:not(:disabled) {
            background-color: var(--button-grey-hover-bg);
            border-color: var(--button-grey-hover-bg);
        }

        .table-container {
            max-height: 650px;
            overflow: auto;
            width: 100%;
            border: 3px solid var(--table-row-border);
            border-radius: 12px;
            margin-top: 20px;
            box-shadow:
                0 8px 20px rgba(0, 0, 0, 0.12),
                inset 0 2px 4px rgba(255, 255, 255, 0.1),
                inset 0 -2px 4px rgba(0, 0, 0, 0.05);
        }

        #dataTable {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }

        #dataTable th.bucket-col {
            width: 10%;
            position: sticky;
            top: 0;
            z-index: 2;
        }

        #dataTable th.volume-matrix-col {
            width: 10%;
            position: sticky;
            top: 0;
            z-index: 2;
        }

        #dataTable th.volume-division-col {
            width: 17%;
        }

        #dataTable th.cycle1-col {
            width: 7%;
        }

        #dataTable th.cycle2-col {
            width: 7%;
        }

        #dataTable th.sd-col {
            width: 7%;
        }

        #dataTable th.comments-col {
            width: 18%;
        }

        th {
            background: linear-gradient(145deg, var(--table-header-bg) 0%, color-mix(in srgb, var(--table-header-bg) 85%, white 15%) 50%, var(--table-header-bg) 100%);
            color: var(--table-header-text);
            text-align: center;
            padding: 12px 10px;
            font-size: 15px;
            font-weight: bold;
            position: sticky;
            top: 0;
            z-index: 2;
            border: 1px solid var(--table-row-border);
            border-bottom: 2px solid var(--table-header-text);
            box-shadow:
                0 4px 12px rgba(0, 0, 0, 0.15),
                inset 0 2px 4px rgba(255, 255, 255, 0.2),
                inset 0 -2px 4px rgba(0, 0, 0, 0.1);
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            transform: translateZ(8px);
        }

        #bucketFilter,
        #matrixFilter {
            width: auto;
            max-width: 80%;
            display: inline-block;
            vertical-align: middle;
            margin-right: 5px;
            font-size: 0.9rem;
            padding: 0.2rem 2em 0.2rem 0.4rem;
            height: auto;
            background-color: var(--input-bg);
            color: var(--input-text) !important;
            border: 1px solid var(--table-row-border);
            border-radius: 4px;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-repeat: no-repeat;
            background-position: right .5em top 50%;
            background-size: .55em auto;
            font-weight: 600;
        }

        #bucketFilterIndicator,
        #matrixFilterIndicator {
            display: none;
            font-size: 0.8em;
            color: var(--table-header-text);
            vertical-align: middle;
        }

        #bucketFilterIndicator.filter-active,
        #matrixFilterIndicator.filter-active {
            display: inline-block;
        }

        .dark-mode #bucketFilter option,
        .dark-mode #matrixFilter option {
            background-color: var(--input-bg);
            color: var(--input-text) !important;
        }

        #bucketFilter option,
        #matrixFilter option {
            color: var(--input-text) !important;
            background-color: var(--input-bg) !important;
        }

        td {
            padding: 10px 8px;
            text-align: left;
            font-size: 14px;
            background: linear-gradient(145deg, var(--modal-bg) 0%, color-mix(in srgb, var(--modal-bg) 97%, white 3%) 100%);
            color: var(--modal-text);
            border: 1px solid var(--table-row-border);
            vertical-align: middle;
            box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 2px rgba(0, 0, 0, 0.05);
            transition: all 0.2s ease;
        }

        .comments-cell {
            position: relative;
            display: flex;
            align-items: center;
        }

        td:empty {
            background-color: #fff8b5 !important;
        }

        .numeric-input {
            width: 100%;
            text-align: right;
            direction: ltr;
            border: 1px solid var(--table-row-border);
            background-color: var(--editable-bg);
            color: var(--input-text);
            outline: none;
            font-size: 14px;
            padding: 5px;
            border-radius: 4px;
            box-sizing: border-box;
            -moz-appearance: textfield;
        }

        .numeric-input::-webkit-outer-spin-button,
        .numeric-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .comments {
            border: 1px solid var(--table-row-border);
            background-color: var(--editable-bg) !important;
            color: var(--input-text);
            white-space: nowrap;
            overflow-x: auto;
            padding: 5px;
            border-radius: 4px;
            box-sizing: border-box;
            cursor: text;
            direction: ltr;
            text-align: left;
            min-height: 34px;
            height: auto;
            width: 100%;
            flex-grow: 1;
            outline: none;
        }

        .view-comment-btn {
            display: none;
            margin-left: 5px;
            padding: 4px;
            cursor: pointer;
            border: none;
            background: none;
        }

        td.td-focused {
            background: linear-gradient(145deg, #cfe2f3 0%, #b8d4f0 100%) !important;
            box-shadow:
                0 4px 12px rgba(79, 172, 254, 0.3),
                inset 0 2px 4px rgba(255, 255, 255, 0.3),
                inset 0 -2px 4px rgba(0, 0, 0, 0.1) !important;
            transform: translateZ(3px);
        }

        .numeric-input:focus,
        .comments:focus {
            background-color: transparent !important;
        }

        .numeric-input:focus {
            border-color: #005a9c !important;
        }

        .comments:focus {
            outline: 1px solid #005a9c !important;
        }

        .td-focused .numeric-input,
        .td-focused .comments {
            color: #1a202c !important;
        }

        #overlay,
        #commentOverlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--overlay-bg);
            z-index: 1000;
        }

        #confirmationModal,
        #commentModal {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background-color: var(--modal-bg);
            color: var(--modal-text);
            padding: 25px;
            border-radius: 10px;
            border: 2px solid var(--table-row-border);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
            z-index: 1001;
            width: 85%;
            max-width: 800px;
            max-height: 85vh;
            overflow-y: auto;
        }

        #confirmationModal h3,
        #commentModal h3 {
            margin-top: 0;
            margin-bottom: 20px;
            text-align: center;
            color: var(--table-header-text);
            background-color: var(--table-header-bg);
            padding: 10px;
            border-radius: 5px;
        }

        #confirmationData,
        #commentModalBody {
            margin-bottom: 25px;
            font-size: 14px;
            line-height: 1.6;
            max-height: 50vh;
            overflow-y: auto;
            border: 1px solid var(--table-row-border);
            padding: 15px;
            border-radius: 5px;
            background-color: var(--modal-bg);
            color: var(--modal-text);
        }

        /* Ensure confirmation data text is always visible */
        #confirmationData p {
            color: var(--modal-text) !important;
            margin: 8px 0;
        }

        #confirmationData strong {
            color: var(--primary-text) !important;
            font-weight: bold;
        }

        #confirmationData hr {
            border: none;
            border-top: 1px solid var(--table-row-border);
            margin: 15px 0;
        }

        #commentModalBody {
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        #commentModalBody a {
            color: #007bff;
            display: block;
            word-break: break-all;
            margin: 5px 0;
        }

        .confirmation-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
            background-color: var(--modal-bg);
            color: var(--modal-text);
        }

        .confirmation-table th,
        .confirmation-table td {
            border: 1px solid var(--table-row-border);
            padding: 6px 8px;
            text-align: left;
            font-size: 13px;
            color: var(--modal-text);
        }

        .confirmation-table th {
            background-color: var(--table-header-bg);
            color: var(--table-header-text);
            font-weight: bold;
        }

        .confirmation-table td:nth-child(4),
        .confirmation-table td:nth-child(5) {
            text-align: right;
        }

        .confirmation-table td:last-child {
            white-space: pre-wrap;
            word-break: break-word;
        }

        .modal-buttons {
            display: flex;
            justify-content: space-around;
            gap: 15px;
            margin-top: 15px;
        }

        .modal-buttons button {
            border: 2px solid black;
            padding: 10px 20px;
            font-size: 15px;
            font-weight: bold;
            border-radius: 8px;
            transition: all 0.3s ease;
            cursor: pointer;
            flex-grow: 1;
        }

        .modal-buttons button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .modal-buttons button:disabled {
            background-color: #ccc;
            color: #666;
            cursor: not-allowed;
            border-color: #999;
            box-shadow: none;
            transform: none;
            opacity: 0.7;
        }

        #confirmSubmitBtn {
            background-color: #8cdc9f;
            color: black;
            border-color: #5ca971;
        }

        #editBtn {
            background-color: #f0ad4e;
            color: black;
            border-color: #d58512;
        }

        #cancelBtn {
            background-color: #ee8c8c;
            color: black;
            border-color: #c85e5e;
        }

        .popup {
            display: none;
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 25px;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: bold;
            text-align: center;
            z-index: 1050;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            color: var(--popup-text-light);
            transition: opacity 0.3s, bottom 0.3s;
        }

        .popup.show {
            display: block;
            opacity: 1;
            bottom: 30px;
        }

        .popup.success {
            background-color: var(--popup-success-bg);
        }

        .popup.error {
            background-color: var(--popup-error-bg);
        }

        .popup.warning {
            background-color: var(--popup-warning-bg);
            color: var(--popup-warning-text);
        }

        .popup.info {
            background-color: var(--popup-info-bg);
        }

        .user-info {
            text-align: right;
            margin-bottom: 3px;
            font-size: 0.9em;
            width: 100%;
            max-width: 1200px;
            padding-right: 20px;
            box-sizing: border-box;
        }

        #loadingMessage {
            text-align: center;
            font-size: 1.2em;
            padding: 20px;
            display: none;
        }

        #infoButton {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 55px;
            height: 55px;
            background: linear-gradient(145deg, var(--info-button-bg) 0%, color-mix(in srgb, var(--info-button-bg) 70%, white 30%) 50%, var(--info-button-bg) 100%);
            color: var(--info-button-text);
            border: 2px solid rgba(255, 255, 255, 0.4);
            border-radius: 50%;
            font-size: 1.9rem;
            font-weight: bold;
            text-align: center;
            line-height: 51px;
            cursor: pointer;
            box-shadow:
                0 8px 20px rgba(0, 0, 0, 0.25),
                inset 0 2px 6px rgba(255, 255, 255, 0.3),
                inset 0 -2px 6px rgba(0, 0, 0, 0.1);
            z-index: 1051;
            transition: all 0.3s ease;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        #infoButton:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }

        #infoOverlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--overlay-bg);
            z-index: 1050;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
        }

        #infoModal {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
            -webkit-backdrop-filter: blur(25px);
            backdrop-filter: blur(25px);
            color: var(--modal-text);
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow:
                0 25px 80px rgba(0, 0, 0, 0.25),
                0 15px 40px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
            z-index: 1051;
            width: 92%;
            max-width: 750px;
            max-height: 85vh;
            overflow-y: auto;
            padding: 0;
        }

        .dark-mode #infoModal {
            background-color: rgba(42, 42, 42, 0.3);
            box-shadow: 0 8px 32px 0 rgba(20, 20, 20, 0.5);
        }

        #infoModal h3 {
            margin: 0;
            padding: 20px 25px;
            text-align: center;
            color: white;
            background: linear-gradient(145deg, var(--info-modal-header-bg) 0%, color-mix(in srgb, var(--info-modal-header-bg) 70%, white 30%) 50%, var(--info-modal-header-bg) 100%);
            border-radius: 18px 18px 0 0;
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
            font-size: 1.4rem;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.2), inset 0 -2px 6px rgba(0, 0, 0, 0.1);
        }

        #infoModalContent {
            padding: 25px 30px;
            line-height: 1.6;
            font-size: 0.95rem;
        }

        #infoModal .modal-buttons {
            margin-top: 15px;
            padding: 0 25px 20px 25px;
            justify-content: flex-end;
        }

        .loader-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--overlay-bg);
            z-index: 2000;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: var(--popup-text);
        }

        .spinner {
            border: 8px solid #f3f3f3;
            border-top: 8px solid #3498db;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            animation: spin 1s linear infinite;
        }

        .dark-mode .spinner {
            border-top: 8px solid #5F9EA0;
        }

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

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

        .loader-overlay p {
            margin-top: 20px;
            font-size: 1.2em;
            color: var(--primary-text);
        }

        .dark-mode .loader-overlay p {
            color: var(--popup-text);
        }

        /* ========================================== */
        /* ======= LANDING / PROJECT SELECTOR ======= */
        /* ========================================== */
        #landingContainer {
            width: 100%;
            max-width: 1000px;
            margin: 0 auto;
            text-align: center;
            /* Center the workspace picker in the middle of the page (no header). */
            min-height: 80vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        #landingContainer .landing-header,
        #landingContainer .landing-cards {
            width: 100%;
        }

        .landing-header h2 {
            font-size: 2rem;
            font-weight: 800;
            color: var(--primary-text);
            margin: 0 0 8px 0;
        }

        .landing-header p {
            font-size: 1.05rem;
            color: #6b7280;
            margin: 0 0 40px 0;
            letter-spacing: 0.3px;
        }

        /* Big engraved "WELCOME" — monochrome, 3D beveled letterpress. */
        .landing-welcome {
            font-size: 4.6rem;
            font-weight: 900;
            letter-spacing: 12px;
            line-height: 1;
            margin: 0 0 6px 0;
            text-indent: 12px; /* balance the trailing letter-spacing */
            color: #6366f1;
            background: linear-gradient(120deg, #2563eb 0%, #6366f1 30%, #a855f7 55%, #ec4899 80%, #f59e0b 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 3px 3px rgba(15,23,42,0.22));
        }

        .landing-header h2 {
            text-shadow: 0 1px 0 rgba(255,255,255,0.7), 0 2px 6px rgba(15,23,42,0.12);
        }

        .landing-cards {
            display: flex;
            gap: 30px;
            justify-content: center;
            flex-wrap: wrap;
            perspective: 1200px; /* gives the tilt real depth */
        }

        /* Elevated 3D "gaming" tabs — brushed-steel monochrome, layered depth. */
        .landing-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            width: 264px;
            min-height: 214px;
            padding: 34px 24px;
            background:
                linear-gradient(160deg, #ffffff 0%, #eef1f6 46%, #dfe3ea 100%);
            border: 1px solid rgba(148,163,184,0.45);
            border-top-color: rgba(255,255,255,0.95);
            border-radius: 20px;
            cursor: pointer;
            transform-style: preserve-3d;
            box-shadow:
                0 2px 0 #ffffff inset,             /* top gloss */
                0 -3px 8px rgba(15,23,42,0.06) inset, /* bottom inner shade */
                0 1px 1px rgba(255,255,255,0.9),
                0 10px 18px rgba(15,23,42,0.16),
                0 22px 40px rgba(15,23,42,0.20);   /* deep floor shadow */
            transition:
                transform 0.28s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.28s ease,
                border-color 0.28s ease;
        }

        /* Sheen sweep across the top of the card. */
        .landing-card::before {
            content: '';
            position: absolute;
            inset: 1px 1px auto 1px;
            height: 46%;
            border-radius: 20px 20px 60% 60% / 20px 20px 22px 22px;
            background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0));
            pointer-events: none;
        }

        /* Coloured accent bar along the top of each card (per-card gradient). */
        .landing-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 18%;
            right: 18%;
            height: 5px;
            border-radius: 0 0 6px 6px;
            background: var(--card-accent, linear-gradient(90deg, #3b82f6, #6366f1));
            box-shadow: 0 2px 10px var(--card-glow, rgba(59,130,246,0.55));
            transition: left 0.28s ease, right 0.28s ease;
        }

        .landing-card:hover::after {
            left: 6%;
            right: 6%;
        }

        .landing-card:hover {
            transform: translateY(-12px) rotateX(6deg) scale(1.03);
            border-color: var(--card-border-hover, rgba(59,130,246,0.7));
            box-shadow:
                0 2px 0 #ffffff inset,
                0 -3px 8px rgba(15,23,42,0.08) inset,
                0 1px 1px rgba(255,255,255,0.9),
                0 18px 28px rgba(15,23,42,0.20),
                0 40px 60px var(--card-glow, rgba(59,130,246,0.30));
        }

        .landing-card:active {
            transform: translateY(-4px) scale(1.0);
            box-shadow:
                0 2px 0 #ffffff inset,
                0 8px 16px rgba(15,23,42,0.18),
                0 16px 30px rgba(15,23,42,0.20);
        }

        /* Per-card colour theme (order: DBR / Incident Report / Incident Info). */
        .landing-card:nth-child(1) {
            --card-accent: linear-gradient(90deg, #2563eb, #06b6d4);
            --card-glow: rgba(37,99,235,0.40);
            --card-border-hover: rgba(37,99,235,0.75);
            background: linear-gradient(160deg, #ffffff 0%, #eff5ff 55%, #dceafe 100%);
        }
        .landing-card:nth-child(2) {
            --card-accent: linear-gradient(90deg, #f59e0b, #ef4444);
            --card-glow: rgba(239,68,68,0.38);
            --card-border-hover: rgba(239,68,68,0.7);
            background: linear-gradient(160deg, #ffffff 0%, #fff7ed 55%, #ffe9d6 100%);
        }
        .landing-card:nth-child(3) {
            --card-accent: linear-gradient(90deg, #10b981, #14b8a6);
            --card-glow: rgba(16,185,129,0.38);
            --card-border-hover: rgba(16,185,129,0.7);
            background: linear-gradient(160deg, #ffffff 0%, #ecfdf5 55%, #d5f5ea 100%);
        }

        .landing-card-icon {
            font-size: 3.3rem;
            line-height: 1;
            /* Full-colour emoji with a soft drop shadow for depth. */
            filter: drop-shadow(0 6px 10px rgba(15,23,42,0.30));
            transition: transform 0.28s ease;
        }

        .landing-card:hover .landing-card-icon {
            transform: translateY(-2px) scale(1.08);
        }

        .landing-card-title {
            font-size: 1.4rem;
            font-weight: 800;
            letter-spacing: 0.5px;
            color: #2b3441;
            text-shadow: 0 1px 0 rgba(255,255,255,0.9);
        }

        .landing-card-desc {
            font-size: 0.92rem;
            color: #6b7280;
            line-height: 1.45;
        }

        .landing-card-badge {
            position: absolute;
            top: 14px;
            right: 14px;
            font-size: 0.62rem;
            font-weight: 800;
            letter-spacing: 0.6px;
            text-transform: uppercase;
            color: #f8fafc;
            background: linear-gradient(145deg, #4b5563 0%, #1f2937 100%);
            padding: 4px 10px;
            border-radius: 999px;
            box-shadow: 0 2px 6px rgba(15,23,42,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
        }

        /* Home (back to landing) button */
        .home-btn {
            position: fixed;
            top: 16px;
            left: 16px;
            padding: 10px 18px;
            font-size: 0.95rem;
            font-weight: 600;
            color: #fff;
            background: linear-gradient(135deg, #1e3a8a, #3b82f6);
            border: none;
            border-radius: 12px;
            cursor: pointer;
            z-index: 1600;
            box-shadow: 0 6px 18px rgba(30,58,138,0.5);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .home-btn:hover {
            transform: translateX(-3px);
            box-shadow: 0 8px 22px rgba(30,58,138,0.65);
        }

        /* Incident Info full view */
        .info-view-body {
            padding: 28px 32px;
            line-height: 1.6;
            color: var(--modal-text);
        }

        .info-view-body h4 {
            color: #1e3a8a;
            margin-bottom: 6px;
        }

        @media (max-width: 768px) {
            .landing-card { width: 100%; max-width: 320px; }
        }



        /* ========================================== */
        /* ========= INCIDENT REPORT STYLES ========= */
        /* ========================================== */
        /* Fixed layout so declared widths are honored exactly. */
        #incidentTable {
            width: 100%;
            table-layout: fixed;
            border-collapse: separate;
            border-spacing: 0;
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 8px 24px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
            background: #fff;
        }

        /* Modern header: subtle steel gradient, uppercase, crisp bottom accent. */
        #incidentTable thead th {
            background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
            color: #334155;
            font-weight: 700;
            font-size: 0.82rem;
            letter-spacing: 0.4px;
            text-transform: uppercase;
            padding: 12px 10px;
            border: none;
            border-bottom: 2px solid #3b82f6;
            vertical-align: middle;
        }

        /* Cells: light dividers only, comfortable padding. */
        #incidentTable tbody td {
            padding: 10px 10px;
            border: none;
            border-bottom: 1px solid #eef1f5;
            border-right: 1px solid #f3f5f8;
            vertical-align: middle;
        }
        #incidentTable tbody td:last-child { border-right: none; }
        #incidentTable tbody tr:last-child td { border-bottom: none; }

        /* Zebra striping + row hover highlight for readability. */
        #incidentTable tbody tr:nth-child(even) { background: #fafbfd; }
        #incidentTable tbody tr:hover { background: #eef4ff; }

        /* Inputs/selects: soft rounded, subtle border, blue focus ring. */
        #incidentTable tbody td .form-control {
            border: 1px solid #d7dce3;
            border-radius: 8px;
            padding: 7px 9px;
            background: #fff;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        #incidentTable tbody td .form-control:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
            outline: none;
        }
        /* Read-only DSP field: clearly non-editable (muted fill). */
        #incidentTable tbody td input[readonly] {
            background: #f4f6f9;
            color: #475569;
            cursor: default;
        }

        /* Column sizing (percentages sum to 100%):
           - No. / Severity / Event Date -> sized as needed.
           - Incident Type, DA ID, DSP Name, Comment -> the rest, split EQUALLY
             (18.5% each) so DSP Name gets more room and Incident Type shrinks. */
        #incidentTable .incident-no-col { width: 4%; text-align: center; font-weight: 600; }
        #incidentTable .incident-severity-col { width: 8%; text-align: center; }
        #incidentTable .incident-eventdate-col { width: 13%; }
        #incidentTable .incident-remove-col { width: 3%; }

        #incidentTable .incident-type-col,
        #incidentTable .incident-transporter-col,
        #incidentTable .incident-dsp-col,
        #incidentTable .comments-col {
            width: 18%;
        }
        #incidentTable .incident-type-col {
            text-align: left;
            font-weight: 600;
        }

        /* Single combined date+time field, full width. */
        #incidentTable .incident-eventdate-input {
            width: 100%;
            display: block;
        }

        /* Inline "DA not found for <site>" hint under the DA ID field. */
        .incident-da-hint {
            margin-top: 3px;
            font-size: 0.72rem;
            font-weight: 600;
            color: #b91c1c;
            line-height: 1.2;
            min-height: 0.9em;
        }

        /* Auto-populated severity badge (colour by level; read-only). */
        .severity-badge {
            display: inline-block;
            min-width: 62px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 0.78rem;
            font-weight: 800;
            letter-spacing: 0.4px;
            text-transform: uppercase;
            color: #6b7280;
            background: #e5e7eb;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
        }
        .severity-badge[data-level="low"] {
            color: #065f46;
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
        }
        .severity-badge[data-level="medium"] {
            color: #92400e;
            background: linear-gradient(135deg, #fef3c7, #fde68a);
        }
        .severity-badge[data-level="high"] {
            color: #fff;
            background: linear-gradient(135deg, #ef4444, #b91c1c);
            box-shadow: 0 2px 8px rgba(239,68,68,0.45);
        }

        #incidentTable td select.incident-type-select {
            background: var(--editable-bg);
            width: 100%;
        }

        #incidentTable .incident-remove-col {
            width: 40px;
            text-align: center;
        }

        #incidentTable .incident-remove-btn {
            background: transparent;
            border: none;
            color: #c0392b;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            line-height: 1;
            padding: 4px 8px;
            border-radius: 6px;
        }

        #incidentTable .incident-remove-btn:hover {
            background: rgba(192, 57, 43, 0.12);
        }

        .incident-add-row {
            margin: 14px 0;
            text-align: left;
        }

        /* ---- Modern incident UI polish ---------------------------------- */
        /* Smooth entrance for newly added rows (no abrupt pop-in). */
        @keyframes incRowIn {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        #incidentTable tbody tr {
            animation: incRowIn 0.22s ease-out;
            transition: background-color 0.15s ease;
        }
        #incidentTable tbody tr:hover {
            background-color: rgba(59, 130, 246, 0.06);
        }
        /* Row being removed: fade + collapse instead of vanishing instantly. */
        #incidentTable tbody tr.incident-row-removing {
            animation: incRowOut 0.2s ease-in forwards;
        }
        @keyframes incRowOut {
            to { opacity: 0; transform: translateX(12px); }
        }

        /* Modern inputs + dropdown: rounded, subtle border, focus ring. */
        #incidentTable td .form-control,
        #incidentTable td select.incident-type-select {
            border: 1px solid var(--table-row-border);
            border-radius: 8px;
            padding: 7px 10px;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        #incidentTable td .form-control:focus,
        #incidentTable td select.incident-type-select:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
        }

        /* Rounder, animated remove button. */
        #incidentTable .incident-remove-btn {
            transition: background-color 0.15s ease, transform 0.1s ease;
        }
        #incidentTable .incident-remove-btn:hover {
            transform: scale(1.15);
        }

        /* Polished + Add Incident button. */
        .incident-add-btn {
            background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
            border: none !important;
            color: #fff !important;
            border-radius: 10px !important;
            padding: 9px 18px !important;
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
            transition: transform 0.12s ease, box-shadow 0.15s ease;
        }
        .incident-add-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
        }
        .incident-add-btn:active {
            transform: translateY(0);
        }

        /* Incident toolbar: allow buttons to wrap so none (Submit/Logout) get
           clipped by the container's overflow:hidden when space is tight. */
        #incidentContainer .button-container {
            flex-wrap: wrap;
        }

        #incidentContainer .button-container button {
            flex: 1 1 130px;
            min-width: 110px;
        }

        /* Incident confirmation modal: keep the action buttons always visible
           by scrolling only the data area (flex child) instead of the whole modal. */
        #incidentConfirmationModal #incConfirmationData {
            flex: 1 1 auto;
            overflow-y: auto;
            min-height: 0;
        }

        #incidentConfirmationModal .modal-buttons {
            flex: 0 0 auto;
            background: var(--modal-bg);
            padding-top: 12px;
            margin-top: 12px;
            border-top: 1px solid var(--table-row-border);
        }

        #incidentConfirmationModal {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--modal-bg);
            color: var(--modal-text);
            padding: 25px 30px;
            border-radius: 16px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
            z-index: 2100;
            max-width: 640px;
            width: 90%;
            max-height: 85vh;
            /* Flex column so the title + action buttons stay fixed and only the
               data area scrolls. Prevents Confirm Submit from being pushed off
               screen when there are many incidents. */
            flex-direction: column;
            overflow: hidden;
        }

        #incidentConfirmationModal h3 {
            flex: 0 0 auto;
            margin-top: 0;
        }

        #incOverlay {
            display: none;
            position: fixed;
            inset: 0;
            background: var(--overlay-bg);
            z-index: 2000;
        }

        /* Incident Info modal styling */
        .incident-info-banner {
            display: flex;
            align-items: center;
            gap: 10px;
            background: linear-gradient(135deg, #eff6ff, #dbeafe);
            border: 1px solid #bfdbfe;
            border-radius: 12px;
            padding: 12px 14px;
            margin-bottom: 16px;
            color: #1e3a8a;
            font-weight: 500;
        }

        .incident-info-badge {
            font-size: 0.65rem;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: #fff;
            background: linear-gradient(135deg, #f97316, #ef4444);
            padding: 3px 9px;
            border-radius: 999px;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
            flex-shrink: 0;
        }

        .incident-info-note {
            background: #fffbeb;
            border-left: 4px solid #f59e0b;
            border-radius: 8px;
            padding: 12px 14px;
            margin-top: 14px;
            color: #78350f;
            font-size: 0.92rem;
        }

        /* ============================================================= */
        /* ===== MODERN GRADIENT THEME (blue -> indigo) overlay ========= */
        /* Cohesive restyle on top of the existing Bootstrap layout.     */
        /* ============================================================= */

        /* Card: thin gradient top accent bar + softer, deeper shadow. */
        .container {
            border: 1px solid rgba(79,70,229,0.14);
            box-shadow:
                0 30px 60px rgba(30,41,89,0.16),
                0 10px 24px rgba(30,41,89,0.10),
                inset 0 1px 0 rgba(255,255,255,0.85);
            position: relative;
        }
        .container::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 5px;
            background: var(--app-accent-grad);
            z-index: 5;
        }

        /* Primary action buttons -> gradient. Applies to DBR + incident submit,
           Add Incident, and the modal confirm button. */
        .button-container .action-button#mainSubmitButton,
        .button-container .action-button#incSubmitButton,
        #incConfirmSubmitBtn,
        .incident-add-btn {
            background: var(--app-accent-grad) !important;
            border: none !important;
            color: #fff !important;
            box-shadow: 0 6px 16px rgba(79,70,229,0.30);
        }
        .button-container .action-button#mainSubmitButton:hover:not(:disabled),
        .button-container .action-button#incSubmitButton:hover:not(:disabled),
        #incConfirmSubmitBtn:hover:not(:disabled),
        .incident-add-btn:hover {
            filter: brightness(1.06);
            box-shadow: 0 9px 22px rgba(79,70,229,0.42);
        }

        /* Page heading banner: gradient instead of grey steel. */
        .main-heading {
            background: var(--app-accent-grad) !important;
            color: #fff !important;
            border: none !important;
        }
        .main-heading::after { display: none; }

        /* Auth / welcome header banner -> same gradient family. */
        .auth-header {
            background: var(--app-accent-grad) !important;
        }

        /* Incident table header: match the indigo accent. */
        #incidentTable thead th {
            border-bottom-color: var(--app-accent) !important;
        }

        /* Home button -> gradient. */
        .home-btn {
            background: var(--app-accent-grad) !important;
        }

        /* ========================================== */
        /* ========== END OF CSS SECTION ========== */
        /* ========================================== */
