@charset "utf-8";
/*
 * My School — clean light theme.
 * Loaded by theme_switch.php only when the theme is switched on
 * (?theme=apple turns it on in one browser, ?theme=classic turns it off).
 * It only overrides the old look; remove the <link> and the site is back as before.
 */

:root {
  --ink: #1D1D1F;
  --ink-2: #424245;
  --muted: #6E6E73;
  --muted-light: #86868B;
  --surface: #FFFFFF;
  --parchment: #F5F5F7;
  --graphite: #1D1D1F;
  --on-dark: #E8E8ED;
  --hairline: #D2D2D7;
  --chip: #E8E8ED;
  --primary: #0071E3;
  --primary-hover: #0076DF;
  --link: #0066CC;
  --link-on-dark: #2997FF;
  --ember: #B64400;
  --shadow: rgba(0, 0, 0, 0.08) 2px 4px 12px 0;
  --radius-card: 18px;
  --radius-input: 11px;
  --radius-sm: 10px;
  --pill: 980px;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "Sukhumvit Set", Thonburi, "Leelawadee UI", "Noto Sans Thai", Sarabun, Tahoma, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    "Sukhumvit Set", Thonburi, "Leelawadee UI", "Noto Sans Thai", Sarabun, Tahoma, sans-serif;
}

/* ---------- Page ---------- */
html body {
  background: var(--parchment) none !important;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html body td, html body th, html body tr, html body p, html body div,
html body span, html body li, html body font, html body center,
html body input, html body select, html body textarea, html body button, html body label {
  font-family: var(--font-text) !important;
}
html body td, html body th {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
}
html body [background] { background-image: none !important; }
html body table[bgcolor=""] { background-color: transparent; }

/* Links: Link Blue on light ground */
html body a, html body a:link, html body a:visited { color: var(--link); text-decoration: none; }
html body a:hover { color: var(--link); text-decoration: underline; }
html body a:active { color: var(--link); }
html body a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 4px; }
html body strong, html body b { font-weight: 600; }

/* Old colour codes mapped onto the new palette */
html body font[color="#000000"], html body font[color="black"] { color: var(--ink); }
html body font[color="red"], html body font[color="#ff0000"], html body font[color="#cc0000"] { color: var(--ember); }
html body font[color="blue"], html body font[color="#0000ff"] { color: var(--link); }

/* Section titles that used the old 'thaisans_neuelight' face */
html body font[face][size="5px"], html body font[face][size="5"] {
  font-family: var(--font-display) !important;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
html body font[face] u { text-decoration: none; }

/* Decorative GIF bullets and icons from the old design */
html body img[src*="arrow2.gif"], html body img[src*="nextblue.gif"], html body img[src*="textedit.gif"],
html body img[src*="app.gif"], html body img[src*="07.gif"], html body img[src*="news.gif"],
html body img[src*="icon_mailheader.gif"] {
  display: none;
}

/* ---------- Header: frosted bar ---------- */
html body div.iBannerFix {
  background: rgba(250, 250, 252, 0.8) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
html body div.iBannerFix > table { height: 100px; }
html body div.iBannerFix td { padding: 0 28px; }
html body div.iBannerFix img[src*="logohead.jpg"] {
  height: 58px;
  width: auto;
  margin-top: 8px;
}
/* The logo JPG has a white box; show a transparent copy of it on the frosted bar */
html body div.iBannerFix td:has(> img[src*="logohead.jpg"]) {
  background: url(../images/logohead-clear.png) no-repeat 28px 8px / auto 58px !important;
}
html body div.iBannerFix td:has(> img[src*="logohead.jpg"]) > img { visibility: hidden; }
html body div.iBannerFix td[align="right"][valign="top"] font {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-text) !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
html body div.iBannerFix marquee font {
  font-family: var(--font-text) !important;
  font-size: 14px;
  font-weight: 600;
  color: var(--ember);
}
html body div.iBannerFix td[align="right"][valign="bottom"] { padding-bottom: 10px; }
html body div.iBannerFix td[align="right"][valign="bottom"] font {
  font-family: var(--font-text) !important;
  font-size: 14px;
  font-weight: 400;
}
html body div.iBannerFix strong { font-weight: 400; }
html body div.iBannerFix td[align="right"][valign="bottom"] a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--pill);
  color: var(--ink);
  line-height: 1.2;
}
html body div.iBannerFix td[align="right"][valign="bottom"] a:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
  text-decoration: none;
}

/* Director on duty band: dark, and hidden when nobody is listed */
html body table[bgcolor="#3CB371"] {
  background: var(--graphite);
  height: 36px;
}
html body table[bgcolor="#3CB371"] font, html body table[bgcolor="#3CB371"] b {
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 400;
}
html body table[bgcolor="#3CB371"]:not(:has(font)) { display: none; }

/* ---------- Three columns ---------- */
html body td[width="70%"] { padding: 0 8px 0 24px; }
html body td[width="15%"][background] { padding: 24px 24px 24px 8px; }

/* Left column as one white card */
html body table[background="images/1234.jpg"] > tbody > tr > td[width="17%"] { padding: 24px 0 24px 24px; }
html body table[background="images/1234.jpg"] > tbody > tr > td[width="17%"] > table > tbody > tr > td[width="17%"] {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
html body table[background="images/1234.jpg"] > tbody > tr > td[width="17%"] > table > tbody > tr > td[width="17%"] font[face] {
  display: block;
  font-size: 17px;
  margin-bottom: 8px;
}
html body table[background="images/1234.jpg"] > tbody > tr > td[width="17%"] div[align="left"] strong {
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  padding: 3px 0;
}
/* Waiting-document counts as small chips */
html body font[color="#ff0066"] {
  display: inline-block;
  min-width: 26px;
  padding: 0 8px;
  border-radius: var(--pill);
  background: var(--chip);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
}
html body table[background="images/1234.jpg"] center { font-size: 14px; }
html body table[background="images/1234.jpg"] center > font[color="#ff0000"] {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
html body table[background="images/1234.jpg"] center > font[color="#ff0000"] u { text-decoration: none; }
html body .fontmain { border-collapse: collapse !important; width: 100%; }
html body .fontmain td { font-size: 13px; color: var(--ink-2); border-bottom: 1px solid #EDEDF0; padding: 4px 0; }
html body .fontmain .fontmain td { height: auto; }
html body .fontmain tr:last-child td { border-bottom: 0; }

/* ---------- Center: login, circulars, calendar ---------- */
html body table[bgcolor="#EBFDB3"] {
  width: 340px;
  margin-top: 24px;
  padding: 24px 28px 18px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border-spacing: 0 10px;
}
html body table[bgcolor="#EBFDB3"] img[src*="login.png"] { display: none; }
html body table[bgcolor="#EBFDB3"] td:has(> img[src*="login.png"])::before {
  content: "เข้าสู่ระบบ My School";
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
html body table[bgcolor="#EBFDB3"] td[width="87"] {
  width: 84px;
  padding-right: 12px;
  font-size: 14px;
  color: var(--muted);
  vertical-align: middle;
}
html body table[bgcolor="#EBFDB3"] input[type="text"],
html body table[bgcolor="#EBFDB3"] input[type="password"] { width: 100%; box-sizing: border-box; }
html body table[bgcolor="#EBFDB3"] td:has(> input[type="submit"]) { font-size: 0; text-align: center; }
html body table[bgcolor="#EBFDB3"] td:has(> input[type="submit"]) input[type="submit"] {
  display: block;
  width: 100%;
  margin: 6px 0 12px;
}
html body table[bgcolor="#EBFDB3"] td:has(> input[type="submit"]) a { font-size: 13px; margin: 0 8px; }

html body table[width="550"][bgcolor="FFFFFF"] {
  width: 100%;
  max-width: 640px;
  margin-top: 8px;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  font-size: 14px;
}
html body table[width="550"][bgcolor="FFFFFF"] font[face] { display: block; margin-bottom: 8px; }

html body center:has(> table.calendar, > table.calendars, > table.calendarcar, > table.calendarswork) {
  display: block;
  margin-top: 28px;
  font-family: var(--font-display) !important;
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}
/* Calendars: meetings (.calendar / .calendars), vehicles (.calendarcar), work (.calendarswork).
   The page runs in quirks mode, so class names match regardless of case. */
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) {
  width: 100%;
  max-width: 720px;
  margin: 12px auto 32px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 15px;
  font-weight: 400;
}
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) td {
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
}
html body :is(.calendarHeader, .calendarsHeader, .calendarcarHeader, .calendarsworkHeader) {
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  padding: 4px 0;
}
html body :is(.calendarHeader, .calendarsHeader, .calendarcarHeader, .calendarsworkHeader)[colspan] {
  font-family: var(--font-display) !important;
  font-size: 21px !important;
  color: var(--ink) !important;
  vertical-align: middle;
}
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) > tbody > tr:first-child > td:not([colspan]) {
  vertical-align: middle;
}
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) > tbody > tr:first-child > td:not([colspan]) a {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) > tbody > tr:first-child > td:not([colspan]) a:hover {
  background: #DEDEE3;
}
html body :is(td.calendar, td.calendars, td.calendarcar, td.calendarswork,
              td.calendarToday, td.calendarsToday, td.calendarcarToday, td.calendarsworkToday):not(:has(table[class])) {
  height: 44px;
  vertical-align: middle;
  border-radius: var(--radius-sm);
  font-weight: 400;
}
html body :is(td.calendar, td.calendars, td.calendarcar, td.calendarswork):not(:has(table[class])):hover {
  background: var(--parchment);
}
html body :is(td.calendarToday, td.calendarsToday, td.calendarcarToday, td.calendarsworkToday) {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
}
/* Days that have a booking: the old code puts a small table with a red number in the cell */
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) td table { background: transparent; }
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) td table tr { background: transparent !important; }
html body :is(table.calendar, table.calendars, table.calendarcar, table.calendarswork) td table font {
  color: var(--link);
  font-size: 15px;
}
html body :is(td.calendarToday, td.calendarsToday, td.calendarcarToday, td.calendarsworkToday) table font { color: #FFFFFF; }

/* Right column */
html body td[width="15%"][background] table[width="250"]:first-of-type {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-spacing: 0 2px;
}
html body td[width="15%"][background] table[width="250"] td[colspan] { text-align: left; }
html body td[width="15%"][background] table[width="250"] font[face] { font-size: 17px; }
html body td[width="15%"][background] table[width="250"] td { font-size: 13px; color: var(--ink-2); }
html body td[width="15%"][background] table[width="250"] td[width="50"] { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Footer ---------- */
html body table[background="images/125.jpg"] {
  background: var(--parchment);
  border-top: 1px solid var(--hairline);
}
html body table[background="images/125.jpg"] td { padding: 14px 24px 22px; }
html body table[background="images/125.jpg"] font {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Form controls ---------- */
html body input[type="text"], html body input[type="password"], html body input[type="email"],
html body input[type="number"], html body input[type="date"], html body input[type="search"],
html body input:not([type]), html body select, html body textarea {
  font-size: 15px;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  padding: 8px 12px;
  line-height: 1.3;
  box-shadow: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
html body select { padding-right: 28px; }
html body input[type="text"]:focus, html body input[type="password"]:focus, html body input[type="email"]:focus,
html body input[type="number"]:focus, html body input[type="date"]:focus, html body input[type="search"]:focus,
html body input:not([type]):focus, html body select:focus, html body textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
html body input[type="submit"], html body input[type="button"], html body button {
  -webkit-appearance: none;
  appearance: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  color: #FFFFFF;
  background: var(--primary);
  border: 0;
  border-radius: var(--pill);
  padding: 11px 21px;
  cursor: pointer;
}
html body input[type="submit"]:hover, html body input[type="button"]:hover, html body button:hover {
  background: var(--primary-hover);
}
html body input[type="submit"]:focus-visible, html body input[type="button"]:focus-visible, html body button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
html body input[type="reset"] {
  -webkit-appearance: none;
  appearance: none;
  font-size: 15px;
  color: var(--link);
  background: transparent;
  border: 1px solid var(--link);
  border-radius: var(--pill);
  padding: 10px 20px;
  cursor: pointer;
}

/* ---------- Signed-in menus ---------- */
html body #cpanel div.icon { margin: 8px; }
html body #cpanel div.icon a {
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  padding: 6px 8px;
}
html body #cpanel div.icon a:hover {
  border: 0;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--link);
  text-decoration: none;
}
html body #cpanel div.icon img { margin-top: 10px; margin-bottom: 4px; }

html body #cssmenu ul {
  background: rgba(29, 29, 31, 0.92);
  border-bottom: 0;
}
html body #cssmenu li a { color: var(--on-dark); font-weight: 400; font-size: 13px; }
html body #cssmenu li a:hover { color: #FFFFFF; }
html body #cssmenu li ul { background: rgba(29, 29, 31, 0.96); border-radius: 0 0 12px 12px; }
html body #cssmenu li ul a:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
html body #cssmenu .active > a { background: rgba(255, 255, 255, 0.12); }

/* ---------- Popups ---------- */
html body .highslide-html-content { border-radius: var(--radius-card); }
html body .control { font-size: 13px; }
