/* rtd/css/rtd.css - Real Time Display Styles */

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Century Gothic', 'CenturyGothic', 'Apple Gothic', sans-serif;
    background: #f5f6fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay .loading-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.loading-overlay .loading-content i {
    font-size: 40px;
    color: #0a5cff;
}

.loading-overlay .loading-content p {
    margin-top: 16px;
    color: #666;
    font-size: 16px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
#toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

#toast-notification.success {
    background: #28a745;
}

#toast-notification.error {
    background: #dc3545;
}

#toast-notification.warning {
    background: #ffc107;
    color: #333;
}

/* ============================================
   RTD BUILDER LAYOUT
   ============================================ */
#rtdBuilder {
    display: flex;
    flex-direction: column;
    height: 100vh;
	overflow: hidden;
}

/* ============================================
   TOP BAR
   ============================================ */
.rtd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 2px solid #e1e1e1;
    flex-shrink: 0;
    height: 60px;
}

.rtd-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rtd-logo {
    height: 30px;
}

.rtd-builder-title {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
    letter-spacing: 0.5px;
}

.rtd-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rtd-user-info {
    font-size: 14px;
    color: #666;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */
.rtd-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.rtd-btn-primary {
    background: #0a5cff;
    color: #fff;
}

.rtd-btn-primary:hover {
    background: #0847cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 92, 255, 0.3);
}

.rtd-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.rtd-btn-secondary:hover {
    background: #e1e1e1;
}

.rtd-btn-danger {
    background: #dc3545;
    color: #fff;
}

.rtd-btn-danger:hover {
    background: #c82333;
}

.rtd-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.rtd-main-layout {
	display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.rtd-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    background: #fff;        /* or #e8ecf1 — pick one */
}

/* ============================================
   SIDE MENU
   ============================================ */
.rtd-side-menu {
    width: 280px;
    min-width: 280px;
    background: #2c3e50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.rtd-side-menu-header {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #ecf0f1;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.rtd-side-menu-header i {
    color: #0a5cff;
}

/* RTD Selector */
.rtd-selector {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
	align-items: center;
}

.rtd-selector select {
    flex: 1;
    min-width: 0;                /* ← IMPORTANT: allows the select to shrink below its content size */
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #34495e;
    color: #ecf0f1;
    cursor: pointer;
    text-overflow: ellipsis;     /* ← shows "..." if text is too long */
}

.rtd-selector select:focus {
    outline: none;
    border-color: #0a5cff;
}

.rtd-selector select option {
    background: #2c3e50;
    color: #ecf0f1;
}

.rtd-selector .rtd-btn {
    background: #0a5cff;
    color: #fff;
    padding: 6px 12px;
    flex-shrink: 0;              /* ← IMPORTANT: prevents the button from being squeezed */
    min-width: 32px;             /* ← ensures the button has a minimum width */
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtd-selector .rtd-btn:hover {
    background: #0847cc;
}

/* Menu Items */
.rtd-menu-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.rtd-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.rtd-menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: #ecf0f1;
}

.rtd-menu-item.active {
    background: rgba(10, 92, 255, 0.2);
    color: #fff;
    border-left: 3px solid #0a5cff;
}

.rtd-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #7f8c8d;
}

.rtd-menu-item.active i {
    color: #0a5cff;
}

.rtd-menu-item:hover i {
    color: #ecf0f1;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.rtd-tab-content {
	flex: 1;
    background: #fff;
    overflow: visible;
    padding: 20px 24px;
    border-left: 1px solid #e1e1e1;
}

.rtd-tab-panel {
    display: none;
}

.rtd-tab-panel.active {
    display: block;
}

/* Tab Sections */
.rtd-tab-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.rtd-tab-section:last-child {
    border-bottom: none;
}

.rtd-tab-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #0a5cff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Groups */
.rtd-form-group {
    margin-bottom: 14px;
}

.rtd-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.rtd-input,
.rtd-select,
.rtd-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: #fff;
}

.rtd-input:focus,
.rtd-select:focus,
.rtd-textarea:focus {
    outline: none;
    border-color: #0a5cff;
}

.rtd-textarea {
    resize: vertical;
    min-height: 80px;
}

.rtd-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtd-input-group .rtd-input {
    width: auto;
}

.rtd-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.rtd-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* File Upload */
.rtd-file-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rtd-file-upload input[type="file"] {
    display: none;
}

/* Background Preview */
.rtd-background-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed #e1e1e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.rtd-background-preview.has-image {
    border-color: #0a5cff;
}

.rtd-background-preview.has-image .rtd-background-remove {
    display: flex;
}

.rtd-background-remove {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.rtd-background-remove:hover {
    background: #dc3545;
}

/* ============================================
   WORKSPACE
   ============================================ */
.rtd-workspace {
    background: #e8ecf1;
    position: relative;
    padding: 0px;
    min-height: 300px;
    overflow: visible;
}

.rtd-workspace-content {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: visible;
}

.rtd-workspace-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
}

.rtd-workspace-groups {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.rtd-workspace-group {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.rtd-workspace-group:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #0a5cff;
}

.rtd-workspace-group-header {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.rtd-workspace-group-value {
    font-size: 24px;
    font-weight: 700;
    color: #0a5cff;
}

.rtd-workspace-group-more {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.rtd-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    padding: 40px;
}

.rtd-empty-state h3 {
    margin-top: 16px;
    font-size: 20px;
    color: #666;
}

.rtd-empty-state p {
    margin-top: 8px;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .rtd-side-menu {
        width: 220px;
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .rtd-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }

@media (max-width: 992px) {
    .dg-var-selector-layout {
        grid-template-columns: 1fr 1fr;
    }
}

    .rtd-topbar-left {
        flex: 1;
    }
    
    .rtd-builder-title {
        font-size: 14px;
    }
    
    .rtd-topbar-right {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .rtd-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .rtd-main-layout {
        flex-direction: column;
    }
    
    .rtd-side-menu {
        width: 100%;
        min-width: unset;
        max-height: 300px;
        border-right: none;
        border-bottom: 2px solid #e1e1e1;
    }
    
    .rtd-tab-content {
        max-height: 400px;
    }
}

/* ============================================
   DATA GROUPS STYLES
   ============================================ */

/* Groups Layout */
.dg-groups-layout {
    display: flex;
    gap: 20px;
    min-height: 300px;
}

.dg-groups-left {
    flex: 1;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.dg-groups-right {
    flex: 1.5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dg-groups-header,
.dg-variables-header,
.dg-position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.dg-group-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}

.dg-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.dg-group-item:hover {
    background: #f0f4ff;
    border-color: #d0dfff;
}

.dg-group-item.selected {
    background: #e8f0ff;
    border-color: #0a5cff;
}

.dg-group-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dg-group-icon {
    color: #0a5cff;
    width: 24px;
    text-align: center;
}

.dg-group-name {
    font-weight: 500;
    font-size: 14px;
}

.dg-group-count {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 0 8px;
    border-radius: 10px;
}

.dg-group-actions {
    display: flex;
    gap: 4px;
}

.dg-group-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dg-group-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.dg-group-actions .dg-delete-btn:hover {
    color: #dc3545;
}

/* Variables */
.dg-variables-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dg-variables-list {
    flex: 1;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.dg-variable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.dg-var-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dg-var-index {
    font-size: 11px;
    color: #aaa;
    width: 20px;
}

.dg-var-name {
    font-size: 13px;
}

.dg-var-unit {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 0 6px;
    border-radius: 8px;
}

.dg-var-actions {
    display: flex;
    gap: 4px;
}

.dg-var-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dg-var-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.dg-var-actions .dg-delete-btn:hover {
    color: #dc3545;
}

/* Position */
.dg-position-section {
    border-top: 1px solid #e1e1e1;
}

.dg-position-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

.dg-pos-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dg-pos-group label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Pointer Tools */
.dg-pointer-tools {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 14px;
}

.dg-pointer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.dg-pointer-color,
.dg-pointer-width,
.dg-pointer-icon,
.dg-pointer-snap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dg-pointer-color label,
.dg-pointer-width label,
.dg-pointer-icon label,
.dg-pointer-snap label {
    font-size: 13px;
    color: #666;
}

.dg-pointer-color input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
}

.dg-pointer-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

.dg-pointer-hint i {
    color: #0a5cff;
}

/* Config Sections */
.dg-config-section {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dg-config-section:last-child {
    border-bottom: none;
}

.dg-config-section h5 {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.dg-config-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.dg-config-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dg-config-group label {
    font-size: 13px;
    color: #666;
}

.dg-config-group input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
    cursor: pointer;
}

/* Empty State */
.dg-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

.dg-empty-state i {
    font-size: 32px;
    color: #ddd;
    display: block;
    margin-bottom: 10px;
}

.dg-empty-state p {
    margin: 0;
    font-size: 14px;
}

.dg-empty-state .dg-hint {
    font-size: 12px;
    color: #bbb;
}

/* Modals */
.dg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.dg-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: block !important;
}

.dg-modal-wide {
    max-width: 900px;
}

.dg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.dg-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.dg-modal-header h3 i {
    margin-right: 8px;
}

.dg-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.dg-modal-close:hover {
    color: #dc3545;
}

.dg-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    display: block !important;
}

.dg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

/* Indicator Shapes */
.dg-indicator-shapes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.dg-shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
    min-width: 70px;
}

.dg-shape-option:hover {
    border-color: #0a5cff;
    background: #f0f4ff;
}

.dg-shape-option.selected {
    border-color: #0a5cff;
    background: #e8f0ff;
}

.dg-shape-option i {
    font-size: 24px;
    color: #0a5cff;
}

.dg-shape-option span {
    font-size: 11px;
    color: #666;
}

/* Variable Selector */
.dg-var-selector-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.dg-var-col {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dg-var-col label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.dg-var-col select {
    flex: 1;
    display: block !important;
    visibility: visible !important;
    width: 100%;
    min-height: 120px;
    padding: 6px 10px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.dg-var-arrows {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
}

.dg-var-arrows .rtd-btn {
    padding: 8px 12px;
}

/* Pointer Points on Workspace */
.dg-pointer-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0a5cff;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .dg-groups-layout {
        flex-direction: column;
    }
    
    .dg-var-selector-layout {
        flex-direction: column;
    }
    
    .dg-var-arrows {
        flex-direction: row;
        justify-content: center;
        padding: 8px 0;
    }
    
    .dg-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================
   CONTOUR STYLES
   ============================================ */

/* Contour Form */
.contour-form-group {
    margin-bottom: 14px;
}

.contour-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.contour-field {
    transition: all 0.3s ease;
}

.contour-scale-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.contour-scale-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.contour-scale-group label {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
}

.contour-scale-group input {
    padding: 6px 10px;
}

/* Contour Variables */
.contour-variables-section {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.contour-variables-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.contour-variables-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.contour-var-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.contour-var-item:last-child {
    border-bottom: none;
}

.contour-var-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contour-var-index {
    font-size: 11px;
    color: #aaa;
    width: 20px;
}

.contour-var-name {
    font-size: 13px;
}

.contour-var-unit {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 0 6px;
    border-radius: 8px;
}

.contour-var-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.contour-var-actions button:hover {
    background: #f0f0f0;
    color: #dc3545;
}

/* Contour Table */
.contour-table-section {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.contour-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.contour-table-actions {
    display: flex;
    gap: 8px;
}

.contour-table-wrapper {
    overflow-x: auto;
    padding: 8px;
}

.contour-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.contour-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #e1e1e1;
    font-weight: 600;
    color: #555;
}

.contour-table td {
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.contour-table-input {
    padding: 4px 8px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.contour-table-input:focus {
    outline: none;
    border-color: #0a5cff;
}

.contour-table-hint {
    padding: 10px 14px;
    font-size: 12px;
    color: #888;
    background: #fafafa;
    border-top: 1px solid #e1e1e1;
}

.contour-table-hint i {
    color: #0a5cff;
    margin-right: 4px;
}

/* Contour Empty State */
.contour-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

.contour-empty-state i {
    font-size: 32px;
    color: #ddd;
    display: block;
    margin-bottom: 10px;
}

.contour-empty-state p {
    margin: 0;
    font-size: 14px;
}

.contour-empty-state .contour-hint {
    font-size: 12px;
    color: #bbb;
}

/* Contour Modals */
.contour-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contour-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.contour-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.contour-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.contour-modal-header h3 i {
    margin-right: 8px;
}

.contour-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.contour-modal-close:hover {
    color: #dc3545;
}

.contour-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.contour-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

/* Contour Variable Selector */
.contour-var-selector {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.contour-var-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contour-var-col label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.contour-var-col select {
    flex: 1;
    min-height: 150px;
}

.contour-var-arrows {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
}

.contour-var-arrows .rtd-btn {
    padding: 8px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .contour-var-selector {
        flex-direction: column;
    }
    
    .contour-var-arrows {
        flex-direction: row;
        justify-content: center;
        padding: 8px 0;
    }
    
    .contour-scale-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .contour-table-actions {
        flex-wrap: wrap;
    }
}

/* ============================================
   INDICATORS STYLES
   ============================================ */

/* Layout */
.ind-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 400px;
}

.ind-left {
    flex: 1;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ind-right {
    flex: 1.5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

/* Header */
.ind-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

/* List */
.ind-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.ind-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ind-item:hover {
    background: #f0f4ff;
    border-color: #d0dfff;
}

.ind-item.selected {
    background: #e8f0ff;
    border-color: #0a5cff;
}

.ind-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ind-icon {
    width: 28px;
    text-align: center;
}

.ind-icon i {
    font-size: 16px;
}

.ind-name {
    font-size: 13px;
    font-weight: 500;
}

.ind-type-badge {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 0 8px;
    border-radius: 10px;
}

.ind-actions {
    display: flex;
    gap: 4px;
}

.ind-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ind-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.ind-actions .ind-delete-btn:hover {
    color: #dc3545;
}

/* Empty State */
.ind-empty-state {
    padding: 30px 20px;
    text-align: center;
    color: #999;
}

.ind-empty-state i {
    font-size: 32px;
    color: #ddd;
    display: block;
    margin-bottom: 10px;
}

.ind-empty-state p {
    margin: 0;
    font-size: 14px;
}

.ind-empty-state .ind-hint {
    font-size: 12px;
    color: #bbb;
}

/* Details Panel */
.ind-details-panel {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.ind-details-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.ind-details-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.ind-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ind-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.ind-details-header h4 {
    font-size: 18px;
    color: #0a5cff;
    margin: 0;
}

.ind-details-header h4 i {
    margin-right: 8px;
}

.ind-details-type {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 12px;
    border-radius: 12px;
}

.ind-details-body {
    flex: 1;
}

.ind-detail-row {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

.ind-detail-row strong {
    color: #555;
    display: inline-block;
    width: 140px;
}

.ind-details-footer {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
    margin-top: 16px;
}

/* Type Grid */
.ind-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 10px 0;
}

.ind-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ind-type-card:hover {
    border-color: #0a5cff;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ind-type-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.ind-type-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Indicator Form */
.ind-form-group {
    margin-bottom: 14px;
}

.ind-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.ind-form-row {
    display: flex;
    gap: 16px;
}

.ind-var-selector-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ind-columns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px 0;
}

/* Modals */
.ind-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ind-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ind-modal-wide {
    max-width: 900px;
}

.ind-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.ind-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.ind-modal-header h3 i {
    margin-right: 8px;
}

.ind-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.ind-modal-close:hover {
    color: #dc3545;
}

.ind-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.ind-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

/* Responsive */
@media (max-width: 768px) {
    .ind-layout {
        flex-direction: column;
    }
    
    .ind-left {
        max-height: 300px;
    }
    
    .ind-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ind-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .ind-columns-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

/* Layout */
.nav-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 400px;
}

.nav-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-right {
    flex: 1.5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

/* Sections */
.nav-section {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.nav-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.nav-section-header i {
    color: #0a5cff;
    margin-right: 6px;
}

.nav-section-body {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

/* List Items */
.nav-list {
    min-height: 60px;
}

.nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: #f0f4ff;
    border-color: #d0dfff;
}

.nav-item.selected {
    background: #e8f0ff;
    border-color: #0a5cff;
}

.nav-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item-index {
    font-size: 11px;
    color: #aaa;
    min-width: 24px;
}

.nav-item-label {
    font-size: 13px;
    font-weight: 500;
}

.nav-item-link {
    font-size: 12px;
    color: #888;
}

.nav-item-actions {
    display: flex;
    gap: 4px;
}

.nav-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-item-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.nav-item-actions .nav-delete-btn:hover {
    color: #dc3545;
}

/* Empty State */
.nav-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

.nav-empty-state i {
    font-size: 28px;
    color: #ddd;
    display: block;
    margin-bottom: 8px;
}

.nav-empty-state p {
    margin: 0;
    font-size: 13px;
}

.nav-empty-state .nav-hint {
    font-size: 12px;
    color: #bbb;
}

/* Details Panel */
.nav-details-panel {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.nav-details-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.nav-details-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.nav-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nav-details-header {
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.nav-details-header h4 {
    font-size: 18px;
    color: #0a5cff;
    margin: 0;
}

.nav-details-header h4 i {
    margin-right: 8px;
}

.nav-details-body {
    flex: 1;
}

.nav-detail-row {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

.nav-detail-row strong {
    color: #555;
    display: inline-block;
    width: 140px;
}

.nav-coords-display {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    word-break: break-all;
    margin-top: 4px;
}

.nav-details-footer {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
    margin-top: 16px;
}

/* Modals */
.nav-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.nav-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.nav-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.nav-modal-header h3 i {
    margin-right: 8px;
}

.nav-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.nav-modal-close:hover {
    color: #dc3545;
}

.nav-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.nav-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

.nav-form-group {
    margin-bottom: 14px;
}

.nav-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.nav-form-row {
    display: flex;
    gap: 16px;
}

/* Drawing Overlay */
.nav-drawing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: none;
}

.nav-drawing-instructions {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.nav-drawing-instructions i {
    color: #0a5cff;
}

.nav-draw-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0a5cff;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-draw-line {
    pointer-events: none;
    z-index: 100;
}

.nav-drawing-mode {
    cursor: crosshair !important;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-layout {
        flex-direction: column;
    }
    
    .nav-left {
        max-height: 400px;
    }
    
    .nav-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-drawing-instructions {
        font-size: 12px;
        padding: 8px 14px;
        flex-wrap: wrap;
        justify-content: center;
        top: 10px;
    }
}

/* ============================================
   PHOTOS STYLES
   ============================================ */

/* Layout */
.photo-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 400px;
}

.photo-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.photo-right {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.photo-section {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.photo-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.photo-section-header i {
    color: #0a5cff;
    margin-right: 6px;
}

.photo-section-body {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

/* List Items */
.photo-list {
    min-height: 60px;
}

.photo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.photo-item:hover {
    background: #f0f4ff;
    border-color: #d0dfff;
}

.photo-item.selected {
    background: #e8f0ff;
    border-color: #0a5cff;
}

.photo-item-preview {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item-preview.webcam-preview {
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    font-size: 10px;
}

.photo-item-preview.webcam-preview i {
    font-size: 20px;
    margin-bottom: 2px;
}

.photo-item-info {
    flex: 1;
    min-width: 0;
}

.photo-item-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.photo-item-desc {
    display: block;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.photo-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.photo-item-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.photo-item-actions .photo-delete-btn:hover {
    color: #dc3545;
}

/* Empty State */
.photo-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

.photo-empty-state i {
    font-size: 28px;
    color: #ddd;
    display: block;
    margin-bottom: 8px;
}

.photo-empty-state p {
    margin: 0;
    font-size: 13px;
}

.photo-empty-state .photo-hint {
    font-size: 12px;
    color: #bbb;
}

/* Details Panel */
.photo-details-panel {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.photo-details-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.photo-details-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.photo-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.photo-details-header {
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 12px;
}

.photo-details-header h4 {
    font-size: 18px;
    color: #0a5cff;
    margin: 0;
}

.photo-details-header h4 i {
    margin-right: 8px;
}

.photo-details-preview {
    text-align: center;
    margin-bottom: 12px;
}

.photo-details-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
    padding: 4px;
}

.photo-details-body {
    flex: 1;
}

.photo-detail-row {
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}

.photo-detail-row strong {
    color: #555;
    display: inline-block;
    width: 120px;
}

.photo-details-footer {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 2px solid #f0f0f0;
    margin-top: 12px;
}

/* Positioning */
.photo-positioning {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.photo-positioning-header {
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    font-weight: 600;
    font-size: 13px;
}

.photo-positioning-header i {
    color: #0a5cff;
    margin-right: 6px;
}

.photo-positioning-body {
    padding: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.photo-position-hint {
    width: 100%;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.photo-position-hint i {
    color: #0a5cff;
    margin-right: 4px;
}

/* Modals */
.photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.photo-modal-wide {
    max-width: 700px;
}

.photo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.photo-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.photo-modal-header h3 i {
    margin-right: 8px;
}

.photo-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.photo-modal-close:hover {
    color: #dc3545;
}

.photo-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.photo-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

/* Form */
.photo-form-group {
    margin-bottom: 14px;
}

.photo-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.photo-form-row {
    display: flex;
    gap: 16px;
}

.photo-size-options {
    display: flex;
    gap: 16px;
    padding: 4px 0;
}

/* Upload Area */
.photo-upload-area {
    border: 2px dashed #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.photo-upload-area:hover {
    border-color: #0a5cff;
}

.photo-upload-dropzone {
    cursor: pointer;
}

.photo-upload-dropzone i {
    font-size: 40px;
    color: #ccc;
}

.photo-upload-dropzone p {
    margin: 8px 0 4px;
    color: #666;
}

.photo-upload-dropzone span {
    font-size: 12px;
    color: #999;
}

.photo-upload-dropzone.dragover {
    border-color: #0a5cff;
    background: #f0f4ff;
}

.photo-current-preview {
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.photo-current-preview img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
}

.photo-current-preview span {
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .photo-layout {
        flex-direction: column;
    }
    
    .photo-left {
        max-height: 400px;
    }
    
    .photo-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .photo-size-options {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   LEVEL INDICATOR STYLES
   ============================================ */

/* Form */
.level-form-group {
    margin-bottom: 14px;
}

.level-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.level-form-row {
    display: flex;
    gap: 16px;
}

.level-field {
    transition: all 0.3s ease;
}

.level-line-field,
.level-endpoint-field {
    transition: all 0.3s ease;
    padding-left: 12px;
    border-left: 3px solid #0a5cff;
    margin-top: 8px;
}

/* Drawing Mode */
.level-drawing-mode {
    cursor: crosshair !important;
}

.level-drawing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: none;
}

.level-drawing-instructions {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.level-drawing-instructions i {
    color: #0a5cff;
}

.level-draw-rect {
    position: absolute;
    border: 2px dashed #0a5cff;
    background: rgba(10, 92, 255, 0.1);
    pointer-events: none;
    z-index: 101;
}

/* Locations */
.level-locations-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 4px;
}

.level-location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.level-location-item:last-child {
    border-bottom: none;
}

.level-location-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.level-location-name {
    font-size: 14px;
    font-weight: 500;
}

.level-location-name i {
    color: #0a5cff;
    margin-right: 6px;
}

.level-location-coords {
    font-size: 12px;
    color: #888;
}

.level-location-actions {
    display: flex;
    gap: 4px;
}

.level-location-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.level-location-actions button:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.level-location-actions .level-delete-btn:hover {
    color: #dc3545;
}

/* Empty State */
.level-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

.level-empty-state i {
    font-size: 28px;
    color: #ddd;
    display: block;
    margin-bottom: 8px;
}

.level-empty-state p {
    margin: 0;
    font-size: 13px;
}

.level-empty-state .level-hint {
    font-size: 12px;
    color: #bbb;
}

/* Modals */
.level-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.level-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.level-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0a5cff;
}

.level-modal-header h3 i {
    margin-right: 8px;
}

.level-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.level-modal-close:hover {
    color: #dc3545;
}

.level-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.level-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e1e1e1;
}

/* Responsive */
@media (max-width: 768px) {
    .level-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .level-drawing-instructions {
        font-size: 12px;
        padding: 8px 14px;
        flex-wrap: wrap;
        justify-content: center;
        top: 10px;
    }
}

/* ============================================
   RTD VIEWER STYLES
   ============================================ */

.rtd-viewer {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #f5f6fa;
}

.rtd-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 2px solid #e1e1e1;
    z-index: 20;
    position: relative;
}

.rtd-viewer-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #0a5cff;
    margin: 0;
}

.rtd-viewer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rtd-viewer-time {
    font-size: 13px;
    color: #888;
}

.rtd-viewer-time i {
    margin-right: 4px;
}

.rtd-viewer-refresh {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rtd-viewer-refresh:hover {
    background: #f0f0f0;
    color: #0a5cff;
}

.rtd-viewer-refresh:active {
    transform: rotate(180deg);
}

.rtd-viewer-workspace {
    position: relative;
    width: 100%;
    height: calc(100% - 60px);
    overflow: hidden;
    background: #fff;
}

.rtd-viewer-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    pointer-events: none;
}

/* Viewer Groups */
.rtd-viewer-groups {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.rtd-viewer-group {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rtd-viewer-group-header {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.rtd-viewer-group-value {
    font-size: 22px;
    font-weight: 700;
    color: #0a5cff;
}

.rtd-viewer-group-more {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Viewer Numerics */
.rtd-viewer-numeric {
    position: absolute;
    z-index: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    text-align: center;
}

.rtd-viewer-numeric-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.rtd-viewer-numeric-value {
    font-weight: 700;
}

.rtd-viewer-numeric-alarm {
    font-size: 11px;
    color: #28a745;
    margin-top: 2px;
}

/* Viewer Compass */
.rtd-viewer-compass {
    position: absolute;
    z-index: 1;
}

.rtd-viewer-compass-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtd-viewer-compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    width: 4px;
    height: 60%;
    margin-left: -2px;
    margin-top: -30%;
    transition: transform 0.5s ease;
}

.rtd-viewer-compass-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #FF0000;
    position: absolute;
    top: -20px;
    left: -10px;
}

.rtd-viewer-compass-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rtd-viewer-compass-labels span {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.rtd-viewer-compass-labels span:nth-child(1) { top: 6px; left: 50%; transform: translateX(-50%); }
.rtd-viewer-compass-labels span:nth-child(2) { right: 6px; top: 50%; transform: translateY(-50%); }
.rtd-viewer-compass-labels span:nth-child(3) { bottom: 6px; left: 50%; transform: translateX(-50%); }
.rtd-viewer-compass-labels span:nth-child(4) { left: 6px; top: 50%; transform: translateY(-50%); }

.rtd-viewer-compass-name {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #888;
}

.rtd-viewer-compass-time {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    color: #999;
}

.rtd-viewer-compass-value {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 10px;
    color: #666;
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Viewer Graphs */
.rtd-viewer-graph {
    position: absolute;
    z-index: 1;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rtd-viewer-graph-header {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
}

.rtd-viewer-graph-container {
    padding: 4px;
}

/* Viewer Timestamps */
.rtd-viewer-timestamp {
    position: absolute;
    z-index: 1;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    text-align: center;
}

.rtd-viewer-timestamp-label {
    font-size: 12px;
    color: #666;
}

.rtd-viewer-timestamp-value {
    font-weight: 600;
}

.rtd-viewer-timestamp-alarm {
    font-size: 11px;
    color: #28a745;
}

/* Viewer Text */
.rtd-viewer-text {
    position: absolute;
    z-index: 1;
    overflow: hidden;
    word-wrap: break-word;
}

/* Viewer Displacement */
.rtd-viewer-displacement {
    position: absolute;
    z-index: 1;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rtd-viewer-displacement-header {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
}

.rtd-viewer-displacement-container {
    padding: 10px;
    height: calc(100% - 30px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Viewer Alarm Table */
.rtd-viewer-alarmtable {
    position: absolute;
    z-index: 1;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rtd-viewer-alarmtable-header {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rtd-viewer-alarmtable-body {
    padding: 4px;
    height: calc(100% - 30px);
    overflow-y: auto;
}

/* Viewer Photos */
.rtd-viewer-photo {
    position: absolute;
    z-index: 1;
}

.rtd-viewer-photo img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
    padding: 4px;
    background: #fff;
}

/* Viewer Webcams */
.rtd-viewer-webcam {
    position: absolute;
    z-index: 1;
    background: #2c3e50;
}

.rtd-viewer-webcam-title {
    padding: 4px 8px;
    background: rgba(0,0,0,0.1);
    color: #fff;
    font-weight: 500;
}

.rtd-viewer-webcam-content {
    color: #fff;
}

/* Viewer Nav Buttons */
.rtd-viewer-nav-btn {
    position: absolute;
    z-index: 15;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rtd-viewer-nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.rtd-viewer-nav-btn:active {
    transform: scale(0.95);
}

.rtd-viewer-nav-alarm {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Viewer Areas (SVG) */
.rtd-viewer-areas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.rtd-viewer-area {
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}

/* Viewer Vectors (SVG) */
.rtd-viewer-vectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Viewer Loading */
.rtd-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.rtd-viewer-loading i {
    font-size: 48px;
    color: #0a5cff;
    margin-bottom: 16px;
}

.rtd-viewer-loading p {
    font-size: 16px;
}

/* Viewer Error */
.rtd-viewer-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    padding: 40px;
    text-align: center;
}

.rtd-viewer-error i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 16px;
}

.rtd-viewer-error h3 {
    font-size: 20px;
    color: #dc3545;
    margin: 0 0 8px 0;
}

.rtd-viewer-error p {
    font-size: 14px;
    margin: 0 0 16px 0;
}

/* Viewer Toast */
.rtd-viewer-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.rtd-viewer-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.rtd-viewer-toast.success {
    background: #28a745;
}

.rtd-viewer-toast.error {
    background: #dc3545;
}

.rtd-viewer-toast.warning {
    background: #ffc107;
    color: #333;
}

/* Viewer Responsive */
@media (max-width: 768px) {
    .rtd-viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }
    
    .rtd-viewer-header h2 {
        font-size: 16px;
    }
    
    .rtd-viewer-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .rtd-viewer-group-value {
        font-size: 18px;
    }
    
    .rtd-viewer-compass {
        transform: scale(0.8);
    }
    
    .rtd-viewer-graph {
        width: 90% !important;
        height: 200px !important;
    }
}

/* RTD Side Dropdown - Same style as Historical */
.rtd-side-dropdown {
    position: fixed; /* Changed from absolute to escape sidebar overflow */
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.rtd-side-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.rtd-side-header {
    padding: 10px 16px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e1e1e1;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtd-side-header i {
    color: #0a5cff;
}

.rtd-side-item {
    padding: 8px 16px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}

.rtd-side-item:hover {
    background: #f0f4ff;
    color: #0a5cff;
}

.rtd-side-item i {
    color: #888;
    width: 18px;
}

.rtd-side-item:hover i {
    color: #0a5cff;
}

.rtd-side-empty,
.rtd-side-loading {
    padding: 16px;
    color: #888;
    font-size: 13px;
    text-align: center;
}

.rtd-side-loading i {
    color: #0a5cff;
    margin-right: 8px;
}

.rtd-side-create {
    padding: 8px 16px;
    border-top: 1px solid #e1e1e1;
}

.rtd-side-create button {
    width: 100%;
    padding: 8px 12px;
    background: #0a5cff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.rtd-side-create button:hover {
    background: #0847cc;
}

/* Dragging state for workspace groups */
.rtd-workspace-group {
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.1s ease, outline 0.2s ease;
}

.rtd-workspace-group:hover {
    transform: scale(1.02);
}

.rtd-workspace-group.rtd-dragging {
    cursor: grabbing !important;
    transform: scale(1.03);
    z-index: 9999 !important;
    outline: 3px solid #0a5cff;
    outline-offset: 2px;
    box-shadow: 0 8px 30px rgba(10, 92, 255, 0.5);
    opacity: 0.9;
}

/* Workspace cursor during drag */
.rtd-workspace-content.rtd-drag-active {
    cursor: grabbing !important;
}

/* Indicators are draggable in builder mode */
.rtd-workspace-indicators .rtd-draggable-indicator {
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.rtd-workspace-indicators .rtd-draggable-indicator:hover {
    box-shadow: 0 0 0 2px #0a5cff;
}

.rtd-draggable-indicator {
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

.rtd-draggable-indicator:hover {
    box-shadow: 0 0 0 2px #0a5cff;
}