/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== SAFARI FIXES ===== */
/* Fix Safari input rendering issues */
input[type="text"], input[type="email"], input[type="password"] {
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    -webkit-box-shadow: none;
    box-shadow: none;
    -webkit-transition: none;
    transition: none;
}

/* Prevent Safari from applying default styling */
input:focus {
    -webkit-appearance: none;
    outline: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}

/* Simple password masking for text inputs */
.password-masked {
    -webkit-text-security: disc;
    text-security: disc;
}


/* ===== CUSTOM TOOLTIPS ===== */
[title] {
    position: relative;
}

/* Disable browser tooltips to prevent double tooltips */
[title]:hover {
    text-decoration: none;
}

/* Hide browser tooltips completely */
[title] {
    -webkit-tooltip: none;
    tooltip: none;
}

[data-original-title] {
    position: relative;
}

[data-original-title]::after {
    content: attr(data-original-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    margin-bottom: 5px;
}

[data-original-title]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    margin-bottom: -5px;
}

[data-original-title]:hover::after,
[data-original-title]:hover::before {
    opacity: 1;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== CUSTOM ALERT SYSTEM ===== */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 100%;
}

.custom-alert {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid;
    animation: alertSlideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.custom-alert.alert-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #f8f9fa 100%);
}

.custom-alert.alert-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f8f9fa 100%);
}

.custom-alert.alert-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #f8f9fa 100%);
}

.custom-alert.alert-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #f8f9fa 100%);
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success .alert-icon {
    color: #28a745;
}

.alert-error .alert-icon {
    color: #dc3545;
}

.alert-warning .alert-icon {
    color: #ffc107;
}

.alert-info .alert-icon {
    color: #17a2b8;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.alert-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.alert-close:hover {
    color: #333;
}

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    animation: alertProgress linear;
}

.alert-success .alert-progress {
    background: #28a745;
}

.alert-error .alert-progress {
    background: #dc3545;
}

.alert-warning .alert-progress {
    background: #ffc107;
}

.alert-info .alert-progress {
    background: #17a2b8;
}

@keyframes alertSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes alertSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes alertProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.alert-slide-out {
    animation: alertSlideOut 0.3s ease-in forwards;
}

body {
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    padding: 20px;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-content {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

/* ===== TAB SYSTEM ===== */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    background: white;
    border-bottom-color: #007bff;
    color: #007bff;
}

.tab:hover {
    background: #e9ecef;
}

.tab-content {
    display: none;
    padding: 20px;
}

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

/* ===== BOX & ITEM COMPONENTS ===== */
.box {
    flex: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.box.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
}

.box-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.item-list {
    min-height: 200px;
}

.item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
}

.item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.item:active {
    cursor: grabbing;
}

.item.dragging {
    opacity: 0.5;
}

.item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.item-details {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.item-description {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

.item-id {
    font-size: 10px;
    color: #ccc;
    text-align: right;
}

/* ===== STATS & ACTIONS ===== */
.stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 20px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.actions {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #ddd;
}

/* ===== BUTTON SYSTEM ===== */
.btn {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #545b62;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

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

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* ===== STATUS INDICATORS ===== */
.status-live { border-left: 4px solid #28a745; }
.status-inactive { border-left: 4px solid #dc3545; }
.status-pending { border-left: 4px solid #ffc107; }
.status-maintenance { border-left: 4px solid #17a2b8; }

/* ===== COMPANY & PROJECT CARDS ===== */
.company-assets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.company-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
}

.company-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
}

.project-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.project-details {
    font-size: 11px;
    color: #333;
    line-height: 1.2;
    margin-bottom: 8px;
}

.project-details div {
    margin-bottom: 2px;
}

.project-details div:last-child {
    margin-bottom: 0;
}

.company-asset {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 5px;
    font-size: 12px;
}

/* ===== OVERVIEW COMPONENTS ===== */
.overview-history-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.overview-history-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.overview-histories-container {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-width: 600px;
    max-height: 800px;
    overflow-y: auto;
}

.overview-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.overview-main-content {
    flex: 1;
}

.overview-data-records {
    flex: 1;
    max-width: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 15px;
    align-self: flex-start;
}

/* ===== USER HEADER ===== */
.user-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span:first-child {
    font-weight: 600;
    color: #495057;
}

.user-info span:last-child {
    color: #6c757d;
    font-size: 14px;
}

.user-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== PROJECT OVERVIEW STYLING ===== */
.project-description {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    color: #495057;
    line-height: 1.5;
    font-size: 14px;
}

.project-description:hover {
    background: #e9ecef;
    transition: background-color 0.2s ease;
}

.overview-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 10px;
    align-self: flex-start;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .overview-layout {
        flex-direction: column;
    }
    
    .overview-sidebar {
        width: 100%;
        order: -1;
    }
    
    .overview-histories-container {
        min-width: auto;
        max-width: 100%;
    }
    
    .history-name-tooltip .tooltip-content {
        width: 90vw;
        max-width: 90vw;
        left: 0;
        transform: none;
    }
}

/* ===== SCROLLBAR STYLING ===== */
.overview-histories-container::-webkit-scrollbar {
    width: 8px;
}

.overview-histories-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.overview-histories-container::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.overview-histories-container::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ===== CONFIGURATION COMPONENTS ===== */
.zero-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.zero-button:hover {
    background-color: #2980b9;
}

.config-input, .config-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
    background-color: white;
}

.config-input:focus, .config-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.config-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}

.set-config-button {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 8px;
}

.set-config-button:hover {
    background-color: #229954;
}

.create-alert-button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 8px;
}

.create-alert-button:hover {
    background-color: #e67e22;
}

/* ===== ASSIGNMENT CONTROLS ===== */
.assignment-controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.company-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 10px;
}

.company-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.selected-company-info {
    background: #e3f2fd;
    border: 1px solid #007bff;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
}

.company-details {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}

/* ===== FILTERS & INPUTS ===== */
.project-filter, .client-filter {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.project-filter-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

/* ===== CLIENT & PROJECT SECTIONS ===== */
.client-details-header h3 {
    margin: 0 0 15px 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.client-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.client-info div {
    margin-bottom: 8px;
}

.client-projects h4 {
    margin: 15px 0 10px 0;
    color: #495057;
}

.project-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}

.project-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.project-status {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 3px;
}

.project-dates {
    font-size: 11px;
    color: #adb5bd;
}

/* ===== COMPANY TREE COMPONENTS ===== */
.company-tree-item {
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

.company-tree-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.company-tree-header:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.expand-icon {
    cursor: pointer;
    font-weight: bold;
    color: #007bff;
    min-width: 24px;
    text-align: center;
    user-select: none;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.expand-icon:hover {
    color: #0056b3;
}

.company-name {
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    font-size: 14px;
}

.company-status {
    font-size: 11px;
    color: #6c757d;
    background: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    font-weight: 500;
}

.company-children {
    margin-top: 12px;
    margin-left: 30px;
    border-left: 3px solid #007bff;
    padding-left: 20px;
    position: relative;
}

.company-children::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #007bff 0%, #e9ecef 100%);
}

.company-tree-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -23px;
    top: 24px;
    width: 20px;
    height: 2px;
    background: #007bff;
}

.company-tree-details-header h3 {
    margin: 0 0 15px 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* ===== DRAG & DROP STYLES ===== */
.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    transition: all 0.2s ease;
}

.drop-zone {
    background-color: #f0f8ff !important;
    border-color: #007bff !important;
    transition: all 0.2s ease;
}

.item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item.draggable {
    cursor: grab;
}

.item.draggable:active {
    cursor: grabbing;
}

.drag-instructions, .drop-zone-instructions {
    font-size: 13px;
    line-height: 1.4;
}

.drag-instructions strong, .drop-zone-instructions strong {
    color: #333;
}

.item-actions {
    margin-top: 8px;
    text-align: right;
}

/* ===== COMPANY TREE INFO & PROJECTS ===== */
.company-tree-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.company-tree-info div {
    margin-bottom: 8px;
}

.company-tree-projects h4 {
    margin: 15px 0 10px 0;
    color: #495057;
}

.project-tree-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}

.project-tree-name {
    font-weight: 600;
}

.company-tree-container {
    max-height: 700px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.tree-level-indicator {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* ===== COMPANY TREE SCROLLBAR ===== */
.company-tree-container::-webkit-scrollbar {
    width: 10px;
}

.company-tree-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 5px;
}

.company-tree-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.company-tree-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== MODAL & FORM STYLES ===== */
.create-company-modal {
    max-width: 1200px;
    width: 95%;
}

.form-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.section-header i {
    color: #007bff;
    font-size: 18px;
    margin-right: 10px;
}

.section-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

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

.form-help {
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.file-upload-wrapper {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.file-upload-label i {
    font-size: 24px;
    color: #007bff;
}

.file-upload-label span {
    color: #6c757d;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* ===== TAB BUTTONS & CONTENT ===== */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.asset-tab-content, .location-tab-content, .overview-tab-content {
    display: none;
}

.asset-tab-content.active, .location-tab-content.active, .overview-tab-content.active {
    display: block;
}

.overview-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.overview-tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.overview-tab-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.overview-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* ===== COMPANY OVERVIEW COMPONENTS ===== */
.company-overview-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.company-overview-header h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 24px;
}

.company-overview-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    font-size: 16px;
    color: #6c757d;
}

.company-projects-section,
.company-histories-section,
.company-assets-section {
    margin-bottom: 25px;
}

.company-projects-section h4,
.company-histories-section h4,
.company-assets-section h4 {
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

.company-project-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.project-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 16px;
}

.project-status {
    color: #6c757d;
    margin-bottom: 5px;
    font-size: 14px;
}

.project-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.company-overview .overview-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.company-overview .overview-main-content {
    flex: 1;
}

.company-overview .overview-sidebar {
    width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    height: fit-content;
}

/* ===== PROJECT STATUS & HEADERS ===== */
.project-tree-status {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 3px;
}

.project-tree-dates {
    font-size: 11px;
    color: #adb5bd;
}

.project-status-active { border-left: 4px solid #28a745; }
.project-status-pending { border-left: 4px solid #ffc107; }
.project-status-completed { border-left: 4px solid #17a2b8; }
.project-status-cancelled { border-left: 4px solid #dc3545; }

.project-header {
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

/* ===== TOOLTIP SYSTEM ===== */
.history-name-tooltip {
    position: relative;
    cursor: pointer;
}

.history-name-tooltip .tooltip-content {
    visibility: hidden;
    width: 800px;
    max-width: 90vw;
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: fixed;
    z-index: 99999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #34495e;
    pointer-events: none;
}

.tooltip-two-column {
    display: flex;
    gap: 15px;
}

.tooltip-left-column {
    flex: 1;
    border-left: 1px solid #34495e;
    padding-left: 10px;
}

.tooltip-right-column {
    flex: 1;
    border-left: 1px solid #34495e;
    padding-left: 10px;
}

.history-name-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.history-name-tooltip .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.tooltip-section {
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.tooltip-section:not(:last-child) {
    border-bottom: 1px solid #34495e;
    padding-bottom: 8px;
}

.tooltip-section-title {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tooltip-field {
    margin-bottom: 3px;
    display: flex;
    align-items: flex-start;
}

.tooltip-field-label {
    font-weight: 600;
    color: #bdc3c7;
    min-width: 120px;
    margin-right: 6px;
}

.tooltip-field-value {
    color: #ecf0f1;
    flex: 1;
}

/* ===== OVERVIEW DETAIL DISPLAY ===== */
.detail-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3px;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 100px;
    margin-right: 8px;
    font-size: 12px;
}

.detail-value {
    color: #495057;
    flex: 1;
    font-size: 12px;
}

.variance-field {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #495057;
    white-space: nowrap;
}

.tooltip-data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 6px;
}

.tooltip-data-field {
    display: flex;
    flex-direction: column;
}

.tooltip-data-label {
    font-weight: 600;
    color: #bdc3c7;
    font-size: 10px;
    margin-bottom: 1px;
}

.tooltip-data-value {
    color: #ecf0f1;
    font-size: 11px;
}

.tooltip-config {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    background: #1a252f;
    padding: 6px;
    border-radius: 3px;
    margin-top: 4px;
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #34495e;
}

.tooltip-variance-item {
    margin-bottom: 6px;
    padding: 4px 6px;
    background: #1a252f;
    border-radius: 3px;
    border: 1px solid #34495e;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 10px;
}

.tooltip-variance-field {
    display: flex;
    align-items: center;
    gap: 3px;
}

.tooltip-variance-label {
    color: #bdc3c7;
    font-weight: 600;
    font-size: 9px;
}

.tooltip-variance-value {
    color: #ecf0f1;
}

/* ===== USER LIST COMPONENTS ===== */
.user-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.user-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #007bff;
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
}

.user-id {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.user-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.user-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-detail-value {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.user-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-status-live {
    background: #d4edda;
    color: #155724;
}

.user-status-inactive {
    background: #fff3cd;
    color: #856404;
}

.user-status-suspended {
    background: #f8d7da;
    color: #721c24;
}


/* ===== HISTORY COMPONENTS ===== */
.history-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.history-details {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.history-status {
    color: #007bff;
    font-size: 0.9em;
    font-weight: bold;
}

/* ===== MODAL SYSTEM ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message i {
    color: #dc3545;
}

/* ===== FORM COMPONENTS ===== */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ===== FILTER COMPONENTS ===== */
.filter {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.filter-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .tabs {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .overview-layout {
        flex-direction: column;
    }

    .company-overview .overview-sidebar {
        width: 100%;
    }
}

/* ===== SENSOR MANAGEMENT TAB STYLES ===== */
.sensor-content {
    padding: 20px;
}

.sensor-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sensor-form-section h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sensor-form-section p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sensor-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.sensor-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.sensor-form .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.sensor-form .form-group .form-control {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
    height: 40px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

.sensor-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}


/* Responsive design for sensor form */
@media (max-width: 768px) {
    .sensor-form .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sensor-form .form-actions {
        flex-direction: column;
    }
    
    .sensor-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sensor-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== INFO TAB STYLES ===== */
.info-content {
    padding: 20px;
}

.info-filter-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-filter-section h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-filter-section p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.imei-search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.imei-search-form .form-group {
    display: flex;
    flex-direction: column;
    max-width: 500px;
}

.imei-search-form .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.imei-search-form .form-group .form-control {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: 10px;
}

.imei-search-form .form-group .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.imei-search-form .btn {
    align-self: flex-start;
}

.info-results-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-results-section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-tab-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.info-tab-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.info-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.info-tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.info-tab-content.active {
    display: block;
}

/* PDF Import Tab Styles */
.pdf-import-content {
    padding: 20px;
}

.pdf-drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pdf-drop-zone:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.pdf-drop-zone.dragover {
    border-color: #28a745;
    background: #d4edda;
    transform: scale(1.02);
}

.pdf-drop-zone .drop-zone-content {
    pointer-events: none;
}

.pdf-drop-zone .drop-zone-content i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.pdf-drop-zone:hover .drop-zone-content i {
    color: #007bff;
}

.pdf-drop-zone.dragover .drop-zone-content i {
    color: #28a745;
}

.pdf-drop-zone h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.pdf-drop-zone p {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 14px;
}

.pdf-file-list {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

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

.pdf-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-file-info i {
    color: #dc3545;
    font-size: 18px;
}

.pdf-file-details {
    display: flex;
    flex-direction: column;
}

.pdf-file-name {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.pdf-file-size {
    color: #6c757d;
    font-size: 12px;
}

.pdf-file-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.pdf-file-status.processing {
    color: #856404;
}

.pdf-file-status.success {
    color: #155724;
}

.pdf-file-status.error {
    color: #721c24;
}

.pdf-extracted-data {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.pdf-data-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.import-progress {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.progress {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.import-status-text {
    color: #6c757d;
    font-size: 14px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.info-table th,
.info-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.info-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.info-table td {
    color: #6c757d;
    font-size: 0.85em;
}

.info-table tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Responsive design for info tab */
@media (max-width: 768px) {
    .info-tabs {
        flex-direction: column;
    }
    
    .info-tab-btn {
        text-align: center;
    }
    
    .info-table {
        font-size: 0.8em;
    }
    
    .info-table th,
    .info-table td {
        padding: 6px 8px;
    }
}

/* Histories card layout */
.histories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.history-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.history-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.history-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.history-status.live {
    background: #d4edda;
    color: #155724;
}

.history-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.history-status.unknown {
    background: #e2e3e5;
    color: #6c757d;
}

.history-content {
    padding: 15px;
}

.history-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.history-row:last-child {
    margin-bottom: 0;
}

.history-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-field.full-width {
    flex: 100%;
}

.history-field label {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-field span {
    font-size: 13px;
    color: #333;
    word-break: break-word;
}

/* Sensor data sections */
.sensor-data-section {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.sensor-data-section h4 {
    margin: 0;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.sensor-data-section .info-table {
    margin-top: 0;
}

.sensor-data-section .info-table th {
    background: #e9ecef;
}

/* Responsive design for histories */
@media (max-width: 768px) {
    .histories-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .history-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .history-field {
        flex: none;
    }
}

/* ===== SEARCHABLE DROPDOWN STYLES ===== */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.searchable-dropdown .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.searchable-dropdown .dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.searchable-dropdown .dropdown-option:hover {
    background-color: #f8f9fa;
}

.searchable-dropdown .dropdown-option:last-child {
    border-bottom: none;
}

.searchable-dropdown .dropdown-option.highlighted {
    background-color: #007bff;
    color: white;
}

/* ===== DRAGGABLE OVERLAY MARKERS ===== */
.draggable-marker {
    position: absolute;
    cursor: move;
    z-index: 1000;
    transition: transform 0.1s;
    user-select: none;
}

.draggable-marker:hover {
    transform: scale(1.05);
}

.draggable-marker .marker-container {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
    color: #0000ff;
    line-height: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.draggable-marker .marker-container > div {
    white-space: nowrap;
}

/* Draggable history items */
.draggable-history-item {
    transition: background-color 0.2s, transform 0.1s;
    user-select: none;
}

.draggable-history-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.draggable-history-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Drop zone styling */
#overlay-image-preview.drag-over {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
    border-width: 3px !important;
}