/* filepath: public/css/dashboard.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* --- Colors --- */
    /* Primary - Wappi Brand */
    --primary-yellow: #FFD803;
    --primary-yellow-light: #FFDC4B;
    --primary-orange: #F1851A;
    --primary-orange-light: #F6A01B;
    --primary-red: #E95321;
    --primary-red-light: #ED6C20;
    --primary-gradient: linear-gradient(135deg, #FFD803 0%, #F1851A 50%, #E95321 100%);
    --primary-gradient-subtle: linear-gradient(135deg, #FFDC4B 0%, #F6A01B 100%);
    
    /* Semantic Colors */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    
    /* Aliases for original names */
    --accent-blue: var(--info);
    --accent-blue-bg: var(--info-bg);
    --accent-green: var(--success);
    --accent-green-bg: var(--success-bg);
    
    /* Status Colors (Original) */
    --status-pending: #FEF3C7;
    --status-pending-text: #D97706;
    --status-review: #DBEAFE;
    --status-review-text: #2563EB;
    --status-resolved: #D1FAE5;
    --status-resolved-text: #059669;
    
    /* Text */
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A68;
    --text-muted: #8E8E9A;
    --text-white: #FFFFFF;
    
    /* Background & Surfaces */
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-header: #FFFFFF;
    
    /* Borders */
    --border-light: #E5E7EB;
    --border-subtle: #F1F5F9;
    --border-focus: var(--primary-orange);
    
    /* --- Spacing System --- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --container-padding: clamp(16px, 5vw, 32px);
    
    /* --- Typography --- */
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: clamp(24px, 5vw, 36px);
    --font-size-3xl: clamp(32px, 8vw, 48px);
    
    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* --- Other --- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography Utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); font-weight: 700; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* Spacing Utilities */
.margin-top-xs { margin-top: var(--space-xs); }
.margin-bottom-sm { margin-bottom: var(--space-sm); }
.margin-bottom-md { margin-bottom: var(--space-md); }
.no-margin { margin: 0; }

/* Color Utilities */
.color-orange { color: var(--primary-orange); }
.color-blue { color: var(--info); }
.color-green { color: var(--success); }
.color-red { color: var(--danger); }

/* Card Components */
.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-base);
    overflow: hidden;
    height: 100%;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
}

.card-section {
    padding: var(--space-lg);
}

.card-section.border-bottom {
    border-bottom: 1px solid var(--border-light);
}

/* Primary Gradient Button/Element */
.gradient-primary {
    background: var(--primary-gradient);
    color: white;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Metric Cards */
.metric-card {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md); /* Space between icon and label/value */
}

.metric-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.metric-value.large {
    font-size: var(--font-size-3xl);
}

.metric-trend {
    font-size: var(--font-size-xs);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.metric-subtext {
    color: var(--text-muted);
    opacity: 0.8;
}

.metric-trend.positive {
    color: var(--accent-green);
}

.metric-trend.negative {
    color: var(--danger);
}

/* Split Card */
.split-card {
    display: flex;
    gap: 0;
}

.split-card > div {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.split-card > div:first-child {
    border-right: 1px solid var(--border-light);
}

.split-card .split-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.split-card .split-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Icon Containers */
.icon-container {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-container.yellow {
    background: linear-gradient(135deg, rgba(255, 216, 3, 0.15) 0%, rgba(241, 133, 26, 0.15) 100%);
    color: var(--primary-orange);
}

.icon-container.orange {
    background: linear-gradient(135deg, rgba(241, 133, 26, 0.15) 0%, rgba(233, 83, 33, 0.15) 100%);
    color: var(--primary-red);
}

.icon-container.red {
    background: linear-gradient(135deg, rgba(233, 83, 33, 0.15) 0%, rgba(229, 38, 21, 0.15) 100%);
    color: var(--primary-red);
}

.icon-container.blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.icon-container.green {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

/* Pill Tags */
.pill-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.pill-tag.green {
    background: var(--accent-green-bg);
    color: var(--status-resolved-text);
}

.pill-tag.pink {
    background: #FDF2F8;
    color: #DB2777;
}

.pill-tag.yellow {
    background: var(--warning-bg);
    color: var(--warning);
}

.pill-tag.orange {
    background: linear-gradient(135deg, rgba(241, 133, 26, 0.2) 0%, rgba(233, 83, 33, 0.2) 100%);
    color: var(--primary-red);
}

.pill-tag.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.pill-tag.blue {
    background: var(--status-review);
    color: var(--status-review-text);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #FAFAFA;
}

.data-table th:first-child {
    border-radius: 12px 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 12px 0 0;
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #FAFAFA;
}

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: var(--transition-base);
    min-width: fit-content;
}

.period-selector:hover {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(241, 133, 26, 0.1);
}

.period-selector .date-text {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.period-selector .calendar-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Chart Container */
.chart-wrapper {
    padding: 24px;
    height: 360px;
    position: relative;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot.orange {
    background: var(--primary-orange);
}

.legend-dot.green {
    background: var(--accent-green);
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-main);
    border-radius: 10px;
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
}

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

.faq-resolution {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sparkline Mini Chart */
.sparkline {
    height: 30px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.sparkline-bar {
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
    opacity: 0.7;
}

.sparkline-bar:last-child {
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-img {
    height: 40px;
    width: auto;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--container-padding);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.9);
}

.logo-img {
    height: clamp(32px, 4vw, 40px);
    width: auto;
}
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.table-section {
    margin-bottom: var(--space-xl);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .chart-wrapper {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .period-selector {
        width: 100%;
        justify-content: center;
    }
    
    .metric-card {
        padding: var(--space-md);
    }
    
    .chart-wrapper {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: var(--space-md);
    }
    
    .metric-value {
        font-size: var(--font-size-xl);
    }
    
    .chart-wrapper {
        height: 240px;
        padding: var(--space-sm);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-sm);
        font-size: var(--font-size-xs);
    }
    
    .footer-content {
        padding: 0 var(--space-md);
    }
}

/* --- Footer --- */
.main-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-2xl) var(--space-lg);
    margin-top: var(--space-2xl);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    height: 32px;
    margin: 0 auto var(--space-md) auto;
    display: block;
}

.footer-text {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-copyright {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}
