/* CSS Variables */
:root {
    /* Colors */
    --accent-primary: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-light: #3b82f6;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-inverse: #f1f5f9;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-elevated: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --border-light: #e2e8f0;
    --border-primary: #cbd5e1;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 20px;
    --space-xl: 28px;
    --space-2xl: 40px;
    --space-3xl: 56px;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px 0 rgba(0, 0, 0, 0.1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    /* Mobile optimizations */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Mobile-first responsive container */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    text-align: center;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: 1.125rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

h4 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: var(--space-md);
}

li {
    margin-bottom: var(--space-xs);
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Progress Bar */
.progress-container {
    background: var(--bg-primary);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-xl);
}

.progress-wrapper {
    background: var(--border-light);
    border-radius: var(--radius-lg);
    height: 8px;
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
    height: 100%;
    border-radius: var(--radius-lg);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* Header */
header {
    background: var(--accent-primary);
    color: var(--text-white);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-bottom: var(--space-lg);
}

header h1, header h2, header p {
    color: var(--text-white);
}

header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Main */
main {
    padding-bottom: var(--space-3xl);
    min-height: calc(100vh - 300px);
}

/* Cards */
.content-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-light);
}

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
}

.card h4 {
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* Radio and Checkbox Groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-item, .checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.radio-item:hover, .checkbox-item:hover {
    border-color: var(--border-primary);
    background: var(--bg-hover);
}

.radio-item input, .checkbox-item input {
    width: auto;
    margin: 0;
}

.radio-item label, .checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    gap: var(--space-sm);
    font-family: inherit;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-white);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--accent-primary);
    border-color: var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
    border-color: var(--danger);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

/* Heater Type Selection */
.heater-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.heater-type-card {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    background: var(--bg-primary);
}

.heater-type-card:hover {
    border-color: var(--accent-primary);
}

.heater-type-card.selected {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.05);
}

.heater-type-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.heater-type-card h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: 1rem;
}

.heater-type-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

/* Lists */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-list li {
    padding: var(--space-lg);
    margin-bottom: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-size: 1rem;
}

.item-info p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.875rem;
}

.item-actions {
    display: flex;
    gap: var(--space-sm);
}

.item-actions .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    min-width: auto;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: var(--space-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    padding: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

/* Footer */
footer {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-top: var(--space-2xl);
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.footer-content a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
}

.footer-content a:hover {
    color: var(--accent-primary);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    background: var(--bg-primary);
}

.file-upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.file-upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Status Messages */
.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: var(--space-md);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: var(--space-md);
}

/* Validation */
.input-error {
    border-color: var(--danger) !important;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

th, td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-primary);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
    margin-bottom: var(--space-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Alert */
.alert {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border: 1px solid;
}

.alert-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

/* Navigation Grid */
.nav-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.nav-buttons-grid .card {
    margin-bottom: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-buttons-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-buttons-grid .btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    min-height: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    /* Header adjustments */
    header {
        padding: var(--space-lg) 0;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    header p {
        font-size: 1rem;
        padding: 0 var(--space-md);
    }
    
    /* Content cards */
    .content-card {
        padding: var(--space-lg);
        margin-bottom: var(--space-md);
    }
    
    .card {
        padding: var(--space-md);
        margin-bottom: var(--space-md);
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: var(--space-lg);
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: var(--space-md);
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }
    
    .btn-group .btn {
        width: 100%;
        max-width: 300px;
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    .btn {
        min-height: 44px; /* Touch target size */
        font-size: 0.95rem;
    }
    
    /* Navigation buttons */
    .nav-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    /* Grids */
    .heater-type-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    /* Lists */
    .item-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
        gap: var(--space-sm);
    }
    
    .item-actions .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }
    
    /* File upload */
    .file-upload-area {
        padding: var(--space-xl);
        min-height: 120px;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: var(--space-sm) !important;
    }
    
    /* Progress bar */
    .progress-container {
        padding: var(--space-sm) 0;
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .container {
        padding: 0 var(--space-sm);
    }
    
    /* Header */
    header {
        padding: var(--space-md) 0;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: var(--space-sm);
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    /* Content */
    .content-card {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }
    
    .card {
        padding: var(--space-sm);
    }
    
    /* Typography */
    h3 {
        font-size: 1rem;
    }
    
    h4 {
        font-size: 0.9rem;
    }
    
    /* Forms */
    .form-control {
        padding: var(--space-sm);
    }
    
    .form-group {
        margin-bottom: var(--space-md);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .btn-group .btn {
        max-width: none;
        width: 100%;
    }
    
    /* Navigation */
    .nav-buttons-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .nav-buttons-grid .btn {
        padding: var(--space-md);
        font-size: 0.9rem;
    }
    
    /* Grids */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: var(--space-sm);
        padding: var(--space-md);
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding-bottom: var(--space-sm);
    }
    
    .modal-footer {
        padding-top: var(--space-sm);
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    /* File upload */
    .file-upload-area {
        padding: var(--space-lg);
        min-height: 100px;
    }
    
    .file-upload-area h4 {
        font-size: 0.9rem;
    }
    
    .file-upload-area p {
        font-size: 0.8rem;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-section {
        font-size: 0.9rem;
    }
    
    .data-section p {
        margin-bottom: var(--space-xs);
        line-height: 1.4;
    }
    
    .data-section strong {
        display: block;
        margin-bottom: var(--space-xs);
        color: var(--accent-primary);
    }
    
    /* Alerts */
    .alert {
        padding: var(--space-sm);
        font-size: 0.9rem;
    }
    
    .alert h4 {
        font-size: 1rem;
    }
    
    /* Progress */
    .progress-container {
        margin-bottom: var(--space-md);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch-specific styles */
    .btn:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    /* Larger touch targets */
    .btn, .form-control, .file-upload-area {
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .item-list li:hover {
        background: var(--bg-primary);
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: var(--space-sm) 0;
    }
    
    .progress-container {
        padding: var(--space-xs) 0;
        margin-bottom: var(--space-sm);
    }
    
    .content-card {
        padding: var(--space-md);
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* Very small screens (older phones) */
@media (max-width: 320px) {
    .container {
        padding: 0 var(--space-xs);
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .form-control {
        font-size: 14px;
    }
    
    .nav-buttons-grid .btn {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)) !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on retina displays */
    .progress-bar {
        background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
    }
    
    .btn {
        border-width: 0.5px;
    }
}

/* Tablet specific adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .nav-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 200px;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print styles for mobile */
@media print {
    .container {
        padding: 0;
    }
    
    .progress-container,
    .btn-group,
    .nav-buttons-grid {
        display: none;
    }
    
    .content-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* Building Structure Styles */
.building-structure {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floor-card {
    background: var(--background-light);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.floor-header h5 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.2rem;
}

.floor-stats {
    display: flex;
    gap: 0.5rem;
}

.stat-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.rooms-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.room-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-left: 1rem;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.room-name {
    font-weight: 500;
    color: var(--text-primary);
}

.heater-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--background-light);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}

.heaters-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.heater-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 4px;
    font-size: 0.9rem;
}

.heater-item.configured {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.heater-item.unconfigured {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.heater-item small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.no-heaters, .no-rooms {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.simple-structure {
    margin-bottom: 1rem;
}

.simple-structure h5 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.room-item, .heater-item {
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

/* File display improvements */
.files-category {
    margin-bottom: 1.5rem;
}

.files-category h6 {
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.file-item-compact {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    gap: 0.5rem;
}

.file-info-compact {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.2;
}

.file-size {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Data grid improvements */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.data-item label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.data-item span {
    color: var(--text-primary);
    font-weight: 400;
}

/* Subtype Selector Styles */
.subtype-selector {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.subtype-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.subtype-display:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.subtype-text {
    font-weight: 500;
    color: var(--text-primary);
}

.subtype-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.subtype-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.subtype-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.subtype-option:hover {
    background-color: var(--background-light);
    color: var(--primary-blue);
}

.subtype-option.selected {
    background-color: var(--primary-blue);
    color: white;
}

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

.option-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.subtype-option.selected .option-icon {
    opacity: 1;
}

/* Improved photo upload area */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-blue);
    background: #f0f8ff;
}

.file-upload-area.dragover {
    border-color: var(--primary-blue);
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.photo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.photo-preview img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form hints styling */
.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.form-hint br {
    margin: 0.2rem 0;
}

/* Subtype text color changes */
.subtype-text.unknown {
    color: #ff9800 !important;
    font-weight: 500;
}

.subtype-text.recognized {
    color: var(--success-color, #4caf50) !important;
    font-weight: 500;
}

.subtype-text.manual {
    color: var(--primary-blue) !important;
    font-weight: 500;
}

/* Detected type display */
.detected-type-display {
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

/* Manual override section */
.manual-override-section {
    margin-top: 0.5rem;
}

.manual-override-toggle {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.manual-override-toggle:hover {
    color: var(--primary-blue-dark);
    transform: translateX(2px);
}

.toggle-icon {
    font-size: 1rem;
}

.toggle-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* Manual type selection */
.manual-type-selection {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

.manual-type-selection.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.manual-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.manual-type-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.manual-type-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.manual-type-card.selected {
    border-color: var(--primary-blue);
    background: #f0f8ff;
}

.manual-type-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-blue);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.type-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-family: monospace;
    font-weight: bold;
}

.type-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.type-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .manual-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .manual-type-card {
        padding: 0.75rem;
    }
    
    .type-icon {
        font-size: 1.5rem;
    }
}

/* Data category styling */
.data-category {
    margin-bottom: 1.5rem;
}

.data-category h5 {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.data-category:last-child {
    margin-bottom: 0;
}

.data-category h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-icon {
    font-size: 1.2rem;
}

.category-badge {
    background: var(--primary-blue);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    margin-left: auto;
}

/* Enhanced data items */
.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.data-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.data-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.field-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.data-value {
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.data-value.status-positive {
    color: #22c55e;
    background: #f0fdf4;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.data-value.status-negative {
    color: #ef4444;
    background: #fef2f2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.data-value.status-measure {
    color: var(--primary-blue);
    background: #f0f8ff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: monospace;
}

.data-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

/* Responsive data grid */
@media (min-width: 768px) {
    .data-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .data-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .data-value {
        text-align: left;
        align-self: stretch;
    }
    
    .category-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Data summary styling */
.data-summary {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 12px;
    border: 1px solid #b3d9ff;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-icon {
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

/* Improved heater type cards */
.heater-type-card {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.heater-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.heater-type-card.selected {
    border-color: var(--primary-blue);
    background: #f0f8ff;
}

.heater-type-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Email Teaser Styles */
.email-teaser-container {
    position: relative;
    display: inline-block;
}

.email-teaser-btn {
    position: relative;
    overflow: hidden;
    cursor: not-allowed !important;
    opacity: 0.7;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    transition: all 0.3s ease;
}

.email-teaser-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coming-soon-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
}

.teaser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    backdrop-filter: blur(2px);
}

.email-teaser-btn:hover .teaser-overlay {
    opacity: 1;
}



.teaser-text {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.teaser-info {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.email-teaser-container:hover .teaser-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.teaser-info-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.teaser-info-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #667eea;
}

.teaser-info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.teaser-info-text {
    flex: 1;
}

.teaser-info-text strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
}

.teaser-info-text p {
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .teaser-info {
        left: -50px;
        right: -50px;
    }
    
    .teaser-info-content {
        padding: 12px;
    }
    
    .teaser-info-text strong {
        font-size: 0.8rem;
    }
    
    .teaser-info-text p {
        font-size: 0.75rem;
    }
}

/* Completeness Statistics */
.completeness-stat {
    position: relative;
    cursor: help;
}

.completeness-bar {
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.completeness-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.stat-item.completeness-stat .stat-value {
    font-weight: bold;
    transition: color 0.3s ease;
}

/* Completeness Tooltip */
.completeness-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 0.85rem;
    line-height: 1.4;
}

.completeness-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.completeness-stat:hover .completeness-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip-section {
    margin-bottom: 12px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.tooltip-section ul {
    margin: 0;
    padding-left: 16px;
    list-style: none;
}

.tooltip-section li {
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #64748b;
}

.tooltip-section li:last-child {
    margin-bottom: 0;
}

/* Responsive tooltip */
@media (max-width: 768px) {
    .completeness-tooltip {
        min-width: 250px;
        max-width: 280px;
        left: 0;
        transform: none;
        margin-left: -125px;
    }
    
    .completeness-stat:hover .completeness-tooltip {
        transform: translateY(-5px);
    }
    
    .completeness-tooltip::after {
        left: 50%;
        margin-left: 125px;
    }
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Print Styles */
@media print {
    .btn, .modal, footer, .teaser-info {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
    }
}
