/* Shared office theme. Loaded after the framework and module styles.
   Keep semantic status colours and existing interaction hooks intact. */
:root {
  --primary-50: #eef8fd;
  --primary-100: #d9effb;
  --primary-200: #b6e2f5;
  --primary-300: #86ceee;
  --primary-400: #4fb6e4;
  --primary-500: #219ed9;
  --primary-600: #076cae;
  --primary-700: #07568c;
  --primary-800: #06466f;
  --primary-900: #083a59;
  --primary-950: #06283e;
  --office-ink: #17344d;
  --office-muted: #536579;
  --office-line: #d8e8f2;
  --office-canvas: #f2f8fc;
  --office-shadow: 0 4px 20px rgb(7 65 103 / 5%);
  --att-primary: #076cae;
  --att-primary-light: #eef8fd;
  --att-primary-dark: #07568c;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-card: var(--office-shadow);
  --brand-blue: #076cae;
  --brand-sky: #219ed9;
  --brand-lime: #9bca3b;
  --brand-header: linear-gradient(115deg, #07568c 0%, #076cae 100%);
}

html { font-size: 16px; scroll-padding-top: 150px; }
body { font-size: 1rem; line-height: 1.7; background-color: var(--office-canvas) !important; }
body:not(.welcomepage) { background-image: none !important; }
::selection { background: #b6e2f5; color: #083a59; }
img, video, canvas { max-width: 100%; }
fieldset, .td, #content, #scroll-to { min-width: 0; }
button, input, textarea, select { font: inherit; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary-600); }
a, button, input, select, textarea { -webkit-tap-highlight-color: rgb(7 108 174 / 15%); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #219ed9 !important;
  outline-offset: 3px;
}
:where(button, input, select, textarea):disabled,
.button[aria-disabled=true] { opacity: .55; cursor: not-allowed; }

/* The application shell stays spacious without nesting large white cards. */
body:not(.welcomepage) .wrapper { width: min(96%, 1840px); padding: 24px 0 12px; }
header.header {
  background: var(--brand-header) !important;
  box-shadow: 0 3px 16px rgb(7 65 103 / 12%) !important;
  border: 1px solid #1683bc !important;
  border-bottom: 3px solid var(--brand-lime) !important;
  border-radius: 18px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: 28px;
}
header.header .table.fullwidth { width: 100%; padding: 16px 24px; gap: 16px; }
#logo { font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }
.user_pill_wrap { border-radius: 10px; box-shadow: none; }
.user_online_dot { animation: none; box-shadow: none; }
.user_name_link { font-size: .875rem; font-weight: 500; }
.language-menu { height: 40px; border-radius: 10px !important; font-size: .875rem; }
.language-menu ul::before { content: ''; position: absolute; inset: -10px 0 auto; height: 10px; }
.language-menu ul li a, .language-menu ul li a span { font-size: .875rem !important; }
.menu_wrapper { background: #06466f !important; border-radius: 0 0 17px 17px; }
.topmenu { width: 100%; padding: 0 14px; }
.topmenu > ul { gap: 4px; padding: 7px 0; }
.topmenu > ul > li > a, .topmenu > ul > li > span { min-height: 44px; font-size: .875rem; padding: 9px 14px; font-weight: 500; }
.topmenu > ul > li.select > a, .topmenu > ul > li.select > span {
  background: #076cae !important; box-shadow: none; color: #fff !important;
}
.topmenu > ul > li:hover > a, .topmenu > ul > li:hover > span,
.topmenu ul ul li:hover > a, .topmenu ul ul li:hover > span { transform: none; }
.topmenu li:focus-within > ul { opacity: 1; visibility: visible; transform: none; top: 100%; left: 0; }
.topmenu ul ul li:focus-within > ul { top: 0; left: 100%; }
.topmenu ul ul li a, .topmenu ul ul li span { font-size: .875rem; }

main#content { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; min-height: 55vh; }
.content_bg { border: 1px solid var(--office-line); border-radius: 18px; padding: 28px; box-shadow: var(--office-shadow); min-height: 0; }
.content_bg .content_bg { padding: 0; border: 0; box-shadow: none; }
main#content > :not(.content_bg):is(form, article) { margin-bottom: 24px; }
.breadcrumbs ul { background: transparent !important; padding: 0 !important; box-shadow: none !important; font-size: .875rem !important; border-radius: 0 !important; }
.breadcrumbs li { white-space: normal; }
.breadcrumbs li a { color: var(--primary-700) !important; }
main#content h1, main#content h2, main#content h2.title, .content_bg h1, .content_bg h2,
.content_bg header h2, main#content header h2 {
  font-size: clamp(1.25rem, 1.1rem + .55vw, 1.65rem) !important;
  font-weight: 600 !important; color: var(--office-ink) !important;
  line-height: 1.55 !important; letter-spacing: 0 !important; flex-wrap: wrap;
}
.content_bg header h2::before, main#content header h2::before { color: var(--primary-600) !important; }
main#content header[class] h2 { color: inherit !important; }

/* Shared hero treatment also covers report pages with embedded styles. */
body main#content :is(.att-hero, .leave-hero, .leave-form-hero, .export-hero, .export-hero-annual) {
  background: var(--brand-header) !important; color: #fff !important;
  border-radius: 16px; box-shadow: none; padding: 28px !important;
}
body main#content :is(.att-hero, .leave-hero, .leave-form-hero, .export-hero, .export-hero-annual) :is(h2, h3) { color: #fff !important; }
body main#content :is(.att-hero, .leave-hero, .leave-form-hero, .export-hero, .export-hero-annual)::after { display: none; }
.att-hero-title p, .export-hero-title p { line-height: 1.7; }

/* Forms: readable Thai labels, predictable focus and generous touch targets. */
.setup_frm { padding: 26px; max-width: 100%; border-color: var(--office-line); box-shadow: none; border-radius: 14px; }
.item > label, form .item > label, .setup_frm .item > label { font-size: .9375rem !important; font-weight: 500 !important; line-height: 1.65 !important; }
legend span { color: var(--office-ink) !important; font-weight: 600 !important; }
label.g-input, span.g-input, .g-input { border-color: #bdcbd6 !important; border-radius: 10px !important; box-shadow: none !important; }
label.g-input:focus-within, span.g-input:focus-within, .g-input:focus-within,
#login_div label.g-input:focus-within {
  border-color: var(--primary-600) !important; box-shadow: 0 0 0 3px rgb(7 108 174 / 12%) !important;
}
.g-input input, .g-input select, .g-input textarea { font-size: 1rem !important; line-height: 1.65 !important; }
textarea { min-height: 110px; resize: vertical; }
select:not([multiple]):not([size]) { min-height: 44px; border-radius: 10px; }
.comment, .item .comment, .setup_frm .comment { color: var(--office-muted); font-size: .875rem; line-height: 1.7; }
.button, button[type=submit], button[type=button], a.button {
  min-height: 44px; border-radius: 10px !important; font-size: .9375rem;
  font-weight: 500; box-shadow: none !important; transition: background-color .15s, border-color .15s;
}
.button:hover, button[type=submit]:hover, button[type=button]:hover { transform: none !important; }
.button.save, .button.ok, .button.login, .button.blue,
.table_nav .button.go, .table_nav button.go {
  background: var(--primary-600) !important; border-color: var(--primary-600) !important; color: #fff !important;
}
.button.save:hover, .button.ok:hover, .button.login:hover, .button.blue:hover,
.table_nav .button.go:hover { background: var(--primary-700) !important; }
.button.cancel, .button.gray { background: #edf2f6 !important; color: #334155 !important; border: 1px solid #d8e8f2 !important; }

/* Tables scroll inside their own panel; filters wrap above them. */
.table_nav { background: #f6f8fa; border-color: var(--office-line); padding: 16px; gap: 14px; border-radius: 12px; }
.table_nav > div { gap: 12px 18px; min-width: 0; }
.table_nav fieldset > label { font-size: .875rem; }
.table_nav .input-gcalendar, .table_nav input[type=text], .table_nav input[type=search] { min-height: 44px; }
div.responsive-v, div.data { border-color: var(--office-line); box-shadow: none; border-radius: 12px; max-width: 100%; overscroll-behavior-x: contain; }
table.fullwidth thead th, table.data thead th, table.responsive-v thead th {
  background: #eef3f6 !important; color: #42576b !important; font-size: .875rem !important;
  letter-spacing: 0; text-transform: none; padding: 14px 16px !important;
}
table.fullwidth tbody td, table.data tbody td { font-size: .9375rem; padding: 14px 16px !important; line-height: 1.65; }
table.fullwidth tbody tr:nth-child(even), table.data tbody tr:nth-child(even) { background: #fafcfd; }
table td a[class^=icon-], table td a[class*=" icon-"], table td button[class^=icon-] { min-width: 40px; min-height: 40px; }
.splitpage { flex-wrap: wrap; }
.splitpage a, .splitpage strong { min-width: 42px; height: 42px; font-size: .875rem !important; }
.splitpage strong { background: var(--primary-600) !important; box-shadow: none !important; }
.badge, .att-badge, .term0, .term1, .term2 { font-size: .875rem !important; letter-spacing: 0; line-height: 1.5 !important; }
.tab_menus { flex-wrap: wrap; gap: 6px; background: #edf2f6; padding: 6px; box-shadow: none; }
.tab_menus > li { border-radius: 9px; }
.tab_menus > li.select { background: var(--primary-600) !important; color: #fff !important; }
.tab_menus > li > a { font-size: .9375rem; min-height: 44px; }

/* Attendance, analytics, leave and export panels share the same surfaces. */
body main#content :is(.att-panel, .att-card, .att-kpi-card, .analytics-kpi-card,
 .analytics-chart-card, .analytics-table-card, .analytics-filter-card,
 .facereg-card, .leave-form-card, .export-card, .export-kpi-card) {
  border: 1px solid var(--office-line); border-radius: 14px; box-shadow: var(--office-shadow);
}
body main#content :is(.att-kpi-card, .analytics-kpi-card):hover { transform: none; }
.analytics-kpi-title, .att-kpi-label, .analytics-dept-name, .analytics-bar-label { font-size: .875rem; color: var(--office-muted); }
.analytics-kpi-number, .att-kpi-value { letter-spacing: -.03em; }
.analytics-tab-nav { flex-wrap: wrap; gap: 8px; }
.analytics-tab-btn { min-height: 44px; font-size: .875rem; }
.analytics-tab-btn.active { background: var(--primary-600) !important; border-color: var(--primary-600) !important; color: #fff; }
.att-btn-primary, .facereg-btn-primary, .att-mode-btn.active {
  background: var(--primary-600) !important; color: #fff !important;
  border-color: var(--primary-600) !important;
}
.att-btn-primary:hover, .facereg-btn-primary:hover { background: var(--primary-700) !important; }
.facereg-tab.active, .att-report-tabs a.active,
.analytics-tab-btn:hover:not(.active), .analytics-btn-export:hover {
  color: var(--primary-700) !important; border-color: var(--primary-200) !important;
  background: var(--primary-50) !important;
}
.analytics-kpi-card.card-kpi-indigo { background: linear-gradient(135deg, #eef8fd, #d9effb); border-color: var(--primary-200); }
.analytics-bar-fill, .analytics-dept-bar-fill, .seasonal-bar-fill { background: var(--primary-600); }
.analytics-bar-fill.bar-peak { background: var(--primary-800); }
.curr-pill { background: var(--primary-600); }
.current-month-col .seasonal-score { color: var(--primary-600) !important; }
.leave-form-shell .setup_frm .button.ok { background: var(--primary-600) !important; }
.leave-form-shell .setup_frm .button.ok:hover { background: var(--primary-700) !important; }
#login_div .language-menu { color: var(--primary-700) !important; background: var(--primary-50) !important; border-color: var(--primary-200) !important; }
#login_div .language-menu:hover, #login_div .language-menu:focus-within { background: var(--primary-100) !important; }
#login_div input.showpassword + span:hover { color: var(--primary-700) !important; }
.table_nav { background: #f3f9fd; }
table.fullwidth thead th, table.data thead th, table.responsive-v thead th { background: #eaf4fb !important; }
.att-home-content, .att-main-grid > *, .analytics-charts-row > * { min-width: 0; }
.content_bg div.att-home-dashboard > .card .card-item { height: auto !important; min-height: 100px; box-shadow: none !important; border-radius: 14px !important; }
.content_bg div.att-home-dashboard > .card .card-item:hover { transform: none !important; }
.content_bg div.att-home-dashboard > .card .card-subitem.icon { height: auto !important; align-self: stretch; width: 64px !important; }
.content_bg div.att-home-dashboard > .card .card-subitem .title {
  white-space: normal !important; font-size: .875rem !important; overflow: visible !important; line-height: 1.6;
}
.content_bg div.att-home-dashboard > .card .card-subitem b { text-shadow: none !important; font-weight: 600 !important; }
.content_bg div.att-home-dashboard > .card:nth-child(12n+1) .card-item { background: #07568c !important; }
.content_bg div.att-home-dashboard > .card:nth-child(12n+2) .card-item { background: #96570c !important; }
.content_bg div.att-home-dashboard > .card:nth-child(12n+3) .card-item { background: #076cae !important; }
.content_bg div.att-home-dashboard > .card:nth-child(12n+4) .card-item { background: #08517d !important; }
.content_bg div.att-home-dashboard > .card .card-item::after { display: none; }
.chart .label { font-size: .875rem; }
.modal_detail .item { gap: 16px; flex-wrap: wrap; }
.gmodal .modal_content { border-radius: 16px; max-width: calc(100vw - 24px); }

/* Authentication, password recovery and registration use the same theme. */
body.welcomepage {
  background: radial-gradient(ellipse at 15% 10%, #167bae 0, transparent 55%), #06466f !important;
  padding: 40px 20px !important;
}
body.welcomepage #slidemenu_content { min-height: auto; max-width: 480px !important; }
#login_div { max-width: 440px !important; }
#login_div form { padding: 32px !important; border-radius: 18px !important; box-shadow: 0 20px 60px rgb(0 0 0 / 18%) !important; }
#login_div h1 a#logo { text-shadow: none !important; font-weight: 600 !important; }
#login_div h3 { color: #c5d4e1 !important; font-size: .9375rem !important; line-height: 1.7; }
#login_div .login-header-row h2 { font-size: 1.35rem !important; font-weight: 600 !important; color: var(--office-ink) !important; }
#login_div .button.login { background: var(--primary-600) !important; border-radius: 10px !important; box-shadow: none !important; font-size: 1rem !important; }
#login_div .button.login:hover { background: var(--primary-700) !important; transform: none !important; }
#login_div fieldset.center a { color: var(--primary-700) !important; font-size: .875rem !important; }
#login_div .accept_term label { font-size: .9375rem !important; }
#login_div .accept_term input[type=checkbox] { accent-color: var(--primary-600) !important; }
#login_div label.g-input:focus-within::before { color: var(--primary-600) !important; }
footer.footer .copy { color: #5c6e80 !important; font-size: .875rem !important; }
body.welcomepage footer.footer .copy { color: #bdcddd !important; }
.scroller { border-radius: 12px; background-color: var(--primary-700); color: #fff; }

/* The supplied square PNG has transparent space above and below its artwork.
   A fixed image window displays the full mark on a readable white surface. */
header.header #logo img.company-logo {
  width: 124px;
  height: 72px;
  max-height: none;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  background: #fff;
  border: 6px solid #fff;
  border-radius: 10px;
  filter: none;
}
#login_div h1 a#logo img.company-logo {
  width: 240px !important;
  height: 140px !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center;
  padding: 0 !important;
  border: 14px solid #fff;
  border-radius: 16px !important;
  box-shadow: none !important;
}

@media (min-width: 961px) {
  header.header .table.fullwidth { flex-direction: row; align-items: center; }
  .topmenu > ul { flex-direction: row; align-items: center; }
}
@media (max-width: 960px) {
  html { scroll-padding-top: 110px; }
  body:not(.welcomepage) .wrapper { width: 100%; padding: 0; }
  header.header { border-radius: 0; margin-bottom: 20px; }
  body.responsive header.header .table.fullwidth { padding: 14px 16px 14px 64px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  header.header .td.right { gap: 8px; flex-wrap: wrap; }
  .user_display_name { max-width: 140px; }
  body.responsive .topmenu.slidemenu { background: #06466f; padding: 0; }
  body.responsive .topmenu.slidemenu ul ul { transform: none; }
  body.responsive .topmenu.slidemenu li:focus-within > ul { height: auto; top: 0; left: 0; }
  body.responsive .topmenu.slidemenu li > a { min-height: 44px; white-space: normal; }
  body.responsive input.toggle-menu:checked ~ #slidemenu_content .menu_bg { position: fixed !important; background: rgb(6 40 62 / 55%) !important; border-radius: 0; }
  main#content { margin: 0 16px; }
  .content_bg { padding: 20px; }
  .setup_frm { padding: 20px; }
}
@media (max-width: 640px) {
  #logo { font-size: 1rem; }
  #logo img { max-height: 32px; max-width: 160px; }
  header.header #logo img.company-logo { width: 106px; height: 64px; }
  .user_pill_wrap { padding-right: 8px; gap: 6px; }
  .user_display_name { max-width: 110px; }
  main#content { margin: 0 10px; }
  .content_bg { padding: 18px 12px; border-radius: 14px; }
  .setup_frm { padding: 18px 12px; }
  body main#content :is(.att-hero, .leave-hero, .leave-form-hero, .export-hero, .export-hero-annual) { padding: 20px 16px !important; }
  .table_nav { padding: 12px; }
  .table_nav fieldset > label { gap: 8px; flex-wrap: wrap; }
  .table_nav fieldset > label > :is(select, input, .input-gcalendar) { max-width: 100%; }
  .table_nav fieldset > label > select { width: 100%; flex-basis: 100%; }
  .table_nav fieldset.search, .table_nav fieldset.search input { width: 100%; }
  .att-kpi-grid, .analytics-kpi-grid, .analytics-charts-row, .att-boards-grid, .export-kpi-grid, .export-sheets-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .analytics-filter-card, .analytics-period-controls, .analytics-form-inline { flex-wrap: wrap; gap: 10px; }
  .analytics-select { max-width: 100%; }
  .analytics-seasonal-grid { overflow-x: auto; }
  .att-hero-content, .export-hero-content { flex-wrap: wrap; gap: 16px; }
  .tab_menus { gap: 4px; }
  .tab_menus > li { flex: 1 1 auto; text-align: center; }
  #login_div form { padding: 24px 20px !important; }
  body.welcomepage { padding: 28px 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html.smooth { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body:not(.welcomepage) { background: #fff !important; }
  header.header, footer.footer, .scroller { display: none !important; }
  main#content { margin: 0; }
  .content_bg { box-shadow: none; border: 0; }
}
