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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --highlight: #d1fae5;
    --highlight-border: #10b981;
    --dim-bg: #f1f5f9;
    --dim-text: #94a3b8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 30px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.status-bar.loading {
    background: #fef3c7;
    color: #92400e;
}

.status-bar.success {
    background: #d1fae5;
    color: #065f46;
}

.status-bar.error {
    background: #fee2e2;
    color: #991b1b;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card h3 {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 10px;
}

.summary-card p {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Column Stats - การ์ดแยกตามหัวข้อ */
.column-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.column-stat-card {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary);
    transition: all 0.3s;
}

.column-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.column-stat-card .stat-title {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-stat-card .stat-count {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.column-stat-card .stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
}

.column-stat-card.has-pending {
    border-left-color: var(--warning);
}

.column-stat-card.has-pending .stat-count {
    color: var(--warning);
}

/* Filter Bar Styles */
.filter-bar {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.filter-result {
    margin-left: auto;
    font-size: 16px;
    font-weight: 600;
}

.highlight-text {
    color: var(--secondary);
}

.highlight-count {
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
}

th, td {
    padding: 15px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    white-space: nowrap;
}

tbody tr {
    transition: all 0.3s;
}

tbody tr:hover {
    background: #f1f5f9;
}

/* Highlight & Dim Styles - ปรับให้ชัดขึ้น */
tbody tr.row-highlight {
    background-color: #bbf7d0 !important;
    border-left: 6px solid #16a34a !important;
    border-right: 6px solid #16a34a !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    font-weight: 700;
    position: relative;
}

tbody tr.row-highlight td {
    color: #14532d !important;
}

tbody tr.row-highlight .status-badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

tbody tr.row-dim {
    background-color: #f8fafc;
    color: #cbd5e1;
    opacity: 0.35;
}

tbody tr.row-dim .status-badge {
    opacity: 0.5;
}

tbody tr.row-dim:hover {
    opacity: 0.6;
    background-color: #f1f5f9;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-green-dark {
    background: #1e7e34;
    color: #ffffff;
}

.status-red-dark {
    background: #c82333;
    color: #ffffff;
}

.status-yellow {
    background: #fff3cd;
    color: #856404;
}

.status-blue {
    background: #cce5ff;
    color: #004085;
}

.loading {
    text-align: center;
    padding: 50px;
    color: var(--secondary);
}

.info-box {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.info-box p {
    margin-bottom: 8px;
    color: var(--text);
}

.info-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.info-box a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-result {
        margin-left: 0;
        text-align: center;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 12px;
    }
}
