:root {
    --primary: #DA251D; /* National Red */
    --primary-dark: #b51c16;
    --gold: #FCD116; /* National Gold */
    --gold-dim: #e6b907;
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --hover-bg: #fdf2f2;
}

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

html {
    background-color: var(--bg-main);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Tên file hình ảnh nền bạn lưu vào thư mục này */
    background-image: url('bg-trong-dong.jpg'); 
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none; /* Không cho phép click chặn chuột */
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--gold);
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.national-emblem {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.header-titles h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.header-titles h2 {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    opacity: 0.9;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* Upload Section */
.upload-card {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
    padding: 3rem 2rem;
}
.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}
.upload-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1.5rem;
}
.upload-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(218, 37, 29, 0.3);
}
.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
}
.status-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary);
}
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(218, 37, 29, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.stat-info h4 {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Data View Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}
.search-bar {
    position: relative;
    width: 300px;
}
.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(218, 37, 29, 0.1);
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
thead { background-color: #f1f5f9; }
th {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
}
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.95rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}
tbody tr {
    transition: background-color 0.2s;
    cursor: pointer;
}
tbody tr:hover {
    background-color: var(--hover-bg);
}
.col-stt {
    width: 60px;
    text-align: center;
}

/* Pagination */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.page-controls { display: flex; gap: 0.5rem; }
.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.show { opacity: 1; }
.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal.show .modal-content { transform: translateY(0); }
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdf2f2;
    border-radius: 12px 12px 0 0;
}
.modal-header h2 {
    color: var(--primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: var(--primary); }
.modal-body {
    padding: 2rem;
    overflow-y: auto;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.detail-item {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.detail-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.detail-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-word; /* Allow wrapping */
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; }
    .search-bar { width: 100%; }
}
