@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #5b50e5;
    /* Vibrant Indigo */
    --secondary-color: #8b5cf6;
    --accent-color: #fca5a5;
    --background-color: #f3f4f6;
    /* Light Gray Background */
    --card-bg: #ffffff;
    /* White Card */
    --card-border: #e5e7eb;
    /* Light Border */
    --text-main: #1f2937;
    /* Dark Gray Text */
    --text-muted: #6b7280;
    /* Muted Gray */
    --success-color: #10b981;
    --error-color: #ef4444;
    --input-bg: #f9fafb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Kanit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    /* Near Black */
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    /* Softer rounded corners */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Soft Drop Shadow for depth */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #374151;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Updated Input Styling */
.form-control {
    background: var(--input-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-main) !important;
}

.file-input-wrapper {
    width: 100%;
    height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    background: #f9fafb;
    transition: all 0.2s;
}

.file-input-wrapper:hover {
    border-color: var(--primary-color);
    background: #eef2ff;
    /* Light indigo tint */
    color: var(--primary-color);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    font-family: 'Kanit', sans-serif;
    width: 100%;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(91, 80, 229, 0.3);
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    color: #000;
}

.btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background-color: #fecaca;
}

.table-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    font-size: 0.95rem;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

tr.clickable-row:hover {
    background-color: #eef2ff;
    /* Light Indigo Hover */
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    font-family: 'Kanit', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:hover td {
    background-color: #f9fafb;
}

tr:last-child td {
    border-bottom: none;
}

.modal-confirm-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #047857;
}

.d-flex {
    display: flex;
    gap: 1rem;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.mb-1 {
    margin-bottom: 1rem;
}