/* Yulgang W — ธีมกลางหลังบ้าน GM (โหลดท้ายสุดทุกหน้า ทับสีเฉพาะหน้าให้เป็นโทนเดียวกัน)
   พื้นครีม · การ์ดขาวนวล · ตัวหนังสือน้ำตาลเข้ม (contrast สูง) · แดงชาด/ทองเป็นสีเน้น */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&family=Kanit:wght@500;600&display=swap');

:root {
    --yw-bg: #f4ece0;
    --yw-card: #fffdf8;
    --yw-ink: #2a1d14;
    --yw-ink-2: #4a3828;
    --yw-muted: #6b5643;
    --yw-line: #e2d2b8;
    --yw-red: #9e1b10;
    --yw-red-2: #7a1209;
    --yw-gold: #a9761f;
    --yw-green: #17703a;
    --yw-head: #f3e7d3;

    /* ชื่อตัวแปรที่แต่ละหน้าใช้ ให้ชี้มาที่โทนเดียวกัน */
    --bg: var(--yw-bg);
    --card: var(--yw-card);
    --txt: var(--yw-ink);
    --ink: var(--yw-ink);
    --text-main: var(--yw-ink);
    --text-muted: var(--yw-muted);
    --muted: var(--yw-muted);
    --dim: var(--yw-muted);
    --line: var(--yw-line);
    --border: var(--yw-line);
    --primary: var(--yw-red);
    --primary-hover: var(--yw-red-2);
    --jade: var(--yw-green);
    --gold: var(--yw-gold);
}

html, body, .dashboard-body {
    background: var(--yw-bg) !important;
    color: var(--yw-ink) !important;
}
body, input, button, select, textarea, table {
    font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', 'Inter', 'Segoe UI', Tahoma, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}
body { font-size: 15px; line-height: 1.6; }

h1, h2, h3, .title, .card-header .title, header h1 {
    font-family: 'Kanit', 'IBM Plex Sans Thai', sans-serif !important;
    font-weight: 600;
    color: var(--yw-ink) !important;
    letter-spacing: .01em;
}

/* การ์ด/กล่อง: พื้นเดียวกันทุกหน้า */
.card, .panel, .box, .stat, .tile, .quick a, .wrap > section {
    background: var(--yw-card) !important;
    border-color: var(--yw-line) !important;
    color: var(--yw-ink) !important;
}
.card-header { border-bottom-color: var(--yw-line) !important; }

/* ตัวหนังสือรอง: เข้มพอให้อ่านชัด */
.sub, .muted, .hint, .note, .k, .tile .k, .tile .s, .quick span, label, small,
.card-header .sub, header .sub, .auth-help, .card .k {
    color: var(--yw-muted) !important;
    font-weight: 500;
}
.tile .v, .stat .v, .card .v, .num { color: var(--yw-ink) !important; }

/* ตาราง */
table { border-color: var(--yw-line) !important; }
th {
    background: var(--yw-head) !important;
    color: var(--yw-ink-2) !important;
    font-weight: 600 !important;
    border-color: var(--yw-line) !important;
}
td {
    background: transparent !important;
    color: var(--yw-ink) !important;
    border-color: var(--yw-line) !important;
}
tbody tr:nth-child(even) td { background: rgba(169, 118, 31, .05) !important; }
tbody tr:hover td { background: rgba(158, 27, 16, .06) !important; }

/* ลิงก์ */
a { color: var(--yw-red) !important; }
a:hover { color: var(--yw-red-2) !important; }

/* ฟอร์ม */
input, select, textarea {
    background: #fff !important;
    color: var(--yw-ink) !important;
    border: 1px solid #d6c3a3 !important;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--yw-gold) !important;
    box-shadow: 0 0 0 3px rgba(169, 118, 31, .18) !important;
    outline: none;
}
input::placeholder, textarea::placeholder { color: #9a8670 !important; }

/* ปุ่ม */
.btn, button, input[type=submit] { font-weight: 600 !important; }
.btn-primary, button.primary, input[type=submit] {
    background: linear-gradient(#ad190c, #6f0c04) !important;
    border-color: #c9973f !important;
    color: #fff4d6 !important;
}
.btn-primary:hover, button.primary:hover, input[type=submit]:hover { filter: brightness(1.08); }

/* แถบข้าง (คงแดงเข้ม ตัวหนังสือครีมสว่าง) */
.sidebar, aside.sidebar { background: linear-gradient(180deg, #2a0b07, #4a150c) !important; }
.sidebar, .sidebar a, .sidebar .sidebar-link { color: #f7e6cc !important; }
.sidebar a:hover, .sidebar a.active, .sidebar .sidebar-link.active { color: #ffd779 !important; background: rgba(236, 208, 152, .12) !important; }
.sidebar .btn { color: #382c23 !important; background: #fffaf2 !important; }
.sidebar .btn-danger { color: #fff !important; background: linear-gradient(#ad190c, #670800) !important; }

/* แถบหัวหน้า login (เดิมตัวหนังสือแดงบนแดง) */
.auth-card .card-header .sub, .auth-card .sub { color: #f1dcbc !important; }
.auth-card .card-header .title { color: #f6dfa8 !important; }

/* ข้อความสถานะ */
.ok, .success, .msg-ok, .alert-success { color: var(--yw-green) !important; }
.err, .error, .danger, .alert-danger { color: var(--yw-red) !important; }
code, .mono { font-family: 'JetBrains Mono', Consolas, monospace !important; color: #5a2a12 !important; }

/* --- แถบข้าง: หัว / ผู้ใช้ / เมนูที่เลือก / hover (v2) --- */
.sidebar .sidebar-brand { color: #ffd98a !important; text-shadow: 0 1px 0 rgba(0,0,0,.35); font-family: "Kanit", "IBM Plex Sans Thai", sans-serif !important; }
.sidebar .sidebar-user { color: #e9d3b4 !important; opacity: 1 !important; }
.sidebar .sidebar-link { color: #f7e6cc !important; background: transparent !important; }
.sidebar .sidebar-link:hover { background: rgba(255, 215, 121, .12) !important; color: #ffe2a3 !important; }
.sidebar .sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(255, 215, 121, .28), rgba(255, 215, 121, .10)) !important;
    color: #fff3d1 !important;
    box-shadow: inset 3px 0 0 #ffd779;
    font-weight: 700 !important;
}

/* ปุ่ม LINE: เขียวเข้มขึ้นให้ตัวหนังสือขาวอ่านชัด */
.btn-discord, .btn-line { background: #05873a !important; border-color: #05873a !important; color: #fff !important; }
.btn-discord:hover, .btn-line:hover { background: #046e30 !important; }

/* ป้ายสถานะ/แท็ก: พื้นอ่อน ตัวเข้ม */
.badge, .pill, .tag, .chip { font-weight: 600 !important; }
