/* CSS Variables for Theming - Process Insight Design System */
/* Reference: docs/DESIGN_SYSTEM.md */
:root {
    /* Backgrounds */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3a;
    --bg-card: #1a1f2e;

    /* Text */
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-on-primary: #0f1419;

    /* Accents */
    --accent-primary: #00d4ff;
    --accent-primary-hover: #00b8e6;
    --accent-secondary: #7c3aed;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #00d4ff;

    /* Borders */
    --border-color: #2a3441;
    --border-primary: #2a3441;
    --border-secondary: #1f2633;
    --border-accent: #00d4ff;

    /* Shadows */
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-sm: rgba(0, 0, 0, 0.2);
    --shadow-md: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
    --shadow-glow: rgba(0, 212, 255, 0.3);
    --overlay: rgba(15, 20, 25, 0.8);

    /* Legacy support (for backwards compatibility) */
    --primary: var(--accent-primary);
    --on-accent: #0f1419;
    --on-success: #0f1419;
    --on-warning: #0f1419;
    --on-error: #ffffff;
}

/* Light Theme (Future Implementation) */
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #f9fafb;

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-on-primary: #ffffff;

    --accent-primary: #0ea5e9;
    --accent-primary-hover: #0284c7;
    --accent-secondary: #7c3aed;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #0ea5e9;

    --border-color: #e5e7eb;
    --border-primary: #e5e7eb;
    --border-secondary: #f3f4f6;
    --border-accent: #0ea5e9;

    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --shadow-glow: rgba(14, 165, 233, 0.3);
    --overlay: rgba(0, 0, 0, 0.5);

    /* Legacy support */
    --primary: var(--accent-primary);
    --on-accent: #ffffff;
    --on-success: #0f1419;
    --on-warning: #0f1419;
    --on-error: #ffffff;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Force Inter font on all headings and common elements */
h1, h2, h3, h4, h5, h6, p, span, div, button, a, label, input, select, textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

/* Theme toggle on login page */
.login-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border-color);
    padding: 40px;
    text-align: center;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.login-btn {
    width: 100%;
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--accent-secondary);
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: var(--error);
    border: 1px solid var(--error);
    color: var(--on-error);
    display: none;
    opacity: 0.9;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

/* Main Page Styles */
.main-body {
    background: var(--bg-primary);
    min-height: 100vh;
}

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow);
}

.header h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--text-secondary);
}

.logout-btn {
    background: var(--error);
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, opacity 0.2s;
}

.logout-btn:hover {
    opacity: 0.8;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle-btn .theme-icon {
    font-size: 14px;
    font-weight: 500;
}

/* Help Button - matches theme toggle styling */
.help-btn,
.help-btn:link,
.help-btn:visited {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

.main-container {
    display: flex;
    height: calc(100vh - 80px);
}

/* Tool Section - 15% */
.tool-section {
    width: 15%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.tool-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* XML Upload Section */
.event-log-upload-section {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.event-log-upload-section h3 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.event-log-file-input {
    width: 100%;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s;
}

.event-log-file-input:hover {
    border-color: var(--accent-primary);
}

.file-format-hint {
    color: #a6adc8;
    font-size: 0.85rem;
    margin-top: 8px;
    display: block;
    text-align: center;
    font-style: italic;
}

.file-status {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.file-status.no-file {
    background: var(--error);
    color: var(--on-error);
    border: 1px solid var(--error);
    opacity: 0.9;
}

.file-status.file-loaded {
    background: var(--success);
    color: var(--on-success);
    border: 1px solid var(--success);
    opacity: 0.9;
}

.file-status.file-error {
    background: var(--error);
    color: var(--on-error);
    border: 1px solid var(--error);
    opacity: 0.9;
}

.file-status.file-loading {
    background: var(--warning);
    color: var(--on-warning);
    border: 1px solid var(--warning);
    opacity: 0.9;
}

/* Progress Bar for File Processing */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.tool-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-accent);
}

.tool-btn.active {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Work Section - 70% */
.work-section {
    width: 70%;
    padding: 20px 30px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.work-header h2 {
    color: var(--text-primary);
    font-size: 1.6rem;
}

.work-content {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border-color);
}

.placeholder-content h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.placeholder-content p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.sample-project {
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-primary);
    border-radius: 6px;
    border-left: 4px solid var(--accent-primary);
}

.sample-project h4 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.welcome-message {
    text-align: center;
    padding: 80px 40px;
}

.welcome-message h2 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

.feature-list li {
    color: var(--text-muted);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-list li:last-child {
    border-bottom: none;
}

.recent-activity {
    margin-top: 40px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid var(--success);
}

.recent-activity h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.recent-activity ul {
    list-style: none;
}

.recent-activity li {
    padding: 8px 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.recent-activity li:last-child {
    border-bottom: none;
}

/* Settings Section - 15% */
.settings-section {
    width: 15%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.settings-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.settings-group {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.settings-group h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.settings-btn {
    width: 100%;
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.settings-btn:hover {
    opacity: 0.8;
}

/* Graph Visualization Styles */
.graph-container {
    width: 100%;
    height: 100%;
}

#graphSvg {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    cursor: grab;
}

#graphSvg:active {
    cursor: grabbing;
}

/* Legend */
.color-legend {
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
}

/* XML Editor Styles */
.xml-editor-container {
    width: 100%;
    height: 100%;
}

.editor-content {
    height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.xml-textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: none;
    white-space: pre;
    overflow: auto;
}

.editor-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Summary Tool Styles */
.summary-container {
    width: 100%;
    height: 100%;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.summary-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
}

.summary-card h4 {
    color: var(--text-primary);
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border-accent);
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

.stat-label {
    font-weight: 500;
    color: var(--text-muted);
}

.stat-value {
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Table Styles */
.summary-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.summary-card th {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.summary-card td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.summary-card tr:hover {
    background: var(--bg-card);
}

/* Conformance Checking Styles */
.conformance-container {
    width: 100%;
    height: 100%;
}

.conformance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.conformance-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.check-btn {
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.check-btn:hover {
    opacity: 0.8;
}

.check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.conformance-results {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-box {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-box h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.summary-box .value {
    color: var(--accent-primary);
    font-size: 2rem;
    font-weight: bold;
}

.deviations-list {
    margin-top: 20px;
}

.deviations-list h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.deviation-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--error);
}

.deviation-item strong {
    color: var(--text-secondary)  /* Changed from red */;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* XML Editor Toolbar */
.xml-editor-toolbar {
    padding: 10px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.xml-btn {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.xml-btn:hover {
    opacity: 0.9;
}

.xml-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.validation-result {
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== PROCESS SUMMARY TOOL STYLES ===== */

.summary-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.summary-header {
    margin-bottom: 40px;
}

.summary-header h2 {
    font-size: 2rem;
    color: #f2f2ed;
    margin-bottom: 8px;
}

.summary-subtitle {
    color: #a6adc8;
    font-size: 1.05rem;
}

.summary-section {
    margin-bottom: 40px;
}

.summary-section h3 {
    font-size: 1.4rem;
    color: #f2f2ed;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-controls {
    display: flex;
    gap: 10px;
}

.section-info {
    color: #a6adc8;
    font-size: 0.9rem;
}

.control-btn.small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.overview-card {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid #313244;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.card-label {
    color: #a6adc8;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.card-value {
    color: #89b4fa;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Data Tables */
.data-table-container {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid #313244;
    border-radius: 6px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(49, 50, 68, 0.6);
    border-bottom: 2px solid #313244;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    color: #89b4fa;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 15px;
    color: #cdd6f4;
    border-top: 1px solid #313244;
}

.data-table tbody tr:hover {
    background: rgba(49, 50, 68, 0.3);
}

.col-rank {
    width: 60px;
    text-align: center;
    color: #a6adc8;
}

.col-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-number {
    text-align: right;
    width: 120px;
}

.col-bar {
    width: 200px;
}

/* Progress Bar in Table */
.bar-container {
    width: 100%;
    height: 8px;
    background: rgba(49, 50, 68, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #89b4fa;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.table-footer {
    padding: 12px 15px;
    text-align: center;
    color: #a6adc8;
    font-size: 0.9rem;
    background: rgba(49, 50, 68, 0.3);
    border-top: 1px solid #313244;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid #313244;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    color: #a6adc8;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    color: #89b4fa;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 15px;
}

.export-btn {
    padding: 12px 24px;
    background: #89b4fa;
    color: #1e1e2e;
    border: 1px solid #89b4fa;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.export-btn:hover {
    opacity: 0.9;
}

/* Responsive Design for Summary */
@media (max-width: 768px) {
    .overview-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .col-bar {
        display: none;
    }

    .export-buttons {
        flex-direction: column;
    }
}

/* ============================================================================
   UNIFIED BUTTON SYSTEM (Design System v2 - November 2024)
   ============================================================================ */

/* Base button styles - all buttons inherit from this */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary button - main actions */
.btn-primary {
    background: var(--accent-primary);
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(137, 180, 250, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    box-shadow: 0 4px 12px rgba(137, 180, 250, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary button - less prominent actions */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
}

/* Success button - positive actions (save, confirm, etc.) */
.btn-success {
    background: var(--accent-green);
    color: var(--text-primary);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover, #94e2d5);
    transform: translateY(-1px);
}

/* Danger button - destructive actions (delete, reset, etc.) */
.btn-danger {
    background: var(--accent-red);
    color: var(--text-primary);
}

.btn-danger:hover:not(:disabled) {
    background: var(--error-hover, #eba0ac);
    transform: translateY(-1px);
}

/* Warning button - cautionary actions */
.btn-warning {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-hover, #fab387);
}

/* Info button - informational actions */
.btn-info {
    background: var(--accent-teal);
    color: var(--text-primary);
}

.btn-info:hover:not(:disabled) {
    background: var(--info-hover, #74c7ec);
}

/* Button sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Button variants */
.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-outline.btn-primary {
    color: var(--accent-primary);
}

.btn-outline.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary);
    color: var(--text-on-primary);
}

.btn-ghost {
    background: transparent;
    box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card);
}

/* Button groups */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn-group-vertical {
    flex-direction: column;
}

/* Icon buttons */
.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* ==============================================================================
   LOADING STATES & SKELETONS (Sprint 5.1 - November 2024)
   ============================================================================== */

/* Fullscreen Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinner-rotation 0.8s linear infinite;
}

.loading-spinner.sm {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.loading-spinner.lg {
    width: 64px;
    height: 64px;
    border-width: 5px;
}

@keyframes spinner-rotation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading Spinner with Label */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-container .loading-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Inline Loading Spinner */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-inline .loading-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Skeleton Screens */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-card) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton Variants */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.large {
    height: 24px;
}

.skeleton-text.small {
    height: 12px;
}

.skeleton-title {
    height: 32px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-paragraph {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-paragraph .skeleton-text:nth-child(1) {
    width: 100%;
}

.skeleton-paragraph .skeleton-text:nth-child(2) {
    width: 95%;
}

.skeleton-paragraph .skeleton-text:nth-child(3) {
    width: 85%;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-avatar.sm {
    width: 32px;
    height: 32px;
}

.skeleton-avatar.lg {
    width: 64px;
    height: 64px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 6px;
}

.skeleton-input {
    height: 42px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-table-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.skeleton-table-cell {
    height: 20px;
    flex: 1;
}

/* Loading Progress Bar */
.loading-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

.loading-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.loading-progress-bar.indeterminate {
    width: 30%;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* Loading Content Placeholder */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-placeholder .loading-spinner {
    margin-bottom: 16px;
}

.loading-placeholder h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.loading-placeholder p {
    font-size: 14px;
    max-width: 400px;
}

/* Pulsing Dot Indicator */
.loading-dots {
    display: inline-flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: loading-dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading-dot-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading State for Cards */
.card.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinner-rotation 0.8s linear infinite;
}

/* Light Theme Loading States */
body.light-theme .skeleton {
    background: linear-gradient(
        90deg,
        #f3f4f6 0%,
        #e5e7eb 50%,
        #f3f4f6 100%
    );
}

body.light-theme .loading-overlay {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .loading-spinner {
    border-color: #e5e7eb;
    border-top-color: #00d4ff;
}



/* ==============================================================================
   EMPTY STATES (Sprint 5.2 - November 2024)
   ============================================================================== */

/* Empty State Container */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 60px 40px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state-description {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Empty State Variants */
.empty-state.compact {
    min-height: 300px;
    padding: 40px 20px;
}

.empty-state.no-data::before {
    content: '📊';
    font-size: 64px;
    display: block;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state.no-file::before {
    content: '📁';
    font-size: 64px;
    display: block;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state.no-results::before {
    content: '🔍';
    font-size: 64px;
    display: block;
    margin-bottom: 24px;
    opacity: 0.5;
}

/* Empty Table/List States */
.empty-table {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
}

.empty-table-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}
