:root {
  --brand: #2f4a9e;
  --brand-dark: #22377a;
  --bs-body-font-family: "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { background: #f4f6fb; font-size: .95rem; }
.bg-brand { background: var(--brand) !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }
.card { border: 0; box-shadow: 0 1px 3px rgba(20, 30, 70, .08); }
.card-header { background: #fff; font-weight: 600; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { color: #6c757d; font-size: .85rem; }
.table thead th { background: #eef1f9; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.table td, .table th { vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.items-table input, .items-table select { min-width: 70px; font-size: .9rem; padding: .25rem .4rem; }
.items-table .col-desc { min-width: 240px; }
.items-table .row-total { font-weight: 600; }
.doc-sheet { background: #fff; border-radius: .5rem; padding: 1.5rem; }
.doc-sheet dt { color: #6c757d; font-weight: 500; font-size: .85rem; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #2f4a9e 0%, #5b77c9 100%); }
.login-card { width: 100%; max-width: 400px; }
.portal-card { transition: transform .15s, box-shadow .15s; }
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(20, 30, 70, .15); }
.bar { height: 10px; background: var(--brand); border-radius: 5px; }
.errorlist { color: #dc3545; list-style: none; padding: 0; margin: 0; font-size: .85rem; }
@media (max-width: 576px) { main { padding-left: 12px !important; padding-right: 12px !important; } }

/* ปฏิทินบริษัท (home page): calendar against the right edge of the screen, systems centred on the left */
.portal-wide { padding-left: 1rem; padding-right: 1rem; }
.portal-main { max-width: 1140px; margin: 0 auto; }
/* งานที่รอฉัน (home page, left) */
.my-tasks { border: 0; overflow: hidden; background: #fffaf0; }
.my-tasks-head { background: linear-gradient(135deg, #f08a24, #f4b03e); color: #fff; border: 0; }
.my-tasks-system { font-size: .72rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .03em;
  margin: .5rem .25rem .25rem; }
.my-tasks-group { background: #fff; border-radius: .4rem; margin-bottom: .4rem; overflow: hidden; }
.my-tasks-group .list-group-item { border-color: #f1f1f1; }
.company-cal-wrap { margin-top: 1.5rem; }
@media (max-width: 1199.98px) { .company-cal-wrap { max-width: 560px; margin: 0 auto; } }
.company-cal { border: 0; overflow: hidden; background: #f3f8ff; }
.company-cal-head { background: linear-gradient(135deg, var(--brand), #4a6fd1); color: #fff; border: 0; }
.cal-dot { display: inline-block; width: .8em; height: .8em; border-radius: 3px; vertical-align: -.05em; }
.cal-dot.cal-hol { background: #f47a20; }
.cal-dot.cal-pay { background: #b6ea6b; }
.cal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
@media (max-width: 419.98px) { .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cal-month { background: #fff; border-radius: .5rem; padding: .3rem .2rem .3rem; border: 1px solid transparent; }
.cal-month.cal-current { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 74, 158, .15); }
.cal-mname { text-align: center; font-weight: 700; font-size: .8rem; color: #1d2a55; margin-bottom: .15rem; }
.cal-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 1px; font-size: .64rem; }
.cal-table th { background: #5bc8f5; color: #1d3f9e; text-align: center; font-weight: 600; border-radius: 2px; line-height: 1.5; }
.cal-table th.cal-sun { color: #e0262b; }
.cal-table td { text-align: center; line-height: 1.55; border-radius: 3px; color: #222; padding: 0; }
.cal-table td.cal-sun { color: #e0262b; font-weight: 600; }
.cal-table td.cal-holiday { background: #f47a20; color: #fff; font-weight: 600; cursor: help; }
.cal-table td.cal-payday { background: #b6ea6b; color: #1b3a00; font-weight: 600; cursor: help; }
.cal-table td.cal-holiday.cal-payday { background: linear-gradient(135deg, #f47a20 50%, #b6ea6b 50%); }
.cal-table td.cal-today { outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 700; }
