/* ============================================
   UBS LC Command Center – Demo Styles
   Dark modern dashboard theme
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette */
    --bg-dark: #111822;
    --bg-card: #182231;
    --bg-card-light: #1e2a3a;
    --border-color: #2a3a4d;
    --text-primary: #f5f5f5;
    --text-secondary: #a0aec0;
    --text-muted: #6b7a8a;
    
    /* Accent Colors */
    --accent-teal: #38b2ac;
    --accent-blue: #4299e1;
    --accent-green: #48bb78;
    --accent-yellow: #ecc94b;
    --accent-orange: #ed8936;
    --accent-red: #fc8181;
    
    /* Field Colors */
    --field-input: #c6f6d5;      /* Light green for text input */
    --field-notes: #fbb6ce;       /* Light magenta for notes */
    --field-ai: #faf089;          /* Light yellow for AI/populated */
    
    /* Status Colors */
    --status-grey: #808080;
    --status-blue: #1e88e5;
    --status-red: #e53935;
    --status-orange: #fb8c00;
    --status-yellow: #fdd835;
    --status-green: #43a047;
    --status-black: #000000;
    
    /* Sizing */
    --header-height: 60px;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-dark);
}

/* ============================================
   App Header
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, #1a2634 0%, #0f1922 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-teal);
    letter-spacing: 1px;
}

.header-divider {
    color: var(--text-muted);
}

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-center {
    flex: 1;
    text-align: center;
}

.loss-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-teal);
    color: #fff;
}

.btn-primary:hover {
    background: #319795;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-light);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ============================================
   Color Legend
   ============================================ */
.color-legend {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(17, 24, 34, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 90;
    font-size: 12px;
}

.legend-title {
    color: var(--text-muted);
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-swatch.input-field {
    background: var(--field-input);
}

.legend-swatch.notes-field {
    background: var(--field-notes);
}

.legend-swatch.ai-field {
    background: var(--field-ai);
}

/* ============================================
   Main Layout Grid
   ============================================ */
.layout-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 0.9fr;
    gap: 16px;
    padding: 16px 24px 24px;
    margin-top: calc(var(--header-height) + 40px);
    min-height: calc(100vh - var(--header-height) - 40px);
}

.column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.card-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 16px;
}

.card-body.scrollable {
    max-height: 320px;
    overflow-y: auto;
}

.card-description {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 12px;
    font-style: italic;
}

.card-small .card-body {
    padding: 12px;
}

/* ============================================
   Badges & Pills
   ============================================ */
.badge {
    background: var(--accent-blue);
    color: #fff;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill {
    background: var(--bg-dark);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.form-input.input-field {
    background: var(--field-input);
    color: #1a202c;
}

.form-input.notes-field {
    background: var(--field-notes);
    color: #1a202c;
}

.form-input.ai-field {
    background: var(--field-ai);
    color: #1a202c;
}

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

select.form-input {
    cursor: pointer;
}

/* Checkboxes */
.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

.checkbox-item.small {
    font-size: 12px;
    margin-top: 8px;
}

.checkbox-item input, .radio-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 20px;
}

/* ============================================
   Loss Status Card
   ============================================ */
.status-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-dark);
    cursor: pointer;
    transition: background 0.2s ease;
}

.status-item:hover {
    background: var(--bg-card-light);
}

.status-checkbox {
    width: 18px;
    height: 18px;
}

.status-label {
    flex: 1;
    font-size: 13px;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.status-indicator.grey { background: var(--status-grey); }
.status-indicator.blue { background: var(--status-blue); }
.status-indicator.red { background: var(--status-red); }
.status-indicator.orange { background: var(--status-orange); }
.status-indicator.yellow { background: var(--status-yellow); }
.status-indicator.green { background: var(--status-green); }
.status-indicator.black { background: var(--status-black); border: 1px solid #333; }
.status-indicator.gradient { 
    background: linear-gradient(90deg, var(--status-yellow) 0%, var(--status-yellow) 50%, var(--status-green) 50%, var(--status-green) 100%); 
}

/* Status card color states */
#loss-status-card.status-active {
    transition: background-color 0.3s ease;
}

#loss-status-card.status-active .card-body {
    color: #fff;
}

#loss-status-card.status-dark {
    color: #fff;
}

#loss-status-card.status-dark .status-label,
#loss-status-card.status-dark .card-header h2 {
    color: #fff;
}

/* ============================================
   Budget Card
   ============================================ */
.budget-checkboxes {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.budget-progress-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.budget-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.budget-progress-bar {
    height: 20px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--status-green) 0%, var(--status-green) 70%, var(--status-yellow) 85%, var(--status-red) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.budget-warning {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(229, 62, 62, 0.2);
    border-left: 3px solid var(--status-red);
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent-red);
}

.budget-note {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Upload Placeholder
   ============================================ */
.upload-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.upload-placeholder:hover {
    border-color: var(--accent-teal);
}

.upload-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

/* ============================================
   Folder Tree / File List
   ============================================ */
.folder-tree {
    font-size: 13px;
}

.folder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.folder-icon {
    font-size: 16px;
}

.file-list {
    padding-left: 24px;
    margin-bottom: 8px;
}

.file-list.empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--text-secondary);
}

.file-icon {
    font-size: 14px;
}

.file-name {
    flex: 1;
}

.file-source {
    font-size: 11px;
    color: var(--text-muted);
}

.file-status.uploaded {
    color: var(--accent-green);
    font-size: 12px;
}

/* ============================================
   Activity Table
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.activity-table th {
    text-align: left;
    padding: 8px 10px;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.activity-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.activity-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   Asset List
   ============================================ */
.uploaded-assets {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.uploaded-assets h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.asset-list {
    list-style: none;
}

.asset-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.asset-icon {
    font-size: 14px;
}

.asset-date {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

/* ============================================
   Agent Card
   ============================================ */
.agent-intro {
    color: var(--text-muted);
    margin-bottom: 12px;
    font-style: italic;
}

.agent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.agent-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agent-btn:hover {
    border-color: var(--accent-teal);
    color: var(--text-primary);
}

.agent-btn.active {
    background: var(--accent-teal);
    border-color: var(--accent-teal);
    color: #fff;
}

.agent-description {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    border-left: 3px solid var(--accent-teal);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Local Info Card
   ============================================ */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.info-value {
    font-size: 13px;
    color: var(--text-primary);
}

.info-links {
    margin-bottom: 12px;
}

.info-links h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.info-links ul {
    list-style: none;
}

.info-links li {
    padding: 4px 0;
}

.fake-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 12px;
}

.fake-link:hover {
    text-decoration: underline;
}

.info-actions {
    margin-bottom: 12px;
}

.info-search {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.info-search .form-input {
    flex: 1;
}

/* ============================================
   Hotel List
   ============================================ */
.hotel-list {
    list-style: none;
}

.hotel-item {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.hotel-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.hotel-details {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Resource Lists
   ============================================ */
.resource-list {
    list-style: none;
    margin-top: 10px;
}

.resource-list li {
    padding: 6px 0;
}

.resource-list a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 12px;
}

.resource-list a:hover {
    text-decoration: underline;
}

/* ============================================
   Announcements
   ============================================ */
.announcement-list {
    list-style: none;
}

.announcement-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.announcement-date {
    font-size: 11px;
    color: var(--accent-teal);
    font-weight: 600;
    min-width: 50px;
}

.announcement-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1100px) {
    .layout-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .column-3 {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .column-3 .card {
        grid-column: auto;
    }
    
    #agent-card, #local-info-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
    
    .column-3 {
        display: flex;
        flex-direction: column;
    }
    
    .app-header {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 8px;
    }
    
    .header-center {
        order: -1;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .color-legend {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .layout-grid {
        margin-top: calc(var(--header-height) + 100px);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4a5d;
}
