:root {
  --tsl-surface: rgba(255, 255, 255, 0.92);
  --tsl-surface-strong: #ffffff;
  --tsl-border: rgba(16, 32, 63, 0.1);
  --tsl-border-strong: rgba(16, 32, 63, 0.2);
  --tsl-shadow: 0 24px 70px rgba(16, 54, 120, 0.12);
  --tsl-success: #22c55e;
  --tsl-warning: #f97316;
  --tsl-danger: #ef4444;
  --tsl-info: #2563ff;
}

body.page-employee-dashboard,
body.page-client-portal,
body.page-online-seo {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 255, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(54, 193, 177, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.tsl-app-shell {
  min-height: 100vh;
  color: var(--ink, #10203f);
  font-family: var(--sans, "Plus Jakarta Sans", sans-serif);
}

.tsl-app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--tsl-border);
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(18px);
}

.tsl-app-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tsl-app-header-left h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-family: var(--serif, "Instrument Serif", serif);
  font-weight: 400;
  line-height: 0.96;
}

.tsl-app-kicker {
  margin: 0 0 8px;
  color: var(--amber-deep, #114fd9);
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tsl-app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tsl-back-link,
.tsl-ghost-button,
.tsl-menu-toggle,
.tsl-primary-button,
.tsl-secondary-link,
.tsl-action-button,
.tsl-danger-button,
.tsl-mini-button,
.tsl-control-card {
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tsl-back-link,
.tsl-ghost-button,
.tsl-menu-toggle,
.tsl-secondary-link,
.tsl-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tsl-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink, #10203f);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.tsl-primary-button,
.tsl-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--amber, #2563ff), var(--amber-deep, #114fd9));
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(37, 99, 255, 0.22);
}

.tsl-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff8f66, var(--tsl-danger));
  color: #16090a;
  font-size: 0.88rem;
  font-weight: 700;
}

.tsl-control-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border: 1px solid var(--tsl-border);
  border-radius: 24px;
  background: var(--tsl-surface);
  color: var(--ink, #10203f);
  box-shadow: var(--tsl-shadow);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.tsl-back-link:hover,
.tsl-ghost-button:hover,
.tsl-menu-toggle:hover,
.tsl-primary-button:hover,
.tsl-secondary-link:hover,
.tsl-action-button:hover,
.tsl-danger-button:hover,
.tsl-mini-button:hover,
.tsl-control-card:hover {
  transform: translateY(-1px);
}

.tsl-app-main {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.tsl-screen-shell {
  display: grid;
  gap: 24px;
}

.tsl-card-stack {
  display: grid;
  gap: 24px;
}

.tsl-panel,
.tsl-screen-card {
  border: 1px solid var(--tsl-border);
  border-radius: 28px;
  background: var(--tsl-surface);
  box-shadow: var(--tsl-shadow);
  padding: 24px;
}

.tsl-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.tsl-panel-head h2,
.tsl-screen-card h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.3vw, 2.2rem);
  font-family: var(--serif, "Instrument Serif", serif);
  font-weight: 400;
  line-height: 1;
}

.tsl-form-stack,
.tsl-form-grid {
  display: grid;
  gap: 16px;
}

.tsl-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tsl-span-2 {
  grid-column: 1 / -1;
}

.tsl-form-stack label,
.tsl-form-grid label {
  display: grid;
  gap: 8px;
}

.tsl-form-stack span,
.tsl-form-grid span,
.tsl-checklist legend {
  color: var(--ink, #10203f);
  font-size: 0.84rem;
  font-weight: 700;
}

.tsl-form-stack input,
.tsl-form-stack textarea,
.tsl-form-stack select,
.tsl-form-grid input,
.tsl-form-grid textarea,
.tsl-form-grid select,
.tsl-inline-search input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--tsl-border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink, #10203f);
  font-family: inherit;
  font-size: 0.95rem;
}

.tsl-form-stack input:focus,
.tsl-form-stack textarea:focus,
.tsl-form-stack select:focus,
.tsl-form-grid input:focus,
.tsl-form-grid textarea:focus,
.tsl-form-grid select:focus,
.tsl-inline-search input:focus {
  border-color: rgba(37, 99, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 255, 0.12);
  outline: none;
}

.tsl-form-grid textarea,
.tsl-form-stack textarea {
  resize: vertical;
}

.tsl-notice {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(37, 99, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink, #10203f);
  font-size: 0.95rem;
  font-weight: 700;
}

.tsl-stat-grid,
.tsl-control-grid,
.tsl-two-up,
.tsl-button-row,
.tsl-inline-actions {
  display: grid;
  gap: 14px;
}

.tsl-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tsl-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tsl-two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tsl-button-row,
.tsl-inline-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
}

.tsl-stat-card,
.tsl-credential-block,
.tsl-auto-fill-preview,
.tsl-checklist,
.tsl-schedule-card {
  border: 1px solid var(--tsl-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
}

.tsl-stat-card span,
.tsl-stat-card small,
.tsl-auto-fill-preview span {
  display: block;
  color: var(--ink-soft, #475a7c);
}

.tsl-stat-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 1.7rem;
  line-height: 1;
}

.tsl-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(37, 99, 255, 0.1);
  color: var(--amber-deep, #114fd9);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tsl-schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

.tsl-schedule-card strong,
.tsl-schedule-card span,
.tsl-schedule-card em,
.tsl-schedule-card small {
  display: block;
}

.state-off,
.state-on,
.state-on-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
}

.state-off {
  background: rgba(255, 115, 86, 0.18);
  color: #742311;
}

.state-on {
  background: rgba(34, 197, 94, 0.18);
  color: #136533;
}

.state-on-call {
  background: rgba(37, 99, 255, 0.16);
  color: #123f9b;
}

.tsl-status-toggle {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
}

.tsl-status-toggle.state-off {
  background: #ff8667;
  color: #16090a;
}

.tsl-status-toggle.state-on {
  background: #3ad47d;
  color: #08260f;
}

.tsl-status-toggle.state-on-call {
  background: #4d8dff;
  color: #041228;
}

.tsl-record-list {
  display: grid;
  gap: 12px;
}

.tsl-record-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--tsl-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.tsl-record-card strong,
.tsl-record-card a {
  color: var(--ink, #10203f);
  font-weight: 700;
}

.tsl-record-card small,
.tsl-record-card span {
  color: var(--ink-soft, #475a7c);
}

.tsl-record-card a {
  text-decoration: none;
}

.tsl-inline-search {
  min-width: min(280px, 100%);
}

.tsl-inline-delete-form {
  margin-top: 16px;
}

.tsl-map-frame {
  overflow: hidden;
  border: 1px solid var(--tsl-border);
  border-radius: 24px;
  background: #dde7fb;
}

.tsl-map-frame iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
}

.tsl-schedule-board {
  overflow-x: auto;
}

.tsl-schedule-board table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.tsl-schedule-board th,
.tsl-schedule-board td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--tsl-border);
  text-align: left;
  vertical-align: top;
}

.tsl-schedule-board th {
  color: var(--ink, #10203f);
  font-size: 0.82rem;
  font-weight: 700;
}

.tsl-schedule-board td small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft, #475a7c);
}

.tsl-menu-drawer {
  position: fixed;
  top: 94px;
  right: 24px;
  width: min(320px, calc(100% - 32px));
  display: none;
  padding: 18px;
  border: 1px solid var(--tsl-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--tsl-shadow);
}

.tsl-menu-drawer.is-open {
  display: block;
}

.tsl-menu-drawer-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.tsl-menu-links {
  display: grid;
  gap: 8px;
}

.tsl-menu-links a,
.tsl-menu-links span {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--tsl-border);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.9);
  color: var(--ink, #10203f);
  font-weight: 700;
  text-decoration: none;
}

.tsl-menu-links a.is-active {
  border-color: rgba(37, 99, 255, 0.28);
  background: rgba(37, 99, 255, 0.1);
}

.tsl-menu-links .is-disabled {
  opacity: 0.56;
}

.tsl-checklist {
  display: grid;
  gap: 10px;
}

.tsl-checklist label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tsl-checklist input {
  width: auto;
  margin-top: 2px;
}

.tsl-print-shell {
  min-height: 100vh;
  background: #fff;
  padding: 32px 16px;
}

.tsl-print-invoice {
  width: min(820px, 100%);
  margin: 0 auto;
  border: 1px solid #d7dce8;
  background: #fff;
  padding: 32px;
  color: #111827;
  font-family: "Times New Roman", serif;
}

.tsl-print-invoice h1,
.tsl-print-invoice h2 {
  margin-top: 0;
  font-family: "Times New Roman", serif;
}

.tsl-print-invoice table {
  width: 100%;
  border-collapse: collapse;
}

.tsl-print-invoice th,
.tsl-print-invoice td {
  padding: 10px 8px;
  border-bottom: 1px solid #d7dce8;
  text-align: left;
}

.tsl-portal-header .tsl-menu-toggle {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.22);
}

@media (max-width: 1100px) {
  .tsl-stat-grid,
  .tsl-control-grid,
  .tsl-two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tsl-schedule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tsl-app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tsl-app-main {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .tsl-form-grid,
  .tsl-stat-grid,
  .tsl-control-grid,
  .tsl-two-up,
  .tsl-schedule-grid {
    grid-template-columns: 1fr;
  }

  .tsl-record-card,
  .tsl-inline-actions,
  .tsl-button-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .tsl-record-card {
    align-items: flex-start;
  }

  .tsl-menu-drawer {
    top: 132px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}
