:root {
  --primary: #1a2b5c;
  --accent: #2d8a3e;
  --primary-d: #152247;
  --accent-d: #257534;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1c2530;
  --muted: #6b7683;
  --border: #e4e8ef;
  --green: #2e7d32;
  --amber: #b7791f;
  --red: #b23a3a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-wrap {
  flex: 1; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
.login-brand { display: flex; justify-content: center; margin-bottom: 12px; }
.login-brand .logo-img.lg { height: 64px; max-width: 240px; background: transparent; }
.login-card {
  background: var(--card); width: 100%; max-width: 400px; border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25); padding: 32px;
}
.login-card h1 { margin: 0 0 4px; color: var(--primary); font-size: 22px; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); }
.login-card label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 13px; }
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background-color: #fff !important;
  background-image: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.login-card input.has-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 99999s ease-out;
  caret-color: var(--text);
}
.login-password-wrap {
  position: relative;
}
.login-password-wrap input {
  padding-right: 44px;
}
.login-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  border-radius: 6px;
  background: transparent !important;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: none !important;
}
.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: #f1f5f9 !important;
  color: var(--primary);
  outline: none;
}
.login-password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}
.login-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 0;
}
.login-forgot-link {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  background: transparent !important;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
}
.login-forgot-link:hover {
  text-decoration: underline;
  background: transparent !important;
}
.login-error-banner {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #f0c4c4;
  background: #fff5f5;
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
  min-height: 0;
}
.login-error-banner:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}
.login-card .login-submit {
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
  font-size: 14px;
}
.login-card a.btn,
.login-card .login-google-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
  font-weight: 600;
}
.login-card .login-google-btn:hover {
  background: #f8fafc;
  text-decoration: none;
}
.login-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.login-card .login-hint {
  font-size: 12px;
  margin: 12px 0 0;
  text-align: center;
}
.login-card .login-alt-link {
  width: 100%;
  margin-top: 16px;
  padding: 8px 12px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-card .login-alt-link:hover {
  background: #eef2f8;
}
.login-card .login-alt-link-muted {
  color: #b0b8c4;
  font-weight: 500;
  font-size: 12px;
}
.login-card .login-alt-link-muted:hover {
  color: #8a93a3;
  background: transparent;
  text-decoration: underline;
}
.login-card form label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 13px; }
.login-card form label:first-of-type { margin-top: 0; }
/* Email-first sign-in: the email chosen in step 1, with a way back */
.login-who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f9fc;
  font-size: 13px;
}
.login-who-email { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-product-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* ---------- Public product page & trial form ---------- */
.product-page { --product-width: 1320px; background: var(--bg); }
.product-page a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.product-page .btn.ghost { background: #eef2f8; color: var(--primary); }
.product-page .btn.ghost:hover { background: #e2e8f2; }
.product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px max(20px, calc((100% - var(--product-width)) / 2 + 20px));
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.product-brand { display: inline-flex; align-items: center; text-decoration: none !important; }
.product-logo { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: 0.01em; }
.product-top-actions { display: flex; gap: 8px; }
.product-main { flex: 1; width: 100%; max-width: var(--product-width); margin: 0 auto; padding: 0 20px 20px; }
/* Hero: text, call to action and feature list on the left; the matching screen on the right. */
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 36px;
  align-items: start;
  padding: 14px 0 8px;
}
.product-band h1 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; color: var(--primary); }
.product-band .product-lead { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.product-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-btn-lg { padding: 11px 22px; font-size: 15px; border-radius: 10px; }
.product-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.product-cta .product-note { margin: 0; }
.product-explorer-label {
  margin: 22px 0 8px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
}
.product-feature-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eaf5ec;
  color: var(--accent);
}
.product-feature-icon .ui-icon { width: 18px; height: 18px; }

/* Feature explorer: feature list on the left, the matching screen on the right; screens cross-fade. */
.product-explorer { scroll-margin-top: 20px; }
.product-explorer-list { display: flex; flex-direction: column; gap: 4px; }
.product-explorer-item { border: 1px solid transparent; border-radius: 12px; }
.product-explorer-item.is-active { background: var(--card); border-color: var(--border); box-shadow: var(--shadow); }
.product-page button.product-explorer-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  color: var(--primary);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  text-align: left;
}
.product-page button.product-explorer-tab:hover { background: rgba(30, 58, 110, 0.05); }
.product-explorer-item.is-active button.product-explorer-tab:hover { background: transparent; }
.product-explorer-detail { display: none; padding: 0 12px 10px 54px; }
.product-explorer-item.is-active .product-explorer-detail { display: block; }
.product-explorer-detail h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.product-explorer-detail ul { list-style: none; margin: 0; padding: 0; }
.product-explorer-detail li {
  position: relative;
  margin-bottom: 3px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.product-explorer-detail li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.product-explorer-detail .product-tags { margin-top: 8px; }

/* Smaller features: one slim row under the explorer. */
.product-extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.product-extra { display: flex; align-items: flex-start; gap: 12px; }
.product-extra h3 { margin: 2px 0 2px; font-size: 14px; color: var(--primary); }
.product-extra p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Welcome band above the hero: illustration and a short line side by side. */
.product-band {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding: 8px 28px 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.product-band p { margin: 0; color: var(--muted); }
.product-band-art { display: block; width: 100%; max-height: 120px; object-fit: contain; }

.product-preview-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.16);
}
.product-preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  background: #eef2f7;
  border-bottom: 1px solid var(--border);
}
.product-preview-dot { width: 10px; height: 10px; border-radius: 50%; background: #d3dae5; }
.product-preview-url {
  flex: 0 1 360px;
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-preview-screens { position: relative; aspect-ratio: 1280 / 800; background: #f4f6fa; }
.product-preview-screens img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.product-preview-screens img.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .product-preview-screens img { transition: none; }
}

.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.product-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
}

/* Footer for the public pages (the app keeps its own dark footer). */
.product-footer { margin-top: 20px; background: var(--card); border-top: 1px solid var(--border); }
.product-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  max-width: var(--product-width);
  margin: 0 auto;
  padding: 22px 20px 14px;
}
.product-footer-brand p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.product-footer-brand .product-footer-stage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.product-footer h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product-footer nav a,
.product-footer nav button {
  display: block;
  padding: 4px 0;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.product-footer nav a:hover,
.product-footer nav button:hover { background: none; color: var(--accent); text-decoration: underline; }
.product-footer-bottom {
  width: calc(100% - 40px);
  max-width: calc(var(--product-width) - 40px);
  margin: 0 auto;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}
.trial-card { max-width: 720px; margin: 36px auto 0; padding: 24px; }
.trial-card h1 { margin: 0 0 6px; font-size: 24px; color: var(--primary); }
.trial-head { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 20px; margin-bottom: 14px; }
.trial-head p { margin: 0; }
.trial-head-art { display: block; width: 100%; height: auto; }
.trial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.trial-captcha { min-height: 65px; margin-top: 4px; }
/* "Continue with Google" above the trial form */
.trial-sso { margin: 4px 0 14px; }
.trial-sso-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.trial-sso-buttons .trial-sso-btn { flex: 1 1 220px; }
.product-page button.trial-sso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 10px 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.product-page button.trial-sso-btn:hover { background: #f8fafc; }
.trial-sso-btn .login-google-icon { width: 18px; height: 18px; }
.trial-sso-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.trial-sso-or::before,
.trial-sso-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.trial-sso-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #cfe6d2;
  border-radius: 10px;
  background: #f0f7f1;
  color: var(--green);
  font-size: 13.5px;
}
.trial-card input.is-verified { background: #f4f6fa; color: var(--muted); }
.trial-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* Spam trap: kept off-screen rather than display:none, which some bots skip. */
.trial-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 800px) {
  .trial-grid { grid-template-columns: 1fr; }
  .trial-head { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .trial-head-art { max-width: 220px; margin: 0 auto; }
  .product-page .product-top a.product-top-trial { display: none; }
  /* Phones: headline and button first, then the screen, then the feature list. */
  .product-hero { grid-template-columns: 1fr; gap: 0; padding: 24px 0 0; text-align: center; }
  .product-hero-text { display: contents; }
  .product-cta { order: 0; }
  .product-cta { justify-content: center; }
  .product-hero .product-preview-frame { order: 1; margin-top: 20px; }
  .product-explorer-label { order: 2; margin-top: 20px; text-align: center; }
  .product-explorer-list { order: 2; text-align: left; }
  .product-explorer-detail { padding: 0 12px 10px; }
  .product-extras { grid-template-columns: 1fr; }
  .product-footer-inner { grid-template-columns: 1fr 1fr; }
  .product-band { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 8px 14px 8px 8px; }
  .product-band h1 { font-size: 20px; }
  .product-band .product-lead { font-size: 13px; }
  .product-footer-brand { grid-column: 1 / -1; }
}
/* Settings → Website & trials */
.trial-table td { vertical-align: top; }
.trial-table .tr-notes { width: 220px; }
.trial-row-new td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.trial-message { margin-top: 6px; font-size: 12.5px; white-space: pre-wrap; max-width: 320px; }
.demo-hint {
  margin-top: 18px; font-size: 12.5px; color: var(--muted);
  background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.demo-hint code { color: var(--primary); }
.error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w, 196px) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--primary);
  color: #dfe7f3;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 14px;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.brand b { color: #fff; font-size: 16px; }
.nav { flex: 1; }
.ui-icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: #e3eaf6; margin-bottom: 2px; font-weight: 500; font-size: 13.5px;
}
.nav a .ui-icon { opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a.active .ui-icon { opacity: 1; }
.side-group { margin: 2px 0 6px; }
.nav a.side-group-head.current { color: #fff; }
.nav a.side-group-head .chip-notif-badge { margin-left: auto; }
.nav a.side-sub { padding: 6px 10px 6px 30px; font-size: 12.5px; margin-bottom: 1px; }
.nav a.side-sub.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.side-items { margin: 0 0 4px 30px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.nav a.side-item {
  display: block; padding: 4px 10px 4px 10px; margin: 0; border-radius: 0 6px 6px 0;
  font-size: 12px; font-weight: 400; color: #c7d3e6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav a.side-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav a.side-item.is-muted { opacity: 0.6; }
.side-row { position: relative; margin-bottom: 2px; }
.nav .side-row > a { margin-bottom: 0; padding-right: 32px; }
.nav button.side-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  opacity: 0.85;
}
.nav button.side-toggle:hover { background: rgba(255, 255, 255, 0.14); color: #fff; opacity: 1; }
.nav button.side-toggle span { display: inline-block; transition: transform 0.15s; }
.nav button.side-toggle[aria-expanded="true"] span { transform: rotate(90deg); }
.company-tabs { margin: 4px 0 12px; }
.tabs a.tab-link {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #eef2f8; color: var(--primary); text-decoration: none;
}
.tabs a.tab-link:hover { background: #e2e9f3; }
.tabs a.tab-link.active { background: var(--accent); color: #fff; }
.sidebar-clock {
  margin: 0 0 10px;
  padding: 4px 10px;
  text-align: left;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
}
.sidebar-clock-date {
  font-size: 12px;
  font-weight: 700;
  color: #5eead4;
  white-space: nowrap;
}
.sidebar-clock-time {
  font-size: 12px;
  font-weight: 600;
  color: #99f6e4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-top: 0;
}
.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar-foot .sidebar-clock { margin: 0 0 6px; }
.sidebar-last-login {
  margin: 0;
  padding: 0 10px 4px;
}
.sidebar-last-login-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9db0cc;
}
.sidebar-last-login-value {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #e8eef8;
  line-height: 1.35;
}
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 8px;
  z-index: 15;
  cursor: col-resize;
  touch-action: none;
}
.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}
.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
body.is-resizing-sidebar .sidebar-resizer::after { background: var(--accent); }
.sidebar-resizer:focus-visible { outline: none; }
body.is-resizing-sidebar { cursor: col-resize; user-select: none; }
body.is-resizing-sidebar iframe { pointer-events: none; }
.topbar {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.topbar-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.topbar-welcome-slot {
  justify-self: start;
  min-width: 0;
}
.topbar-row-main .topbar-actions {
  justify-self: end;
}
.topbar-tagline {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  max-width: min(40rem, 100%);
  padding: 6px 8px 6px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3faf5 0%, #e8f1ea 100%);
  border: 1px solid #c5dbc9;
  color: #1a4d2e;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: normal;
  text-align: center;
  box-shadow: 0 1px 0 rgba(45, 138, 62, 0.06);
}
.topbar-product {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2d8a3e 0%, #1f6b2e 100%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(45, 138, 62, 0.35);
}
/* Pre-release marker (APP_RELEASE_STAGE in app.js) */
.release-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff4d6;
  border: 1px solid #f0c75e;
  color: #7a4b00;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: help;
}
.release-badge--topbar { margin-left: 8px; box-shadow: none; }
.release-badge--phone { display: none; }
.release-badge--footer { cursor: default; }
.login-stage { margin: 2px 0 6px; }
.app-footer .footer-stage { display: inline-flex; align-items: center; gap: 8px; color: #fbe7b5; }
.topbar-tagline-text {
  padding-right: 10px;
  color: #1a4d2e;
  font-size: 11px;
  font-weight: 600;
}
.preview-sidebar-banner {
  margin: 0 0 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #e8f1ea;
  border: 1px solid #c5dbc9;
  color: #1a4d2e;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.topbar-tagline-spacer { width: 0; height: 0; }
.topbar-row-links { align-items: flex-start; }
.topbar-row-compact { justify-content: flex-end; }
.topbar-welcome { min-width: 0; }
.topbar-welcome-title { font-size: 17px; font-weight: 700; color: var(--primary); line-height: 1.25; }
.topbar-welcome-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-links {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-width: 0; width: 100%;
}
.topbar-chip { font-size: 13px; padding: 6px 12px; white-space: nowrap; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.topbar-chip .ui-icon { width: 15px; height: 15px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn .ui-icon { width: 15px; height: 15px; }
.notification-bell { display: inline-flex; align-items: center; justify-content: center; }
.topbar-chip.active { background: var(--accent); color: #fff; }
.topbar-chip.active:hover { background: var(--accent-d); color: #fff; }
button.topbar-chip-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
button.topbar-chip-btn:hover { background: #e2e9f3; }
.notepad-hint { margin: 0 0 10px; font-size: 13px; }
.notepad-textarea {
  width: 100%;
  min-height: 280px;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  user-select: text;
  -webkit-user-select: text;
}
.notepad-toolbar {
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.notepad-clear-confirm {
  margin-top: 10px;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: #fef2f2;
  border-radius: 8px;
}
#notepadStatus.error { color: var(--red); }
.chip-notif-badge {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
  margin-left: 6px; border-radius: 999px; background: var(--amber); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1; vertical-align: middle;
}
.chip-notif-badge[hidden] { display: none; }
.topbar-chip.active .chip-notif-badge { background: #fff; color: var(--amber); }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.notification-bell { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--amber); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center;
}
.notif-panel {
  position: fixed; z-index: 1200; width: min(380px, calc(100vw - 24px)); max-height: 420px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.notif-panel-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.notif-panel-foot {
  padding: 8px 12px 10px; font-size: 11px; line-height: 1.4; border-top: 1px solid var(--border);
  background: #fafbfd;
}
.notif-list { max-height: 360px; overflow: auto; }
.notif-item {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px;
  border: none; border-bottom: 1px solid #eef1f6; background: #fff; cursor: pointer;
  color: var(--text); font: inherit; font-size: 14px; border-radius: 0;
  box-shadow: none;
}
.notif-item:hover { background: #f4f7fb; }
.notif-item.unread { background: #eef4ff; box-shadow: inset 3px 0 0 var(--accent); }
.notif-item b { display: block; color: var(--primary); font-size: 13px; margin-bottom: 2px; }
.notif-icon { font-size: 18px; line-height: 1.2; flex: none; margin-top: 2px; }
.notif-body { min-width: 0; flex: 1; }
.notif-text { font-size: 12.5px; margin-top: 2px; line-height: 1.45; color: var(--text); }
.notif-time { font-size: 11px; margin-top: 5px; color: var(--muted); }
.notif-empty { padding: 14px 12px; color: var(--muted); }
.announcement-feedback {
  border: 1px solid #e8edf4; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fafbfd;
}
.announcement-feedback.removed { background: #fffaf5; border-color: #f0e2c8; }
.topbar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 10px;
  color: inherit; text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.topbar-profile:hover { background: #f4f6fa; text-decoration: none; }
.topbar-profile.active { background: #eaf2fb; border-color: #c5daf0; }
.topbar-profile-meta { line-height: 1.25; }
.topbar-profile-name { font-weight: 600; font-size: 14px; color: var(--text); }
.topbar-profile-title { font-size: 12px; color: var(--muted); }
.content { padding: 24px; flex: 1; }

/* ---------- Footer ---------- */
.app-footer {
  background: var(--primary); color: #dfe7f3; margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.08);
}
.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e8eef8;
}
.app-footer .footer-copy { text-align: center; }
.app-footer .footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-footer .footer-sep {
  color: rgba(232, 238, 248, 0.35);
  font-size: 11px;
}
.software-about-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 11px;
  color: rgba(232, 238, 248, 0.55);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.software-about-link:hover { color: rgba(232, 238, 248, 0.92); }
.feedback-hint { margin: 0 0 12px; font-size: 13px; }
.feedback-stars {
  display: flex;
  gap: 6px;
  align-items: center;
}
.feedback-star {
  background: transparent;
  border: none;
  padding: 0 2px;
  font-size: 28px;
  line-height: 1;
  color: #c5cdd8;
  cursor: pointer;
}
.feedback-star.on { color: #e6a817; }
.feedback-star:hover { transform: scale(1.08); }
.feedback-comment {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
}
.feedback-rating-cell { color: #e6a817; letter-spacing: 1px; white-space: nowrap; }
.login-page .app-footer { background: var(--primary); }
.page-title { margin: 0 0 4px; font-size: 22px; color: var(--primary); }
.page-sub { margin: 0 0 20px; color: var(--muted); }
.settings-lead {
  margin: 6px 0 0;
  max-width: 36rem;
  line-height: 1.4;
  font-size: 13px;
}
.settings-section-head {
  margin-bottom: 4px;
}
.settings-section-title-row {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.settings-section-title-row h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}
.settings-section-actions {
  margin-left: auto;
  flex-shrink: 0;
}
.settings-tab-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.settings-tab-group .tabs {
  margin-bottom: 0;
}
.settings-tab-group-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  margin: 0 0 6px;
}
.settings-danger-zone {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid #f0c4c4;
  border-radius: 12px;
  background: #fff8f8;
}
.settings-danger-zone h4 {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 15px;
}
.settings-danger-zone p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
}
.emp-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.emp-row-actions-extra {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.emp-row-actions-extra[hidden] {
  display: none !important;
}
.emp-actions-toggle {
  min-width: 28px;
  padding-left: 8px;
  padding-right: 8px;
  letter-spacing: 0.05em;
}
.emp-actions-toggle[aria-expanded="true"] {
  background: var(--border);
}
.req { color: var(--red); font-weight: 600; }
.is-hidden { display: none !important; }

.profile-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.profile-toolbar a.muted { color: var(--primary); font-weight: 500; }
.profile-toolbar a.muted:hover { text-decoration: underline; }

/* ---------- Components ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.avatar-photo, img.avatar {
  object-fit: cover; display: block; flex: none;
}
.avatar.avatar-photo.sm, img.avatar.sm { width: 30px; height: 30px; }
.avatar.avatar-photo.lg, img.avatar.lg { width: 72px; height: 72px; font-size: 24px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); align-items: stretch; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-2 > .card,
.grid.cols-3 > .card,
.grid.cols-2 > .content-card,
.grid.cols-2 > .announcement-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Content cards end where their text ends instead of stretching to the tallest card in the row. */
.grid.content-grid { align-items: start; }
.grid.content-grid > .card { height: auto; }
.grid.content-grid .content-card-cta { margin-top: 0; padding-top: 12px; justify-content: flex-start; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--primary); }
.card.click { cursor: pointer; transition: transform .08s, box-shadow .08s; }
.card.click:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }

.emp-card { display: flex; gap: 12px; align-items: center; }
.emp-card .meta { min-width: 0; }
.emp-card .name { font-weight: 700; }
.emp-card .muted { color: var(--muted); font-size: 12.5px; }
.emp-card.is-absent { border-color: #f0c7a0; background: #fffaf5; }
.emp-avatar-wrap { position: relative; flex-shrink: 0; }
.emp-avatar-wrap.is-absent::after,
.emp-avatar-wrap.is-present::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
}
.emp-avatar-wrap.is-present::after { background: var(--green, #2f9e64); }
.emp-avatar-wrap.is-absent::after { background: #d97706; }
.emp-avatar-wrap.work-arr-dot-on_site.is-present::after { background: #1f6feb; }
.emp-avatar-wrap.work-arr-dot-hybrid.is-present::after { background: #7c3aed; }
.emp-avatar-wrap.work-arr-dot-remote.is-present::after { background: #0d9488; }
.emp-avatar-wrap.work-arr-dot-field.is-present::after { background: #c2410c; }
.emp-avatar-wrap.work-arr-dot-wfa.is-present::after { background: #0369a1; }
.badge.presence-badge { font-size: 11px; font-weight: 700; }
.badge.presence-present { background: #e8f6ee; color: #1f7a4d; }
.badge.presence-absent { background: #fff1e0; color: #b45309; }
.badge.presence-inactive { background: #eef1f5; color: #5b6573; }
.work-arr-badge { font-weight: 600; }
.work-arr-badge.work-arr-on_site { background: #e8f0fe; color: #1a56db; }
.work-arr-badge.work-arr-hybrid { background: #f3e8ff; color: #6d28d9; }
.work-arr-badge.work-arr-remote { background: #ccfbf1; color: #0f766e; }
.work-arr-badge.work-arr-field { background: #ffedd5; color: #c2410c; }
.work-arr-badge.work-arr-wfa { background: #e0f2fe; color: #0369a1; }
.work-arr-badge.is-absent { opacity: 0.72; }
.emp-card.work-arr-card-on_site.is-present-arr { border-left: 3px solid #1f6feb; }
.emp-card.work-arr-card-hybrid.is-present-arr { border-left: 3px solid #7c3aed; }
.emp-card.work-arr-card-remote.is-present-arr { border-left: 3px solid #0d9488; }
.emp-card.work-arr-card-field.is-present-arr { border-left: 3px solid #c2410c; }
.emp-card.work-arr-card-wfa.is-present-arr { border-left: 3px solid #0369a1; }
.work-nature-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}
.dir-absent-wrap { margin-bottom: 14px; }
.dir-presence-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.dir-stat {
  background: #eef2f8;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.dir-stat b { margin-left: 4px; }
.dir-stat.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dir-stat-present.active { background: #1f7a4d; border-color: #1f7a4d; }
.dir-stat-absent.active { background: #b45309; border-color: #b45309; }
.dir-stat-date { font-size: 12px; margin-left: 4px; }
.dir-absent-card { margin: 0; }
.dir-absent-none { padding-top: 12px; padding-bottom: 12px; }
.dir-absent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.dir-absent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #f0c7a0;
  background: #fffaf5;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}
.dir-absent-chip:hover { border-color: #d97706; }
.dir-back-on { color: #b45309; font-weight: 600; }
.dir-card-back {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: #b45309;
}
.location-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.location-history-list li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.location-history-main {
  font-size: 13px;
  color: var(--primary);
}
.location-history-comment {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
}

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; background: #eef2f8; color: var(--primary);
}
.badge.green { background: #e8f5e9; color: var(--green); }
.badge.amber { background: #fff6e6; color: var(--amber); }
.badge.red { background: #fdecec; color: var(--red); }
.badge.expired {
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f1aeb5;
  font-weight: 700;
}
.badge.grey { background: #eef1f5; color: var(--muted); }

.badge.role-badge { font-weight: 700; letter-spacing: 0.01em; }
.badge.role-admin { background: #ede9fe; color: #5b21b6; }
.badge.role-hr { background: #e0f2fe; color: #0369a1; }
.badge.role-manager { background: #ecfdf5; color: #047857; }
.badge.role-member { background: #f1f5f9; color: #475569; }
/* Legacy class aliases */
.badge.role-owner { background: #ede9fe; color: #5b21b6; }
.badge.role-hr-exec { background: #e0f2fe; color: #0369a1; }
.badge.role-employee { background: #f1f5f9; color: #475569; }
.badge.role-sysadmin { background: #fef3c7; color: #92400e; }

.cr-viewer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.cr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.cr-meta-sep { color: #c5ccd6; }
.cr-details {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8eef5;
  display: grid;
  gap: 8px;
}
.cr-detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
}
.cr-detail-label {
  color: var(--muted);
  font-weight: 600;
}
.cr-detail-value {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 560px) {
  .cr-detail-row { grid-template-columns: 1fr; gap: 2px; }
}

.empty-state {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f7f9fc;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.empty-state.warn { background: #fff6e6; border-color: #f0d9a8; }
.empty-state.info { background: #eaf2fb; border-color: #c5daf0; }
.empty-state.success { background: #f0f7f1; border-color: #cfe6d2; }
.empty-state-icon { font-size: 22px; line-height: 1; flex: none; margin-top: 1px; }
.empty-state-body h4 { margin: 0 0 6px; font-size: 15px; color: var(--primary); }
.empty-state-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.empty-state-body a { font-weight: 600; }

button, .btn {
  font-family: inherit;
  background: var(--accent); color: #fff; border: none; padding: 7px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-d); }
button.ghost { background: #eef2f8; color: var(--primary); }
button.ghost:hover { background: #e2e9f3; }
button.green { background: var(--green); }
button.red { background: var(--red); }
button.sm { padding: 5px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  margin: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
  cursor: pointer;
  box-shadow: none;
}
.th-sort:hover,
.th-sort:focus-visible {
  background: #eef2f8;
  color: var(--primary);
}
.th-sort.is-active {
  background: #e8f0fa;
  color: var(--primary);
}
.th-sort.is-active:hover,
.th-sort.is-active:focus-visible {
  background: #dde7f4;
  color: var(--primary);
}
.th-sort .sort-ind {
  font-size: 10px;
  opacity: 0.45;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: inherit;
}
.th-sort.is-active .sort-ind { opacity: 1; }
.cell-type {
  font-weight: 700;
  color: var(--primary);
}
.cell-dates {
  font-weight: 600;
  color: #34507a;
  white-space: nowrap;
}
.cell-days {
  font-weight: 700;
  color: var(--accent-d);
}
tr:last-child td { border-bottom: none; }

input, select {
  font-family: inherit;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: #fff;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field label { font-weight: 600; font-size: 13px; }
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.search { width: 320px; max-width: 100%; }

.bar { height: 8px; border-radius: 999px; background: #eef1f5; overflow: hidden; margin: 6px 0; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.progress-edit {
  margin-bottom: 12px;
}
.progress-edit-label {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  flex: none;
}
.progress-edit-value {
  min-width: 3.5ch;
  text-align: right;
  flex: none;
  font-size: 13px;
}
.progress-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 120px;
  height: 8px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--progress, 0%),
    #eef1f5 var(--progress, 0%),
    #eef1f5 100%
  );
  outline: none;
  cursor: pointer;
}
.progress-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.progress-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}
.progress-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
}
.progress-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.progress-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chain .step { display: flex; align-items: center; gap: 8px; }
.chain .arrow { color: var(--muted); }

.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--border); }
.tree > ul { padding-left: 0; border-left: none; }
.tree li { margin: 6px 0; }
.node { display: inline-flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
.node.is-me { border-color: var(--accent); background: #f3faf4; box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }

.project-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.project-team-card h3 { color: var(--primary); }
.project-team-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-team-member {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.project-team-member.is-me {
  border-color: var(--accent);
  background: #f3faf4;
}
.project-team-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}
.badge.project-role-badge {
  background: #e7f0fb;
  color: var(--accent);
  font-weight: 700;
}

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { background: #eef2f8; color: var(--primary); }
.tabs button.active { background: var(--accent); color: #fff; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; }
.team-section-heading {
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
  margin: 22px 0 10px;
}
.leave-subheading {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: none;
  letter-spacing: 0;
}
.holidays-table-head {
  margin-bottom: 2px;
}
.holidays-table-head th {
  border-bottom: 1px solid var(--border);
}
.holidays-month-block { margin-top: 12px; }
.holidays-month-block:first-child { margin-top: 8px; }
.holidays-month-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
}
.holidays-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.holidays-table th,
.holidays-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.holidays-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f7f9fc;
}
.holidays-table tbody tr:last-child td { border-bottom: none; }
.holidays-td-scope { font-size: 12px; margin-top: 2px; }
.holiday-location-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.holiday-location-pick select { max-width: 260px; }
.holidays-admin-table select { max-width: 220px; }
.locations-table select { max-width: 200px; }
.locations-table th { white-space: nowrap; }
.locations-table td.row { flex-wrap: nowrap; }
.locations-table button { white-space: nowrap; }
.holidays-td-date {
  width: 7.5rem;
  white-space: nowrap;
  font-weight: 650;
  color: var(--primary);
}
.holidays-td-day {
  width: 3.25rem;
  color: var(--muted);
  white-space: nowrap;
}
.holidays-td-name {
  color: var(--text);
  line-height: 1.35;
}
.holidays-year-block { margin-top: 10px; }
.holidays-year-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
}
.holidays-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.holidays-grid-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.holidays-date {
  color: var(--primary);
  font-weight: 650;
  white-space: nowrap;
  font-size: 12.5px;
  min-width: 7.5rem;
}
.holidays-name { color: var(--text); line-height: 1.35; }

.content-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}
.content-card-meta {
  margin: 0 0 10px;
}
.content-meta-badge {
  font-weight: 650;
}
.content-card-effective {
  font-size: 12px;
  margin-top: 8px;
}
.content-card-actions {
  margin-top: auto;
  padding-top: 10px;
}
.has-card-menu {
  position: relative;
}
.has-card-menu > .card-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}
.has-card-menu > .content-card-title,
.has-card-menu > .section-title,
.has-card-menu > b:first-of-type {
  padding-right: 36px;
}
.announcement-card-tools {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
}
.announcement-card-tools .card-menu {
  position: relative;
  top: auto;
  right: auto;
}
.card-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #6b7683);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.card-menu-btn:hover,
.card-menu.is-open .card-menu-btn {
  background: #eef2f7;
  border-color: var(--border);
  color: var(--primary);
}
.card-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
  z-index: 20;
}
.card-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.card-menu-item:hover {
  background: #f3f6fa;
}
.card-menu-item.is-danger {
  color: var(--red, #b23a3a);
}
.card-menu-item.is-danger:hover {
  background: #fdecec;
}
.content-card--clickable {
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .08s;
}
.content-card--clickable:hover {
  border-color: #c5d4e8;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.1);
  transform: translateY(-1px);
}
.content-card--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.content-card-cta {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 10px;
}
.content-card-readmore {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, #2e74b5);
}
.card-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.content-card--clickable:hover .card-cta-btn {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-d);
}
.announcement-card .announcement-read,
.announcement-card .row.emp-row-actions,
.announcement-card .content-card-actions {
  margin-top: auto;
}
.pre { white-space: pre-line; }
.task-modal-title-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 2px 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary);
  outline: none;
}
.task-modal-title-input:hover,
.task-modal-title-input:focus {
  border-bottom-color: var(--border);
}
.task-desc-block .task-desc-body {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg, #f4f6f9);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}
.comment-attach-label {
  display: inline-flex;
  align-items: center;
  height: 36px;
}

.badge.blue { background: #e7f0fb; color: var(--accent); }

.leave-balance-cell { line-height: 1.35; min-width: 110px; }
.leave-balance-warn { margin-top: 4px; }
.leave-row-warn td { background: #fffaf5; }
.leave-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.leave-days-cell { line-height: 1.35; min-width: 90px; }
.leave-adjust-note {
  margin-top: 4px;
  font-size: 11px;
  color: #7a5b00;
  background: #fff3cd;
  border: 1px solid #e6d28a;
  border-radius: 6px;
  padding: 3px 6px;
  max-width: 220px;
}
.leave-manager-note {
  font-size: 12px;
  line-height: 1.4;
  max-width: 240px;
  color: var(--text);
}

.link-btn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--accent); font: inherit; font-weight: 600;
  cursor: pointer; text-align: left; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; color: var(--primary); }

.leave-balance-detail {
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e8ecf1);
}
.leave-balance-detail:last-child { border-bottom: none; }
.leave-balance-detail.is-highlight {
  background: #f7fbff;
  margin: 0 -12px;
  padding: 12px;
  border-radius: 8px;
  border-bottom-color: transparent;
}
.leave-balance-detail.is-exceeded.is-highlight,
.leave-balance-detail.is-exceeded {
  background: #fff8f5;
}
.leave-balance-type { font-weight: 600; color: var(--text); }

.announcement-expired { opacity: 1; background: #fff8f8; border-color: #f1aeb5; }
.announcement-card .announcement-read {
  margin-top: auto;
  align-self: flex-start;
}
button.announcement-read {
  background: transparent;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
button.announcement-read:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-d);
}
.announcement-card .row .badge { flex: none; }

/* ---------- Branding / logos ---------- */
.logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; flex: none;
}
.logo.lg { width: 56px; height: 56px; font-size: 26px; border-radius: 12px; }
.logo-img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #fff; flex: none; }
.logo-img.lg { width: auto; height: 56px; max-width: 220px; border-radius: 8px; object-fit: contain; }
.logo-img.brand { width: 100%; height: auto; max-height: 48px; border-radius: 6px; object-fit: contain; background: #fff; padding: 5px 6px; }
.preview-topbar { display: flex; align-items: center; border-radius: 10px; padding: 12px 14px; }
.tabs.wrap { flex-wrap: wrap; }
input[type="color"] { padding: 2px; width: 46px; height: 34px; cursor: pointer; }
tfoot td { border-top: 2px solid var(--border); }

textarea {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: #fff; font-family: inherit; resize: vertical; width: 100%;
}

/* ---------- Dashboard widgets ---------- */
.dashboard-grid {
  display: block;
  column-width: 300px;
  column-gap: 16px;
}
.dashboard-grid > .widget {
  break-inside: avoid;
  margin-bottom: 16px;
}
.dashboard-grid > .muted {
  column-span: all;
  display: block;
  margin-bottom: 16px;
}
.widget .widget-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.widget { overflow: hidden; }
.approval-list { display: flex; flex-direction: column; gap: 10px; }
.approval-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.approval-item:last-child { border-bottom: none; padding-bottom: 0; }
.approval-item:first-child { padding-top: 0; }
.approval-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.task-row:hover { text-decoration: none; color: var(--accent); }
.task-row:last-child { border-bottom: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); }
.dot.blue { background: var(--accent); } .dot.grey { background: #b7c0cc; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: #eef2f8; color: var(--primary); font-weight: 600; font-size: 13px;
}
.chip:hover { background: #e2e9f3; text-decoration: none; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; background: #eef2f8; border-radius: 8px; padding: 3px; gap: 3px; align-items: center; }
.seg.wrap { flex-wrap: wrap; }
.seg button { background: transparent; color: var(--primary); padding: 0 12px; height: 28px; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; }
.seg button:hover { background: rgba(0,0,0,.05); }
.seg button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }

/* ---------- Week Navigation Bar ---------- */
.week-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 34px;
}

button.week-nav-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0 9px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  line-height: normal;
}

button.week-nav-btn .nav-arrow {
  font-size: 11px;
  line-height: 1;
  opacity: 0.75;
}

button.week-nav-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #94a3b8;
}

button.week-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
}

button.week-nav-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  height: 28px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(30, 64, 175, 0.04);
  line-height: normal;
  color: inherit;
  font: inherit;
  cursor: default;
}
button.week-nav-dates.is-jump {
  cursor: pointer;
}
button.week-nav-dates.is-jump:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
button.week-nav-dates.is-current {
  cursor: default;
}

.week-nav-icon {
  font-size: 11.5px;
  line-height: 1;
}

.week-nav-text {
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.week-nav-tag {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.2;
  letter-spacing: 0.1px;
}
.week-nav-tag-jump {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.tab-chevron {
  font-size: 10px;
  opacity: 0.75;
  margin-left: 2px;
}

/* ---------- Kanban board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.board-col {
  background: #f7f8fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-height: 120px;
  border-top: 3px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.board-col--Todo,
.board-col--InProgress,
.board-col--Review,
.board-col--Done {
  border-top-color: #cbd5e1;
}
.board-col--Blocked {
  border-top-color: var(--red);
  background: #fff8f8;
  border-color: #f0c4c4;
}
.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef1f6;
  flex: none;
}
.board-col--Blocked .board-col-head {
  background: #fde8e8;
}
.board-col-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #475569;
}
.board-col--Blocked .board-col-title {
  color: #b42318;
}
.board-col-count {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #94a3b8;
  box-shadow: none;
}
.board-col--Blocked .board-col-count {
  background: var(--red);
}
.board-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 72px;
}
.board-empty {
  text-align: center;
  padding: 20px 8px;
  font-size: 12.5px;
  color: #94a3b8;
}
.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  position: relative;
}
.task-card.task-card--select-gutter,
.task-card.task-card--selectable {
  padding-left: 38px;
}
.task-card-select,
.task-card-select-spacer {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.task-card-select {
  cursor: pointer;
}
.task-card-select:hover {
  background: rgba(26, 43, 92, 0.06);
  border-radius: 10px 0 0 0;
}
.task-card-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.task-card.task-card--selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.tasks-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #fff6f6;
  border: 1px solid #f0c4c4;
  border-radius: var(--radius);
}
.tasks-bulk-bar--active {
  background: #fff6f6;
  border-color: #f0c4c4;
}
.tasks-bulk-bar[hidden] {
  display: none !important;
}
.tasks-bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.gantt-label .gantt-del {
  margin-top: 4px;
}
.task-card.task-self-added {
  border-color: #c9b458;
  background: linear-gradient(180deg, #fffdf5 0%, #fff 55%);
  box-shadow: inset 3px 0 0 #c9a227, var(--shadow);
}
.task-card.task-card--blocked {
  border-color: #e8a0a0;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 60%);
  box-shadow: inset 3px 0 0 var(--red), var(--shadow);
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }
.task-card.task-self-added:hover { box-shadow: inset 3px 0 0 #c9a227, 0 6px 16px rgba(16,24,40,.12); }
.task-card.task-card--blocked:hover { box-shadow: inset 3px 0 0 var(--red), 0 6px 16px rgba(16,24,40,.12); }
.task-card.draggable { cursor: grab; }
.task-card.dragging { opacity: 0.55; cursor: grabbing; transform: rotate(1deg); }
.task-card-top {
  display: block;
}
.task-card-title {
  line-height: 1.35;
  font-size: 13.5px;
  display: block;
}
.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  justify-content: flex-start;
}
.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.task-card-dot { opacity: 0.55; margin: 0 2px; }
.task-card-assignee { font-weight: 600; color: #445066; }
.task-card-source { font-size: 11px; }
.task-card-bar { margin-top: 8px; }
.task-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.task-card-foot .task-code {
  font-size: 11px;
}
.board-col-body.drag-over { background: #e7f0fb; outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 8px; }
.board-col--Blocked .board-col-body.drag-over {
  background: #fdecec;
  outline-color: var(--red);
}
.blocker { margin-top: 8px; font-size: 12px; color: var(--red); background: #fdecec; border-radius: 6px; padding: 5px 8px; }

.tasks-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.tasks-page-heading .page-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.page-info-tip {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  background: #eef2f8;
  color: var(--primary);
  border: 1px solid var(--border);
  cursor: help;
  flex: none;
}
.page-info-tip:hover { background: #e2e9f3; }
.tasks-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.tasks-page-actions .seg {
  margin-right: 4px;
}
.task-week-mode-seg {
  flex: none;
}
.tasks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 8px 12px;
  min-height: 48px;
  background: #f4f7fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tasks-toolbar-trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.tasks-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tasks-toolbar-meta {
  font-size: 12.5px;
  white-space: nowrap;
}
.tasks-project-filter {
  min-width: 160px;
  max-width: 240px;
  padding: 0 10px;
  font-size: 13px;
  height: 34px;
  line-height: 1.3;
  box-sizing: border-box;
}
.tasks-inline-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.task-create-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #1a4a7a;
  background: #eaf2fb;
  border: 1px solid #c5daf0;
  border-radius: 8px;
}
.task-create-notice b { display: block; margin-bottom: 4px; }
.task-create-notice p { margin: 0; }
.form-success {
  margin: 12px 0 0;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #1e4d28;
  background: #f0f7f1;
  border: 1px solid #cfe6d2;
  border-radius: 8px;
}
.form-success b { color: #1e4d28; }
.form-success p { margin: 6px 0 0; color: #2d5a38; }
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  max-width: 100%;
  background: #eef5ff;
  border: 1px solid #c5d8f0;
  border-radius: 10px;
  font-size: 13px;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.attachment-chip a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.attachment-chip a:hover { text-decoration: underline; }
.attachment-doc-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d5e3f5;
  font-size: 15px;
  line-height: 1;
}
.attachment-chip-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.attachment-chip-name {
  color: var(--primary);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.attachment-chip-action {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.attachment-view-btn {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.attachment-view-btn:hover,
.attachment-chip:hover {
  background: #e3eefc;
  border-color: #9fc0e8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.attachment-view-btn:hover .attachment-chip-action {
  text-decoration: underline;
}
.attachment-icon { font-size: 15px; }
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }
.badge.self-added { background: #fff3cd; color: #7a5b00; border: 1px solid #e6d28a; }
.task-category-badge { font-weight: 600; }
.task-project-badge {
  background: #eef2f7;
  color: #334155;
  border: 1px solid #c5d0de;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.task-code {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: #eef2f8; padding: 2px 6px; border-radius: 4px;
}

/* ---------- Project Gantt / Timeline ---------- */
.gantt-card { padding: 14px 16px; }
.gantt-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.gantt { min-width: 640px; }
.gantt-head, .gantt-row {
  display: grid;
  grid-template-columns: var(--gantt-label-w, 220px) 1fr;
  align-items: stretch;
}
.gantt-head {
  position: sticky; top: 0; z-index: 2;
  background: #eef2f7; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.gantt-label-h, .gantt-label {
  padding: 8px 12px; border-right: 1px solid var(--border);
  background: #fff; position: sticky; left: 0; z-index: 1;
}
.gantt-label-h { background: #eef2f7; display: flex; align-items: center; }
.gantt-weeks { display: flex; }
.gantt-week {
  flex: 0 0 auto; padding: 8px 6px; border-right: 1px solid #e2e8f0;
  box-sizing: border-box; white-space: nowrap;
}
.gantt-row { border-bottom: 1px solid #eef1f5; min-height: 52px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-meta { font-size: 11px; margin-top: 2px; line-height: 1.3; }
.gantt-track {
  position: relative; height: 52px; background:
    repeating-linear-gradient(90deg, transparent 0, transparent 27px, #eef1f5 27px, #eef1f5 28px);
}
.gantt-plan-band {
  position: absolute; top: 0; bottom: 0;
  background: rgba(46, 116, 181, 0.08); border-left: 1px dashed #2e74b5; border-right: 1px dashed #2e74b5;
  pointer-events: none; z-index: 0;
}
.gantt-today {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #c0392b; z-index: 2; pointer-events: none;
}
.gantt-bar {
  position: absolute; top: 14px; height: 24px; border: none; border-radius: 6px;
  padding: 0 8px; cursor: pointer; z-index: 1;
  display: flex; align-items: center; justify-content: flex-end;
  color: #fff; font-size: 11px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.gantt-bar.is-editable:hover { filter: brightness(1.05); outline: 2px solid rgba(16,24,40,.2); outline-offset: 1px; }
.gantt-bar-text { opacity: 0.95; }
.gantt-bar--Todo { background: #64748b; }
.gantt-bar--InProgress { background: var(--accent, #2e74b5); }
.gantt-bar--Review { background: #b7791f; }
.gantt-bar--Blocked { background: var(--red, #c0392b); }
.gantt-bar--Done { background: var(--green, #1f7a3a); opacity: 0.85; }
.gantt-empty { padding: 24px; text-align: center; }

/* ---------- Project Plan ---------- */
.plan-card { padding: 14px 16px; }
.plan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.plan-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.plan-card-title b { font-size: 15px; }
.plan-card-project { font-size: 12.5px; }
.plan-info-tip { margin: 0; }
.plan-table { width: 100%; border-collapse: collapse; }
.plan-table th, .plan-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.plan-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-grip-cell {
  white-space: nowrap;
  width: 56px;
  vertical-align: middle !important;
}
.plan-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: grab;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: -2px;
  line-height: 1;
  vertical-align: middle;
}
.plan-grip:hover { background: #eef2f8; color: #64748b; }
.plan-grip:active { cursor: grabbing; }
.plan-ord-num {
  display: inline-block;
  min-width: 1.2em;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  vertical-align: middle;
}
.rearrange-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.rearrange-group-label { margin: 14px 0 6px; }
.rearrange-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  cursor: grab;
}
.rearrange-row:active { cursor: grabbing; }
.rearrange-grip { color: var(--muted); font-size: 14px; letter-spacing: -2px; user-select: none; }
.rearrange-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rearrange-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rearrange-meta { font-size: 12px; }
.rearrange-row button:disabled { opacity: 0.35; cursor: default; }
.rearrange-row--dragging { opacity: 0.45; }
.rearrange-row--over { outline: 2px dashed var(--accent); outline-offset: -2px; background: #f0f7fc; }
.rearrange-last { font-size: 12px; margin: 8px 0 0; }

/* Settings → Company info: custom Company sections */
.content-sections-card { margin-top: 12px; }
.content-section-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.content-section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.content-section-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.content-section-name .muted { font-size: 12px; }
.content-section-actions { display: flex; gap: 4px; }
.content-section-actions button:disabled { opacity: 0.35; cursor: default; }
.content-group-head { margin-top: 20px; }
.plan-row--dragging { opacity: 0.45; }
.plan-row--drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: #f0f7fc; }
.plan-activity-cell { min-width: 180px; }
.plan-activity-meta {
  font-size: 11px;
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.plan-row-status { color: var(--muted); }
.plan-row-status--err { color: var(--red); }
.plan-dur-cell { width: 88px; }
.plan-date-cell { width: 140px; }
.plan-table input.plan-title,
.plan-table select.plan-assignee,
.plan-table input.plan-duration,
.plan-table input.plan-start,
.plan-table input.plan-due {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.plan-table input.plan-duration { max-width: 80px; }
.plan-actions-cell { width: 88px; text-align: right; vertical-align: middle !important; }
.plan-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.plan-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.plan-icon-btn:hover {
  background: #eef2f8;
  color: var(--primary);
  border-color: #c5d0de;
}
.plan-icon-btn--danger {
  color: #b42318;
}
.plan-icon-btn--danger:hover {
  background: #fef3f2;
  color: #912018;
  border-color: #fecdca;
}
.plan-icon {
  display: block;
  flex: none;
}
.plan-icon-spacer {
  display: inline-block;
  width: 32px;
  height: 32px;
}
.plan-empty { padding: 24px; text-align: center; }

@media (max-width: 720px) {
  .gantt { --gantt-label-w: 140px; }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.5); display: grid; place-items: center;
  padding: 20px; z-index: 1300;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
  padding: 22px; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
}
.modal.modal-wide { max-width: 760px; }
.modal.modal-sm {
  max-width: 400px;
  padding: 18px 18px 16px;
}
.modal-backdrop-busy {
  cursor: wait;
  pointer-events: all;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  margin: 16px auto 4px;
  border: 3px solid var(--border);
  border-top-color: var(--accent, #2d8a3e);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}
.delete-progress-bar {
  height: 4px;
  margin: 14px 0 2px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.delete-progress-bar > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--accent, #2d8a3e);
  animation: delete-progress-slide 1.1s ease-in-out infinite;
}
@keyframes delete-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
.reset-scope-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reset-scope-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.reset-scope-row input {
  margin-top: 3px;
}
.reset-scope-row b {
  display: block;
  font-size: 14px;
}
.reset-scope-hint {
  display: block;
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.4;
}
@keyframes login-spin {
  to { transform: rotate(360deg); }
}
.confirm-message {
  margin: 0;
  line-height: 1.45;
  font-size: 14px;
  color: var(--text);
}
.reset-wipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.reset-confirm-lead {
  color: var(--accent, #2563eb);
  font-weight: 700;
}
.reset-confirm-logout {
  color: var(--accent, #2563eb);
  font-weight: 700;
}
.reset-wipe-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fdecec;
  border: 1px solid #f0b4b4;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  animation: reset-wipe-pulse 1.4s ease-in-out infinite;
}
@keyframes reset-wipe-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(196, 92, 92, 0.35);
    background: #fdecec;
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px rgba(196, 92, 92, 0);
    background: #fcdada;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reset-wipe-tag { animation: none; }
}
.attachment-inline { margin-top: 10px; width: 100%; }
.cr-detail-row + .attachment-inline { margin: 4px 0 10px; }
.attachment-view-btn.is-open { border-color: var(--accent); }
.software-about-inline { width: min(960px, 94vw); margin: 0 auto 16px; }
.video-viewer-wrap { margin-top: 4px; }
.content-video {
  width: 100%;
  max-height: min(70vh, 520px);
  background: #0f172a;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.video-teaser-wrap {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
}
.content-video-teaser {
  display: block;
  width: 100%;
  max-height: 280px;
  background: #0f172a;
  vertical-align: middle;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; color: var(--primary); }
.modal .field { margin-bottom: 12px; }

.announcement-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.announcement-item:last-child { border-bottom: none; padding-bottom: 0; }
.announcement-title {
  display: block;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
}
.announcement-title:hover,
.announcement-title:focus {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}
.announcement-title-static { font-weight: 700; color: var(--primary); margin: 0; }
.announcement-preview {
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.45;
  white-space: pre-line;
}
.announcement-read { margin-top: 8px; padding: 6px 10px; font-size: 12.5px; }
.announcement-body {
  max-height: 58vh;
  overflow-y: auto;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.55;
  font-size: 14px;
}

.content-reader { margin-top: 12px; }
.reader-back {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}
.content-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.content-reader-heading { min-width: 0; }
.content-reader-title { margin: 0; color: var(--primary); font-size: 20px; line-height: 1.3; }
.content-reader-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.content-reader-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; }
.content-reader .announcement-body { max-height: none; overflow: visible; }
.content-reader .pdf-pager-stage { height: max(420px, calc(100vh - 440px)); }
.content-reader .pdf-pager .fullscreen-toggle { display: none; }

/* Full screen: the browser's own full-screen mode, or a window-filling overlay where that is unavailable (iPhone). */
.is-pseudo-fullscreen { position: fixed; inset: 0; z-index: 1250; margin: 0; }
body.has-pseudo-fullscreen { overflow: hidden; }
.content-reader:fullscreen,
.content-reader.is-pseudo-fullscreen {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-y: auto;
  background: var(--card);
  padding: 20px max(20px, calc((100vw - 1040px) / 2));
}
.content-reader:fullscreen .content-reader-title,
.content-reader.is-pseudo-fullscreen .content-reader-title { font-size: 24px; }
.content-reader:fullscreen .content-reader-actions > :not(.fullscreen-toggle),
.content-reader.is-pseudo-fullscreen .content-reader-actions > :not(.fullscreen-toggle) { display: none; }
.content-reader:fullscreen .announcement-body,
.content-reader.is-pseudo-fullscreen .announcement-body { font-size: 17px; line-height: 1.7; padding: 20px 24px; }
/* A PDF uses the whole screen: slim title row and controls, no reading-column margins (those are for text). */
.content-reader:fullscreen:has(.pdf-pager),
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) { padding: 8px 16px; }
.content-reader:fullscreen:has(.pdf-pager) .content-reader-head,
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) .content-reader-head { align-items: center; min-height: 36px; margin-bottom: 6px; flex-wrap: nowrap; }
.content-reader:fullscreen:has(.pdf-pager) .content-reader-heading,
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) .content-reader-heading { flex: 1; min-width: 0; }
.content-reader:fullscreen:has(.pdf-pager) .content-reader-title,
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) .content-reader-title {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.content-reader:fullscreen:has(.pdf-pager) .content-reader-meta,
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) .content-reader-meta { display: none; }
.content-reader:fullscreen:has(.pdf-pager) .pdf-viewer-wrap,
.content-reader.is-pseudo-fullscreen:has(.pdf-pager) .pdf-viewer-wrap { margin-top: 0; }
/* 100px = 8px padding + 36px title row + 6px gap + 6px gap + ~36px controls + 8px padding. */
.content-reader:fullscreen .pdf-pager-stage,
.content-reader.is-pseudo-fullscreen .pdf-pager-stage { height: calc(100vh - 100px); height: calc(100dvh - 100px); padding: 6px; }
.content-reader:fullscreen .pdf-pager-bar,
.content-reader.is-pseudo-fullscreen .pdf-pager-bar { margin-top: 6px; }
/* Fit width: reserve the scrollbar so the page doesn't resize when it appears. */
.pdf-pager.is-fit-width .pdf-pager-stage { scrollbar-gutter: stable; }
.content-reader:fullscreen .content-video,
.content-reader.is-pseudo-fullscreen .content-video { max-height: calc(100vh - 200px); }
.pdf-pager:fullscreen,
.pdf-pager.is-pseudo-fullscreen {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--card);
}
.pdf-pager:fullscreen .pdf-pager-stage,
.pdf-pager.is-pseudo-fullscreen .pdf-pager-stage { flex: 1; height: auto; min-height: 0; }
.content-reader-notice {
  margin-top: 12px;
  padding: 8px 12px;
  font-size: 13px;
  background: #fff8e6;
  border: 1px solid #f1dfb0;
  border-radius: 8px;
}

.comments { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; padding: 4px; }
.comment { background: #f4f6fa; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.comment.mine { background: #eaf2fb; }
.feedback { background: #f0f7f1; border: 1px solid #cfe6d2; border-radius: 10px; padding: 10px 12px; color: var(--green); }

.cust-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.cust-row label { display: flex; align-items: center; gap: 8px; font-weight: 600; }

@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    display: flex; flex-direction: row; overflow-x: auto; padding: 8px;
    position: sticky; top: 0; z-index: 20; gap: 4px;
    min-height: 0; height: auto; overflow-y: hidden;
  }
  .side-sub, .side-items, .sidebar-resizer, .side-toggle { display: none !important; }
  .side-row { display: contents; }
  .nav .side-row > a { padding-right: 10px; }
  .side-group { display: contents; }
  .nav a.side-group-head { white-space: nowrap; }
  .brand { display: none; }
  .nav { display: flex; gap: 4px; flex: none; }
  .nav a { margin-bottom: 0; white-space: nowrap; padding: 8px 10px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .sidebar-foot { display: none; }
  .topbar { padding: 10px 14px; }
  .topbar-row-main { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .topbar-tagline { display: none; }
  .release-badge--phone { display: inline-flex; }
  .topbar-welcome-slot:empty { display: none; }
  .topbar-actions { gap: 8px; margin-left: auto; }
  .topbar-profile { padding: 4px; }
  .topbar-profile-meta { display: none; }
  .sidebar-clock {
    margin: 0 4px 0 0;
    padding: 6px 10px;
    white-space: nowrap;
    order: -1;
  }
  .sidebar-last-login {
    margin: 0;
    padding: 4px 8px;
    border-bottom: none;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    order: -1;
    max-width: 140px;
  }
  .sidebar-last-login-label { font-size: 9px; }
  .sidebar-last-login-value { font-size: 10px; }
  .sidebar-clock-date, .sidebar-clock-time { font-size: 11px; }
}

/* ---------- Print reports ---------- */
.employee-log-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}
.employee-log-summary .stat {
  background: #f6f8fb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.employee-log-summary .stat b { display: block; font-size: 20px; margin-top: 4px; color: var(--primary); }
.employee-log-summary .green-text { color: var(--accent); }
.employee-log-summary .red-text { color: var(--red); }

.work-context-card {
  border-left: 3px solid var(--primary);
}
.work-context-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.work-plan-card {
  border-left: 3px solid var(--accent);
}
.work-plan-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.work-plan-peek {
  background: #f3f8f4;
  border: 1px solid #cfe3d4;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
.work-plan-peek-inner { font-size: 13px; }

/* ---------- Employee Leave Statement & Ledger ---------- */
button.leave-emp-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  display: inline;
}
button.leave-emp-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.leave-statement-sheet {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
}

.leave-statement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.leave-statement-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.leave-statement-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.leave-statement-empbox {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
}
.leave-empbox-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.leave-empbox-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.leave-empbox-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.leave-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.leave-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.leave-kpi-card.kpi-entitled { border-top: 3px solid #2e74b5; }
.leave-kpi-card.kpi-taken { border-top: 3px solid #2d8a3e; }
.leave-kpi-card.kpi-pending { border-top: 3px solid #b7791f; }
.leave-kpi-card.kpi-available { border-top: 3px solid #1a2b5c; }
.leave-kpi-num {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}
.leave-kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.leave-date-pill {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px 2px 2px 0;
  white-space: nowrap;
}

.leave-statement-signatures {
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #cbd5e1;
  gap: 32px;
}
.leave-sig-col {
  flex: 1;
  max-width: 260px;
}
.leave-sig-line {
  border-bottom: 1px solid #334155;
  margin-bottom: 6px;
  height: 32px;
}
.leave-sig-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.leave-sig-sub {
  font-size: 11px;
  color: var(--muted);
}

@media print {
  /* Hide all interactive UI, sidebar, navigation, controls, forms, and dialogs */
  .sidebar,
  .sidebar-resizer,
  .topbar,
  .tabs,
  .nav,
  .page-title,
  .page-sub,
  .report-actions,
  .report-screen-controls,
  .leave-statement-controls,
  .employee-log-filters,
  .modal-backdrop,
  #modalRoot,
  .app-footer,
  input,
  select,
  .field,
  button:not(.leave-emp-link) {
    display: none !important;
  }

  /* Reset outer container margins and paddings so content starts at top of page without blank space */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }
  .shell {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  .main {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .content, #view {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Do NOT avoid break inside card: allow card to flow immediately from top of first page */
  .card,
  .leave-statement-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  /* Report print header */
  .report-print-header {
    display: block !important;
    margin: 0 0 14px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
  }
  .report-print-header h2 {
    margin: 2px 0 4px 0 !important;
    font-size: 18px !important;
    color: #1a2b5c !important;
  }

  /* Clean table layout across pages */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11.5px !important;
  }
  thead {
    display: table-header-group !important;
  }
  tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  th, td {
    padding: 6px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  th {
    border-bottom: 2px solid #cbd5e1 !important;
    color: #1a2b5c !important;
  }
  th button.th-sort {
    color: inherit !important;
    cursor: default !important;
    padding: 0 !important;
  }
  button.leave-emp-link {
    color: #000 !important;
    cursor: default !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    display: inline !important;
  }

  /* Employee Leave Statement specific print rules */
  .leave-statement-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 14px !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }
  .leave-statement-empbox {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .leave-kpi-grid {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin: 10px 0 14px 0 !important;
  }
  .leave-kpi-card {
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 8px 10px !important;
  }
  .leave-statement-signatures {
    display: flex !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-top: 24px !important;
    padding-top: 16px !important;
    border-top: 1px solid #cbd5e1 !important;
  }

  .badge {
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    background: #f8fafc !important;
  }
  .leave-date-pill {
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    background: #f1f5f9 !important;
  }
  .employee-log-summary {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .employee-log-foot {
    color: #555 !important;
  }
}
.report-print-header.hidden-print { display: none; }

/* PDF attachments / viewer */
.pdf-teaser {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  max-width: 100%;
  background: #eef5ff;
  border: 1px solid #c5d8f0;
  border-radius: 10px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.pdf-viewer-wrap { margin-top: 4px; }
.pdf-pager { outline: none; }
.pdf-pager:focus-visible .pdf-pager-stage { box-shadow: 0 0 0 2px var(--accent); }
.pdf-pager-stage {
  position: relative;
  display: flex;
  height: min(68vh, 720px);
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #e8eef5;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-x pan-y pinch-zoom;
}
/* margin:auto centres the page while still letting a zoomed page scroll from its top-left corner. */
.pdf-pager-canvas {
  display: block;
  margin: auto;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.18);
}
.pdf-pager-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.pdf-pager-stage > .pdf-missing { margin: auto; width: 100%; }
/* Page buttons centred under the page, fit and zoom on the right (the empty first column balances it). */
.pdf-pager-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pdf-pager-nav { grid-column: 2; }
.pdf-pager-tools { grid-column: 3; justify-self: end; }
.pdf-pager-nav,
.pdf-pager-tools { display: flex; align-items: center; gap: 6px; }
.pdf-pager-bar button { display: inline-flex; align-items: center; gap: 4px; }
.pdf-pager-bar .ui-icon { width: 16px; height: 16px; }
.pdf-pager-count { min-width: 96px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); }
.pdf-pager-tools [data-pdf-zoom-in],
.pdf-pager-tools [data-pdf-zoom-out] { min-width: 32px; justify-content: center; font-size: 16px; line-height: 1; }
.pdf-pager-zoom-level { min-width: 56px; justify-content: center; }
/* Fit page | Fit width: two joined buttons, the active one highlighted. */
.pdf-fit-toggle { display: inline-flex; }
.pdf-fit-toggle button { white-space: nowrap; border-radius: 0; }
.pdf-fit-toggle button:first-child { border-radius: 8px 0 0 8px; }
.pdf-fit-toggle button:last-child { border-radius: 0 8px 8px 0; margin-left: 1px; }
.pdf-fit-toggle button.is-active { background: var(--primary); color: #fff; }
.pdf-fit-toggle button.is-active:hover { background: var(--primary-d); }
.pdf-fit-short { display: none; }
.fullscreen-toggle { display: inline-flex; align-items: center; gap: 6px; }
.fullscreen-toggle .ui-icon { width: 15px; height: 15px; }
@media (max-width: 560px) {
  .pdf-pager-nav button span,
  .fullscreen-toggle span { display: none; }
  .pdf-pager-stage { height: 62vh; padding: 6px; }
  .content-reader-head { flex-wrap: wrap; }
  .content-reader-heading { flex: 1 1 100%; }
  .content-reader-actions { justify-content: flex-start; }
  /* Phones, in the page: too narrow for one row, so fit and zoom drop to a second row, still on the right. */
  .pdf-pager-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .pdf-pager-tools { margin-left: auto; gap: 4px; }
  .pdf-fit-long { display: none; }
  .pdf-fit-short { display: inline; }
  .pdf-pager-zoom-level { min-width: 44px; }
  /* Full screen on phones: keep the title row and the controls to one line each so the page gets the height. */
  .content-reader:fullscreen:has(.pdf-pager) .content-reader-head,
  .content-reader.is-pseudo-fullscreen:has(.pdf-pager) .content-reader-head { flex-wrap: nowrap; }
  .content-reader:fullscreen .pdf-pager-bar,
  .content-reader.is-pseudo-fullscreen .pdf-pager-bar { display: grid; gap: 6px; }
  .content-reader:fullscreen .pdf-pager-tools,
  .content-reader.is-pseudo-fullscreen .pdf-pager-tools { margin-left: 0; }
  .content-reader:fullscreen .pdf-pager-nav,
  .content-reader:fullscreen .pdf-pager-tools,
  .content-reader.is-pseudo-fullscreen .pdf-pager-nav,
  .content-reader.is-pseudo-fullscreen .pdf-pager-tools { gap: 4px; }
  .content-reader:fullscreen .pdf-pager-count,
  .content-reader.is-pseudo-fullscreen .pdf-pager-count { min-width: 0; font-size: 12px; white-space: nowrap; }
  /* No room for the zoom level here; tapping the active fit option (or pinching) resets the zoom. */
  .content-reader:fullscreen .pdf-pager-zoom-level,
  .content-reader.is-pseudo-fullscreen .pdf-pager-zoom-level { display: none; }
  .content-reader:fullscreen .pdf-pager-stage,
  .content-reader.is-pseudo-fullscreen .pdf-pager-stage { height: calc(100vh - 104px); height: calc(100dvh - 104px); }
}
@media print {
  .pdf-pager-stage canvas { display: none !important; }
}
.pdf-missing {
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
}
.pdf-missing strong { color: var(--text); font-size: 15px; }
