:root {
    --primary: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --secondary: #14b8a6;
    --secondary-light: #2dd4bf;
    --bg-gradient-start: #f0f9ff;
    --bg-gradient-end: #e0f2fe;
    
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(255, 255, 255, 0.8);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(14, 165, 233, 0.1);
    --shadow-hover: 0 20px 40px 0 rgba(14, 165, 233, 0.15);
    
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Kanit', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.dashboard-container {
    max-width: 1280px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* Header */
.header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-box {
    font-size: 2.5rem;
    background: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Form & Inputs */
.filter-form {
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.5);
}

.date-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    font-family: 'Kanit', sans-serif;
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    min-width: 150px;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.btn-primary {
    font-family: 'Kanit', sans-serif;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    height: 40px; /* match input height */
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.summary-card.gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.summary-card.gradient-primary p {
    color: rgba(255,255,255,0.8);
}

.card-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.summary-card:not(.gradient-primary) .card-icon {
    background: var(--bg-gradient-start);
}

.card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.card-content h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.2;
}

.card-content small {
    font-size: 1rem;
    font-weight: 400;
}

.text-teal { color: var(--secondary); }
.text-blue { color: var(--primary); }

.allele-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.allele-breakdown h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.allele-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

/* Charts */
.chart-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Table */
.table-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.table-responsive {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.modern-table th {
    background: rgba(255,255,255,0.5);
    padding: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 2px solid var(--primary-light);
    white-space: nowrap;
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.9rem;
    vertical-align: middle;
}

.modern-table tr {
    transition: background 0.2s;
}

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

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.badge-opd {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-ipd {
    background: #ccfbf1;
    color: #0f766e;
}

.result-text {
    font-weight: 500;
}

.empty-state {
    color: var(--text-muted);
    padding: 2rem !important;
}

.mock-alert {
    background: #fffbeb;
    color: #b45309;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid #fde68a;
    margin-top: 1rem;
}

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

/* Quick Filters */
.quick-filters {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-outline {
    font-family: 'Kanit', sans-serif;
    background: transparent;
    color: var(--primary-dark);
    border: 1px solid var(--primary-light);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-outline:hover, .btn-outline.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form {
        width: 100%;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input, .btn-primary {
        width: 100%;
    }
}
