  /* ── NAV ── */
  .nav {
    background: #3C2A0E;
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px;
  }
  .nav-logo { color: #E8C97A; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
  .nav-logo-icon { width: 28px; height: 28px; background: #E8C97A; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
  .nav-logo-icon svg { width: 18px; height: 18px; }
  .nav-links { display: flex; gap: 20px; }
  .nav-link { color: #C9A85A; font-size: 14px; cursor: pointer; }
  .nav-link:hover { color: #E8C97A; }
  .nav-btn { background: #E8C97A; color: #3C2A0E; border: none; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }

  /* ── HERO ── */
  .hero {
    background: linear-gradient(160deg, #2D1F08 0%, #4A320F 60%, #3C2A0E 100%);
    padding: 48px 24px 40px;
    text-align: center;
    position: relative; overflow: hidden;
  }
  .hero-pattern {
    position: absolute; inset: 0; opacity: 0.06;
    background-image: repeating-linear-gradient(45deg, #E8C97A 0, #E8C97A 1px, transparent 0, transparent 50%);
    background-size: 20px 20px;
  }
  .hero-tag { display: inline-block; background: rgba(232,201,122,0.15); color: #E8C97A; font-size: 11px; letter-spacing: 1.5px; padding: 4px 12px; border-radius: 20px; border: 0.5px solid rgba(232,201,122,0.3); margin-bottom: 16px; }
  .hero h1 { color: #F0DFA0; font-size: 26px; font-weight: 500; margin-bottom: 6px; line-height: 1.3; }
  .hero-sub { color: #A08040; font-size: 14px; margin-bottom: 28px; }
  .search-wrap { max-width: 560px; margin: 0 auto; position: relative; }
  .search-input {
    width: 100%; height: 48px; border-radius: 8px;
    border: 1.5px solid #8B6520;
    background: rgba(255,255,255,0.07);
    color: #F0DFA0; font-size: 15px; padding: 0 120px 0 44px;
    outline: none;
  }
  .search-input::placeholder { color: #7A6030; }
  .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #A08040; font-size: 18px; }
  .search-btn {
    position: absolute; right: 6px; top: 6px; height: 36px;
    background: #C49A28; border: none; border-radius: 6px;
    color: #2D1F08; font-size: 13px; font-weight: 500; padding: 0 16px; cursor: pointer;
  }
  .search-hints { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
  .hint-chip { background: rgba(232,201,122,0.1); color: #A08040; font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 0.5px solid rgba(232,201,122,0.2); cursor: pointer; }

	.search-row { display: flex; gap: 8px; }
	.search-box { position: relative; flex: 1; }
	.search-box input { width: 50%; height: 42px; background: rgba(255,255,255,0.06); border: 1px solid #5A3E10; border-radius: 6px; color: #F0DFA0; font-size: 14px; padding: 0 12px 0 38px; outline: none; }
	.search-box input::placeholder { color: #5A3E10; }
	.search-box input:focus { border-color: #D4A820; }
	.search-select { height: 42px; background: rgba(255,255,255,0.06); border: 1px solid #5A3E10; border-radius: 6px; color: #C8A060; font-size: 13px; padding: 0 10px; outline: none; }


/* BODY */
.body {max-width: 1280px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.sidebar { display: flex; flex-direction: column; gap: 12px; }
/* ===========================
   SIDEBAR CARD
=========================== */
.sidebar-card {
    background: #ffffff;
    border: 0.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.sidebar-title {
    font-size: 14px;
    color: #cc6600;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ===========================
   รายการหมวดหมู่
=========================== */
.cat-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 0.5px solid #f3f4f6;
    cursor: pointer;
}

.cat-item:last-child {
    border-bottom: none;
}

.cat-item:hover .cat-name {
    color: #C49A28;
}

/* จุดสี (dot) */
.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
}

/* ชื่อหมวดหมู่ */
.cat-name {
    font-size: 13px;
    color: #4b5563;
    flex: 1;
    transition: color 0.15s;
}

/* ตัวเลข badge */
.cat-count {
    font-size: 12px;
    color: #92651a;
    background: rgba(212, 168, 32, 0.12);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
}

/* RECENT */
.recent-item { padding: 6px 0; border-bottom: 0.5px solid var(--color-border-tertiary); cursor: pointer; display: flex; align-items: flex-start; gap: 6px; }
.recent-item:last-child { border-bottom: none; }
.recent-dot { width: 5px; height: 5px; background: #D4A820; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.recent-name { font-size: 14px; color: #666666; line-height: 1.4; }
.recent-name: a {text-decoration: none;} 
.recent-name:hover { color: #D4A820;}
.badge-done { font-size: 11px; background: rgba(99,153,34,0.15); color: #3B6D11; border-radius: 10px; padding: 3px 3px; white-space: nowrap; }


  /* ── STATS BAR ── */
  .stats-bar { background: #2D1F08; padding: 14px 24px; display: flex; justify-content: center; gap: 40px; }
  .stat { text-align: center; }
  .stat-num { color: #E8C97A; font-size: 18px; font-weight: 500; }
  .stat-lbl { color: #7A6030; font-size: 13px; margin-top: 2px; }

  /* ── BODY ── */
  .body-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 20px 20px; max-width: 900px; margin: 0 auto; }

  /* ── FILTERS ── */
  .filter-panel { background: var(--color-background-primary); border-radius: var(--border-radius-lg); border: 0.5px solid var(--color-border-tertiary); padding: 16px; }
  .filter-title { font-size: 12px; color: var(--color-text-secondary); letter-spacing: 1px; margin-bottom: 14px; }
  .filter-group { margin-bottom: 18px; }
  .filter-group-label { font-size: 13px; font-weight: 500; color: var(--color-text-primary); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 0.5px solid var(--color-border-tertiary); }
  .filter-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
  .filter-cb { width: 14px; height: 14px; border: 1px solid #8B6520; border-radius: 3px; background: transparent; flex-shrink: 0; }
  .filter-cb.checked { background: #C49A28; border-color: #C49A28; }
  .filter-item-label { font-size: 13px; color: var(--color-text-secondary); }
  .filter-count { margin-left: auto; font-size: 11px; color: #8B6520; background: rgba(196,154,40,0.12); padding: 1px 6px; border-radius: 10px; }

  /* ── RESULTS ── */
  .results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .results-count { font-size: 14px; color: var(--color-text-secondary); }
  .results-count strong { color: var(--color-text-primary); }
  .sort-select { font-size: 13px; padding: 4px 8px; border-radius: 4px; border: 0.5px solid var(--color-border-tertiary); background: var(--color-background-primary); color: var(--color-text-primary); }
  .result-cards { display: flex; flex-direction: column; gap: 12px; }

  /* ── CARD ── */
  .card { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-lg); display: flex; gap: 0; overflow: hidden; cursor: pointer; transition: border-color 0.2s; }
  .card:hover { border-color: #C49A28; }
  .card-thumb { width: 90px; flex-shrink: 0; background: #3C2A0E; display: flex; align-items: center; justify-content: center; }
  .card-thumb-inner { width: 60px; height: 80px; background: #5A3E10; border-radius: 3px; border: 1px solid #8B6520; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .card-thumb-lines { width: 40px; display: flex; flex-direction: column; gap: 3px; }
  .card-thumb-line { height: 2px; background: #C49A28; opacity: 0.6; border-radius: 1px; }
  .card-thumb-line.s { width: 70%; }
  .card-body { padding: 14px 16px; flex: 1; min-width: 0; }
  .card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
  .tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
  .tag-lang { background: rgba(196,154,40,0.15); color: #8B6520; border: 0.5px solid rgba(196,154,40,0.3); }
  .tag-script { background: rgba(60,42,14,0.08); color: #5A3E10; border: 0.5px solid rgba(90,62,16,0.2); }
  .tag-cat { background: var(--color-background-info); color: var(--color-text-info); }
  .card-title { font-size: 15px; font-weight: 500; color: var(--color-text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-meta-row { display: flex; gap: 16px; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 8px; flex-wrap: wrap; }
  .card-meta-item { display: flex; align-items: center; gap: 4px; }
  .card-desc { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--color-border-tertiary); }
  .card-condition { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-text-secondary); }
  .condition-dot { width: 8px; height: 8px; border-radius: 50%; }
  .cond-good { background: #639922; }
  .cond-fair { background: #BA7517; }
  .card-actions { display: flex; gap: 8px; }
  .action-btn { font-size: 12px; padding: 4px 10px; border-radius: 4px; border: 0.5px solid var(--color-border-secondary); background: transparent; color: var(--color-text-secondary); cursor: pointer; display: flex; align-items: center; gap: 4px; }
  .action-btn.primary { background: rgba(196,154,40,0.1); border-color: rgba(196,154,40,0.4); color: #8B6520; }

  /* ── PAGINATION ── */
  .pagination { display: flex; gap: 6px; justify-content: center; padding: 20px 0 8px; }
  .pg-btn { width: 32px; height: 32px; border-radius: 4px; border: 0.5px solid var(--color-border-tertiary); background: var(--color-background-primary); color: var(--color-text-secondary); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .pg-btn.active { background: #C49A28; border-color: #C49A28; color: #2D1F08; font-weight: 500; }

  /* ── LEGEND ── */
  .legend-bar { background: var(--color-background-secondary); border-top: 0.5px solid var(--color-border-tertiary); padding: 12px 24px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
  .legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); }
  
  /* FOOTER */
.footer { background: #1A0F04; padding: 24px 20px 16px; }
.footer-inner { max-width: 1248px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-brand { color: #e5cf7c; font-size: 15px; line-height: 1.8; }
.footer-brand strong { color: #baa867; font-size: 16px; display: block; margin-bottom: 6px; }
.footer-col-title { color: #baa867; font-size: 15px; letter-spacing: 1px; margin-bottom: 10px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 5px; }
.footer-links a { color: #e5cf7c; font-size: 14px; text-decoration: none; cursor: pointer; }
.footer-links a:hover { color: #f7efd4; }
.footer-bottom { max-width: 900px; margin: 16px auto 0; padding-top: 12px; border-top: 0.5px solid #2C1A06; display: flex; justify-content: space-between; align-items: center; }
.footer-copy { color: #baa867; font-size: 12px; }
.footer-dev { color: #baa867; font-size: 12px; }

/* ------------------ตารางใบลาน------------------------- */
.ms-wrap        { font-family: sans-serif; }

/* หัวตาราง */
.ms-header      { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.ms-count       { font-size:13px; color:#6b7280; }
.ms-count strong{ color:#111827; }
.sort-sel       { font-size:12px; padding:4px 8px; border-radius:4px;
                  border:1px solid #d1d5db; background:#fff; color:#374151; }

/* ตาราง */
.ms-table       { width:100%; border-collapse:collapse; background:#fff;
                  border:0.5px solid #e5e7eb; border-radius:10px; overflow:hidden; font-family: 'Sarabun', sans-serif;}
.ms-table thead tr { background:#2C1A06; }
.ms-table thead th { padding:10px 12px; font-size:14px; font-weight:500;
                     color:#ffffcc; text-align:left; letter-spacing:0.5px;
                     border-right:0.5px solid rgba(255,255,255,0.06); }
.ms-table thead th:last-child { border-right:none; }
.ms-table tbody tr { border-bottom:0.5px solid #f3f4f6; transition:background 0.15s; }
.ms-table tbody tr:last-child  { border-bottom:none; }
.ms-table tbody tr:hover       { background:rgba(212,168,32,0.04); }
.ms-table td    { padding:9px 12px; font-size:14px; color:#6b7280; vertical-align:middle; }

/* ชื่อใบลาน */
.ms-title       { color:#111827; font-weight:500; text-decoration:none; }
.ms-title:hover { color:#C49A28; }
.img-badge      { display:inline-flex; align-items:center; gap:2px; margin-left:6px;
                  background:rgba(212,168,32,0.12); color:#8B6520;
                  font-size:12px; padding:1px 6px; border-radius:3px; }

/* badge อักษร / หมวด */
.script-tag, .cat-tag {
    display:inline-block; font-size:12px; padding:2px 8px;
    border-radius:10px; font-weight:500; white-space:nowrap;
}

/* pagination */
.pg             { display:flex; gap:4px; justify-content:center; padding:16px 0 4px; }
.pg-btn         { min-width:30px; height:30px; border-radius:4px;
                  border:0.5px solid #e5e7eb; background:#fff;
                  color:#6b7280; font-size:12px; cursor:pointer;
                  display:flex; align-items:center; justify-content:center; }
.pg-btn.act     { background:#C49A28; border-color:#C49A28; color:#fff; font-weight:500; }
.pg-btn:hover:not(.act) { border-color:#C49A28; color:#C49A28; }