
/* 1. ดึงฟอนต์ Poppins และ Sarabun มาจาก Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* 2. ตั้งค่าให้ทั้งหน้าเว็บเปิดใช้งานพร้อมกัน */
* {
    font-family: 'Poppins', 'Sarabun', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 3. สำหรับพวกช่องกรอกข้อมูล (Input, Select) บางทีมันไม่ยอมเปลี่ยนตามตัวแม่ ให้บังคับเพิ่มตรงนี้ครับ */
input, select, textarea, button {
    font-family: 'Poppins', 'Sarabun', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
}

.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.glass-card { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 500; }
.input-field { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 10px; font-size: 14px; outline: none; }

.btn-primary { width: 100%; padding: 12px; background: #6366f1; color: white; border: none; border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: 500; margin-top: 10px; }
.btn-primary:hover { background: #4f46e5; }
.toggle-form { margin-top: 15px; color: #6366f1; cursor: pointer; font-size: 14px; text-decoration: underline; }

.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background-color: #1e293b;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
/* 🎯 วางโค้ด 2 บล็อกนี้ต่อท้ายคลาส .sidebar ได้เลยครับ */
.sidebar.closed {
    width: 0;
    overflow: hidden;
}

/* แถม: สไตล์สำหรับปุ่มแฮมเบอร์เกอร์ (☰) ให้ดูสวยงามและเข้ากับธีม */
.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #4b5563;
    padding: 5px 10px;
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-sidebar:hover {
    background: #f3f4f6;
}

/* ค้นหาคลาสหรือแท็กที่เป็นหัวตารางของคุณ */
table th {
    position: -webkit-sticky; /* รองรับ Safari */
    position: sticky;
    top: 0;                   /* ล็อกให้อยู่บนสุดเสมอเมื่อเลื่อนจอ */
    background-color: #f1f5f9; /* ⚠️ สำคัญมาก: ต้องใส่สีพื้นหลังให้หัวตาราง ไม่งั้นเวลาเลื่อน ตัวหนังสือในตารางจะซ้อนทะลุขึ้นมาเห็นด้านหลังครับ */
    z-index: 10;              /* ดันให้อยู่ชั้นบนสุด เพื่อไม่ให้โดนแถวข้อมูลอื่นบัง */
}
/* --------------------------------------------- */
.sidebar-logo {
    padding: 24px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid #334155;
    letter-spacing: -0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
    color: #ffffff;
    background-color: #334155;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.btn-logout { background: #fee2e2; color: #dc2626; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }

.table-card { background: white; padding: 20px; border-radius: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { background: #f9fafb; color: #6b7280; font-weight: 500; }
.td-input { width: 100%; padding: 6px; border: 1px solid #d1d5db; border-radius: 6px; }
.td-select { padding: 6px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; }
.btn-slip { display: inline-block; padding: 4px 10px; background: #e0e7ff; color: #6366f1; border-radius: 6px; text-decoration: none; font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-card { background: white; padding: 25px; border-radius: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.stat-title { color: #6b7280; font-size: 14px; }
.stat-value { font-size: 28px; font-weight: bold; margin-top: 5px; }
tr.clickable-row.selected-row td { background-color: #e0f2fe !important; } /* สีฟ้าอ่อน Tailwind bg-sky-100 */
#infoSlide {
    position: fixed;
    top: 0;
    right: -40vw;      /* ซ่อนไว้ทางขวาเท่ากับความกว้างใหม่ */
    width: 30vw;       /* 👈 ปรับความกว้างเป็น 40% ของหน้าจอ */
    min-width: 360px;  /* ป้องกันไม่ให้แคบเกินไปเวลาเปิดบนมือถือหรือจอเล็ก */
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1); /* เพิ่มเงาฝั่งซ้ายให้มิติสวยขึ้น */
    z-index: 1000;
    overflow-y: auto;  /* ให้เลื่อนขึ้นลงได้หากข้อมูลยาวเกินหน้าจอ */
    transition: right 0.3s ease-in-out; /* อนิเมชันเลื่อนเข้า-ออก */
}

/* เมื่อมีคลาส .open ให้เลื่อนกลับเข้ามาที่ขอบขวาพอดี */
#infoSlide.open {
    right: 0;
}

/* ========================================= */
/* UNIFIED STYLES EXTRACTED FROM HTML FILES  */
/* ========================================= */

/* --- AUTHENTICATION PAGES --- */
.auth-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
}
.auth-card h2 { text-align: center; margin: 0 0 10px 0; font-size: 28px; font-weight: 700; color: #000000; }
.auth-card p { text-align: center; color: #333333; font-size: 15px; margin: 0 0 25px 0; line-height: 1.4; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333333; font-size: 15px; }
.input-control { width: 100%; padding: 14px 16px; border: 1px solid #cccccc; border-radius: 12px; font-size: 16px; outline: none; transition: border-color 0.2s; }
.input-control:focus { border-color: #5c5cff; }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper .input-control { padding-right: 50px; }
.toggle-btn { position: absolute; right: 16px; background: none; border: none; cursor: pointer; font-size: 18px; color: #666666; padding: 0; display: flex; align-items: center; justify-content: center; }
.btn-submit { width: 100%; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600; background: #5c5cff; color: white; border: none; cursor: pointer; margin-top: 10px; transition: background 0.2s; }
.btn-submit:hover { background: #4b4bdf; }
.btn-submit:disabled { background: #a5a5ff; cursor: not-allowed; }
#errorMessage { color: #dc3545; text-align: center; margin-top: 20px; font-size: 14px; font-weight: 500; display: none; line-height: 1.4; }
.toggle-form-mode { text-align: center; margin-top: 20px; color: #5c5cff; text-decoration: none; font-weight: 500; font-size: 15px; cursor: pointer; }
.toggle-form-mode:hover { text-decoration: underline; }
.back-link { text-align: center; margin-top: 20px; }
.back-link a { color: #5c5cff; text-decoration: none; font-weight: 500; font-size: 15px; cursor: pointer; }
.back-link a:hover { text-decoration: underline; }


/* --- Extracted from admins.html --- */
.table-card {
            background: #ffffff;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.03);
            padding: 20px;
            margin-bottom: 20px;
            width: 100%;
            box-sizing: border-box;
        }

        .table-responsive-scroll {
            max-height: 500px;
            overflow: auto;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            position: relative;
        }

        table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }

        .total-summary-text {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 16px;
            display: block;
        }

        thead th.sortable {
            cursor: pointer;
            user-select: none;
            transition: background-color 0.2s;
        }
        thead th.sortable:hover {
            background-color: #f1f5f9 !important;
            color: #1e293b;
        }

        thead th {
            position: sticky;
            top: 0;
            background-color: #f8fafc !important;
            z-index: 10;
            box-shadow: inset 0 -1px 0 #e2e8f0;
            padding: 14px 10px;
            font-weight: 600;
            color: #64748b;
            text-align: left;
            font-size: 14px;
        }

        td {
            padding: 12px 10px;
            border-bottom: 1px solid #f1f5f9;
            color: #334155;
            background-color: #ffffff;
            font-size: 14px;
        }

        tr.clickable-row { cursor: pointer; transition: background-color 0.15s; }
        tr.clickable-row:hover td { background-color: #f8fafc !important; }

        .btn-add-member {
            background: #28a745;
            color: white;
            border: none;
            padding: 10px 18px;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .btn-add-member:hover { background: #218838; }

        /* ปรับสไตล์ปุ่มลบให้ดูเต็มและกดง่ายขึ้นเมื่ออยู่ใน Slide panel */
        .btn-action-delete {
            background: #dc3545;
            color: white;
            border: none;
            padding: 10px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            font-size: 14px;
            width: 100%;
            transition: all 0.2s;
            margin-top: 25px;
            display: block;
            text-align: center;
            box-sizing: border-box;
        }
        .btn-action-delete:hover { background: #c82333; }

        /* สไตล์กล่อง Slide-over รายละเอียดด้านขวา */
        .info-slide {
            position: fixed;
            top: 0;
            right: -460px;
            width: 420px;
            height: 100%;
            background: #ffffff;
            box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1), -1px 0 0px 0 rgba(0, 0, 0, 0.05);
            transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 999;
            padding: 28px;
            overflow-y: auto;
            box-sizing: border-box;
        }
        .info-slide.open { right: 0; }
        .info-slide-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #f1f5f9;
            padding-bottom: 16px;
            margin-bottom: 24px;
        }
        .info-slide-header h2 {
            font-size: 18px;
            margin: 0;
            font-weight: 600;
            color: #0f172a;
        }
        .info-slide-close {
            font-size: 22px;
            cursor: pointer;
            border: none;
            background: #f1f5f9;
            color: #64748b;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .info-slide-close:hover { background: #e2e8f0; color: #0f172a; }
        .info-group { margin-bottom: 18px; }
        .info-group label { font-weight: 600; display: block; color: #475569; margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; }
        .info-group p { margin: 0; padding: 10px 14px; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px; color: #334155; font-size: 14px; word-break: break-all; }

        .user-profile-dropdown {
            position: relative;
            display: inline-block;
            font-family: inherit;
        }

        .dropdown-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 6px 12px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #334155;
            transition: all 0.2s;
            user-select: none;
        }

        .dropdown-trigger:hover { background: #e2e8f0; }

        .dropdown-menu {
            display: none;
            position: absolute;
            right: 0;
            top: calc(100% + 6px);
            background: #ffffff;
            min-width: 160px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            z-index: 1000;
            overflow: hidden;
            padding: 4px 0;
        }

        .dropdown-menu.show { display: block; }

        .dropdown-item {
            display: block;
            width: 100%;
            padding: 10px 16px;
            text-align: left;
            background: none;
            border: none;
            font-size: 14px;
            color: #334155;
            cursor: pointer;
            text-decoration: none;
            box-sizing: border-box;
            font-family: inherit;
            transition: background 0.15s;
        }

        .dropdown-item:hover { background: #f8fafc; color: #0f172a; }
        .dropdown-item.text-danger { color: #ef4444; }
        .dropdown-item.text-danger:hover { background: #fef2f2; color: #dc2626; }

/* --- Extracted from dashboard.html --- */
/* New Grid Layout for Dashboard */
        .dashboard-grid-layout {
            display: grid;
            grid-template-columns: 380px 1fr 1fr;
            gap: 24px;
            margin-bottom: 32px;
        }

        @media (max-width: 1200px) {
            .dashboard-grid-layout {
                grid-template-columns: 320px 1fr 1fr;
            }
        }

        @media (max-width: 1024px) {
            .dashboard-grid-layout {
                grid-template-columns: 1fr 1fr;
            }
            .main-card {
                grid-row: auto !important;
                grid-column: 1 / -1;
            }
        }

        @media (max-width: 768px) {
            .dashboard-grid-layout {
                grid-template-columns: 1fr;
            }
        }

        /* Dashboard Card Styles */
        .dashboard-card {
            background: var(--bg-card);
            padding: 24px;
            border-radius: 16px;
            border: 1px solid var(--border-color);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .dashboard-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            border-color: var(--primary-light);
        }

        /* Large card on the left spans two grid rows of the right-hand grid */
        .main-card {
            grid-row: span 2;
        }

        /* Premium Dark Slate/Purple Card */
        .dark-card {
            background-color: #231f3c;
            border-color: #2e2a4a;
            color: #ffffff;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }

        .dark-card:hover {
            border-color: #4f46e5;
        }

        .dark-card .card-title {
            color: #ffffff;
        }

        .dark-card .card-subtitle {
            color: #94a3b8;
        }

        .card-header {
            margin-bottom: 16px;
        }

        .card-title {
            font-size: 18px;
            font-weight: 700;
            margin: 0;
            color: var(--text-main);
            letter-spacing: -0.5px;
        }

        .card-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin: 4px 0 0 0;
            font-weight: 500;
        }

        .chart-container {
            width: 100%;
            max-width: 220px;
            position: relative;
            margin: 16px auto;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 2x2 Sub Stats Grid in Left Card */
        .sub-stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            border-top: 1px solid var(--border-color);
            margin-top: 16px;
        }

        .sub-stat-item {
            padding: 16px 8px;
            display: flex;
            flex-direction: column;
        }

        .sub-stat-item:nth-child(1) {
            border-right: 1px solid var(--border-color);
            border-bottom: 1px solid var(--border-color);
        }

        .sub-stat-item:nth-child(2) {
            border-bottom: 1px solid var(--border-color);
            padding-left: 20px;
        }

        .sub-stat-item:nth-child(3) {
            border-right: 1px solid var(--border-color);
        }

        .sub-stat-item:nth-child(4) {
            padding-left: 20px;
        }

        .sub-dot {
            font-size: 12px;
            margin-right: 6px;
        }

        .sub-dot.pending { color: #f59e0b; }
        .sub-dot.waiting { color: #f97316; }
        .sub-dot.shipped { color: #06b6d4; }
        .sub-dot.failed { color: #94a3b8; }

        .sub-label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-main);
            display: flex;
            align-items: center;
        }

        .sub-price {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-main);
            margin-top: 6px;
        }

        .sub-count {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        /* 2-Column Row Layout inside Cards */
        .card-body-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            margin-top: auto;
            padding-top: 12px;
        }

        .card-body-col {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .card-body-col.text-right {
            text-align: right;
            align-items: flex-end;
        }

        .body-divider {
            width: 1px;
            height: 60px;
            background-color: var(--border-color);
            margin: 0 20px;
            align-self: center;
        }

        .dark-card .body-divider {
            background-color: #383456;
        }

        .body-label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 6px;
        }

        .dark-card .body-label {
            color: #94a3b8;
        }

        .body-value {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-main);
        }

        .body-desc {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .dark-card .body-desc {
            color: #94a3b8;
        }

        /* Custom text colors for dark card states */
        .text-warning { color: #f59e0b !important; }
        .text-info { color: #3b82f6 !important; }
        .text-light-gray { color: #cbd5e1 !important; }

        /* Tables */
        .table-responsive {
            background: var(--bg-card);
            border-radius: 16px;
            border: 1px solid var(--border-color);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            overflow: hidden;
        }
        .custom-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 14px; }
        .custom-table th {
            background: #f8fafc;
            padding: 16px 24px;
            font-weight: 600;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border-color);
            text-transform: uppercase;
            font-size: 12px;
            letter-spacing: 0.5px;
        }
        .custom-table td {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-main);
            vertical-align: middle;
        }
        .custom-table tbody tr {
            transition: background-color 0.2s;
        }
        .custom-table tbody tr:hover {
            background-color: #f8fafc;
        }
        .custom-table tr:last-child td { border-bottom: none; }
        .img-proof { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--border-color); transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
        .img-proof:hover { opacity: 0.9; transform: scale(1.05); }

        /* User Dropdown */
        .user-profile-dropdown {
            position: relative;
            display: inline-block;
            font-family: inherit;
        }

        .dropdown-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 6px 12px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #334155;
            transition: all 0.2s;
            user-select: none;
        }

        .dropdown-trigger:hover {
            background: #e2e8f0;
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            right: 0;
            top: calc(100% + 6px);
            background: #ffffff;
            min-width: 160px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            z-index: 1000;
            overflow: hidden;
            padding: 4px 0;
        }

        .dropdown-menu.show {
            display: block;
        }

        .dropdown-item {
            display: block;
            width: 100%;
            padding: 10px 16px;
            text-align: left;
            background: none;
            border: none;
            font-size: 14px;
            color: #334155;
            cursor: pointer;
            text-decoration: none;
            box-sizing: border-box;
            font-family: inherit;
            transition: background 0.15s;
        }

        .dropdown-item:hover {
            background: #f8fafc;
            color: #0f172a;
        }

        .dropdown-item.text-danger {
            color: #ef4444;
        }

        .dropdown-item.text-danger:hover {
            background: #fef2f2;
            color: #dc2626;
        }

/* --- Extracted from orders.html --- */
/* Inputs & Selects for Table inline editing */
        .td-input,
        .td-select {
            background-color: #ffffff;
            border: 1px solid #cbd5e1;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 14px;
            color: #334155;
            font-family: inherit;
            outline: none;
            transition: all 0.2s;
            box-sizing: border-box;
        }

        .td-input:focus,
        .td-select:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        /* สไตล์สำหรับฟิลด์ที่ห้ามแก้ไข (Read-only / Disabled) */
        .td-input:disabled,
        .td-select:disabled {
            background-color: #f1f5f9;
            color: #64748b;
            border-color: #e2e8f0;
            cursor: not-allowed;
        }

        .total-summary-text {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 16px;
            display: block;
        }

        .total-summary-text {
            text-align: left;
            width: 100%;
            height: 18px;
            cursor: pointer;
            accent-color: #3b82f6;
        }

        /* ระบบ Tab แยกสถานะ */
        .status-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            border-bottom: 1px solid #e2e8f0;
            width: 100%;
            overflow-x: auto;
        }
        .dashboard-container {
            padding: 32px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            width: 100%;
            max-width: 1400px;
            margin: 0 auto;
        }

        .tab-item {
            padding: 12px 16px;
            font-size: 14px;
            font-weight: 500;
            color: #64748b;
            cursor: pointer;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            transition: all 0.2s ease;
            white-space: nowrap;
            font-family: inherit;
        }

        .tab-item:hover {
            color: #3b82f6;
        }

        .tab-item.active {
            color: #3b82f6;
            font-weight: 600;
            border-bottom: 2px solid #3b82f6;
        }

        /* กรอบตาราง Dashboard Card */
        .table-card {
            background: #ffffff;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
            padding: 24px;
            width: 100%;
            box-sizing: border-box;
        }

        .table-responsive-scroll {
            max-height: 550px;
            overflow: auto;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            position: relative;
        }

        /* ตารางหลัก */
        thead th.sortable {
            cursor: pointer;
            user-select: none;
            transition: background-color 0.2s;
        }
        thead th.sortable:hover {
            background-color: #f1f5f9 !important;
            color: #1e293b;
        }
        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            white-space: nowrap;
        }

        thead th {
            position: sticky;
            top: 0;
            background-color: #f8fafc !important;
            z-index: 10;
            border-bottom: 1px solid #e2e8f0;
            padding: 14px 16px;
            font-size: 13px;
            font-weight: 600;
            color: #475569;
            text-align: left;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        td {
            padding: 14px 16px;
            border-bottom: 1px solid #f1f5f9;
            color: #334155;
            background-color: #ffffff;
            font-size: 14px;
        }

        tr.clickable-row {
            cursor: pointer;
            transition: background-color 0.15s;
        }

        tr.clickable-row:hover td {
            background-color: #f8fafc !important;
        }

        tr.clickable-row.selected-row td {
            background-color: #eff6ff !important;
        }

        /* ปุ่มเปิดดูรูปสลิป */
        .btn-slip {
            display: inline-block;
            background: #eff6ff;
            color: #1d4ed8;
            padding: 6px 12px;
            border-radius: 6px;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .btn-slip:hover {
            background: #dbeafe;
        }

        /* แถบควบคุมหน้าการแบ่งหน้า (Pagination) */
        .pagination-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 24px;
            background: #ffffff;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
            width: 100%;
            box-sizing: border-box;
        }

        .pagination-pages {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .btn-page {
            background: #ffffff;
            border: 1px solid #cbd5e1;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #334155;
            transition: all 0.2s;
        }

        .btn-page:hover:not(:disabled) {
            background: #f1f5f9;
            border-color: #94a3b8;
        }

        .btn-page:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* สไตล์กล่อง Slide-over รายละเอียดด้านขวา */
        .info-slide {
            position: fixed;
            top: 0;
            right: -460px;
            width: 420px;
            height: 100%;
            background: #ffffff;
            box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1), -1px 0 0px 0 rgba(0, 0, 0, 0.05);
            transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 999;
            padding: 28px;
            overflow-y: auto;
            box-sizing: border-box;
        }

        .info-slide.open {
            right: 0;
        }

        .info-slide-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #f1f5f9;
            padding-bottom: 16px;
            margin-bottom: 24px;
        }

        .info-slide-header h2 {
            font-size: 18px;
            margin: 0;
            font-weight: 600;
            color: #0f172a;
        }

        .info-slide-close {
            font-size: 22px;
            cursor: pointer;
            border: none;
            background: #f1f5f9;
            color: #64748b;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .info-slide-close:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        .info-group {
            margin-bottom: 18px;
        }

        .info-group label {
            font-weight: 600;
            display: block;
            color: #475569;
            margin-bottom: 6px;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.02em;
        }

        .info-group p {
            margin: 0;
            padding: 10px 14px;
            background: #f8fafc;
            border: 1px solid #f1f5f9;
            border-radius: 8px;
            color: #334155;
            font-size: 14px;
            word-break: break-all;
        }

        /* 🟢 เพิ่มสไตล์สำหรับระบบ User Dropdown มุมขวาบน */
        .user-profile-dropdown {
            position: relative;
            display: inline-block;
            font-family: inherit;
        }

        .dropdown-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 6px 12px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #334155;
            transition: all 0.2s;
            user-select: none;
        }

        .dropdown-trigger:hover {
            background: #e2e8f0;
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            right: 0;
            top: calc(100% + 6px);
            background: #ffffff;
            min-width: 160px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            z-index: 1000;
            overflow: hidden;
            padding: 4px 0;
        }

        .dropdown-menu.show {
            display: block;
        }

        .dropdown-item {
            display: block;
            width: 100%;
            padding: 10px 16px;
            text-align: left;
            background: none;
            border: none;
            font-size: 14px;
            color: #334155;
            cursor: pointer;
            text-decoration: none;
            box-sizing: border-box;
            font-family: inherit;
            transition: background 0.15s;
        }

        .dropdown-item:hover {
            background: #f8fafc;
            color: #0f172a;
        }

        .dropdown-item.text-danger {
            color: #ef4444;
        }

        .dropdown-item.text-danger:hover {
            background: #fef2f2;
            color: #dc2626;
        }
/* --- SPLIT LAYOUT FOR AUTH PAGES (NEW) --- */
body.auth-page {
    background: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}
.auth-split-card {
    display: flex;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 950px;
    min-height: 550px;
}
.auth-left-panel {
    flex: 1.2;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid #e2e8f0;
}
.auth-left-panel img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}
.auth-right-panel {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .auth-split-card {
        flex-direction: column;
    }
    .auth-left-panel {
        display: none;
    }
    .auth-right-panel {
        padding: 40px 30px;
    }
}

/* Adjust inner card to remove shadow since outer card has it */
.auth-right-panel .auth-card {
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 100%;
}
