/* TES shared theme: the top bar and design tokens used by every staff tool (staff.tesx.io, dashboard, invoices).
   Every rule is scoped to .tes-bar or the tes- prefix so it never fights a tool's own styles. */
:root {
  --tes-navy: #0f1b2d;
  --tes-navy-2: #17263d;
  --tes-navy-3: #22344f;
  --tes-orange: #e56910;
  --tes-orange-dark: #c8580a;
  --tes-orange-soft: #fdf0e6;
  --tes-paper: #f4f6f9;
  --tes-card: #ffffff;
  --tes-ink: #17212f;
  --tes-muted: #5f6b7c;
  --tes-line: #e1e6ed;
  --tes-green: #157a55;
  --tes-green-soft: #e3f3ec;
  --tes-red: #b63232;
  --tes-red-soft: #fbeaea;
  --tes-amber: #8a5a00;
  --tes-amber-soft: #fff3d9;
  --tes-radius: 10px;
  --tes-shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 14px rgba(15, 27, 45, .06);
  --tes-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --tes-bar-height: 58px;
}

.tes-bar { position: sticky; top: 0; z-index: 1000; background: var(--tes-navy); color: #fff; font-family: var(--tes-font);
  font-size: 14px; line-height: 1.3; box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 2px 10px rgba(0,0,0,.18); }
.tes-bar *, .tes-bar *::before, .tes-bar *::after { box-sizing: border-box; }
/* Guard against tools whose own CSS styles every <header> (e.g. display:flex, margins): the bar always
   spans the full width with no outer spacing. */
header.tes-bar { display: block; margin: 0; padding: 0; width: 100%; justify-content: normal; align-items: normal; border: 0; border-radius: 0; }
.tes-bar .tes-bar__inner { width: 100%; }
.tes-bar__drawer { display:contents; }
.tes-bar button.tes-bar__mobile-toggle { display:none; }
.tes-bar__inner { display: flex; align-items: center; gap: 22px; height: var(--tes-bar-height); max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.tes-bar__brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; flex: 0 0 auto; }
.tes-bar__brand img { width: 34px; height: 34px; display: block; }
.tes-bar__name { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; letter-spacing: .1px; white-space: nowrap; }
.tes-bar__name small { font-size: 11px; font-weight: 600; color: #9fb0c6; letter-spacing: .9px; text-transform: uppercase; margin-top: 1px; }
.tes-bar__nav { display: flex; align-items: stretch; gap: 2px; height: 100%; flex: 1 1 auto; min-width: 0; }
.tes-bar__link { position: relative; display: flex; align-items: center; padding: 0 13px; color: #c3cedc; text-decoration: none;
  font-weight: 600; white-space: nowrap; border-radius: 0; transition: color .15s, background-color .15s; }
.tes-bar__link:hover { color: #fff; background: rgba(255,255,255,.05); }
.tes-bar__link:focus-visible, .tes-bar__brand:focus-visible, .tes-bar__signout:focus-visible { outline: 2px solid var(--tes-orange); outline-offset: -2px; }
.tes-bar__link.is-active, .tes-bar__group.is-active > .tes-bar__toggle { color: #fff; }
.tes-bar__link.is-active::after, .tes-bar__group.is-active > .tes-bar__toggle::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--tes-orange); }
.tes-bar__badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px;
  background: var(--tes-orange); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.tes-bar__user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tes-bar__me { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-radius: 8px; padding: 3px 6px; margin: 0 -6px; }
.tes-bar__me:hover { background: rgba(255,255,255,.06); }
.tes-bar__me:focus-visible { outline: 2px solid var(--tes-orange); outline-offset: 0; }
img.tes-bar__avatar { object-fit: cover; padding: 0; }
.tes-bar__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tes-navy-3); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; border: 1px solid rgba(255,255,255,.12); }
.tes-bar__who { display: flex; flex-direction: column; max-width: 220px; }
.tes-bar__who strong { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tes-bar__who span { font-size: 12px; color: #9fb0c6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tes-bar__signout { color: #c3cedc; text-decoration: none; font-weight: 600; font-size: 13px; padding: 7px 11px; border: 1px solid var(--tes-navy-3);
  border-radius: 7px; white-space: nowrap; transition: border-color .15s, color .15s; }
.tes-bar__signout:hover { color: #fff; border-color: var(--tes-orange); }
/* Menus. The toggle is a <button>, so every property a tool's own button CSS might set is fixed here. */
.tes-bar__group { position: relative; display: flex; align-items: stretch; }
.tes-bar button.tes-bar__toggle { appearance: none; -webkit-appearance: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
  height: auto; width: auto; min-width: 0; min-height: 0; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.3; letter-spacing: normal;
  text-transform: none; color: #c3cedc; cursor: pointer; gap: 0; padding: 0 11px 0 13px; }
.tes-bar button.tes-bar__toggle:hover, .tes-bar button.tes-bar__toggle[aria-expanded="true"] { color: #fff; background: rgba(255,255,255,.05); }
.tes-bar__group.is-active > button.tes-bar__toggle { color: #fff; }
.tes-bar__chev { width: 12px; height: 12px; margin-left: 5px; flex: 0 0 12px; transition: transform .15s; }
.tes-bar__toggle[aria-expanded="true"] .tes-bar__chev { transform: rotate(180deg); }
.tes-bar__menu { position: absolute; top: 100%; left: 0; min-width: 230px; margin-top: 4px; padding: 6px; background: #fff; color: var(--tes-ink);
  border: 1px solid var(--tes-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,27,45,.18); display: grid; gap: 1px; z-index: 1001; }
.tes-bar__menu[hidden] { display: none; }
.tes-bar__menu.is-right { left: auto; right: 0; }
.tes-bar__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* keeps hover across the gap */
.tes-bar__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 7px;
  color: var(--tes-ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tes-bar__item:hover { background: var(--tes-paper); color: var(--tes-ink); }
.tes-bar__item:focus-visible { outline: 2px solid var(--tes-orange); outline-offset: -2px; }
.tes-bar__item.is-active { background: var(--tes-orange-soft); color: var(--tes-orange-dark); }
.tes-bar__item .tes-bar__badge { margin-left: 0; }
@media (max-width: 1400px) { .tes-bar__who { display: none; } }
@media (max-width: 860px) { .tes-bar__who { display: none; } .tes-bar__name small { display: none; } }
@media (max-width: 560px) { .tes-bar__inner { gap: 10px; padding: 0 12px; } .tes-bar__name { display: none; } .tes-bar__avatar { display: none; }
  .tes-bar__home { display: none; }   /* the logo goes home */
  .tes-bar button.tes-bar__toggle { padding: 0 7px 0 9px; font-size: 13px; }
  .tes-bar__group { position: static; }
  .tes-bar__menu { left: 12px; right: 12px; min-width: 0; } }
@media print { .tes-bar { display: none; } }
/* One compact disclosure holds all navigation and account controls on mobile. */
@media (max-width:560px) {
  .tes-bar__inner { height:var(--tes-bar-height); gap:12px; }
  .tes-bar button.tes-bar__mobile-toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-left:auto; min-height:44px; min-width:100px; padding:10px 14px; border:1px solid var(--tes-navy-3); border-radius:8px; background:transparent; color:#fff; font:inherit; font-weight:600; cursor:pointer; }
  .tes-bar button.tes-bar__mobile-toggle:focus-visible { outline:2px solid var(--tes-orange); outline-offset:2px; }
  .tes-bar__mobile-toggle[aria-expanded="true"] .tes-bar__chev { transform:rotate(180deg); }
  .tes-bar__drawer { display:none; position:absolute; top:100%; left:8px; right:8px; max-height:calc(100vh - var(--tes-bar-height) - 16px); max-height:calc(100dvh - var(--tes-bar-height) - 16px); overflow-y:auto; padding:8px; background:var(--tes-card); color:var(--tes-ink); border:1px solid var(--tes-line); border-radius:0 0 var(--tes-radius) var(--tes-radius); box-shadow:var(--tes-shadow); }
  .tes-bar[data-mobile-open="true"] .tes-bar__drawer { display:flex; flex-direction:column; }
  .tes-bar__nav { flex:none; display:flex; flex-direction:column; height:auto; }
  .tes-bar__home,.tes-bar__nav>a.tes-bar__link { display:flex; align-items:center; min-height:44px; padding:10px 12px; color:var(--tes-ink); }
  .tes-bar__home:hover,.tes-bar__nav>a.tes-bar__link:hover,.tes-bar__me:hover { color:var(--tes-ink); background:var(--tes-paper); }
  .tes-bar__group { display:flex; flex-direction:column; }
  .tes-bar button.tes-bar__toggle { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px; padding:10px 12px; border-radius:7px; color:var(--tes-ink); }
  .tes-bar button.tes-bar__toggle:hover,.tes-bar button.tes-bar__toggle[aria-expanded="true"],.tes-bar__group.is-active>button.tes-bar__toggle,.tes-bar__home.is-active,.tes-bar__nav>a.tes-bar__link.is-active { color:var(--tes-orange-dark); background:var(--tes-orange-soft); }
  .tes-bar__link.is-active::after,.tes-bar__group.is-active>.tes-bar__toggle::after { display:none; }
  .tes-bar__menu,.tes-bar__menu.is-right { position:static; min-width:0; margin:4px 0 8px; border:0; border-radius:7px; box-shadow:none; background:var(--tes-paper); }
  .tes-bar__menu::before { display:none; }
  .tes-bar__item { white-space:normal; min-height:44px; }
  .tes-bar__user { margin:8px 0 0; padding:12px 6px 4px; border-top:1px solid var(--tes-line); flex-wrap:wrap; }
  .tes-bar__me { color:var(--tes-ink); min-width:0; flex:1; }
  .tes-bar__who { display:flex; min-width:0; max-width:100%; }
  .tes-bar__who strong { color:var(--tes-ink); }
  .tes-bar__who span { color:var(--tes-muted); }
  .tes-bar__signout { color:var(--tes-muted); border-color:var(--tes-line); min-height:44px; display:flex; align-items:center; }
  .tes-bar__signout:hover { color:var(--tes-orange-dark); border-color:var(--tes-orange); }
}

/* Email alerts: bell in the bar, notices bottom right (tes-bar.js). */
.tes-bar__bell { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.85); cursor: pointer; }
.tes-bar__bell svg { width: 20px; height: 20px; }
.tes-bar__bell:hover, .tes-bar__bell:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.tes-bar__bell.is-off { color: rgba(255,255,255,.45); }
.tes-bar__bell.is-off svg { opacity: .7; }
.tes-bar__bell.is-off::after { content: ""; position: absolute; width: 22px; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; }
.tes-bar__bell { position: relative; }
.tes-bar__search { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 2px; border-radius: 8px; color: rgba(255,255,255,.85); text-decoration: none; }
.tes-bar__search svg { width: 19px; height: 19px; }
.tes-bar__search:hover, .tes-bar__search:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.tes-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2147483000; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); font-family: var(--tes-font, Arial, sans-serif); }
.tes-toast { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: #fff; color: #1d2733; border-left: 4px solid var(--tes-orange, #e56910); box-shadow: 0 8px 28px rgba(0,25,40,.22); font-size: 14px; line-height: 1.35; animation: tes-toast-in .25s ease-out; }
.tes-toast strong { color: #002a3a; font-size: 15px; }
.tes-toast__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tes-toast__open { font-weight: 700; color: var(--tes-orange-dark, #c04e00); text-decoration: none; }
.tes-toast__open:hover { text-decoration: underline; }
.tes-toast__close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: #7a8594; cursor: pointer; padding: 2px 6px; }
@keyframes tes-toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tes-toast { animation: none; } }
@media print { .tes-toasts { display: none !important; } }
@media (max-width:560px) { .tes-bar__search { color: var(--tes-navy, #002a3a); } .tes-bar__search:hover { background: var(--tes-orange-soft, #fdeee3); color: var(--tes-orange-dark, #c04e00); } .tes-bar__bell { color: var(--tes-navy, #002a3a); } .tes-bar__bell:hover, .tes-bar__bell:focus-visible { background: var(--tes-orange-soft, #fdeee3); color: var(--tes-orange-dark, #c04e00); } .tes-bar__bell.is-off { color: #7a8594; } }

/* Staging banner (tesx.dev only) */
.tes-staging{background:repeating-linear-gradient(135deg,#7a1f00 0 14px,#8f2700 14px 28px);color:#fff;font:600 13px/1.4 system-ui,sans-serif;padding:7px 16px;text-align:center}
.tes-staging strong{background:#fff;color:#7a1f00;border-radius:4px;padding:1px 7px;margin-right:8px;text-transform:uppercase;letter-spacing:.5px}
.tes-staging a{color:#fff;text-decoration:underline;margin-left:8px}
