/*
 * TEMPORARY LOGIN-ONLY ORANGE THEME TRIAL
 * Authenticated dashboard, workspaces, and record pages retain the original
 * colour system. Remove the link from index.html to undo this trial.
 */

.login-screen {
  --ink: #211a17;
  --muted: #7c716c;
  --paper: #fff8f4;
  --white: #fff;
  --teal: #FF5A00;
  --teal-dark: #a93400;
  --aqua: #ffd0ba;
  --gold: #ffc1a3;
  --brand-orange: #FF5A00;
  --line: #efd8cd;
  --shadow: 0 24px 70px rgba(126, 38, 0, .16);
}

.login-screen .login-brand {
  color: #fff;
  background:
    radial-gradient(circle at 15% 85%, rgba(177, 44, 0, .34), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(255, 213, 188, .2), transparent 29%),
    linear-gradient(135deg, #ff6200 0%, #ff4b00 58%, #df3600 100%);
}

.login-screen .login-brand .techbott-india {
  color: #fff !important;
}

/* Reversible pre-login trial: horizontal supplied logo within the old title footprint. */
.login-screen .login-brand .company-title.login-logo-trial {
  display: block;
  width: min(100%, 700px);
  height: clamp(110px, min(15.3vw, 27vh), 220px);
  max-width: 700px;
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
  -webkit-text-stroke: 0;
}

.login-screen .login-brand .company-title.login-logo-trial > .login-logo-original {
  display: none;
}

.login-screen .login-brand .company-title.login-logo-trial > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-screen .login-brand .welcome-title,
.login-screen .login-brand .eyebrow,
.login-screen .brand-copy,
.login-screen .system-strip,
.login-screen .login-footer {
  color: #fff;
}

.login-screen .login-brand:before,
.login-screen .login-brand:after,
.login-screen .system-strip {
  border-color: rgba(255, 255, 255, .25);
}

.login-screen .login-panel {
  background: linear-gradient(155deg, #fff 0%, #fff8f4 68%, #fff0e8 100%);
}

.login-screen .input-wrap {
  border-color: #e9c8b8;
}

.login-screen .input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(255, 75, 0, .1);
}

.login-screen .field-icon,
.login-screen .reveal,
.login-screen .button-link,
.login-screen .security-note span,
.login-screen .eyebrow {
  color: var(--teal);
}

.login-screen .button-primary {
  background: linear-gradient(100deg, #ff4b00, #ff6200);
  box-shadow: 0 9px 24px rgba(255, 75, 0, .24);
}

.login-screen .button-primary:hover {
  background: linear-gradient(100deg, #e94100, #f55700);
}

/* Main authenticated header only */
.app-shell {
  padding-top: 76px;
  padding-bottom: 0;
}

.app-shell .workspace-view,
.app-shell .sidebar {
  min-height: calc(100vh - 76px);
}

.app-shell .home-view {
  height: calc(100dvh - 76px);
}

.app-shell > .topbar {
  --teal: #FF5A00;
  --teal-dark: #a93400;
  --line: rgba(255, 255, 255, .32);
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  color: #fff;
  background: linear-gradient(100deg, #ff6200 0%, #ff4b00 58%, #df3600 100%);
  border-bottom-color: #ce3300;
  box-shadow: 0 6px 20px rgba(126, 38, 0, .18);
}

.app-shell > .topbar .techbott-india {
  color: #fff !important;
}

.app-shell > .topbar .brand-button,
.app-shell > .topbar .topbar-context,
.app-shell > .topbar .account-copy strong {
  color: #fff;
}

.app-shell > .topbar .brand-button small,
.app-shell > .topbar .account-copy small {
  color: #ffe0d2;
}

.app-shell > .topbar .account-copy strong,
.app-shell > .topbar .account-copy small {
  font-weight: 800;
  font-synthesis: weight;
  -webkit-text-stroke: .2px currentColor;
}

/* Preserve the supplied logo artwork inside the original post-login brand footprint. */
.app-shell > .topbar .brand-button .post-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(104px, 10vw, 190px);
  height: 58px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 6px;
  background: #fff;
  border-radius: 6px;
}

.app-shell > .topbar .brand-button .post-login-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-shell > .topbar .topbar-date {
  color: #211a17;
  background: rgba(255, 255, 255, .96);
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 6px 18px rgba(126, 38, 0, .2);
}

.app-shell > .topbar .topbar-date > span:first-child {
  color: #211a17;
}

.app-shell > .topbar .topbar-date-meta strong {
  color: #FF5A00;
}

.app-shell > .topbar .topbar-date-meta small {
  color: #7c716c;
}

.app-shell > .topbar .live-chip {
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
}

.app-shell > .topbar .live-chip i {
  background: #fff;
}

/* Keep the existing topbar typography while rendering all date/status/time content in black. */
.app-shell > .topbar .topbar-date,
.app-shell > .topbar .topbar-date > span:first-child,
.app-shell > .topbar .topbar-date-meta strong,
.app-shell > .topbar .topbar-date-meta small,
.app-shell > .topbar .live-chip,
.app-shell > .topbar #appClock,
.app-shell > .topbar #appClockTime,
.app-shell > .topbar #appClockMeridiem {
  color: #000;
}

.app-shell > .topbar .live-chip i {
  background: #000;
}

.app-shell > .topbar #appClock {
  box-sizing: border-box;
  min-width: clamp(156px, 12.4vw, 210px);
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px clamp(11px, .9vw, 14px);
  white-space: nowrap;
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 500;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(126, 38, 0, .2);
}

.app-shell > .topbar #appClockTime {
  margin-left: 4px;
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 900;
}

.app-shell > .topbar #appClockMeridiem {
  margin-left: 2px;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 500;
}

@media (max-width: 1050px) {
  .app-shell > .topbar .topbar-date,
  .app-shell > .topbar .live-chip,
  .app-shell > .topbar .account-copy {
    display: none;
  }
}

.app-shell > .topbar .avatar {
  color: #000;
  font-weight: 800;
  background: #fff;
}

.app-shell > .topbar .button-logout {
  color: #000;
  font-weight: 800;
  background: #fff;
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 5px 14px rgba(126, 38, 0, .16);
}

.app-shell > .topbar .button-logout:hover {
  background: #fff4ee;
}

/* Preserve a visible gutter between the logo/date group and the Calculator. */
.app-shell > .topbar .brand-button + .topbar-context {
  margin-left: clamp(12px, 1vw, 18px);
}

.app-shell > .topbar .topbar-calculator-button {
  margin-left: clamp(8px, .65vw, 13px);
}

@media (max-width: 760px) {
  .app-shell > .topbar .brand-button + .topbar-context {
    margin-left: 0;
  }

  .app-shell > .topbar .topbar-calculator-button {
    margin-left: auto;
  }
}

/* Keep the post-login controls evenly separated and make Calculator a first-class header action. */
.app-shell > .topbar {
  gap: clamp(9px, 1.1vw, 22px);
  flex-wrap: nowrap;
  padding-inline: clamp(10px, 1.5vw, 34px);
}

/* The context group may grow to centre the date/clock pills, but it must never be
   squeezed narrower than the pills themselves. */
.app-shell > .topbar .topbar-context {
  flex: 1 1 auto;
  min-width: max-content;
  justify-content: center;
  gap: clamp(10px, 1.1vw, 18px);
  margin: 0 0 0 clamp(12px, 1vw, 18px);
}

.app-shell > .topbar .brand-button,
.app-shell > .topbar .topbar-calculator-button {
  flex: 0 0 auto;
}

/* If the width still runs short, the signed-in name is what gives way (ellipsis)
   instead of two header controls overlapping. */
.app-shell > .topbar .account {
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.app-shell > .topbar .avatar,
.app-shell > .topbar .button-logout {
  flex: 0 0 auto;
}

.app-shell > .topbar .account-copy {
  min-width: 0;
}

.app-shell > .topbar .account-copy strong,
.app-shell > .topbar .account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell > .topbar .topbar-calculator-button {
  min-width: clamp(92px, 7vw, 112px);
  min-height: 48px;
  padding: 10px 16px;
  color: #000;
  font-weight: 800;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(126, 38, 0, .16);
}

.app-shell > .topbar .topbar-calculator-button:hover,
.app-shell > .topbar .topbar-calculator-button[aria-expanded="true"] {
  color: #a93400;
  background: #fff4ee;
}

@media (max-width: 1050px) {
  .app-shell > .topbar .topbar-calculator-button {
    padding-inline: 12px;
  }
}

@media (max-width: 760px) {
  .app-shell > .topbar {
    gap: 9px;
  }

  .app-shell > .topbar .topbar-calculator-button {
    margin-left: auto;
  }

}

@media (max-width: 520px) {
  .app-shell > .topbar {
    gap: 6px;
    padding-inline: 10px;
  }

  .app-shell > .topbar .brand-button .post-login-brand {
    width: 118px;
    height: 52px;
  }

  .app-shell > .topbar .avatar {
    display: none;
  }

  .app-shell > .topbar .topbar-calculator-button {
    min-width: 82px;
    min-height: 42px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .app-shell > .topbar .button-logout {
    min-height: 42px;
    margin-left: 0;
    padding-inline: 9px;
    font-size: 11px;
  }
}

/* All four home workspace cards share the orange navigation colour system. */
.app-shell .workspace-card {
  color: #fff;
  background:
    radial-gradient(circle at 15% 85%, rgba(177, 44, 0, .34), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(255, 213, 188, .2), transparent 29%),
    linear-gradient(135deg, #ff6200 0%, #ff4b00 58%, #df3600 100%);
  border-color: rgba(0, 0, 0, .22);
}

.app-shell .workspace-card::before,
.app-shell .master-card::before,
.app-shell .hrms-card::before,
.app-shell .reports-card::before {
  background: #000;
}

.app-shell .workspace-card .module-db,
.app-shell .workspace-card strong,
.app-shell .workspace-card small,
.app-shell .workspace-card .open-link,
.app-shell .workspace-card .module-number {
  color: #fff;
}

.app-shell .workspace-card .module-number {
  opacity: 1;
}

.app-shell .workspace-card .module-icon,
.app-shell .master-card .module-icon,
.app-shell .hrms-card .module-icon,
.app-shell .reports-card .module-icon {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.app-shell .workspace-card:hover {
  border-color: #000;
  box-shadow: 0 18px 42px rgba(126, 38, 0, .28);
}

/* Home-only typography matches the TECHBOTT INDIA wordmark. */
.app-shell.home-active > .topbar,
.app-shell.home-active > .topbar button,
.app-shell .home-view,
.app-shell .home-view button,
.app-shell .home-view .hero-row h1,
.app-shell .home-view .workspace-card strong {
  font-family: "Mectto Geometric", Bahnschrift, "Arial Black", sans-serif;
  font-synthesis: none;
}

/* Numeric values retain Arial without changing their inherited sizes. */
.app-shell.home-active > .topbar #dateDay,
.app-shell.home-active > .topbar #dateYear,
.app-shell.home-active > .topbar .numeric-text,
.app-shell .home-view .numeric-text,
.app-shell .home-view .module-number {
  font-family: Arial, sans-serif;
  font-synthesis: initial;
}

.app-shell .home-view .workspace-card .module-db,
.app-shell .home-view .workspace-card small,
.app-shell .home-view .workspace-card .open-link {
  font-weight: 700;
  font-synthesis: weight;
}

/* Keep the workspace labels prominent and centred inside their buttons. */
.app-shell .home-view .workspace-card strong {
  font-size: clamp(15px, 1.15vw, 22px);
  font-weight: 800;
  font-synthesis: weight;
  line-height: 1.35;
}

.app-shell .home-view .workspace-card {
  display: grid;
  place-items: center;
  text-align: center;
}

.app-shell .home-view .workspace-card .module-number {
  position: absolute;
  top: clamp(14px, 1.5vw, 22px);
  right: auto;
  left: clamp(16px, 1.7vw, 25px);
  z-index: 2;
  color: #fff;
  font-family: "Mectto Geometric", Bahnschrift, "Arial Black", sans-serif;
  font-size: clamp(20px, 1.65vw, 30px);
  font-weight: 800;
  line-height: 1;
}

.app-shell .home-view .workspace-card .module-icon {
  position: absolute;
  top: clamp(15px, 2vw, 23px);
  left: clamp(15px, 2vw, 23px);
  margin: 0;
}

.app-shell .home-view .workspace-card .workspace-title {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: clamp(14px, 1.6vw, 24px);
  right: clamp(14px, 1.6vw, 24px);
  width: auto;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  transform: translateY(-50%);
  text-align: center;
  overflow-wrap: normal;
}

.app-shell .home-view .workspace-title-stacked span {
  display: block;
  white-space: nowrap;
}

@media (max-height: 700px) and (min-width: 761px) {
  .app-shell .home-view .workspace-card .workspace-title {
    top: 50%;
    font-size: clamp(18px, 1.2vw, 22px);
    line-height: 1.25;
  }
}

.app-shell .home-view .home-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-shell .home-view .home-status span:first-child {
  grid-column: 2;
  text-align: center;
}

.app-shell .home-view .home-status span:last-child {
  grid-column: 3;
  text-align: right;
}

@media (max-width: 1000px) {
  .login-screen .login-footer {
    color: #8b6f62;
  }
}

@media (max-width: 760px) {
  .app-shell .home-view .home-status {
    grid-template-columns: 1fr;
  }

  .app-shell .home-view .home-status span:first-child,
  .app-shell .home-view .home-status span:last-child {
    grid-column: 1;
    text-align: left;
  }
}

/* Module navigation uses the same orange colour system as the login page. */
.app-shell .sidebar {
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  background:
    radial-gradient(circle at 15% 85%, rgba(177, 44, 0, .34), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(255, 213, 188, .2), transparent 29%),
    linear-gradient(135deg, #ff6200 0%, #ff4b00 58%, #df3600 100%);
}

.app-shell .sidebar-back {
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  font-size: 13px;
  border-bottom-color: rgba(255, 255, 255, .25);
}

.app-shell .sidebar-heading h2,
.app-shell .sidebar-heading p,
.app-shell .sidebar-heading small,
.app-shell .sidebar-db strong,
.app-shell .sidebar-db small {
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
}

.app-shell .sidebar-heading p {
  font-size: 9px;
}

.app-shell .sidebar-heading h2 {
  font-size: 25px;
}

.app-shell .sidebar-heading small {
  font-size: 12px;
}

.app-shell .sidebar-db strong {
  font-size: 11px;
}

.app-shell .sidebar-db small {
  font-size: 9px;
}

.app-shell .employee-heading {
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  font-size: 10px;
  background: rgba(255, 255, 255, .16);
}

.app-shell .table-button {
  color: #000;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  font-size: 12px;
}

.app-shell .table-button::before {
  border-color: #000;
}

.app-shell .table-button:hover {
  color: #000;
  background: rgba(255, 255, 255, .16);
}

.app-shell .table-button.active {
  color: #000;
  background: #fff;
  box-shadow: 0 5px 14px rgba(126, 38, 0, .16);
}

.app-shell .table-button.active::before {
  background: #000;
  border-color: #000;
}

.app-shell .sidebar-db {
  border-top-color: rgba(255, 255, 255, .25);
}

/* Keep the HRMS title horizontal and reclaim vertical menu space. */
.workspace-view[data-module="hrms"] .sidebar {
  padding-right: 8px;
  padding-left: 8px;
}

.workspace-view[data-module="hrms"] .sidebar-heading {
  padding: 22px 0 14px;
}

.workspace-view[data-module="hrms"] .sidebar-heading h2 {
  white-space: nowrap;
  letter-spacing: -.02em;
}

.workspace-view[data-module="hrms"] .sidebar-heading p {
  margin-bottom: 6px;
}

.workspace-view[data-module="hrms"] .sidebar-heading small {
  margin-top: 5px;
}

@media (min-width: 761px) and (max-width: 1000px) {
  .workspace-view[data-module="hrms"] {
    grid-template-columns: 270px 1fr;
  }
}

/* User Security actions form a complete, non-scrolling vertical menu. */
.workspace-view[data-module="security"] .operation-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(6px, 1vh, 10px);
  padding: clamp(4px, 1vh, 10px) 0;
  margin-bottom: 0;
  overflow: visible;
  border-bottom: 0;
}

.workspace-view[data-module="security"] .operation-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(660px, calc(100% - 24px));
  min-width: 0;
  min-height: clamp(40px, 6.2vh, 52px);
  padding: 9px 18px;
  color: #536c69;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 5px 16px rgba(16, 55, 57, .06);
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.workspace-view[data-module="security"] .operation-tab:hover {
  color: #FF5A00;
  border-color: #ffb08d;
  background: #fff8f4;
}

/* Selected Master Data actions form complete, non-scrolling vertical menus. */
.workspace-view[data-module="master"] .operation-tabs:is(.tenant-operation-tabs, .company-operation-tabs, .departments-operation-tabs, .designations-operation-tabs, .authorization-operation-tabs, .title-operation-tabs, .employee-type-operation-tabs, .salary-type-operation-tabs, .attendance-type-operation-tabs) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(7px, 1.2vh, 11px);
  padding: clamp(5px, 1.2vh, 12px) 0;
  margin-bottom: 0;
  overflow: visible;
  border-bottom: 0;
}

.workspace-view[data-module="master"] .operation-tabs:is(.tenant-operation-tabs, .company-operation-tabs, .departments-operation-tabs, .designations-operation-tabs, .authorization-operation-tabs, .title-operation-tabs, .employee-type-operation-tabs, .salary-type-operation-tabs, .attendance-type-operation-tabs) .operation-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(660px, calc(100% - 24px));
  min-width: 0;
  min-height: clamp(42px, 7vh, 56px);
  padding: 10px 18px;
  color: #536c69;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 5px 16px rgba(16, 55, 57, .06);
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.workspace-view[data-module="master"] .operation-tabs:is(.tenant-operation-tabs, .company-operation-tabs, .departments-operation-tabs, .designations-operation-tabs, .authorization-operation-tabs, .title-operation-tabs, .employee-type-operation-tabs, .salary-type-operation-tabs, .attendance-type-operation-tabs) .operation-tab:hover {
  color: #FF5A00;
  border-color: #ffb08d;
  background: #fff8f4;
}

/* Security, Master Data, and Employee Details keep their identity blocks fixed while their table lists scroll. */
.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100vh - 76px);
  min-height: 0;
  overflow: hidden;
}

.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .sidebar-back,
.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .sidebar-heading,
.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .employee-heading,
.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .sidebar-db {
  flex: 0 0 auto;
}

.workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .table-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Master Data and Employee Details use the full sidebar height for navigation. */
.workspace-view:is([data-module="master"], [data-module="hrms"]) .sidebar-db {
  display: none;
}

.workspace-view:is([data-module="master"], [data-module="hrms"]) .table-list {
  padding-bottom: 12px;
}

@media (max-width: 760px) {
  .app-shell .sidebar {
    min-height: auto;
  }

  .workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .workspace-view:is([data-module="security"], [data-module="master"], [data-module="hrms"]) .table-list {
    flex: 0 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: auto;
  }
}

/* Keep every desktop workspace locked to the viewport so the orange sidebar
   always reaches the bottom; each side scrolls inside its own available area. */
@media (min-width: 761px) {
  .app-shell:not(.home-active) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .app-shell:not(.home-active) .workspace-view {
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
    min-height: 0;
    overflow: hidden;
  }

  .app-shell:not(.home-active) .workspace-view .sidebar {
    position: static;
    top: auto;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell:not(.home-active) .workspace-view .table-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .app-shell:not(.home-active) .workspace-view .work-area {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .app-shell:not(.home-active) .workspace-view[data-module="reports"] .work-area {
    overflow-y: hidden;
  }
}

/* Give long Master Data table names a wider single-line navigation area.
   The list reaches the sidebar's right edge so its scrollbar does not cover text. */
@media (min-width: 761px) {
  .workspace-view[data-module="master"] {
    grid-template-columns: clamp(340px, 25vw, 400px) minmax(0, 1fr);
  }

  .workspace-view[data-module="master"] .sidebar {
    padding-right: 0;
    padding-left: 12px;
  }

  .workspace-view[data-module="master"] .sidebar-back,
  .workspace-view[data-module="master"] .sidebar-heading {
    margin-right: 14px;
  }

  .workspace-view[data-module="master"] .table-list {
    width: 100%;
    padding-right: 10px;
    scrollbar-gutter: stable;
  }

  .workspace-view[data-module="master"] .table-button {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .workspace-view[data-module="master"] .table-button::before {
    flex: 0 0 5px;
  }
}

/* Persistent, user-acknowledged result for attendance-calendar updates. */
.attendance-calendar-result-dialog {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 34px 36px;
  text-align: center;
}

.attendance-calendar-result-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.attendance-calendar-result-dialog::backdrop {
  background: rgba(3, 30, 35, .68);
  backdrop-filter: blur(4px);
}

.attendance-calendar-result-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  border-radius: 50%;
  color: #17613f;
  background: #e1f3e9;
  font-size: 30px;
  font-weight: 900;
}

.attendance-calendar-result-dialog.error .attendance-calendar-result-mark {
  color: #a13232;
  background: #fde8e5;
}

.attendance-calendar-result-dialog h2 {
  margin-bottom: 10px;
  color: #123e42;
  font-size: 30px;
}

.attendance-calendar-result-dialog.error h2 {
  color: #973b3b;
}

.attendance-calendar-result-dialog p {
  max-width: 430px;
  margin: 0;
  color: #536c69;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.attendance-calendar-result-dialog .button {
  min-width: 120px;
  font-size: 15px;
}

/* Attendance Calendar view replaces free-text search with fiscal-year/month selectors. */
.attendance-calendar-editor .toolbar-search > div {
  display: block;
}

.attendance-calendar-editor #attendanceCalendarMonth {
  width: 100%;
  height: 37px;
  padding: 0 34px 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cedbd7;
  border-radius: 7px;
  font-size: 11px;
  outline: none;
}

.attendance-calendar-editor #attendanceCalendarMonth:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 111, 112, .08);
}

.attendance-calendar-editor #attendanceCalendarMonth:disabled {
  color: #82928f;
  background: #f1f4f2;
  cursor: not-allowed;
}

.attendance-calendar-download-mode .editor-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(230px, .8fr);
}

.attendance-calendar-download-mode .record-count {
  display: none;
}

.attendance-calendar-download-action > span {
  display: block;
  margin-bottom: 6px;
  color: #637875;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  visibility: hidden;
}

.attendance-calendar-download-action .button {
  width: 100%;
  min-height: 37px;
  padding: 8px 14px;
  white-space: nowrap;
}

.attendance-calendar-download-action .button:disabled {
  color: #849491;
  background: #dfe6e3;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.attendance-calendar-view-summary .form-meta,
.attendance-calendar-view-summary #dataForm,
.attendance-calendar-view-summary #formEmpty,
.attendance-calendar-view-summary .form-actions {
  display: none !important;
}

.attendance-calendar-custom-modify .form-meta,
.attendance-calendar-custom-modify #dataForm,
.attendance-calendar-custom-modify #formEmpty,
.attendance-calendar-custom-modify > .form-actions {
  display: none !important;
}

.attendance-calendar-download-mode .form-meta,
.attendance-calendar-download-mode #dataForm,
.attendance-calendar-download-mode #formEmpty,
.attendance-calendar-download-mode > .form-actions,
.attendance-calendar-download-mode .attendance-calendar-summary {
  display: none !important;
}

.attendance-calendar-download-dialog {
  width: min(500px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 22px;
  overflow: auto;
  border: 1px solid rgba(13, 111, 112, .16);
  border-radius: 16px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.attendance-calendar-download-dialog .eyebrow {
  margin-bottom: 6px;
  font-size: 8px;
  letter-spacing: .17em;
}

.attendance-calendar-download-dialog h2 {
  margin-bottom: 6px;
  color: #123d41;
  font-size: 24px;
  line-height: 1.2;
}

.attendance-calendar-selected-label {
  margin: 0 0 13px;
  color: #637875;
  font-size: 11px;
}

.attendance-calendar-selected-label strong {
  color: var(--teal);
}

.attendance-calendar-download-section {
  padding: 11px;
  border: 1px solid #d5e1dd;
  border-radius: 10px;
  background: #f8faf8;
}

.attendance-calendar-download-section h3 {
  margin: 0 0 7px;
  color: #526b68;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.attendance-calendar-download-section h3:not(:first-child) {
  margin-top: 10px;
}

.attendance-calendar-format-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.attendance-calendar-format-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid #cfddd9;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.attendance-calendar-format-options label:has(input:checked) {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 111, 112, .08);
}

.attendance-calendar-format-options input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
  accent-color: var(--teal);
}

.attendance-calendar-format-options span {
  color: #284c4e;
  font-size: 10px;
  font-weight: 750;
}

.attendance-calendar-format-options small {
  color: #7a8d89;
  font-size: 8px;
  font-weight: 650;
}

.attendance-calendar-download-section > input[type="email"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cfddd9;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  outline: none;
}

.attendance-calendar-download-section > input[type="email"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 111, 112, .08);
}

.attendance-calendar-download-section .button-block {
  min-height: 36px;
  margin-top: 9px;
  padding: 8px 14px;
  font-size: 10px;
}

.attendance-calendar-dialog-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  color: #748783;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .1em;
}

.attendance-calendar-dialog-divider::before,
.attendance-calendar-dialog-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d9e3e0;
}

.attendance-calendar-download-message {
  min-height: 14px;
  margin: 8px 2px 0;
  color: #536c69;
  font-size: 9px;
  line-height: 1.5;
}

.attendance-calendar-download-message.error {
  color: #a13e3e;
}

.attendance-calendar-download-message.success {
  color: #267351;
}

@media (max-width: 900px) {
  .attendance-calendar-download-mode .editor-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .attendance-calendar-download-dialog {
    width: calc(100% - 16px);
    padding: 18px 15px;
  }
}

.attendance-calendar-summary {
  padding: 14px;
  background: #f7faf8;
  border-top: 1px solid var(--line);
}

.attendance-calendar-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.attendance-calendar-summary-cards article {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d1dfdb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(12, 56, 58, .045);
}

.attendance-calendar-summary-cards span {
  display: block;
  color: #657a77;
  font-size: 8px;
  font-weight: 850;
  line-height: 1.35;
  text-transform: uppercase;
}

.attendance-calendar-summary-cards strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #123e42;
  font-size: clamp(16px, 1.25vw, 21px);
  line-height: 1.2;
}

.attendance-calendar-modify-panel {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #bcd4cf;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(12, 56, 58, .06);
}

.attendance-calendar-date-picker {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(260px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #d7e5e1;
  background: #eaf5f2;
}

.attendance-calendar-date-picker label,
.attendance-calendar-modify-field > span {
  color: #315d58;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.attendance-calendar-date-picker select,
.attendance-calendar-modify-field input,
.attendance-calendar-modify-field select,
.attendance-calendar-modify-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c6d8d4;
  border-radius: 8px;
  color: #173f42;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.attendance-calendar-modify-field input[readonly] {
  color: #516a66;
  background: #eef3f1;
}

.attendance-calendar-modify-fields {
  padding: 18px;
}

.attendance-calendar-date-empty {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: #6b7f7c;
  text-align: center;
}

.attendance-calendar-date-empty strong {
  color: #234b4d;
  font-size: 15px;
}

.attendance-calendar-binary-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 4px solid #0d7773;
  border-radius: 7px;
  color: #315d58;
  background: #eaf5f2;
  font-size: 11px;
}

.attendance-calendar-binary-note strong {
  margin-right: 6px;
  color: #0d5e5e;
}

.attendance-calendar-binary-note span {
  padding: 4px 8px;
  border-radius: 15px;
  background: #fff;
  font-weight: 800;
}

.attendance-calendar-modify-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.attendance-calendar-modify-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.attendance-calendar-modify-field-wide {
  grid-column: span 2;
}

.attendance-calendar-modify-field textarea {
  min-height: 82px;
  resize: vertical;
}

.attendance-calendar-modify-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #dde7e4;
}

.attendance-calendar-holidays {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #d1dfdb;
  border-radius: 12px;
  background: #fff;
}

.attendance-calendar-holidays-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #dce6e3;
  background: #edf6f3;
}

.attendance-calendar-holidays-head small {
  color: #0d6f70;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.attendance-calendar-holidays-head h2 {
  margin: 3px 0 0;
  color: #173f42;
  font: 500 20px/1.2 Georgia, serif;
}

.attendance-calendar-holidays-head > span {
  padding: 6px 10px;
  border-radius: 20px;
  color: #315d58;
  background: #dcece8;
  font-size: 9px;
  font-weight: 850;
}

.attendance-calendar-holiday-table-wrap {
  max-height: 340px;
  overflow: auto;
}

.attendance-calendar-holiday-table {
  width: 100%;
  min-width: 900px;
}

.attendance-calendar-holiday-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 13px;
  background: #f4f7f5;
}

.attendance-calendar-holiday-table td {
  padding: 11px 13px;
  color: #354f4c;
  vertical-align: middle;
}

.attendance-calendar-holiday-table th:first-child,
.attendance-calendar-holiday-table td:first-child {
  width: 125px;
  white-space: nowrap;
}

.attendance-calendar-holiday-table th:nth-child(2),
.attendance-calendar-holiday-table td:nth-child(2) {
  width: 105px;
  white-space: nowrap;
}

.attendance-calendar-holiday-table th:nth-child(3),
.attendance-calendar-holiday-table td:nth-child(3) {
  width: 180px;
}

.attendance-calendar-holiday-table th:nth-child(4),
.attendance-calendar-holiday-table td:nth-child(4) {
  width: 220px;
}

.attendance-calendar-modifications {
  margin-top: 18px;
  border-color: #b8d3ce;
}

.attendance-calendar-modifications .attendance-calendar-holiday-table-wrap {
  overflow-x: hidden;
}

.attendance-calendar-modified-table {
  min-width: 0;
  table-layout: fixed;
}

.attendance-calendar-modified-table th,
.attendance-calendar-modified-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.attendance-calendar-modified-table th:first-child,
.attendance-calendar-modified-table td:first-child {
  width: 9%;
  white-space: normal;
}

.attendance-calendar-modified-table th:nth-child(2),
.attendance-calendar-modified-table td:nth-child(2) {
  width: 7%;
  white-space: normal;
}

.attendance-calendar-modified-table th:nth-child(3),
.attendance-calendar-modified-table td:nth-child(3) {
  width: 10%;
}

.attendance-calendar-modified-table th:nth-child(4),
.attendance-calendar-modified-table td:nth-child(4) {
  width: 9%;
}

.attendance-calendar-modified-table th:nth-child(5),
.attendance-calendar-modified-table td:nth-child(5) {
  width: 8%;
}

.attendance-calendar-modified-table th:nth-child(6),
.attendance-calendar-modified-table td:nth-child(6) {
  width: 13%;
}

.attendance-calendar-modified-table th:nth-child(7),
.attendance-calendar-modified-table td:nth-child(7) {
  width: 8%;
}

.attendance-calendar-modified-table th:nth-child(8),
.attendance-calendar-modified-table td:nth-child(8) {
  width: 20%;
}

.attendance-calendar-modified-table th:nth-child(9),
.attendance-calendar-modified-table td:nth-child(9) {
  width: 16%;
}

.attendance-calendar-status-pill,
.attendance-calendar-flag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.attendance-calendar-status-pill {
  color: #155854;
  background: #e2f1ed;
}

.attendance-calendar-flag.is-true {
  color: #0c625e;
  background: #dff2ec;
}

.attendance-calendar-flag.is-false {
  color: #6c7775;
  background: #edf1ef;
}

.attendance-calendar-no-holidays {
  padding: 24px !important;
  color: #6b7f7c !important;
  text-align: center;
}

.attendance-calendar-edit-record {
  padding: 6px 10px;
  border: 1px solid #78aaa3;
  border-radius: 6px;
  color: #0d6f70;
  background: #fff;
  font-size: 9px;
  font-weight: 850;
}

.attendance-calendar-edit-record:hover {
  color: #fff;
  background: #0d6f70;
}

@media (max-width: 1100px) {
  .attendance-calendar-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-calendar-modify-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .attendance-calendar-summary {
    padding: 12px;
  }

  .attendance-calendar-summary-cards {
    grid-template-columns: 1fr;
  }

  .attendance-calendar-holidays-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .attendance-calendar-date-picker,
  .attendance-calendar-modify-grid {
    grid-template-columns: 1fr;
  }

  .attendance-calendar-modify-field-wide {
    grid-column: auto;
  }
}

/* Customer Details uses the established dashboard card treatment. */
.app-shell .customer-card:before { background: #a34d00; }
.app-shell .customer-card .module-icon { background: rgba(255,255,255,.18); color: #fff; }

/* Keep reports in the first column of the second row after the four-card row. */
@media (min-width: 1101px) { .app-shell .home-view .reports-card { grid-column: 1; } }

.app-shell .customer-section-button:disabled,.app-shell .customer-operation:disabled{cursor:not-allowed;opacity:.6;}
