:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --success-color: #34c759;
    --warning-color: #ff9f0a;
    --danger-color: #ff3b30;
    --border-radius: 20px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--text-secondary);
    font-weight: 400;
}

.date-badge {
    background: #eef0f2;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

main {
    padding: 3rem 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.kpi-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.kpi-sub {
    font-size: 0.875rem;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-sub.neutral {
    color: var(--text-secondary);
}

.kpi-sub.warning {
    color: var(--warning-color);
}

/* Grid Charts */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card canvas {
    max-height: 400px;
    width: 100%;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

/* Campaign Breakdown */
.campaign-list {
    margin-bottom: 4rem;
}

.campaign-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.camp-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.camp-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.camp-stats {
    display: flex;
    gap: 3rem;
    text-align: right;
}

.stat-group .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-group .val {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Diagnostic Section */
.diagnostic-section {
    background: #1d1d1f;
    color: #fff;
    padding: 4rem;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
}

.diagnostic-section h2 {
    color: #fff;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.diagnosis-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.diagnosis-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagnosis-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.bullet-list {
    list-style: none;
}

.bullet-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
}

.bullet-list li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Order Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    color: var(--text-secondary);
    font-weight: 500;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

tr:last-child td {
    border-bottom: none;
}

.order-id {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    color: var(--accent-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-paid {
    background: #dcfce7;
    color: #166534;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 3rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 2.25rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .analytics-grid,
    .diagnostic-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .diagnostic-grid {
        gap: 3rem;
    }

    .camp-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
        text-align: left;
        width: 100%;
    }

    .campaign-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .camp-info {
        margin-bottom: 0.5rem;
    }

    .card canvas {
        min-height: 250px;
    }

    footer div[style*="display: flex"] {
        flex-direction: column;
        gap: 2rem !important;
    }

    footer .container>div:first-child {
        align-items: flex-start;
    }
}

/* Utilities & Components Refactor */

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 2rem;
}

.mb-4 {
    margin-bottom: 3rem;
}

.text-white-70 {
    color: rgba(255, 255, 255, 0.7);
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8);
}

.text-white {
    color: #fff;
}

.text-accent {
    color: var(--accent-color);
}

.text-warning {
    color: var(--warning-color);
}

.font-weight-600 {
    font-weight: 600;
}

.text-secondary {
    color: var(--text-secondary);
}

.bg-glass-dark {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color);
}

.grid-camp-stats {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    width: 100%;
}

.grid-camp-stats-lg {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    width: 100%;
}

.table-row-highlight {
    background-color: rgba(52, 199, 89, 0.05);
}

.cta-section {
    background: #fff;
    padding: 4rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-button {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-main {
    background: #f5f5f7;
    padding: 4rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand {
    flex: 1;
    min-width: 250px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.footer-links {
    flex: 2;
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}