html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ===== ACChieve ===== */
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

html, body { font-family: "Sarabun", "Leelawadee UI", Tahoma, sans-serif; font-size: 16px; background: var(--acw-bg); }
h1:focus { outline: none; }

/* Colours of the web in one place. Pages use these variables instead of fixed colours, so they follow the
   user's โหมดมืด: ThemeMode.razor renders .acw-dark-mode while dark, which switches every value below. */
:root {
    --acw-bg: #f3f5f8; --acw-surface: #ffffff; --acw-surface-2: #f8fafc; --acw-surface-3: #f1f4f8; --acw-hover: #f4f7fa; --acw-input: #ffffff;
    --acw-border: #e3e8ee; --acw-border-soft: #f0f2f5; --acw-border-strong: #cfd8e2;
    --acw-text: #1f2933; --acw-text-2: #26313d; --acw-heading: #1b222c; --acw-label: #3a4754; --acw-muted: #5c6b7a; --acw-faint: #9aa6b2;
    --acw-accent: #1585d8; --acw-accent-text: #0f6db5; --acw-accent-soft: #eaf3fc; --acw-accent-hover: #f1f6fb; --acw-accent-border: #9ccbf0; --acw-on-tone: #ffffff;
    --acw-success: #2e7d32; --acw-success-soft: #e7f4e8; --acw-danger: #d32f2f; --acw-danger-soft: #fdecec; --acw-warning: #c77700; --acw-warning-soft: #fff3e0;
    --acw-tint-blue: #1574c0; --acw-tint-blue-bg: #e6f1fb; --acw-tint-slate: #4b5b6b; --acw-tint-slate-bg: #eceff3;
    --acw-tint-green: #12795a; --acw-tint-green-bg: #e3f4ee; --acw-tint-amber: #a86b00; --acw-tint-amber-bg: #fdf3dc; --acw-star: #e0a100;
    --acw-row-selected: #d9ecfb; --acw-row-cancelled: #ffe4ea; --acw-row-cancelled-text: #9b2c3c; --acw-row-cancelled-selected: #f8c9d3; --acw-auto-code: #e3f2fd;
    --acw-navy: #1b222c;
    --acw-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
    --acw-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 3px 10px rgba(16, 24, 40, .05);
    --acw-drawer-shadow: 3px 0 14px rgba(16, 24, 40, .07);
}
:root:has(.acw-dark-mode) {
    color-scheme: dark;
    --acw-bg: #121820; --acw-surface: #1a222d; --acw-surface-2: #202a36; --acw-surface-3: #222d3a; --acw-hover: #233040; --acw-input: #121921;
    --acw-border: #2b3644; --acw-border-soft: #232d39; --acw-border-strong: #3a4756;
    --acw-text: #e2e8ef; --acw-text-2: #d7dee6; --acw-heading: #eef2f6; --acw-label: #aebbc8; --acw-muted: #94a3b4; --acw-faint: #6b7a8c;
    --acw-accent: #1585d8; --acw-accent-text: #6cb6f6; --acw-accent-soft: rgba(75, 163, 242, .15); --acw-accent-hover: rgba(75, 163, 242, .10); --acw-accent-border: #2f6ea5; --acw-on-tone: #0d1218;
    --acw-success: #6fd3a8; --acw-success-soft: rgba(52, 190, 140, .16); --acw-danger: #f28b8b; --acw-danger-soft: rgba(240, 90, 90, .16); --acw-warning: #f0b45a; --acw-warning-soft: rgba(240, 180, 90, .16);
    --acw-tint-blue: #7cbcf5; --acw-tint-blue-bg: rgba(75, 163, 242, .16); --acw-tint-slate: #b8c4d2; --acw-tint-slate-bg: rgba(148, 163, 184, .16);
    --acw-tint-green: #6fd3a8; --acw-tint-green-bg: rgba(52, 190, 140, .16); --acw-tint-amber: #f0c45a; --acw-tint-amber-bg: rgba(224, 161, 0, .16); --acw-star: #f0c45a;
    --acw-row-selected: rgba(75, 163, 242, .24); --acw-row-cancelled: rgba(240, 90, 90, .14); --acw-row-cancelled-text: #f4a3a3; --acw-row-cancelled-selected: rgba(240, 90, 90, .26); --acw-auto-code: rgba(75, 163, 242, .14);
    --acw-navy: #0d1218;
    --acw-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .28);
    --acw-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .22);
    --acw-drawer-shadow: 3px 0 14px rgba(0, 0, 0, .3);
}

/* app bar and menu */
.app-bar { border-bottom: 3px solid #1585d8; }
.app-bar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; margin-left: .25rem; letter-spacing: .02em; }
.app-bar .brand-acc { background: #e8edf2; color: #1b222c; border-radius: 4px; padding: 0 .35rem; margin-right: .4rem; font-weight: 800; }
.app-bar .brand-acc b { color: #1585d8; }
.app-bar .company { margin-left: 1.25rem; color: #c9d4df; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar-info { display: inline-flex; align-items: center; gap: .25rem; margin-right: 1rem; color: #c9d4df; font-size: .9rem; }
/* สีประจำระบบ (Menu/MenuIcons.cs Tint): --tone = สีไอคอน, --tone-bg = พื้นหลังไอคอน */
.tint-green { --tone: #12795a; --tone-bg: #e3f4ee; }
.tint-orange { --tone: #c2410c; --tone-bg: #fdeee4; }
.tint-teal { --tone: #0f766e; --tone-bg: #dff3f1; }
.tint-rose { --tone: #be123c; --tone-bg: #fde8ee; }
.tint-blue { --tone: #1574c0; --tone-bg: #e6f1fb; }
.tint-amber { --tone: #a86b00; --tone-bg: #fdf3dc; }
.tint-brown { --tone: #8a5a2b; --tone-bg: #f5ece3; }
.tint-slate { --tone: #4b5b6b; --tone-bg: #eceff3; }
.tint-purple { --tone: #7e3fbf; --tone-bg: #f2eafb; }
.tint-cyan { --tone: #0e7fa3; --tone-bg: #e2f4fa; }
.tint-indigo { --tone: #4f46e5; --tone-bg: #ecebfd; }
:root:has(.acw-dark-mode) .tint-green { --tone: #6fd3a8; --tone-bg: rgba(52, 190, 140, .16); }
:root:has(.acw-dark-mode) .tint-orange { --tone: #fb9a5b; --tone-bg: rgba(251, 140, 70, .16); }
:root:has(.acw-dark-mode) .tint-teal { --tone: #5fd4c8; --tone-bg: rgba(45, 200, 185, .15); }
:root:has(.acw-dark-mode) .tint-rose { --tone: #f58aa4; --tone-bg: rgba(240, 90, 130, .16); }
:root:has(.acw-dark-mode) .tint-blue { --tone: #7cbcf5; --tone-bg: rgba(75, 163, 242, .16); }
:root:has(.acw-dark-mode) .tint-amber { --tone: #f0c45a; --tone-bg: rgba(224, 161, 0, .16); }
:root:has(.acw-dark-mode) .tint-brown { --tone: #d6a77a; --tone-bg: rgba(200, 150, 100, .16); }
:root:has(.acw-dark-mode) .tint-slate { --tone: #b8c4d2; --tone-bg: rgba(148, 163, 184, .16); }
:root:has(.acw-dark-mode) .tint-purple { --tone: #c49cf2; --tone-bg: rgba(170, 120, 240, .16); }
:root:has(.acw-dark-mode) .tint-cyan { --tone: #6cd0ee; --tone-bg: rgba(60, 190, 230, .15); }
:root:has(.acw-dark-mode) .tint-indigo { --tone: #a5a1fb; --tone-bg: rgba(120, 110, 240, .18); }

.app-drawer { border-right: 1px solid var(--acw-border); box-shadow: var(--acw-drawer-shadow); }
.page-content { padding: 1rem 1.25rem; }

/* form header with the VB toolbar */
.form-header { display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.form-header h1 { font-size: 1.45rem; font-weight: 700; margin: 0 0 .35rem; color: var(--acw-heading); min-width: 220px; }
.command-bar { display: flex; align-items: stretch; gap: .35rem; background: var(--acw-surface); border: 1px solid var(--acw-border); border-radius: 10px; padding: .4rem .45rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.command-bar .command { --tone: var(--acw-tint-slate); --tone-bg: var(--acw-tint-slate-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 78px; padding: .35rem .5rem .3rem; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer;
    color: var(--acw-text-2); font: inherit; font-size: .85rem; font-weight: 600; transition: background .12s, border-color .12s, transform .06s; }
.command-bar .command .command-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tone-bg); color: var(--tone); transition: background .12s, color .12s; }
.command-bar .command .command-icon .mud-icon-root { font-size: 1.5rem; }
.command-bar .command kbd { font-size: .68rem; font-weight: 600; color: var(--acw-faint); background: var(--acw-surface-3); border: 1px solid var(--acw-border); border-radius: 4px; padding: 0 .3rem; box-shadow: none; font-family: inherit; line-height: 1.35; }
.command-bar .command:hover:not(:disabled) { background: var(--acw-hover); border-color: var(--acw-border); }
.command-bar .command:hover:not(:disabled) .command-icon { background: var(--tone); color: var(--acw-on-tone); }
.command-bar .command:active:not(:disabled) { transform: translateY(1px); }
.command-bar .command:disabled { opacity: .38; cursor: default; }
.command-bar .tone-add { --tone: var(--acw-success); --tone-bg: var(--acw-success-soft); }
.command-bar .tone-edit { --tone: var(--acw-tint-blue); --tone-bg: var(--acw-tint-blue-bg); }
.command-bar .tone-danger { --tone: var(--acw-danger); --tone-bg: var(--acw-danger-soft); }
.command-bar .tone-warning { --tone: var(--acw-warning); --tone-bg: var(--acw-warning-soft); }
.command-bar .tone-neutral { --tone: var(--acw-tint-slate); --tone-bg: var(--acw-tint-slate-bg); }
.command-bar .tone-primary { --tone: #1585d8; --tone-bg: #1585d8; }
.command-bar .tone-primary .command-icon { color: #fff; box-shadow: 0 2px 6px rgba(21, 133, 216, .35); }
.command-bar .tone-primary:hover:not(:disabled) .command-icon { background: #0f6db3; }
.command-bar-status { display: flex; align-items: center; padding: 0 .75rem; }
.mode { font-weight: 700; font-size: 1rem; }
.mode-add { color: var(--acw-success); }
.mode-edit { color: var(--acw-warning); }

/* master data page: list on the left, fields on the right */
.master-layout { display: grid; grid-template-columns: minmax(420px, 5fr) 6fr; gap: 1rem; align-items: start; }
.master-list, .master-detail { background: var(--acw-surface); border: 1px solid var(--acw-border); border-radius: 8px; padding: .9rem; }
.list-options { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: .25rem 0 .5rem; font-size: .9rem; }
.list-table { height: calc(100vh - 330px); min-height: 280px; overflow: auto; border: 1px solid var(--acw-border); border-radius: 6px; outline: none; }
.list-table:focus-visible { border-color: var(--acw-accent); }
.list-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.list-table th { position: sticky; top: 0; background: var(--acw-surface-3); text-align: left; font-weight: 600; padding: .45rem .6rem; border-bottom: 1px solid var(--acw-border); z-index: 1; }
.list-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--acw-border-soft); cursor: pointer; }
.list-table tr:hover td { background: var(--acw-accent-hover); }
.list-table tr.row-selected td { background: var(--acw-row-selected); }
.list-table tr.row-cancelled td { background: var(--acw-row-cancelled); color: var(--acw-row-cancelled-text); }
.list-table tr.row-cancelled.row-selected td { background: var(--acw-row-cancelled-selected); }
.list-empty { padding: 2rem; text-align: center; color: var(--acw-faint); }
.list-count { margin-top: .35rem; font-size: .85rem; color: var(--acw-muted); text-align: right; }
/* Long lists draw only the rows in view (<Virtualize>), so every row keeps one line of the same height. */
.list-table.virtual table { table-layout: fixed; }
.list-table.virtual td { height: 34px; padding-top: 0; padding-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-grid { display: grid; grid-template-columns: 140px 1fr; gap: .55rem 1rem; align-items: center; max-width: 820px; }
.field-grid > label { text-align: right; font-weight: 600; color: var(--acw-label); }
.field-grid .auto-code input { background: var(--acw-auto-code); }
.field-grid .mud-input-control { margin: 0; }
.field-section { grid-column: 1 / -1; margin-top: .75rem; padding-bottom: .25rem; border-bottom: 1px solid var(--acw-border); font-weight: 700; color: var(--acw-heading); }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.3fr 1fr; background: #1b222c; }
.login-brand { background: #181d24 url("img/brand-bg.png") center / cover no-repeat; display: flex; align-items: flex-end; padding: 3rem; color: #9fb0c1; }
.login-panel { display: flex; align-items: center; justify-content: center; background: #f3f5f8; }
.login-box { width: 380px; background: #fff; padding: 2.25rem 2rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.login-box h1 { font-size: 1.6rem; font-weight: 700; margin: 0; color: #1b222c; }
.login-box .sub { color: #6b7a89; margin-bottom: 1.5rem; }
.login-box label { font-weight: 600; color: #3a4754; margin-bottom: .25rem; }
.login-box .form-control, .login-box .form-select { padding: .55rem .75rem; font-size: 1rem; }
.login-box .btn-primary { background: #1585d8; border-color: #1585d8; padding: .6rem; font-weight: 600; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-brand { display: none; } .master-layout { grid-template-columns: 1fr; } }

/* reports (trial pages) */
.report-table-wrap { max-height: calc(100vh - 330px); overflow: auto; border: 1px solid var(--acw-border); background: var(--acw-surface); }
.report-table { margin: 0; font-size: .9rem; }
.report-table thead th { position: sticky; top: 0; background: var(--acw-surface-3); z-index: 1; white-space: nowrap; }
.report-table .num { text-align: right; white-space: nowrap; }
.report-table tr.grp td { font-weight: 600; background: var(--acw-surface-2); }
.report-table tr.grp-1 td { padding-left: 1.5rem; }
.report-table tr.grp-2 td { padding-left: 2.5rem; }
.report-table tr.total td { font-weight: 600; border-top: 1px solid var(--acw-border-strong); }
