/* FactorySync/assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500&display=swap');

/* Existing styles unchanged */
:root {
    --bg-card: rgba(255, 255, 255, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --text-primary: #e2e8f0;
    --bg-hover: rgba(255, 255, 255, 0.1);
    --accent-color: #facc15;
}
body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #0a1d37, #1e3a8a);
    /*background: linear-gradient(181deg, #020913, #737e9c);*/
    margin: 0;
    padding: 0;
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

h5 {
    color: #facc15;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
}

/* Line Switcher - Clean Complete Solution */
.line-switcher-card { margin-bottom: 15px; }

.line-switcher-content { 
    display: block; 
    width: 100%;
}

.line-switcher-content > div:first-child {
    margin-bottom: 0;
}

.line-switcher-button-wrapper {
    margin-top: 15px;
}

.line-switcher-new-btn {
    width: auto;
    min-width: 120px;
}

/* Active Line Dropdown Styling */
#lineSwitch,
.line-switcher-select {
    font-weight: 600;
    font-size: 15px;
    background: #1e3a8a;
    color: #facc15;
    border: 2px solid #facc15; /* Bold border to stand out */
    padding: 10px;
    border-radius: 6px;
}

#lineSwitch:focus,
.line-switcher-select:focus {
    border-color: #facc15;
    background: #2b4b9b;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
    outline: none;
}

/* Add visual indicator for active selection */
.line-switcher-label {
    font-weight: 600;
    color: #facc15;
    margin-bottom: 8px;
    display: block;
}

@media (max-width: 768px) {
    #lineSwitch,
    .line-switcher-select {
        font-size: 14px;
        padding: 8px;
    }
}

.navbar.navbar-expand-lg {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6) !important;
    /*background: linear-gradient(90deg, #0a1d37, #667692) !important;*/
    color: #ffffff !important;
    height: 60px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 500;
    text-decoration: none;
}

.navbar-brand .logo {
    max-width: 80px;
    height: auto;
    margin-right: 20px;
}

.navbar-brand .client-header {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    color: #ffffff;
    flex-grow: 1;
    text-align: center;
    padding: 0 20px;
}

.nav-link {
    color: #ffffff !important;
    font-size: 16px;
}

.nav-link:hover {
    color: #facc15 !important;
}

.placeholder {
    font-style: italic;
    color: #fff;
    background-color: transparent;
    margin: 10px 0;
}

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 0 10px;
    max-width: 100%;
}

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

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #94a3b8;
}

.form-group input,
.form-group select {
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    background: #1e3a8a;
    /*background: rgba(10, 29, 55, 0.5);*/
    color: #facc15;
    transition: border-color 0.3s, background 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #facc15;
    background: #2b4b9b;
    /*background: #3f4862;*/
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
    outline: none;
}

.form-actions {
    text-align: center;
    margin-top: 15px;
    padding: 0 10px;
    margin-bottom: 20px;
}

.button,
.btn.btn-hitech {
    background: linear-gradient(45deg, #3b82f6, #facc15) !important;
    border: none !important;
    color: #0a1d37 !important;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    width: auto;
    transition: background 0.3s, color 0.3s;
    margin-bottom: 5px;
}

.button:hover,
.btn.btn-hitech:hover {
    background: linear-gradient(45deg, #facc15, #3b82f6) !important;
    color: #ffffff !important;
}

.alert.alert-success,
.alert.alert-danger {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert.alert-success {
    border-color: #34d399;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Scale animation for icons and buttons */
.scale-in {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Initial state for hidden containers with animation */
.hi-tech-card.tab-content-hidden,
.hi-tech-panel.tab-content-hidden,
.instructions.tab-content-hidden {
    opacity: 0;
    transform: translateY(20px);
}

/* Initial state for hidden icons and buttons */
.icon-button.tab-content-hidden,
.btn-primary.tab-content-hidden {
    opacity: 0;
    transform: scale(0.5);
}

/* Appended style for config_management.php alert */
.alert-success--config {
    color: #fff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1); /* This was not there in config_management.js */
    border: 1px solid #34d399; /* This was not there in config_management.js */
}

.alert-danger--config {
    color: #fff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1); /* This was not there in config_management.js */
    border: 1px solid #f87171; /* This was not there in config_management.js */
}


.fixed-alert {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 90%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.fixed-alert .close-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 16px;
    cursor: pointer;
}

.alert.alert-danger {
    border-color: #f87171;
}

.error {
    color: #f87171;
    margin-bottom: 15px;
    padding: 0 10px;
    display: block;
}

main {
    padding: 20px 0;
    flex: 1 0 auto;
}

main h2 {
    text-align: center;
    font-size: 24px;
    color: #facc15;
    margin-bottom: 20px;
}

.admin-link {
    text-align: center;
    margin-top: 20px;
    padding: 0 10px;
}

.admin-link a {
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    font-size: 16px;
}

.admin-link a:hover {
    color: #facc15;
}

.hi-tech-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    padding: 15px;
    margin-bottom: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.hi-tech-card h3 {
    color: #facc15;
    margin-bottom: 15px;
    font-size: 18px;
}

.hi-tech-card h4 {
    margin-bottom: 15px;
    color: #e2e8f0;
    font-size: 18px;
}

.tab-container {
    margin-top: 20px;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #3b5eb7 #1e3a8a;
    margin-bottom: 20px;
    border-bottom: 2px solid #facc15;
}

.tab-container::-webkit-scrollbar {
    height: 8px;
}

.tab-container::-webkit-scrollbar-track {
    background: #1e3a8a;
}

.tab-container::-webkit-scrollbar-thumb {
    background: #3b5eb7;
    border-radius: 4px;
}

.tab-container--wrap {
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: visible;
    white-space: normal;
}

.tab-button {
    padding: 10px 20px;
    background-color: #1e3a8a;
    color: #facc15;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-right: 5px;
    overflow: visible;
    display: inline-block;
    white-space: nowrap;
}

.tab-container--wrap .tab-button {
    flex: 1 1 auto;
    min-width: 120px;
    border-bottom: 2px solid #facc15;
}

.tab-button:hover {
    background-color: #2a5098;
}

.tab-button.active {
    background-color: #facc15;
    color: #1e3a8a;
    border-bottom: 2px solid #1e3a8a;
}

.tab-content-container {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 0 5px 5px 5px;
    max-width: 100%;
    box-sizing: border-box;
}

.tab-content {
    width: 100%;
}

.form-control, .btn, .navbar, .alert {
    font-family: 'Open Sans', sans-serif;
}

.parameter-heading {
    color: #facc15;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

}

.data-table {
    width: 100%;
    min-width: 500px;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.data-table th,
.data-table td {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.data-table th {
    background: #1e3a8a;
    color: #facc15;
}

.data-table td input {
    width: 70px;
    text-align: center;
    background: transparent;
    border: none;
    color: #e2e8f0;
}

.data-table td input:focus {
    outline: none;
    border-bottom: 2px solid #facc15;
}

.data-table td select.action-dropdown {
    width: 120px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
}

.data-table.fixed-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1e3a8a;
}

.admin-floating-metrics {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(30, 58, 138, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1001;
    max-width: 250px;
}

.admin-floating-metrics.show {
    display: block;
}

.admin-floating-metrics h5 {
    color: #facc15;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.admin-floating-metrics p {
    margin: 5px 0;
    color: #e2e8f0;
    font-size: 0.9em;
}

.admin-floating-icon {
    position: fixed;
    bottom: 10px;
    right: 20px;
    background: linear-gradient(45deg, #3b82f6, #facc15);
    color: #0a1d37;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    font-size: 24px;
    transition: background 0.3s, transform 0.3s;
}

.admin-floating-icon:hover {
    background: linear-gradient(45deg, #facc15, #3b82f6);
    transform: scale(1.1);
}

.bell-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #facc15;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 1003;
}

.bell-icon .badge-unread {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3333;
    color: #fff;
    border-radius: 50%;
    padding: 3px 7px;
    font-size: 0.7em;
    line-height: 1;
    text-align: center;
}

.bell-icon .badge-read {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #94a3b8;
    color: #1a1a1a;
    border-radius: 50%;
    padding: 3px 7px;
    font-size: 0.7em;
    line-height: 1;
    text-align: center;
}

.confirmation-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #0a1d37, #1e3a8a);
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    max-width: 300px;
    display: none;
}

.confirmation-popup.show {
    display: block;
}

.confirmation-popup .popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #facc15 #1a1a1a;
}

.confirmation-popup .popup-content::-webkit-scrollbar {
    width: 8px;
}

.confirmation-popup .popup-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.confirmation-popup .popup-content::-webkit-scrollbar-thumb {
    background: #facc15;
    border-radius: 4px;
}

.confirmation-popup .popup-content::-webkit-scrollbar-thumb:hover {
    background: #e2b013;
}

.confirmation-popup h3 {
    color: #facc15;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.confirmation-popup .notification-item {
    margin: 10px 0;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.confirmation-popup .notification-item.unread {
    font-weight: 500;
    background: rgba(255, 51, 51, 0.1);
}

.confirmation-popup .notification-item.read {
    font-weight: 400;
    opacity: 0.8;
}

.confirmation-popup .notification-message {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.confirmation-popup .notification-timestamp {
    color: #94a3b8;
    font-size: 0.8em;
}

.confirmation-popup .notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.confirmation-popup .btn-notification {
    background: linear-gradient(45deg, #3b82f6, #facc15);
    color: #0a1d37;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.3s;
}

.confirmation-popup .btn-notification:hover {
    background: linear-gradient(45deg, #facc15, #3b82f6);
    color: #ffffff;
}

.confirmation-popup .btn-notification.delete {
    background: linear-gradient(45deg, #ef4444, #f87171);
}

.confirmation-popup .btn-notification.delete:hover {
    background: linear-gradient(45deg, #b91c1c, #dc2626);
}

.end-shift-container {
    padding: 20px 0;
}

.btn-end-shift {
    background: linear-gradient(45deg, #ef4444, #f87171) !important;
    font-size: 18px !important;
    padding: 12px 40px !important;
}

.btn-end-shift:hover {
    background: linear-gradient(45deg, #b91c1c, #dc2626) !important;
    color: #ffffff !important;
}

.floating-panel {
    position: fixed !important;
    background: #1a1a1a !important;
    color: #e2e8f0 !important;
    padding: 10px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 10000 !important;
    width: 200px !important;
    opacity: 1 !important;
}

.left-panel {
    bottom: 80px !important;
    left: 20px !important;
}

.right-panel {
    bottom: 80px !important;
    right: 20px !important;
    width: 300px !important;
}

.floating-icon {
    position: fixed !important;
    bottom: 20px !important;
    font-size: 24px !important;
    background: linear-gradient(45deg, #3b82f6, #facc15) !important;
    color: #0a1d37 !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    z-index: 1001 !important;
    transition: background 0.3s, transform 0.3s !important;
}

.floating-icon:hover {
    background: linear-gradient(45deg, #facc15, #3b82f6) !important;
    transform: scale(1.1) !important;
}

/* Appended styles for operations.php floating icons */
.floating-icon--left {
    left: 20px;
}

.floating-icon--right {
    right: 20px;
}

/* Appended style for operations.php floating panel */
.floating-panel--operations {
    color: #00ccff !important;
}

.loading-spinner {
    display: none;
    text-align: center;
    color: #facc15;
    font-size: 14px;
    margin: 10px 0;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #facc15;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

.accordion {
    font-family: 'Open Sans', sans-serif;
    background: transparent;
}

.accordion-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.accordion-button {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(90deg, #1e3a8a, #2b4b9b);
    color: #e2e8f0;
    font-weight: 500;
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s, color 0.3s;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(90deg, #3b82f6, #facc15);
    color: #0a1d37;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(250, 204, 21, 0.5);
    outline: none;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e2e8f0'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230a1d37'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.accordion-body {
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

.accordion-body .form-control {
    background: #1e3a8a;
    color: #facc15;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.accordion-body .form-control:focus {
    background: #2b4b9b;
    border-color: #facc15;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

.accordion-body .form-check-label {
    color: #e2e8f0;
}

.accordion-body .alert {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.accordion-body .alert-success {
    border-color: #34d399;
}

.accordion-body .alert-danger {
    border-color: #f87171;
}

.accordion-body .admin-link {
    color: #94a3b8;
}

.accordion-body .admin-link:hover {
    color: #facc15;
}

.form-check {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 10px !important;
    width: 100%;
}

.form-check-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    background: #1e3a8a !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background 0.3s, border-color 0.3s !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
}

.form-check-input:checked {
    background: linear-gradient(45deg, #3b82f6, #facc15) !important;
    border-color: #facc15 !important;
    position: relative !important;
}

.form-check-input:checked::after {
    content: '\2713' !important;
    color: #0a1d37 !important;
    font-size: 12px !important;
    font-weight: bold !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.form-check-input:focus {
    outline: none !important;
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.5) !important;
    border-color: #facc15 !important;
}

.form-check-label {
    color: #e2e8f0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    text-align: center !important;
}

.accordion-body .form-check {
    justify-content: center !important;
}

.accordion-body .form-check-input {
    background: #1e3a8a !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.accordion-body .form-check-input:checked {
    background: linear-gradient(45deg, #3b82f6, #facc15) !important;
    border-color: #facc15 !important;
}

.accordion-body .form-check-label {
    color: #e2e8f0 !important;
}

.dropdown-mobile {
    display: none;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.daily-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.daily-stats-table th,
.daily-stats-table td {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.daily-stats-table th {
    background: #1e3a8a;
    color: #facc15;
}

.footer {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    /*background: linear-gradient(90deg, #0a1d37, #667692);*/
    color: #e2e8f0;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 400;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.footer .company-name {
    color: #facc15;
    font-weight: 500;
}

@media (min-width: 769px) and (max-width: 1366px) {
    .container {
        max-width: 960px;
        padding: 0 20px;
        flex: 1 0 auto;
    }
    .navbar.navbar-expand-lg {
        padding: 12px 20px;
        height: 68px;
    }
    .navbar-brand {
        font-size: 24px;
    }
    .navbar-brand .logo {
        max-width: 80px;
        margin-right: 20px;
    }
    .navbar-brand .client-header {
        font-size: 22px;
        padding: 0 20px;
    }
    .nav-link {
        font-size: 16px;
    }
    .form-grid {
        gap: 16px;
        padding: 0 20px;
    }
    .form-group input,
    .form-group select {
        font-size: 16px;
        padding: 12px;
    }
    .button,
    .btn.btn-hitech {
        font-size: 12px;  /*16px*/
        padding: 8px 16px; /*padding: 12px 25px;*/
    }
    .form-actions {
        margin-top: 25px;
        padding: 0 20px;
        margin-bottom: 20px;
    }
    .alert.alert-success,
    .alert.alert-danger {
        font-size: 16px; 
        padding: 12px;
    }
    .error {
        font-size: 16px;
        padding: 0 20px;
    }
    .main {
        padding: 30px 0;
    }
    .main h2 {
        font-size: 24px;
    }
    .admin-link {
        margin-top: 20px;
        font-size: 16px;
    }
    .hi-tech-card {
        padding: 20px;
        margin-bottom: 30px;
        margin-top: 30px;
    }
    .parameter-heading {
        font-size: 18px;
    }
    .data-table th,
    .data-table td {
        font-size: 15px;
        padding: 10px;
    }
    .data-table td input {
        width: 80px;
    }
    .data-table td select.action-dropdown {
        width: 120px;
    }
    .admin-floating-metrics {
        bottom: 70px;
        right: 20px;
        padding: 15px;
        max-width: 70%;
    }
    .admin-floating-icon {
        bottom: 20px;
        right: 20px;
    }
    .confirmation-popup {
        max-width: 400px;
    }
    .confirmation-popup .btn-notification {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    .floating-panel {
        width: 250px !important;
    }
    .right-panel {
        width: 400px !important;
    }
    .daily-stats-table th,
    .daily-stats-table td {
        font-size: 15px;
        padding: 10px;
    }
    .footer {
        font-size: 15px;
        padding: 12px 0;
    }
}

@media (max-width: 768px) {
    .tab-container,
    .tab-container--wrap {
        display: none; /* Maintains existing mobile behavior */
    }
    .container {
        padding: 10px;
        max-width: 100%;
        flex: 1 0 auto;
    }
    .navbar.navbar-expand-lg {
        padding: 8px 12px;
        width: 100vw;
        margin: 0;
        box-sizing: border-box;
        z-index: 1050;
    }
    .navbar-brand {
        font-size: 20px;
    }
    .navbar-brand .logo {
        max-width: 60px;
        margin-right: 10px;
    }
    .navbar-brand .client-header {
        font-size: 18px;
        padding: 0 10px;
    }
    .nav-link {
        font-size: 14px;
    }
    .navbar-collapse {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100vw;
        background: #1e3a8a;
        padding: 10px;
        display: none;
        z-index: 1050;
    }
    .navbar-collapse.show {
        display: block;
    }
    .tab-container {
        display: none;
    }
    .accordion-container {
        display: block;
    }
    .accordion-container details {
        margin-bottom: 10px;
    }
    .accordion-container summary {
        padding: 10px;
        background-color: #1e3a8a;
        color: #facc15;
        cursor: pointer;
        font-weight: bold;
        border-radius: 4px;
    }
    .accordion-container summary:hover {
        background-color: #2a5098;
    }
    .accordion-container .tab-content {
        display: none;
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 0 0 4px 4px;
    }
    .accordion-container details[open] .tab-content {
        display: block;
    }
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 6px;
    }
    .form-grid {
        padding: 0 10px;
        gap: 10px;
    }
    .form-group input,
    .form-group select {
        font-size: 13px;
        padding: 8px;
    }
    .button,
    .btn.btn-hitech {
        font-size: 14px;
        padding: 8px 20px;
    }
    .form-actions {
        padding: 0 10px;
        margin-bottom: 20px;
    }
    .alert.alert-success,
    .alert.alert-danger {
        font-size: 14px;
        padding: 8px;
    }
    .error {
        padding: 0 10px;
        font-size: 14px;
    }
    .admin-link {
        padding: 0 10px;
        margin-top: 15px;
    }
    .main h2 {
        font-size: 20px;
    }
    .data-table th,
    .data-table td {
        font-size: 13px;
        padding: 6px;
    }
    .data-table td input {
        width: 50px;
    }
    .data-table td select.action-dropdown {
        width: 100px;
    }
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    .admin-floating-metrics {
        bottom: 60px;
        right: 10px;
        padding: 10px;
        max-width: 90%;
    }
    .admin-floating-icon {
        bottom: 10px;
        right: 10px;
    }
    .bell-icon {
        top: 10px;
        right: 10px;
        font-size: 1.2em;
    }
    .confirmation-popup {
        max-width: 90%;
    }
    .confirmation-popup .btn-notification {
        padding: 4px 8px;
        font-size: 0.7em;
    }
    .floating-panel {
        width: 180px !important;
    }
    .right-panel {
        width: 280px !important;
    }
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
    .daily-stats-table th,
    .daily-stats-table td {
        font-size: 13px;
        padding: 6px;
    }
    .footer {
        font-size: 13px;
        padding: 8px 0;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 8px;
        flex: 1 0 auto;
    }
    .navbar.navbar-expand-lg {
        padding: 6px 10px;
    }
    .navbar-brand {
        font-size: 18px;
    }
    .navbar-brand .logo {
        max-width: 50px;
    }
    .navbar-brand .client-header {
        font-size: 16px;
    }
    .nav-link {
        font-size: 12px;
    }
    .form-grid {
        gap: 8px;
    }
    .form-group input,
    .form-group select {
        font-size: 12px;
        padding: 6px;
    }
    .button,
    .btn.btn-hitech {
        font-size: 12px;
        padding: 6px 15px;
    }
    .form-actions {
        margin-bottom: 20px;
    }
    .hi-tech-card {
        padding: 10px;
    }
    .bell-icon {
        top: 8px;
        right: 8px;
        font-size: 1em;
    }
    .confirmation-popup {
        max-width: 95%;
    }
    .confirmation-popup .btn-notification {
        padding: 3px 6px;
        font-size: 0.6em;
    }
    .admin-floating-metrics {
        bottom: 50px;
        right: 8px;
    }
    .admin-floating-icon {
        bottom: 10px;
        right: 8px;
    }
    .floating-panel {
        width: 160px !important;
    }
    .right-panel {
        width: 320px !important;
    }
    .data-table td select.action-dropdown {
        width: 90px;
    }
    .daily-stats-table th,
    .daily-stats-table td {
        font-size: 12px;
        padding: 5px;
    }
    .footer {
        font-size: 12px;
        padding: 6px 0;
    }
}

@media (max-height: 400px) and (orientation: landscape) {
    .container {
        padding: 5px;
        flex: 1 0 auto;
    }
    .hi-tech-card {
        padding: 8px;
    }
    .data-table th,
    .data-table td {
        padding: 4px;
    }
    .data-table td input {
        width: 40px;
    }
    .data-table td select.action-dropdown {
        width: 90px;
    }
    .admin-floating-metrics {
        bottom: 50px;
        right: 5px;
        padding: 8px;
    }
    .admin-floating-icon {
        bottom: 5px;
        right: 5px;
    }
    .bell-icon {
        top: 5px;
        right: 5px;
    }
    .confirmation-popup {
        max-width: 95%;
    }
    .confirmation-popup .btn-notification {
        padding: 3px 6px;
        font-size: 0.6em;
    }
    .form-grid {
        gap: 6px;
    }
    .form-group input,
    .form-group select {
        font-size: 12px;
        padding: 5px;
    }
    .form-actions {
        margin-bottom: 20px;
    }
    .floating-panel {
        width: 150px !important;
    }
    .right-panel {
        width: 240px !important;
    }
    .daily-stats-table th,
    .daily-stats-table td {
        font-size: 12px;
        padding: 4px;
    }
    .footer {
        font-size: 12px;
        padding: 5px 0;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand .logo {
        image-rendering: -webkit-optimize-contrast;
    }
    .button,
    .btn.btn-hitech,
    .btn-end-shift,
    .btn-notification {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Edit Modal Specific Styles */
#edit-modal .form-actions {
    display: block;
    margin-top: 15px;
    margin-bottom: 10px;
}

#edit-modal .button.btn-hitech {
    font-size: 12px;
    padding: 10px 20px;
    line-height: 1.5;
    width: 140px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
}

#edit-modal .button.btn-hitech#cancel-edit {
    margin-bottom: 0;
}

#edit-modal .popup-content {
    height: auto;
    max-height: 70vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #3a8bed #2a2a2a;
}

#edit-modal .popup-content::-webkit-scrollbar {
    width: 8px;
}

#edit-modal .popup-content::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 5px;
}

#edit-modal .popup-content::-webkit-scrollbar-thumb {
    background: #3a8bed;
    border-radius: 5px;
}

#edit-modal .popup-content::-webkit-scrollbar-thumb:hover {
    background: #4a9cff;
}

#edit-modal .form-grid input,
#edit-modal .form-grid select,
#edit-modal .form-grid textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tab Container and Button Fixes */
.hi-tech-card:has(.tab-container) {
    overflow: visible;
}

.tab-container {
    padding-top: 10px;
    padding-bottom: 10px;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    white-space: nowrap;
    margin-top: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #facc15;
    scrollbar-width: thin;
    scrollbar-color: #3b5eb7 #1e3a8a;
}

.tab-container .tab-button {
    border-radius: 5px;
    overflow: visible;
    display: inline-block;
    white-space: nowrap;
    padding: 10px 20px;
    background-color: #1e3a8a;
    color: #facc15;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-right: 5px;
}

.tab-container .tab-button.active {
    background-color: #facc15 !important;
    color: #1e3a8a !important;
    border-bottom: 2px solid #1e3a8a !important;
}


/* Appended styles for edit_workflow.php */
.form-grid--edit-workflow {
    max-width: 500px;
    margin: 0 auto;
    gap: 15px;
}

.form-group--edit-workflow label {
    font-size: 0.9rem;
}

.form-actions--edit-workflow {
    display: flex;
    gap: 10px;
}

.form-actions--edit-workflow button,
.form-actions--edit-workflow a {
    padding: 6px 12px;
}

.alert-info--edit-workflow,
.alert-success--edit-workflow {
    background: #facc15;
    color: #fff;
}

.alert-danger--edit-workflow {
    background: #ff4d4f;
    color: #fff;
}

.select-multiple--edit-workflow {
    height: 100px;
    overflow-y: auto;
}

.hi-tech-card--edit-workflow {
    background: var(--gradient-accent);
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-text--edit-workflow {
    color: #fff;
    margin-top: 8px;
}

.current-approvers--edit-workflow {
    color: #facc15;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Media Queries for Edit Modal and Tab Container */
@media (min-width: 769px) and (max-width: 1366px) {
    #edit-modal .popup-content {
        max-width: 400px;
    }
    #edit-modal .button.btn-hitech {
        font-size: 12px;
        width: 140px;
        height: 36px;
        padding: 10px 20px;
    }
    .tab-container {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

@media (max-width: 768px) {
    #edit-modal .popup-content {
        max-width: 90%;
        padding: 15px;
    }
    #edit-modal .button.btn-hitech {
        font-size: 11px;
        width: 120px;
        height: 32px;
        padding: 8px 15px;
    }
    .tab-container {
        display: none;
    }
}

@media (max-width: 400px) {
    #edit-modal .popup-content {
        max-width: 95%;
        padding: 10px;
    }
    #edit-modal .button.btn-hitech {
        font-size: 10px;
        width: 100px;
        height: 30px;
        padding: 6px 10px;
    }
}

@media (max-height: 400px) and (orientation: landscape) {
    #edit-modal .popup-content {
        max-height: 60vh;
        padding: 10px;
    }
    #edit-modal .button.btn-hitech {
        font-size: 10px;
        width: 100px;
        height: 30px;
        padding: 6px 10px;
    }
}


/* Styles for password toggle icon */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
}

/* Styles for relative positioning of parent div */
.position-relative {
    position: relative;
}

/* Styles for tab content display */
.tab-content-hidden {
    display: none;
}

/* Styles for approval history card */
.approval-card {
    background: transparent;
    border: 1px solid #facc15;
}

/* Styles for inline form */
.form-inline {
    display: inline;
}

/* Styles for centered bold heading */
.centered-bold-heading {
    text-align: center;
    font-weight: bold;
}

/* Styles for user management table */
.user-management-table {
    width: 100%;
    border-collapse: collapse;
}

.user-management-table th {
    width: 25%;
    padding: 10px;
    text-align: left;
    background: #1e3a8a;
    border: 1px solid #facc15;
    color: #e2e8f0;
}

.user-management-table th.actions {
    width: 20%;
}

.user-management-table td {
    padding: 10px;
    max-width: 150px;
    overflow: hidden;
    border: 1px solid #facc15;
    color: #e2e8f0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-management-table td.solo {
    padding: 10px;
    
}

.user-management-table td.no-users {
    padding: 10px;
    text-align: center;
}

/* Styles for canvas in operations page */
.control-chart-canvas {
    background-color: #ffffff !important;
    max-width: 90vw;
    max-height: 50vh;
}


/* Appended styles for user_management.php */
.tab-container--user-management {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.tab-container--user-management .tab-button {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 10px 20px;
    border-bottom: 2px solid #facc15;
    text-align: center;
}

.tab-container--user-management {
    position: relative;
}
.tab-container--user-management::before,
.tab-container--user-management::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 1;
    pointer-events: none;
    display: none;
}
.tab-container--user-management::before {
    left: 0;
    background: linear-gradient(to right, rgba(10, 29, 55, 0.8), transparent);
}
.tab-container--user-management::after {
    right: 0;
    background: linear-gradient(to left, rgba(10, 29, 55, 0.8), transparent);
}
@media (max-width: 576px) {
    .tab-container--user-management.horizontal-scroll::before,
    .tab-container--user-management.horizontal-scroll::after {
        display: block;
    }
}
/* Appended styles from approval_history.php for timeline UI */
.timeline {
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
}

.timeline-dot {
    position: absolute;
    left: -18px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #3b82f6, #facc15); 
    border-radius: 50%;
}

.timeline-content {
    background: transparent;
    border: 2px solid #facc15;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #e2e8f0; /* Adjusted to match theme color */
    padding: 8px;
    border-radius: 5px;
}

.timeline-content h5,
.timeline-content p {
    color: #e2e8f0; /* Adjusted to match theme color */
    margin-bottom: 8px;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 18px;
    bottom: -18px;
    width: 2px;
    background: linear-gradient(45deg, #3b82f6, #facc15); 
}

.pending-approval .timeline-content {
    background-color: rgba(250, 204, 21, 0.1);
    border-color: #facc15;
}

.alert-info,
.alert-success {
    background: #facc15;
    color: #fff;
}

.alert-danger {
    background: #ff4d4f;
    color: #fff;
}

.badge-unread {
    background: #facc15;
    color: #1e3a8a;
}

.badge-read {
    background: #94a3b8;
    color: #1a1a1a;
}

.badge-success {
    background: #28a745;
    color: #fff;
}

.badge-danger {
    background: #ff4d4f;
    color: #fff;
}

.action-dropdown,
.action-dropdown option {
    background: #1e3a8a !important;
    color: #e2e8f0 !important;
}

.modal-content .modal-header,
.modal-content .modal-body,
.modal-content .form-control {
    background: transparent;
    color: #e2e8f0;
}
.modal-dialog.modal-sm {
    max-width: 500px;
}
.modal-body {
    padding: 12px;
}
.table-container {
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
}
.data-table th,
.data-table td {
    padding: 8px;
    border: 1px solid #facc15;
    color: #e2e8f0; 
    text-align: left;
}
.data-table th {
    background: #1e3a8a;
}
.data-table td {
    background: transparent;
}
.data-table.fixed-header th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1e3a8a;
}

@media (max-width: 576px) {
     .tab-container--wrap {
        display: flex; 
    }
    .tab-container--wrap .tab-button {
        min-width: 100%;
        margin-right: 0;
    }
    .tab-container--user-management {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    gap: 5px;
    }

    .tab-container--user-management .tab-button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    }

    .tab-container--user-management .tab-button {
        min-width: 100%;
        margin-right: 0;
        padding: 8px;
        text-align: left;
        background: #1e3a8a;
        color: #e2e8f0;
        border: none;
        outline: none;
        transition: background 0.3s, color 0.3s;
    }
    .tab-container--user-management .tab-button.active {
        background: linear-gradient(45deg, #3b82f6, #facc15);
        color: #0a1d37;
    }
    .tab-container--user-management .tab-button:focus,
    .tab-container--user-management .tab-button:hover {
        outline: none;
        box-shadow: none;
        background: linear-gradient(45deg, #facc15, #3b82f6);
        color: #ffffff;
    }

    .timeline-content {
        padding: 6px;
        font-size: 14px;
    }

    .timeline-content h5 {
        font-size: 16px;
    }

    .btn-hitech.btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }

    .timeline-dot {
        left: -15px;
        width: 8px;
        height: 8px;
    }

    .timeline-item:not(:last-child)::before {
        left: -11px;
        width: 2px;
    }

    .timeline {
        padding-left: 20px;
    }
    .data-table th,
    .data-table td {
        font-size: 14px;
        padding: 6px;
    }
    .alert-success--config {
        font-size: 14px; /* Matches .alert.alert-success at this breakpoint */
        padding: 8px; /* Matches .alert.alert-success at this breakpoint */
    }
    .form-grid--edit-workflow {
        gap: 12px; /* Adjust gap for smaller screens */
    }
    .form-actions--edit-workflow {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 8px;
    }
    .hi-tech-card--edit-workflow {
        padding: 15px; /* Slightly reduce padding for mobile */
    }
    .floating-icon--left,
    .floating-icon--right {
        font-size: 20px; /* Slightly smaller icons on mobile */
        width: 40px;
        height: 40px;
    }
    
}

/* Dropdown Container for Mobile */
.dropdown-container {
    margin-bottom: 1.5rem;
    padding: 0 10px;
}

/* Dropdown Select Styling */
.section-select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: #1e3a8a;
    color: #facc15;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23facc15" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.section-select:focus {
    border-color: #facc15;
    background: #2b4b9b;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
    outline: none;
}

/* Mobile Tab Content */
.mobile-tab-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile Form and Table Optimizations */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 10px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
        box-sizing: border-box;
        border-radius: 4px;
        background: rgba(10, 29, 55, 0.5);
        color: #facc15;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

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

    .form-actions {
        display: flex;
        justify-content: center;
        padding: 0 10px;
        margin-bottom: 20px;
    }

    .btn-hitech {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
        background: linear-gradient(45deg, #3b82f6, #facc15);
        color: #0a1d37;
        border-radius: 4px;
    }

    .btn-hitech:hover {
        background: linear-gradient(45deg, #facc15, #3b82f6);
        color: #ffffff;
    }

    .alert-success--config,
    .alert-danger--config {
        font-size: 14px;
        padding: 8px;
        margin-bottom: 15px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .alert-success--config {
        border-color: #34d399;
    }

    .alert-danger--config {
        border-color: #f87171;
    }

    .data-table {
        width: 100%;
        min-width: 0;
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
        text-align: left;
        border: 1px solid #facc15;
    }

    .data-table td input {
        width: 100%;
        box-sizing: border-box;
    }

    .data-table td select.action-dropdown {
        width: 100px;
        font-size: 13px;
    }

    .table-container {
    max-width: 100%;
    /*overflow-x: hidden;*/
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    }

    .loading-spinner {
        position: relative;
        pointer-events: none;
        opacity: 0.7;
    }
    .no-users {
    color: #e2e8f0;
    text-align: center;
    font-size: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .loading-spinner::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        border: 2px solid #facc15;
        border-top: 2px solid transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
    }
}

@media (max-width: 400px) {
    .section-select {
        font-size: 12px;
        padding: 8px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 12px;
        padding: 8px;
        min-height: 40px;
    }

    .btn-hitech {
        font-size: 12px;
        padding: 8px;
        min-height: 40px;
    }

    .data-table th,
    .data-table td {
        font-size: 12px;
        padding: 6px;
    }

    .data-table td select.action-dropdown {
        width: 90px;
        font-size: 12px;
    }

    .alert-success--config,
    .alert-danger--config {
        font-size: 12px;
        padding: 6px;
    }

    .loading-spinner::after {
        width: 16px;
        height: 16px;
    }
}

/* New styles for role_management.php */
.permissions-table {
    max-width: 100%;
    width: 100%; /* Ensure full container width */
    table-layout: fixed; /* Fixed layout for precise control */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
    box-sizing: border-box; /* Include padding and borders in width */
    border-collapse: collapse; /* Remove extra spacing from borders */
}
.permissions-table th:nth-child(1) {
    width: 5%;
    max-width: 250px;
    min-width: 150px; /* Minimum to fit text */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.permissions-table th:nth-child(2) {
    width: 5%;
    min-width: 50px; /* Minimum to fit checkbox */
    max-width: 15%; /* Cap to prevent expansion */
    text-align: center; /* Center the checkbox */
    padding: 0px; /* Reduced padding to save space */
    text-align: center;
}
.permissions-table td:nth-child(1) {
    max-width: 250px;
    min-width: 150px; /* Minimum to fit text */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.permissions-table td:nth-child(2) {
    text-align: center;
}
.permissions-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #facc15;
    cursor: pointer;
}
.permissions-table input[type="checkbox"]:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.accordion-item.hi-tech-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
}
.accordion-button {
    background: #1e3a8a;
    color: #facc15;
    font-weight: 500;
}
.accordion-button:not(.collapsed) {
    background: linear-gradient(45deg, #3b82f6, #facc15);
    color: #0a1d37;
}
.accordion-button:focus {
    box-shadow: none;
}
.accordion-body {
    background: transparent;
    color: #e2e8f0;
}

@media (max-width: 576px) {

    .tab-container--wrap {
        display: flex;
    }
    .tab-container--wrap .tab-button {
        min-width: 100%;
        margin-right: 0;
    }
    .tab-container--user-management {
        display: flex;
    }
    .tab-container--user-management .tab-button {
        min-width: 100%;
        margin-right: 0;
    }
    .timeline-content {
        padding: 6px;
        font-size: 14px;
    }
    .timeline-content h5 {
        font-size: 16px;
    }
    .btn-hitech.btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    .timeline-dot {
        left: -15px;
        width: 8px;
        height: 8px;
    }
    .timeline-item:not(:last-child)::before {
        left: -11px;
        width: 2px;
    }
    .timeline {
        padding-left: 20px;
    }
    .data-table th,
    .data-table td {
        font-size: 14px;
        padding: 6px;
    }
    .alert-success--config {
        font-size: 14px;
        padding: 8px;
    }
    .form-grid--edit-workflow {
        gap: 12px;
    }
    .form-actions--edit-workflow {
        flex-direction: column;
        gap: 8px;
    }
    .hi-tech-card--edit-workflow {
        padding: 15px;
    }
    .floating-icon--left,
    .floating-icon--right {
        font-size: 20px;
        width: 40px;
        height: 40px;
    }
     .permissions-table th,
    .permissions-table td {
        font-size: 12px;
        padding: 6px;
    }
    .permissions-table th:nth-child(1),
    .permissions-table td:nth-child(1) {
        width: 60%;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .permissions-table th:nth-child(2),
    .permissions-table td:nth-child(2) {
        width: 40%;
    }
    .permissions-table input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .tab-container--user-management {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-container--user-management .tab-button {
    min-width: 100px;
    margin-right: 0;
}
.permissions-table input[type="checkbox"] {
    width: 24px;
    height: 24px;
}
.tree-container {
        padding: 10px;
    }
    #team-tree {
        font-size: 12px;
    }
    .confirmation-popup .popup-content {
        max-width: 90%;
        padding: 15px;
    }
    .popup-content {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
}
    .form-actions .btn-hitech {
        padding: 6px 12px;
        font-size: 12px;
    }
 
    .team-tab-content .mobile-hint {
        /*display: block;*/
    }  

}

/* Add team-tab-content visibility rules (add if not present) */
.team-tab-content {
    display: none;
}

.team-tab-content.show.active {
    display: block;
}



/* Existing team_management.php tree styles (ensure these are present) */
.tree-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-height: 300px;
    overflow-y: auto;
    position: relative;
}

.mobile-hint {
    display: none;
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 10px;
    opacity: 0.8;
}



.tree-container h3 {
    color: #facc15;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    border-bottom: 2px solid #facc15;
    padding-bottom: 10px;
}

/* Team node styling */
#team-tree .jstree-anchor > .jstree-themeicon:not(.jstree-file) {
    color: #facc15;
}

/* Manager node styling */
#team-tree .jstree-anchor:contains("Manager:") {
    color: #3b82f6;
    font-style: italic;
}

/* User node styling */
#team-tree .jstree-file + .jstree-anchor {
    color: #e2e8f0;
}

/* Icon styling */
#team-tree .jstree-icon {
    background: none !important;
    margin-right: 8px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Team icon */
#team-tree .jstree-themeicon:not(.jstree-file):before {
    content: "👥";
}

/* Manager icon */
#team-tree .jstree-anchor:contains("Manager:") .jstree-themeicon:before {
    content: "👔";
}

/* User icon */
#team-tree .jstree-file.jstree-themeicon:before {
    content: "👤";
}

/* Indentation for child nodes */
#team-tree .jstree-children {
    padding-left: 24px;
}

/* Closed folder icon */
#team-tree .jstree-closed > .jstree-ocl:before {
    content: "▶";
    color: #facc15;
}

/* Open folder icon */
#team-tree .jstree-open > .jstree-ocl:before {
    content: "▼";
    color: #facc15;
}

/* Remove default jstree icons */
#team-tree .jstree-ocl {
    background: none !important;
    width: 20px;
    height: 20px;
}

/* No Manager text styling */
#team-tree .jstree-anchor:contains("No Manager") {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.9em;
}

/* Context menu styling */
.jstree-contextmenu .vakata-context {
    background: rgba(30, 58, 138, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.jstree-contextmenu .vakata-context li > a {
    color: #e2e8f0;
    background: transparent;
    padding: 8px 15px;
    font-size: 13px;
    border-radius: 4px;
    margin: 2px;
    transition: all 0.3s ease;
}

.jstree-contextmenu .vakata-context li > a:hover {
    background: linear-gradient(45deg, #3b82f6, #facc15);
    color: #0a1d37;
    transform: scale(1.02);
}

/* Loading spinner for tree */
.tree-container .loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #facc15;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(250, 204, 21, 0.3);
}

.tree-container .loading-spinner::before {
    content: "🔄";
    font-size: 24px;
    margin-right: 10px;
    animation: spin 2s linear infinite;
}

/* Hide jstree node children when collapsed */
.jstree-hidden {
    display: none;
}


/* Mobile adjustments for #team-tree to prevent edge hugging and content clipping */
@media (max-width: 768px) {
    .tree-container {
        padding: 12px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: auto;
    }
    #team-tree {
        padding: 10px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        word-break: break-word;
    }
    #team-tree .jstree-anchor {
        word-break: break-word;
        white-space: normal;
    }
    .team-tab-content .mobile-hint {
        display: block;
    }
}

@media (max-width: 400px) {
    .tree-container {
        padding: 10px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: auto;
    }
    #team-tree {
        padding: 8px;
        margin: 0;
        width: 100%;
        font-size: 10px;
        line-height: 18px;
        box-sizing: border-box;
        overflow-x: auto;
        word-break: break-word;
    }
    #team-tree .jstree-anchor {
        word-break: break-word;
        white-space: normal;
    }
}
/* Replace .approval-badge with .approver-icon */
.approver-icon {
    color: #facc15; /* FactorySync accent color */
    font-size: 12px; /* Smaller than node text (14px) for subtlety */
    font-weight: 800;
    margin-left: 4px; /* Space between name and icon */
    vertical-align: middle; /* Align with text */
    display: inline-flex;
    align-items: center;
}

/* Existing styles for reference (unchanged) */
.approval-categories {
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #e2e8f0;
}
.approval-categories p {
    margin: 0 0 5px;
    font-weight: 500;
    color: #facc15;
}
.approval-categories ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}
.approval-categories li {
    font-size: 14px;
    line-height: 1.5;
    color: #e2e8f0;
}

/* jstree node styles */
.jstree-anchor.jstree-hovered,
.jstree-wholerow.jstree-hovered,
.jstree-default .jstree-anchor.jstree-hovered,
.jstree-default .jstree-wholerow.jstree-hovered,
.jstree-default-dark .jstree-anchor.jstree-hovered,
.jstree-default-dark .jstree-wholerow.jstree-hovered {
    background: linear-gradient(45deg, #1e3a8a, #3b82f6) !important; /* Dark blue gradient for hover */
    color: #facc15 !important; /* Yellow text for readability */
    border-radius: 4px !important;
}
.jstree-anchor.jstree-clicked,
.jstree-wholerow.jstree-clicked,
.jstree-default .jstree-anchor.jstree-clicked,
.jstree-default .jstree-wholerow.jstree-clicked,
.jstree-default-dark .jstree-anchor.jstree-clicked,
.jstree-default-dark .jstree-wholerow.jstree-clicked {
    background: #3b82f6 !important; /* Solid FactorySync blue for click */
    color: #0a1d37 !important; /* Dark text for contrast */
    border-radius: 4px !important;
}
.jstree-anchor,
.jstree-default .jstree-anchor,
.jstree-default-dark .jstree-anchor {
    color: #e2e8f0 !important; /* Default node text color */
}
.jstree-anchor.jstree-hovered .approver-icon,
.jstree-anchor.jstree-clicked .approver-icon,
.jstree-default .jstree-anchor.jstree-hovered .approver-icon,
.jstree-default .jstree-anchor.jstree-clicked .approver-icon,
.jstree-default-dark .jstree-anchor.jstree-hovered .approver-icon,
.jstree-default-dark .jstree-anchor.jstree-clicked .approver-icon {
    color: #facc15 !important; /* Ensure star icon stays yellow */
}

.jstree-default .jstree-wholerow-clicked {
background: transparent;
}   
.jstree-default .jstree-wholerow {
   background: transparent;
}
.hidden {
    display: none;
} 

.truncate {
    display: inline-block;
    max-width: 150px; /* Default for desktop */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    position: relative; /* Required for tooltip positioning */
}

/* Tooltip styles for .truncate */
.truncate[data-bs-toggle="tooltip"]::after {
    content: attr(title); /* Use the title attribute for tooltip content */
    visibility: hidden;
    position: absolute;
    top: -40px; /* Position above the element */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #1e3a8a, #3b82f6); /* Match navbar gradient */
    color: #e2e8f0; /* Match --text-primary */
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal; /* Allow wrapping in tooltip */
    max-width: 250px; /* Limit tooltip width */
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.truncate[data-bs-toggle="tooltip"]:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Ensure timeline-content truncation for approval_history.php */
.timeline-content .truncate {
    max-width: 100%; /* Allow full width in timeline for readability */
    display: block; /* Override inline-block for timeline */
}

/* Responsive adjustments for .truncate */
@media (max-width: 768px) {
    .truncate {
        max-width: 120px; /* Smaller width for tablets */
    }
    .truncate[data-bs-toggle="tooltip"]::after {
        max-width: 200px; /* Smaller tooltip width */
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .truncate {
        max-width: 100px; /* Smaller width for mobile */
    }
    .truncate[data-bs-toggle="tooltip"]::after {
        max-width: 180px; /* Smaller tooltip width */
        font-size: 10px;
    }
    .timeline-content .truncate {
        max-width: 100%; /* Maintain full width in timeline */
    }
}

@media (max-width: 400px) {
    .truncate {
        max-width: 80px; /* Smallest width for narrow screens */
    }
    .truncate[data-bs-toggle="tooltip"]::after {
        max-width: 160px;
        font-size: 9px;
    }
}

/* Process Capability Card */
.process-capability-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
    min-width: 320px;
    overflow: hidden; /* Prevent content overflow */
}
.process-capability-header {
    color: #facc15;
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; 
    position: relative; 
    justify-content: space-between; 
}
.last-refreshed {
    font-size: 12px;
    color: #94a3b8;
    text-align: right;
    margin-bottom: 8px;
    flex: 1;
}

/* SPC Settings Dropdown in Process Capability Card */
.process-capability-header {
    position: relative;
}

.spc-settings-dropdown {
    position: relative;
    display: inline-block;
    margin-left: auto;
}

.spc-settings-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #facc15;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.spc-settings-icon:hover {
    background: rgba(250, 204, 21, 0.2);
    border-color: #facc15;
    transform: rotate(90deg);
}

.spc-settings-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #2b4b9b 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.spc-settings-menu.show {
    display: block;
}

.spc-settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spc-settings-item:last-child {
    border-bottom: none;
}

.spc-settings-item:hover {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
}

.spc-settings-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.spc-settings-item span {
    font-size: 14px;
    font-weight: 500;
}

/* Filters */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 10px 0;
}
.filter-group .form-group {
    flex: 1 1 100px;
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.filter-group .form-group label {
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.3;
}
.filter-group .form-group select,
.filter-group .form-group input {
    padding: 4px;
    font-size: 12px;
    line-height: 1.3;
    min-height: 44px;
}
@media (max-width: 576px) {
    .filter-group {
        flex-direction: column;
        gap: 3px;
        margin-bottom: 10px;
    }
    .filter-group .form-group {
        margin: 0;
        padding: 0;
    }
    .filter-group .form-group label {
        margin-bottom: 4px;
        font-size: 12px;
        line-height: 1.3;
    }
    .filter-group .form-group select,
    .filter-group .form-group input {
        padding: 3px;
        font-size: 12px;
        min-height: 44px;
        margin-bottom: 3px;
    }
}

/* Dashboard Tiles */
.dashboard-tiles {
    margin-top: 10px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}
.capability-tile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    flex: 1;
    transition: transform 0.3s ease;
    position: relative; /* For tooltip positioning */
}
.capability-tile:hover {
    transform: scale(1.02);
}
.capability-tile .value {
    font-size: 24px;
    color: #facc15;
    font-weight: 500;
}

.capability-tile h4 {
    font-size: 16px;
    margin: 0 0 6px 0;
    color: #e2e8f0;
}
.capability-tile .gauge {
    flex-shrink: 0;
}
@media (max-width: 576px) {
    .dashboard-tiles {
        margin-top: 10px;
        margin-bottom: 10px;
        flex-direction: column;
        gap: 10px;
    }
    .capability-tile {
        flex-direction: row;
        align-items: center;
        padding: 12px;
        gap: 8px;
        margin-bottom: 10px;
    }
    .capability-tile h4 {
        margin: 0 0 5px 0;
        font-size: 15px;
    }
    .capability-tile .value {
        font-size: 22px;
    }
}

/* Gauges */
.gauge {
    width: 60px;
    height: 60px;
    background: conic-gradient(#34d399 0% var(--value), #1e3a8a var(--value) 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    position: relative;
}


.gauge::after {
    content: attr(data-value);
    position: absolute;
    font-size: 12px;
}
.gauge-cp {
    --value: 75%;
}
.gauge-cpk {
    --value: 65%;
}
@media (max-width: 576px) {
    .gauge {
        width: 50px;
        height: 50px;
    }
}

/* Capability Table - FIXED FOR MOBILE SCROLLING */
.capability-table-container {
    position: relative;
    z-index: 400;
    width: 100%;
    overflow-x: auto; /* Force horizontal scroll */
    overflow-y: hidden;
    margin-bottom: 40px;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar; /* Better scrollbar handling */
}

/* Ensure table is wider than container to trigger scroll */
.capability-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px; /* Reduced to fit 6 columns (~116px each) */
    position: relative;
}
.capability-table th,
.capability-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    white-space: normal; /* Allow text wrapping */
}
.capability-table th,
.capability-table td {
    width: 16.66%; /* Approx 1/6th for 6 columns */
    box-sizing: border-box; /* Include padding in width */
}

.capability-table .cp-value,
.capability-table .cpk-value {
    font-weight: 500;
}
.capability-table .actions {
    text-align: center;
}
.capability-table .status-indicator,
span.status-indicator {
    display: inline-block !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    margin-right: 5px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}
.status-good { background: #34d399; }
.status-marginal { background: #facc15; }
.status-poor { background: #f87171; }

/* NEW: 5-tier Cpk classification system */
.status-not-capable { background: #f87171 !important; }
.status-marginally-capable { background: #fb923c !important; }
.status-capable-good { background: #facc15 !important; }
.status-very-good { background: #34d399 !important; }
.status-world-class { background: #10b981 !important; }


.sample-warning {
    color: #facc15;
    margin-left: 5px;
    font-size: 12px;
    vertical-align: middle;
}
.sample-warning i {
    cursor: help;
}

/* TOOLTIP FIXES */
.tooltip-icon {
    cursor: help;
    color: #94a3b8;
    margin-left: 3px;
    font-size: 14px;
    position: relative;
    display: inline-block;

}
.tooltip-content {
    display: none;
    background: #2b4b9b;
    padding: 8px;
    border-radius: 4px;
    position: absolute;
    z-index: 10000; /* Very high z-index to appear above everything */
    max-width: 200px;
    min-width: 120px;
    color: #e2e8f0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    white-space: normal;
    overflow-wrap: break-word;
    pointer-events: none;
    line-height: 1.4;
}
.tooltip-icon:hover .tooltip-content,
.tooltip-icon:focus .tooltip-content {
    display: block !important;
}

/* Desktop tooltip positioning */
.capability-tile .tooltip-icon .tooltip-content {
    top: calc(-100% - 15px); /* Above with clearance for 90% zoom */
    left: 50%;
    transform: translateX(-50%);
}

.capability-table th {
    position: relative;
    overflow: visible;
}

.capability-table th .tooltip-icon {
    position: relative;
    z-index: 10010; /* Higher than table z-index */
}

.capability-table th {
    position: relative;
    overflow: visible;
}

.capability-table th .tooltip-icon {
    position: relative;
    display: inline-block;
}

.capability-table th .tooltip-icon .tooltip-content {
    position: absolute;
    z-index: 99999 !important;
    background: #2b4b9b !important;


        
}

.capability-table th .tooltip-icon:hover .tooltip-content,
.capability-table th .tooltip-icon:focus .tooltip-content {
    display: block;
}

/* Ensure tooltips don't get cut off by container */
.capability-table-container {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}



/* Mobile tooltip positioning fixes */
@media (max-width: 576px) {
    .capability-table {
        min-width: 700px; /* Extra wide for mobile */
    }
    .tooltip-icon {
        font-size: 13px;
        margin-left: 2px;
        display: inline-block;
        padding: 2px;
    }
    
    .tooltip-content {
        max-width: 150px;
        min-width: 100px;
        font-size: 11px;
        padding: 8px;
        z-index: 10000; /* Ensure it appears above everything */
    }
    .capability-table th .tooltip-icon {
        position: static; /* Reset positioning */
    }
    
    /* Prevent tooltips from going off-screen on mobile */
    .capability-table th .tooltip-icon .tooltip-content {
        position: absolute;
        
    }

    /* Adjust for first and last columns */
    .capability-table th:first-child .tooltip-icon .tooltip-content {
        top: 0;
        right: auto;
        padding: 8px;
    }
    
    .capability-table th:last-child .tooltip-icon .tooltip-content {
        left: auto;
        right: 0;
    }
    
    /* Prevent tooltip from appearing off-screen */
    .capability-table th .tooltip-icon:hover .tooltip-content,
    .capability-table th .tooltip-icon:focus .tooltip-content {
        display: block !important;
    }
    
    .capability-table-container {
        margin-bottom: 20px; /* Reduce bottom margin for mobile */
    }
    
    .sample-warning {
        display: inline-block;
        margin-left: 2px;
    }
    
    .sample-warning i {
        font-size: 12px;
    }
    
    .sample-warning {
    position: relative; /* Establish positioning context */
    }

    .sample-warning:hover::after,
    .sample-warning:focus::after {
        content: attr(title);
        position: absolute;
        background: #2b4b9b;
        color: #e2e8f0;
        padding: 6px;
        border-radius: 4px;
        font-size: 10px;
        white-space: nowrap;
        z-index: 10000;
        top: calc(-100% - 2px); /* Just above the star icon */
        left: 0; /* Align with the left of the star icon */
        transform: translateX(0); /* Remove centering */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
    
/* Global rule for tiles (keep working) */
.status-indicator {
    position: relative; /* Establish positioning context for tiles */
}
.status-indicator:hover::after,
.status-indicator:focus::after {
    content: attr(title);
    position: absolute;
    background: #2b4b9b;
    color: #e2e8f0;
    padding: 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10000;
    top: calc(-100% - 2px); /* Just above the indicator */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none; /* Prevent interference with touch */
}

/* Specific rule for table status indicators (outside media query for desktop/mobile) */
.capability-table .status-indicator {
    position: relative; /* Specific to table context */
}
.capability-table .status-indicator:hover::after,
.capability-table .status-indicator:focus::after {
    content: attr(title);
    position: absolute;
    background: #2b4b9b;
    color: #e2e8f0;
    padding: 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10001; /* Higher than container z-index */
    top: calc(-100% - 2px); /* Just above the indicator */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none; /* Prevent interference with touch */
}

/* Ensure table container and cells allow tooltip visibility */
.capability-table-container {
    overflow-x: auto !important;
    overflow-y: visible !important; /* Allow tooltip to extend upward */
}
.capability-table th,
.capability-table td {
    position: relative;
    overflow: visible; /* Prevent clipping of tooltip */
}

}

/* Chart Button and Container */
.chart-button {
    background: linear-gradient(45deg, #3b82f6, #facc15);
    color: #0a1d37;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}
.chart-button:hover {
    background: linear-gradient(45deg, #facc15, #3b82f6);
    color: #ffffff;
}
.chart-container {
    background: rgba(10, 29, 55, 0.9);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
}
.chart-container h4 {
    margin-bottom: 10px;
    color: #facc15;
}
@media (max-width: 576px) {
    .chart-container {
        padding: 10px;
        margin-top: 10px;
    }
}

.trend-up {
    color: #34d399;
    margin-left: 5px;
}
.trend-down {
    color: #f87171;
    margin-left: 5px;
}
.info {
    color: #6b7280;
    text-align: center;
    padding: 10px;
}
.tile-placeholder {
    display: block;
    height: 0;
}
.fixed-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center vertically and horizontally */
    width: 70%; /* Reduced width */
    max-width: 400px; /* Reduced max-width */
    z-index: 2000;
    display: block;
    padding: 10px 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    background: rgba(10, 29, 55, 0.9); /* Increased opacity for visibility */
}
/* Scrollbar styling for better UX */
.capability-table-container::-webkit-scrollbar {
    height: 8px;
}

.capability-table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.capability-table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.capability-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.capability-table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Force table status indicator tooltips to show above container */
.capability-table .status-indicator:hover::after,
.capability-table .status-indicator:focus::after {
    z-index: 99999 !important;
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -100%) translateY(-10px) !important;
}




/* Chart Section Styles for shop_floor_monitoring.php */
.charts-header {
    color: #facc15;
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* Allow wrapping on mobile */
}
.charts-overview-card {
    margin-top: 20px;
    padding: 15px;
}

.chart-section {
    margin-bottom: 15px;
    border-radius: 8px;
    width: 100% !important;
    max-width: 100% !important;
}

.collapsed-state {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.3s ease;
}

.collapsed-state:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chart-icon {
    font-size: 24px;
    color: #facc15;
}

.chart-info h4 {
    font-size: 18px;
    margin: 0;
    color: #e2e8f0;
}

.key-metric {
    font-size: 14px;
    color: #94a3b8;
}

.metric-value {
    color: #facc15;
    font-weight: 500;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-good { background: #34d399; color: #0a1d37; }
.status-excellent { background: #10b981; color: #ffffff; }
.status-fair { background: #facc15; color: #0a1d37; }
.status-poor { background: #f87171; color: #ffffff; }
.status-warning { background: #fb923c; color: #0a1d37; }

.status-pending {
    background-color: #ccc;
    color: #333;
}

.expand-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
}


.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.alert-tips-popup {
    max-width: 300px;
    border: 1px solid #facc15;
    z-index: 1050; /* Moved from inline */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.alert-tips-popup ul {
    list-style-type: none;
    padding-left: 0;
}
.alert-tips-popup li {
    margin-bottom: 0.5rem;
}


/* Alert content layout */
.alert-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.alert-message {
    flex: 1;
}

/* Fixed alert positioning */
.alert-fixed {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    max-width: 400px !important;
    padding: 15px !important;
    border-radius: 5px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Close button styling */
.alert-close-btn {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-left: 10px !important;
    color: inherit !important;
    line-height: 1 !important;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.alert-close-btn:hover {
    opacity: 1;
}

.alert-close-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Ensure links in alerts are visible */
.alert-message a {
    color: #facc15 !important;
    text-decoration: underline !important;
    font-weight: bold;
}

.alert-message a:hover {
    text-decoration: none !important;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.9s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .alert-fixed {
        width: 85% !important;
        max-width: none !important;
        padding: 18px !important;
    }
}

/* Add backdrop overlay for better visibility */
.alert-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
    backdrop-filter: blur(2px);
}

/* Override any conflicting styles */
.alert-fixed * {
    box-sizing: border-box !important;
}

/* Ensure no other CSS is interfering */
.alert.alert-fixed {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    bottom: auto !important;
}


/* Custom Backdrop Styling */
.custom-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1049;
}

/* Toast Container - Center Positioned */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1065; /* Higher than modals and panels */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allow clicks through container */
    max-width: 90vw;
    max-height: 80vh;
    overflow: visible;
}

/* Custom Toast Styling */
.custom-toast {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto; /* Allow clicks on toast */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    position: relative;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Toast Type Variants */
.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-success .toast-icon {
    color: #22c55e;
}

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

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

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

.toast-warning .toast-icon {
    color: #f59e0b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 95vw;
    }
    
    .custom-toast {
        min-width: 260px;
        max-width: 320px;
    }
    
    .toast-content {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .toast-message {
        font-size: 0.85rem;
    }
    
    .toast-icon {
        font-size: 16px;
    }
}

/* Animation Keyframes */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* Ensure toasts don't interfere with other UI */
.custom-toast {
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-toast.removing {
    animation: toastSlideOut 0.3s ease-in-out forwards;
}



/* Animation for the alert icon */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .range-alert-insights {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
        border-color: rgba(59, 130, 246, 0.4);
    }
}



/****NELSON****/

/* Nelson Rules Configuration Styles */
.rule-card {
    transition: all 0.3s ease;
}

.rule-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin: 0 10px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(30px);
}

.critical-toggle input:checked + .slider {
    background-color: #dc3545;
}

.warning-toggle input:checked + .slider {
    background-color: #ffc107;
}

.nelson-rule-mini-chart {
    width: 80px;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40"><path d="M5,35 L15,30 L25,25 L35,20 L45,15 L55,10 L65,5 L75,15" stroke="red" stroke-width="2" fill="none"/><line x1="0" y1="20" x2="80" y2="20" stroke="orange" stroke-dasharray="2,2"/></svg>') no-repeat center;
    background-size: contain;
}

.template-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}



.template-card:hover,
.template-card.selected {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.impact-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.impact-high {
    background-color: #dc3545;
}

.impact-medium {
    background-color: #ffc107;
}

.impact-low {
    background-color: #28a745;
}

.progress {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.3s ease;
}

.alert-access-denied {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
}

.param-header {
    width: 200px;
}

.rule-header {
    width: 80px;
}

.action-header {
    width: 100px;
}

.custom-interval {
    display: none;
}

.progress-critical {
    width: 25%;
}

.progress-warning {
    width: 35%;
}

.progress-info {
    width: 40%;
}

.visual-example {
    height: 200px;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .toggle-switch {
        width: 50px;
        height: 25px;
    }

    .slider:before {
        height: 17px;
        width: 17px;
        left: 3px;
        bottom: 3px;
    }

    .toggle-switch input:checked + .slider:before {
        transform: translateX(25px);
    }

    .nelson-rule-mini-chart {
        width: 60px;
        height: 30px;
    }

    .template-card:hover,
    .template-card.selected {
        transform: none;
    }
}

/* Focus and hover states for interactive elements */
.template-card:hover,
.template-card:focus,
.toggle-switch input:focus,
.btn-hitech:hover,
.btn-hitech:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(250, 204, 21, 0.25); /* Yellow glow for focus/hover */
    transition: box-shadow 0.2s ease;
}

/* Selected template card styling */
.template-card.selected {
    border: 2px solid #facc15; /* Yellow border for selected state */
    transform: scale(1.02); /* Slight scale for emphasis */
    transition: transform 0.2s ease, border 0.2s ease;
}

/* Ensure parameter matrix table handles overflow */
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

/* Consistent spacing and styling for vertical sections */
.hi-tech-card.mb-4 {
    margin-bottom: 1.5rem;
}

/* Ensure template cards and other internal rows maintain their layout */
.templates-container .row,
.matrix-container .row,
.settings-container .row {
    margin-bottom: 1rem;
}

/* Cards should stack vertically on all screen sizes */
.rules-container,
.templates-container,
.settings-container {
    display: block;
    margin-bottom: 20px;
}

.rules-container > div,
.templates-container > div,
.settings-container > div {
    width: 100%;
    margin-bottom: 15px;
}

/* Tab scrolling behavior */
.tab-container--user-management {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.tab-container--user-management .tab-button {
    scroll-margin: 20px;
}




/* Recommendation Section */
.recommendation-header {
    color: #34d399; /* Green header */
}

.recommendation-header i.fa-lightbulb {
    color: #facc15; /* Yellow icon */
}

ul.recommendation-list li {
    color: #a5b4fc; /* Indigo bullets */
}

ul.recommendation-list li strong {
    color: #f1f5f9; /* White for strong text */
}

/* Footer Caption */
.footer-caption {
    color: #ef4444; /* Red for urgency */
}

.footer-caption i {
    color: #facc15; /* Yellow icon */
}

/* Mobile Overrides */
@media (max-width: 576px) {
    .stats-container .stats-card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .stats-container .stats-card h5.stats-title {
        font-size: 0.9rem;
    }

    .stats-container .stats-card small {
        font-size: 0.7rem;
    }
}




/* Stats Tiles - Base Font with Low Zoom Adjustment */
.stats-container .stats-card h5.stats-title {
    font-size: 0.70rem !important; /* Default size */
    line-height: 1.0;
    word-break: keep-all; /* Prevent mid-word breaks */
    word-wrap: break-word; /* Wrap at spaces only */
    white-space: normal;
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 800;

}
.stats-container .stats-card h5 small {
    font-size: 0.65rem !important; /* Default size */
    color: inherit;
    font-weight: 800;
    

}

.stats-container .stats-card small {
    color: #cbd5e1; /* Lighter contrast */
    font-size: 0.65rem; /* Default size */
    line-height: 1.0;
    word-break: keep-all;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    font-weight: 500;

}

/* Toast notification improvements - Center positioning */
.toast-notification {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1055 !important;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-radius: 8px;
}

/* Fix white text on white background */
.text-bg-error {
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #b02a37;
}

.text-bg-success {
    background-color: #198754 !important;
    color: white !important;
    border: 1px solid #157347;
}

.text-bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
    border: 1px solid #ffca2c;
}

.text-bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
    border: 1px solid #3dd5f3;
}

/* Mobile responsive toasts */
@media (max-width: 768px) {
    .toast-notification {
        max-width: 90% !important;
        margin: 0 !important;
    }
}
/* Template button improvements */
.btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* Quick templates card mobile responsive */
@media (max-width: 768px) {
    .hi-tech-card h6 {
        font-size: 0.9rem;
    }
    
    .btn-outline-primary.btn-sm {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}


/* Fix Quick Templates button cutoff */
.hi-tech-card .d-grid {
    overflow: visible;
    word-wrap: break-word;
}

.template-quick-btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-size: 0.825rem; /* Slightly smaller font */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .template-quick-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* For zoom levels */
@media (min-width: 769px) and (max-width: 1200px) {
    .template-quick-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}


.btn-bulk-custom {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    border: 1px solid #ffc107 !important;
    color: #000 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-bulk-custom:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%) !important;
    border-color: #d39e00 !important;
    color: #000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255,193,7,0.4) !important;
}

.btn-bulk-custom:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive improvements for bulk actions */
@media (max-width: 991px) {
    .d-flex.flex-column.flex-lg-row {
        gap: 1rem;
    }
    
    .d-flex.flex-column.flex-sm-row {
        width: 100%;
    }
    
    .btn-hitech.btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-height: 38px;
    }
}

@media (max-width: 576px) {
    .btn-hitech.btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .hi-tech-card .p-3 {
        padding: 1rem !important;
    }
}

/* Desktop zoom compatibility */
@media (max-width: 1200px) {
    .btn-hitech.btn-sm {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}
/* Footer actions responsive improvements */
.footer-actions {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
}

.footer-buttons {
    gap: 0.5rem;
}

@media (max-width: 991px) {
    .footer-actions .d-flex {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .footer-caption {
        text-align: center;
        margin-bottom: 0;
    }
    
    .footer-buttons {
        align-items: stretch !important;
        width: 100%;
    }
    
    .footer-buttons .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .footer-actions .p-3 {
        padding: 1.5rem 1rem !important;
    }
    
    .btn-hitech {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}


/* CSS for the Dynamic Impact Analysis */
.impact-metric-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 4px 10px 4px !important; /* Balanced padding */
    text-align: center;
    height: 100%;
    min-height: 130px !important; /* Taller for better text display */
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.impact-metric-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}


.impact-number {
    font-size: 1.5rem !important; /* Slightly larger numbers */
    font-weight: bold;
    line-height: 0.9;
    margin-bottom: 8px;
    word-break: break-word;
    text-align: center;
    overflow: hidden;
}


.impact-label {
    color: #9ca3af;
    font-size: 0.7rem !important; /* Slightly larger than before */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    margin-top: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal; /* Allow text wrapping */
    max-width: 100%;
    padding: 0 2px;
    min-height: 28px; /* Ensure space for wrapped text */
}
.impact-simulation {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.simulation-header {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.simulation-content {
    color: #e5e7eb !important; /* Brighter text color */
    font-size: 1.1rem !important; /* Larger font size */
    line-height: 1.6 !important; /* Better line spacing */
    font-weight: 500 !important; /* Slightly bolder */
}

.simulation-content small {
    color: #9ca3af !important; /* Better color for small text */
    font-size: 0.95rem !important; /* Larger small text */
}

.impact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .impact-number {
        font-size: 2rem;
    }
    
    .impact-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}


/* Responsive adjustments for different screen sizes */
@media (max-width: 1400px) {
    .impact-number {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 1200px) {
    .impact-number {
        font-size: 1.3rem !important;
    }
    
    .impact-label {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 992px) {
    .impact-number {
        font-size: 1.2rem !important;
    }
    
    .impact-label {
        font-size: 0.6rem !important;
    }
    
    .impact-metric-card {
        min-height: 120px !important;
    }
}


@media (max-width: 768px) {
    .impact-number {
        font-size: 1.1rem !important;
    }
    
    .impact-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .impact-label {
        font-size: 0.58rem !important;
    }
    
    .impact-metric-card {
        min-height: 100px !important;
    }
     .simulation-content {
        font-size: 1rem !important;
    }
}

@media (max-width: 576px) {
    .impact-number {
        font-size: 0.9rem !important;
    }

/* Ensure impact cards have enough padding but don't overflow */
.impact-metric-card {
    padding: 15px 8px !important;
    min-height: 120px;
}

/* Style for delete button */
.delete-template-btn {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    padding: 4px 8px;
}

.delete-template-btn:hover {
    background: #dc3545;
    color: white;
}

/* Fix checkbox alignment in custom template form */
.form-group .row .col-md-3,
.form-group .row .col-6 {
    margin-bottom: 12px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-height: 60px;
    transition: all 0.2s ease;
}

.form-check:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.form-check-input {
    margin-top: 4px !important;
    margin-right: 8px !important;
    flex-shrink: 0;
}

.form-check-label {
    line-height: 1.3;
    word-wrap: break-word;
    width: 100%;
}

.form-check-label strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.9rem;
}

.form-check-label small {
    display: block;
    color: #9ca3af;
    font-size: 0.75rem;
}
.progress-critical[data-percentage] {
    width: var(--critical-percentage);
}
.progress-warning[data-percentage] {
    width: var(--warning-percentage);
}
.progress-info[data-percentage] {
    width: var(--info-percentage);
}
/* Add this to your existing CSS */

/* System-generated rule styling */
.system-badge {
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
}

/* Locked toggle styling */
.rule-matrix-toggle:disabled + .slider {
    opacity: 0.7;
    background-color: #6c757d !important;
    cursor: not-allowed;
}

.rule-matrix-toggle:disabled:checked + .slider {
    background-color: #28a745 !important; /* Keep green for Rule1 */
}

.rule-matrix-toggle:disabled:checked + .slider:before {
    background-color: #fff;
    transform: translateX(13px);
}

/* Rule1 column header highlight */
.rule-header:first-of-type {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
}

.rule-header:first-of-type small {
    color: #fff !important;
    font-weight: bold;
}

/* Critical rule toggle styling */
.critical-toggle input:checked + .slider {
    background-color: #dc3545 !important;
}

.critical-toggle input:disabled + .slider {
    background-color: #dc3545 !important;
    opacity: 0.8;
}

/* Tooltip for disabled toggles */
[title*="cannot be disabled"] {
    cursor: help !important;
}

/* Alert Recipients Table Compact Styling */
.alert-recipients-table-compact .alert-role-column {
    width: 25%;
}

.alert-recipients-table-compact .alert-scope-column {
    width: 35%;
}

.alert-recipients-table-compact .alert-critical-column {
    width: 40%;
}

.alert-recipients-table-compact th,
.alert-recipients-table-compact td {
    padding: 0.5rem 0.25rem;
    vertical-align: middle;
}

.compact-select {
    min-width: 100px;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.compact-checkbox {
    margin: 0;
    transform: scale(1.1);
}

.alert-info-tooltip {
    cursor: help;
}

/* Alert Status Items */
.alert-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-status-item:last-child {
    border-bottom: none;
}

.alert-status-label {
    font-weight: 500;
    color: #9ca3af;
}

.alert-status-value {
    color: #e5e7eb;
}

/* Form Actions for Alert Settings */
.form-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #9ca3af;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Responsive adjustments for alert settings */
@media (max-width: 768px) {
    .alert-recipients-table-compact th,
    .alert-recipients-table-compact td {
        padding: 0.4rem 0.2rem;
        font-size: 0.875rem;
    }
    
    .compact-select {
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .form-actions {
        text-align: center;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}



/* Mobile responsive */
@media (max-width: 576px) {
    .spc-settings-menu {
        right: -10px;
        min-width: 220px;
    }
    
    .spc-settings-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .spc-settings-item span {
        font-size: 13px;
    }
}

.opacity-10 {
    opacity: 0.1;
    border-color: #ffffff;
}

/* Shift Actions Group - Override GSAP inline styles */
#shiftActionsGroup {
    display: block !important;
    text-align: center !important;
    margin: 15px auto !important;
    width: 100% !important;
}

#shiftActionsGroup .btn {
    display: inline-block !important;
    min-width: 180px;
    max-width: 220px;
    padding: 10px 20px;
    margin: 0 5px;
}

/* Mobile - Full width buttons */
@media (max-width: 768px) {
    #shiftActionsGroup .btn {
        display: block !important;
        width: 100% !important;
        max-width: none;
        min-width: auto;
        margin: 5px auto;
    }
}


/* Line Switcher - Clean Complete Solution */

@media (max-width: 768px) {
    .line-switcher-button-wrapper {
        margin-top: 12px;
    }
    
    .line-switcher-new-btn {
        width: 100%;
    }
}
