/* Dashboard Components - Reusable UI Elements */
/* Metric cards, activity items, forms, dropzones, buttons, etc. */

/* ===================================
   METRIC CARDS
   =================================== */

.metric-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s var(--ease-out);
}

.metric-card.interactive:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.metric-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.metric-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.metric-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ===================================
   DATA ROWS & TABLES
   =================================== */

.section-content .data-table .data-row,
.category-services-grid .data-table .data-row {
    display: grid;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s var(--ease-out);
    min-height: 32px;
    /* Grid columns defined by component inline styles or helper classes (.table-4-col, .table-5-col) */
    gap: var(--space-sm);
}

.section-content .data-table .data-row.interactive,
.category-services-grid .data-table .data-row.interactive {
    cursor: pointer;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.section-content .data-table .data-row.interactive:hover,
.category-services-grid .data-table .data-row.interactive:hover {
    background: var(--bg-secondary);
}

.section-content .data-table .data-row.header,
.category-services-grid .data-table .data-row.header {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--space-sm);
}

.data-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.data-cell {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.data-status {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

/* Badge backgrounds - only for .data-status (DRY: defined once) */
.data-status.status-excellent,
.data-status.status-good {
    background: rgba(34, 197, 94, 0.1);
}

.data-status.status-fair {
    background: rgba(245, 158, 11, 0.1);
}

.data-status.status-poor {
    background: rgba(220, 38, 38, 0.1);
}

.section-content .data-table.table-4-col .data-row {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-sm);
}

.section-content .data-table.table-5-col .data-row {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-sm);
}

.section-content .data-table.table-auto .data-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
}

/* ===================================
   ACTIVITY ITEMS
   =================================== */

.activity-item {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    transition: all 0.2s var(--ease-out);
}

.activity-item.interactive {
    cursor: pointer;
}

.activity-item.interactive:hover {
    background: var(--bg-secondary);
    box-shadow: 3px 3px 6px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.activity-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.activity-type {
    padding: 2px var(--space-xs);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.activity-content {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ===================================
   STATUS & STATE SYSTEMS
   =================================== */

/* Base status classes - color only (KISS: one source of truth) */
.status-excellent { color: var(--color-success); font-weight: 600; }
.status-good { color: var(--color-success); }
.status-fair { color: var(--color-warning); font-weight: 600; }
.status-poor { color: var(--color-error); font-weight: 600; }

.trend-up { color: var(--color-success); }
.trend-down { color: var(--color-error); }
.trend-neutral { color: var(--text-muted); }

.trend-up::before { content: "↗"; margin-right: var(--space-xs); }
.trend-down::before { content: "↘"; margin-right: var(--space-xs); }
.trend-neutral::before { content: "→"; margin-right: var(--space-xs); }

.alert-high .activity-type { background: var(--color-error); color: white; }
.alert-medium .activity-type { background: var(--color-warning); color: white; }
.alert-low .activity-type { background: var(--color-info); color: white; }

.interactive { cursor: pointer; }
.clickable { cursor: pointer; }
.disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    pointer-events: none; 
}

.size-sm { 
    padding: var(--space-sm); 
    font-size: var(--text-sm); 
}
.size-md { 
    padding: var(--space-md); 
    font-size: var(--text-base); 
}
.size-lg { 
    padding: var(--space-lg); 
    font-size: var(--text-lg); 
}

/* ===================================
   PROGRESS BARS
   =================================== */

.progress-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s var(--ease-out);
}

.progress-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 35px;
}

/* ===================================
   LIVE INDICATORS
   =================================== */

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-error);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===================================
   CHART ELEMENTS
   =================================== */

.chart-bar {
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.3s var(--ease-out);
}

.chart-fill.primary { background: var(--color-primary); }
.chart-fill.secondary { background: var(--color-secondary); }
.chart-fill.success { background: var(--color-success); }
.chart-fill.warning { background: var(--color-warning); }
.chart-fill.error { background: var(--color-error); }
.chart-fill.info { background: var(--color-info); }

/* ===================================
   BUTTONS - Now in styles-unified.css
   =================================== */
/* REMOVED: Duplicate button definitions - see styles-unified.css */

/* ===================================
   FILE DROPZONE
   =================================== */

.file-dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    background: var(--bg-gray-50);
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
}

.file-dropzone:hover {
    border-color: var(--primary-400);
    background: var(--bg-primary-50);
}

.file-dropzone.drag-over {
    border-color: var(--primary-600);
    background: var(--bg-primary-100);
    transform: scale(1.02);
}

.dropzone-content svg {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.dropzone-content h3 {
    margin: 0 0 var(--space-sm) 0;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 600;
}

.dropzone-content p {
    margin: 0 0 var(--space-xs) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.dropzone-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ===================================
   EXPANDABLE LIST COMPONENTS - Now in styles-unified.css
   =================================== */
/* REMOVED: Duplicate expandable list definitions - see styles-unified.css */

/* ===================================
   STATUS BADGES - Now in styles-unified.css
   =================================== */
/* REMOVED: Duplicate badge definitions - see styles-unified.css */

/* ===================================
   FILTER CONTROLS - Now in styles-unified.css
   =================================== */
/* REMOVED: Duplicate filter definitions - see styles-unified.css */

/* ===================================
   MODAL SYSTEM
   =================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.modal-header h2 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease-out);
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* ===================================
   FORM STYLES
   =================================== */

.request-form {
    max-width: 100%;
}

.form-section {
    margin-bottom: var(--space-xl);
}

.form-section h3 {
    margin: 0 0 var(--space-lg) 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--space-sm);
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-body);
    transition: all 0.2s var(--ease-out);
    box-sizing: border-box;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.input-group input:invalid,
.input-group textarea:invalid {
    border-color: var(--color-error);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-xl);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    padding: 12px var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Read-only fields */
.read-only-field {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.read-only-field:focus {
    border-color: var(--border-medium);
    box-shadow: none;
}

/* ===================================
   PRIORITY BADGES
   =================================== */

.priority-badge {
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
}

.priority-badge.high {
    background: var(--color-error);
    color: var(--bg-white);
}

.priority-badge.normal {
    background: var(--color-info);
    color: var(--bg-white);
}

.priority-badge.low {
    background: var(--color-secondary);
    color: var(--bg-white);
}

.priority-badge.urgent {
    background: #dc2626;
    color: var(--bg-white);
    animation: pulse 2s infinite;
}

/* ===================================
   META TEXT
   =================================== */

.meta-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-right: var(--space-md);
}

/* ===================================
   PROPERTY MATRIX
   =================================== */

.property-matrix {
    width: 100%;
    overflow: hidden;
}

.matrix-container {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    /* Scrollbar styling applied via grid.css */
}

.matrix-value {
    font-weight: 600;
    display: inline-block;
    /* Status colors inherited from base .status-* classes (DRY) */
}

.metric-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===================================
   COMPACT METRICS ROW
   =================================== */

.compact-metrics-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    flex-wrap: wrap;
}

.compact-metric {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.compact-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.compact-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.compact-variance {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-left: var(--space-xs);
}

.compact-separator {
    color: var(--text-muted);
    font-weight: 300;
    margin: 0 var(--space-xs);
}

.compact-note {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-left: var(--space-sm);
}

