:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
}
.container-fluid1{
    height: 100vh;
}
body {
    background-color: #f5f7fb;
    font-family: calibri;
    font-size: 0.888rem;
}

.dashboard-header {
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card {
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 500;
    letter-spacing: 0.5px;

}

.main-content1 {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 0px;
    margin-bottom: 0px;
    overflow-x: auto;
    
}

.form-page {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-top: 10px;
    display: none; /* Initially hidden */
    max-height: 90vh;
    overflow-y: auto;
}

.form-page.active {
    display: block; /* Show when active */
}

.form-header {
    color: var(--primary);
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 0.888rem;
}

.status-badge {
    padding: 0.25em 0.5em;
    border-radius: 50px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-active {
    background-color: #e7f7ef;
    color: #2ecc71;
}

.badge-maintenance {
    background-color: #fef5e7;
    color: #f39c12;
}

.badge-inactive {
    background-color: #fdecea;
    color: #e74c3c;
}

.device-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #eaeaea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.device-img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 2px;
    font-size: 0.888rem;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(to right, #3a56e0, #3831b8);
}

.upload-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8f9fa;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
}

.page-title {
    position: relative;
    padding-left: 15px;
    font-size: 0.888rem;
    margin-bottom: 1rem;
}

.page-title:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color:var(--primary) #f1f1f1; /* Optional: thumb and track color for Firefox */
  }
  
  /* For WebKit browsers like Chrome, Edge, Safari */
  .table-responsive::-webkit-scrollbar {
    height: 6px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 50%;
  }
  
  .table-responsive::-webkit-scrollbar-track {
    background-color: #f1f1f1;
  }
  

.table th, .table td {
    vertical-align: middle !important;
    text-align: center;
}

.table th {
    background-color: #f1f5fd;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.888rem;
    padding: 0.75rem 0.5rem;
}

.table td {
    font-size: 0.888rem;
    padding: 0.75rem 0.5rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: #6c757d;
    font-size: 0.9rem;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #dee2e6;
}

/* Transition effects */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    transform: translateY(0);
}

/* View page styles */
.view-details-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.view-details-card .card-body {
    padding: 1.5rem;
}

.view-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.888rem;
    letter-spacing: 0.5px;
}

.view-value {
    font-size: 0.888rem;
    color: var(--dark);
    font-weight: 500;
}

.view-image-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.view-image-card .card-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
}

.view-image-card .card-body {
    padding: 1.5rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-image-preview {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar{
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#deviceSearch {
    width: 250px;
    padding: 10px;
    left: 10px;
    margin: 10px;
    display: inline-block;
}

#paginationControls {
    width: 100%;
    padding: 0 10px;
}
#paginationControls button {
    min-width: 90px;
}
#paginationInfo {
    flex: 1;
    text-align: center;
}

/* On small screens, force table to be scrollable horizontally */
@media (max-width: 991.98px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table {
        min-width: 700px; /* Adjust as needed for your columns */
    }
    ::-webkit-scrollbar{
        display: none;
    }
}

/* Table row (tr) overflow handling */
.table-responsive tr {
    white-space: nowrap; /* Prevent row wrapping */
}

/* Optional: If you want each cell to scroll horizontally if content is too wide */
.table-responsive td, .table-responsive th {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px; /* Adjust as needed */
    white-space: nowrap;
}
/* make all radios 1.1rem diameter instead of 1.25rem */
/* Add to your existing CSS */
#columnFilterMenu {
    width: 220px !important;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 15px;
  }
  
  #columnFilterMenu .dropdown-item {
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    white-space: normal !important;
  }
  
  #columnFilterMenu .form-check {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 3px 0;
  }
  
  #columnFilterMenu .form-check-input {
    margin-top: 0;
    margin-right: 8px;
    flex-shrink: 0;
  }
  
  #columnFilterMenu .form-check-label {
    flex-grow: 1;
    word-break: break-word;
    font-size: 0.888rem;
  }



   /* Improved YES/NO toggle switch style for status */
   .form-check.form-switch {
    min-height: 1.5em;
}
.form-check-input[type="checkbox"] {
    width: 2.5em;
    height: 1.5em;
    background-color: #e9ecef;
    border: 1px solid #adb5bd;
    transition: background 0.2s, border 0.2s;
    cursor: pointer;
}
.form-check-input:checked {
    background-color: #f44336;
    border-color: #f44336;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}
#yesNoLabel {
    display: inline-block;
    min-width: 2.5em;
    font-weight: 500;
    color: #fff;
    background: #0d6efd;
    border-radius: 0.5em;
    padding: 0.2em 0.7em;
    margin-left: 0.5em;
    transition: background 0.2s;
    user-select: none;
}
.form-check-input:checked + #yesNoLabel {
    background: #f44336;
}
/* Remove old toggle styles */
.toggle-button-cover, .button-cover, .button, .knobs, .layer, #button-3 { display: none !important; }
#output {
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
    font-size: 0.888rem;
}