@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');
:root{--navy:#171d3b;--orange:#f07824;--ink:#252d4b;--muted:#838ba2;--line:#e9ecf5;--bg:#f4f6fb}
*{box-sizing:border-box}body{font-family:'Sarabun',sans-serif;background:var(--bg);color:var(--ink)}.topbar{background:var(--navy);padding:13px 0;box-shadow:0 4px 18px #1720441c}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#ff9b45,#e96816);font-size:24px;color:#fff;font-weight:700}.navbar-brand{font-weight:700}.brand-light{color:#ffc08a;font-weight:400;margin-left:3px}.brand-caption{font-size:11px;font-weight:400;letter-spacing:.2px;color:#b7bdd6}.hero h1{font-size:clamp(1.7rem,3vw,2.35rem);font-weight:700;letter-spacing:-.5px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.7px;color:var(--orange)}.live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#27c79a;margin-right:7px;box-shadow:0 0 0 4px #27c79a20}.panel,.stat-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 6px 22px #25325a08}.stat-card{padding:19px;height:100%}.stat-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;margin-bottom:12px}.orange-theme{background:#fff0e2;color:#e96816}.blue{background:#e7f3ff;color:#3385d9}.green{background:#e2f8f0;color:#20a77d}.orange{background:#fff0e2;color:#e78b32}.purple{background:#d9d5fd;color:#6558dc}.stat-label{font-size:12px;color:var(--muted)}.stat-value{font-size:clamp(1.4rem,2.4vw,1.9rem);font-weight:700}.stat-value small{font-size:12px;font-weight:400;color:var(--muted)}.panel-head{padding:21px 23px 16px}.panel-head h2{font-size:18px;font-weight:700;margin:0 0 4px}.tabs{background:#f8f9fd;border-block:1px solid #f0f1f7;padding:9px;display:flex;gap:8px;flex-wrap:wrap}.tabs .btn{border-radius:10px;font-size:13px;font-weight:600}.btn-primary{background:var(--orange);border-color:var(--orange)}.btn-primary:hover{background:#d85c0c;border-color:#d85c0c}.candidate-row{display:grid;grid-template-columns:34px 48px minmax(0,1fr) auto;gap:13px;align-items:center;padding:15px 12px;border-bottom:1px solid #f0f2f7}.candidate-row:last-child{border-bottom:0}.candidate-row.winner{background:linear-gradient(90deg,#fff8f1,#fff);border:1px solid #ffe0c2;border-radius:13px;margin-bottom:7px}.rank{font-weight:700;color:#9299ad;text-align:center}.rank-first{color:#dba528;font-size:20px}.avatar{width:46px;height:46px;border-radius:14px;object-fit:cover;background:#fff0e2;color:#e96816;display:grid;place-items:center;font-weight:700;font-size:19px}.candidate-name{font-weight:700;font-size:14px}.candidate-meta{font-size:11px;color:#8a91a5;margin-top:4px}.winner-chip{font-size:10px;color:#d85c0c;background:#fff0e2;padding:3px 7px;border-radius:5px;white-space:nowrap}.score{text-align:right;font-size:clamp(1.1rem,2.2vw,1.5rem);font-weight:700;font-variant-numeric:tabular-nums}.winner .score{color:var(--orange)}.score-caption{font-size:11px;color:#959cb0;text-align:right}.score-bar{height:5px;background:#eff0f7;border-radius:9px;overflow:hidden;margin-top:9px}.score-bar span{display:block;height:100%;background:linear-gradient(90deg,#ffb66f,#ef741d)}.district-table th{font-size:12px;color:#7c849b;background:#f8f9fd;white-space:nowrap}.district-table td{font-size:13px;vertical-align:middle}.table-responsive{border-radius:0 0 15px 15px}.form-label{font-weight:600;font-size:13px}.form-control,.form-select{border-color:#dfe3ef;border-radius:10px;padding:.65rem .8rem}.avatar-preview{width:80px;height:80px;object-fit:cover;border-radius:16px;background:#f0f1f8}.section-note{font-size:12px;color:var(--muted)}.district-heading{font-size:15px;font-weight:700}.admin-nav{display:flex;flex-wrap:wrap;gap:8px}.admin-nav a{font-size:13px}@media(max-width:767px){.panel-head{padding:18px 16px 14px}.candidate-row{grid-template-columns:25px 40px minmax(0,1fr) auto;gap:8px;padding:13px 3px}.avatar{width:38px;height:38px;border-radius:11px}.candidate-name{font-size:12px}.candidate-meta{font-size:10px}.winner-chip{display:inline-block;margin-top:3px}.score{font-size:17px}.stat-card{padding:14px;border-radius:14px}.stat-icon{width:32px;height:32px}.district-table th,.district-table td{font-size:11px;padding:8px}.tabs .btn{flex:1}.table-responsive{overflow-x:auto}}
/* SktcoopBoard branding */
.brand-logo{width:48px;height:48px;object-fit:contain;flex:0 0 auto;background:#fff;border-radius:50%;padding:2px;box-shadow:0 1px 8px #0002}.brand-logo-small{width:40px;height:40px}.brand-title{font-size:19px;line-height:1.25;font-weight:700}.brand-caption{max-width: min(78vw, 620px);white-space:normal;line-height:1.35}.navbar-brand{min-width:0}@media(max-width:575px){.brand-logo{width:40px;height:40px}.brand-logo-small{width:36px;height:36px}.brand-title{font-size:16px}.brand-caption{font-size:10px;max-width:72vw}}

/* สถานะไม่มีคู่แข่ง / ไม่มีการลงคะแนน */
.no-contest-notice{display:flex;flex-direction:column;gap:3px;margin:0 0 14px;padding:13px 16px;border:1px solid #ffd2a8;border-radius:12px;background:#fff5eb;color:#8a3b08;font-size:14px}
.no-contest-notice strong{font-size:15px}
.no-contest-chip{display:inline-block;margin-left:5px;padding:3px 8px;border-radius:6px;background:#fff0e2;color:#b94c08;font-size:10px;font-weight:700;white-space:nowrap}


/* Header admin menu and mobile national score cards */
.topbar .dropdown-menu { min-width: 210px; border: 1px solid var(--line); border-radius: 12px; padding: 7px; }
.topbar .dropdown-item { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.topbar .dropdown-item:hover { background: #fff0e2; color: #b94c08; }
.national-mobile-scores { padding: 12px; }
.district-score-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px; margin-bottom: 12px; box-shadow: 0 4px 14px #25325a08; }
.district-score-card:last-child { margin-bottom: 0; }
.district-score-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 11px; margin-bottom: 10px; border-bottom: 1px solid #f0f2f7; }
.district-candidate-number { color: var(--muted); font-size: 11px; }
.district-score-card h3 { margin: 3px 0 0; font-size: 14px; font-weight: 700; line-height: 1.45; }
.district-total-score { text-align: right; flex: 0 0 auto; }
.district-total-score strong { display: block; color: var(--orange); font-size: 18px; line-height: 1.2; }
.district-total-score span { color: var(--muted); font-size: 10px; }
.district-score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.district-score-item { min-width: 0; padding: 8px 5px; background: #f8f9fd; border-radius: 9px; text-align: center; }
.district-score-item span { display: block; color: #737c94; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.district-score-item strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .national-desktop-table { display: none; } .topbar { padding: 9px 0; } .topbar .container { gap: 8px; } }
@media (min-width: 768px) { .national-mobile-scores { display: none !important; } }
