/* =====================================================
   🌍 GLOBAL DESIGN SYSTEM
===================================================== */

/* ---------- CSS RESET (Modern) ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at top left, #eef1ff, transparent 40%),
        radial-gradient(circle at bottom right, #f5f7ff, transparent 40%),
        linear-gradient(135deg, #f4f6fb, #eef1ff);
    color: #1f2937;
}

/* ---------- COLOR TOKENS ---------- */
:root {
    --primary-900: #2b3cff;
    --primary-600: #6b7cff;
    --primary-300: #c7ceff;

    --neutral-900: #111827;
    --neutral-700: #374151;
    --neutral-500: #6b7280;
    --neutral-300: #d1d5db;
    --neutral-100: #f9fafb;

    --surface: #ffffff;
    --surface-soft: #f8faff;

    --border-soft: rgba(0,0,0,0.08);

    --shadow-soft:
        0 10px 30px rgba(15,23,42,0.08),
        0 2px 8px rgba(15,23,42,0.04);

    --shadow-hover:
        0 20px 50px rgba(15,23,42,0.15);

    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* =====================================================
   📐 LAYOUT
===================================================== */

.layout {
    max-width: 1100px;
    margin: auto;
    padding: 64px 20px;
}

/* =====================================================
   🧱 CARD (Enterprise Grade)
===================================================== */

.card {
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #fdfdff 100%
    );
    border-radius: var(--radius-xl);
    padding: 44px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

/* Decorative glow */
.card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle, rgba(107,124,255,0.08), transparent 40%);
    z-index: 0;
}

.card > * {
    position: relative;
    z-index: 1;
}

/* =====================================================
   🧠 HEADER
===================================================== */

.card-header {
    margin-bottom: 36px;
}

.card-header h1,
.card-header h2 {
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.card-header h1 {
    font-size: 1.9rem;
}

.card-header h2 {
    font-size: 1.5rem;
}

.card-header p {
    margin-top: 10px;
    color: var(--neutral-500);
    line-height: 1.6;
}

/* =====================================================
   🧾 FORM SYSTEM
===================================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--neutral-700);
}

/* INPUT / SELECT */
input,
select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: #fff;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

/* Focus */
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow:
        0 0 0 4px rgba(107,124,255,0.18);
}

/* =====================================================
   🎯 BUTTON (Luxury)
===================================================== */

.form-action {
    margin-top: 10px;
}

button {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    border: none;
    background:
        linear-gradient(
            135deg,
            var(--primary-900),
            var(--primary-600)
        );
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.4px;
    box-shadow:
        0 10px 24px rgba(43,60,255,0.35);
    transition: all 0.25s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 20px 40px rgba(43,60,255,0.45);
}

button:active {
    transform: scale(0.98);
}

/* =====================================================
   📊 TABLE (Professional)
===================================================== */

.table-wrapper {
    margin-top: 24px;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

thead th {
    background:
        linear-gradient(180deg, #eef1ff, #f8faff);
    padding: 16px;
    text-align: left;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--neutral-700);
}

tbody td {
    padding: 16px;
    border-top: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--surface-soft);
}

/* =====================================================
   🔗 LINKS
===================================================== */

.link-download {
    color: var(--primary-600);
    font-weight: 400;
    text-decoration: none;
    position: relative;
}

.link-download::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.25s ease;
}

.link-download:hover::after {
    width: 100%;
}

/* =====================================================
   📭 EMPTY STATE
===================================================== */

.empty-state {
    padding: 60px;
    text-align: center;
    color: var(--neutral-500);
    font-size: 1rem;
}

/* =====================================================
   🎛 SELECT2 PREMIUM THEME
===================================================== */

.select2-container .select2-selection--single {
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
}

.select2-selection__rendered {
    padding-left: 16px !important;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
}

.select2-selection__arrow {
    height: 100% !important;
}

.select2-container--default
.select2-results__option--highlighted[aria-selected] {
    background: var(--primary-600);
}

/* =====================================================
   📱 RESPONSIVE
===================================================== */

@media (max-width: 768px) {
    .layout {
        padding: 40px 14px;
    }

    .card {
        padding: 28px;
    }

    .card-header h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .card {
        border-radius: 18px;
    }

    button {
        font-size: 0.95rem;
    }
}
/* =====================================================
   Header with Logo (Official Style)
===================================================== */

.header-with-logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo img {
    height: 72px;
    width: auto;
    object-fit: contain;
}

.header-text h1 {
    margin: 0;
}

.header-text p {
    margin-top: 6px;
    color: var(--neutral-500);
}

.header-text small {
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .header-with-logo {
        flex-direction: column;
        text-align: center;
    }

    .header-logo img {
        height: 60px;
    }
}
/* =====================================================
   Download Button (Official Style)
===================================================== */

.btn-download {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f6cff, #6b8cff);
    color: #ffffff;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 10px rgba(79,108,255,0.35);
    transition: all 0.2s ease;
}

.btn-download:hover {
    background: linear-gradient(135deg, #3f5cff, #5b7cff);
    box-shadow: 0 6px 14px rgba(79,108,255,0.45);
    transform: translateY(-1px);
}

.btn-download:active {
    transform: scale(0.96);
}
