/* Shared owner/staff visual language. No customer templates include this file.
   Main-content rules require .tt-content; billing checkout deliberately omits it. */
.tt-brand { display: flex; align-items: center; gap: 12px; min-height: 56px; color: inherit; text-decoration: none; min-width: 0; }
.tt-brand img { width: 56px; height: 56px; border-radius: 50%; object-fit: contain; background: #fff; flex-shrink: 0; border: 1px solid #d9e1ec; }
.tt-brand strong { display: block; font-size: 18px; font-weight: 750; line-height: 1.3; color: inherit; }
.tt-brand small { display: block; font-size: 11px; line-height: 1.5; font-weight: 550; color: inherit; opacity: .95; }
.owner-sidebar-brand { padding: 8px 4px 20px; }
.owner-sidebar-brand .tt-brand { display: flex; }
.tt-platform-brand { border-bottom: 1px solid #d9e1ec; margin-bottom: 12px; }
.tt-tenant-identity { margin-top: 16px; }
.tt-tenant-identity > :first-child { margin-bottom: 12px; }
.tt-content { --leaf: #005ecb; --leaf-dark: #001534; --clay: #b42318; --muted: #526078; }
.tt-content h1 { background: linear-gradient(115deg,#e8efff,#f1eaff 60%,#e6f5ff); color: #17243b; border: 1px solid #d9dff5; border-left: 4px solid #005ecb; border-radius: 20px; padding: 22px 24px; overflow-wrap: anywhere; }
.tt-content :is(.owner-overview-header,.workspace-overview-header) h1 { background: none; border: none; padding: 0; border-radius: 0; }
.tt-content h2 { color: #253f78; }
.tt-content :is(article,section,div,ul,form).bg-card,
.tt-content .card { background: linear-gradient(135deg,#fff,#f2f6ff); border-color: #cbd8ef; box-shadow: 0 6px 20px #17243b08; }
.tt-content :is(article,section,div,ul,form).bg-card:nth-of-type(3n+2) { background: linear-gradient(135deg,#fff,#edf8f3); }
.tt-content :is(article,section,div,ul,form).bg-card:nth-of-type(3n+3) { background: linear-gradient(135deg,#fff,#fff5e5); }
/* Keep the deliberately assigned KPI tints from the overview styles. */
.tt-content .owner-kpi-sales, .tt-content .workspace-kpi[data-kpi="revenue-today"], .tt-content .workspace-kpi[data-kpi="vouchers-valid"] { background: #eaf7f2; }
.tt-content .owner-kpi-workspaces, .tt-content .workspace-kpi[data-kpi="active-users"], .tt-content .workspace-kpi[data-kpi="vouchers-sold"] { background: #edf2ff; }
.tt-content .owner-kpi-subscriptions, .tt-content .workspace-kpi[data-kpi="active-routers"], .tt-content .workspace-kpi[data-kpi="outstanding"] { background: #edf6ff; }
.tt-content .workspace-kpi[data-kpi="uptime"], .tt-content .workspace-kpi[data-kpi="vouchers-expired"] { background: #f3edfc; }
.tt-content table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #cbd8ef; border-radius: 14px; background: #fff; overflow: hidden; }
.tt-content thead { color: #253f78; background: #e8efff; }
.tt-content :is(th,td) { padding: 12px 14px; border-bottom: 1px solid #d9e1ec; }
.tt-content tbody tr:nth-child(even) { background: #f3f6fd; }
.tt-content tbody tr:hover { background: #eaf3ff; }
.tt-content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { background-color: #fff; color: #17243b; border-color: #8998ad; border-radius: 12px; min-height: 44px; max-width: 100%; }
.tt-content :is(input[type=checkbox],input[type=radio]) { accent-color: #005ecb; }
.tt-content :is(form[method=get],form[method=GET]) { background: #edf2ff; border: 1px solid #cbd8ef; border-radius: 16px; padding: 16px; }
.tt-content .btn { color: #fff; background: #005ecb; border: 1px solid #005ecb; border-radius: 14px; min-height: 44px; }
.tt-content .btn:hover { background: #001534; filter: none; }
.tt-content button:not(.btn) { min-height: 44px; }
.tt-content :is(a,button)[class*="border-line"] { border-color: #a9bcdf; background: #edf2ff; color: #005ecb; }
.tt-content :is(nav,[role=tablist]) { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid #d9e1ec; border-radius: 14px; background: #edf2ff; }
.tt-content :is(nav a,[role=tab]) { padding: 10px 14px; border-radius: 10px; min-height: 44px; color: #005ecb; }
.tt-content :is([aria-current=page],[aria-selected=true],[data-active=true]) { background: #005ecb; color: #fff; }
.tt-content :is(span,p,div)[class*="bg-leaf/"] { background-color: #e8efff; color: #005ecb; }
.tt-content :is(span,p,div)[class*="bg-clay/"] { background-color: #fff0ed; color: #b42318; }
.tt-content :is(span,p,div)[class*="bg-gold/"] { background-color: #edf6ff; color: #754400; }
.tt-content :is(li,p)[class*="text-muted"] { color: #526078; }
.tt-content :is(ul,div)[class*="border-dashed"] { background: #edf2ff; border-color: #9db6e5; }
.tt-auth { background: radial-gradient(ellipse at top left,#e8efff,transparent 55%),#f7f8fc; }
.tt-auth .tt-brand { margin-bottom: 24px; }
.tt-content a:not(.btn):not(.tt-brand) { text-underline-offset: 3px; }
.tt-content a:not(.btn):hover { text-decoration: underline; }
@media (max-width: 1023px) { .owner-sidebar-brand { display: block; } .tt-brand { min-height: 48px; gap: 10px; } .tt-brand img { width: 48px; height: 48px; } .tt-brand strong { font-size: 17px; } .tt-platform-brand { margin-bottom: 0; } }
@media (max-width: 640px) { .tt-content h1 { padding: 18px; font-size: 1.75rem; } .tt-content :is(th,td) { padding: 10px; } .tt-content :is(.owner-overview-header,.workspace-overview-header) h1 { padding: 0; } }
@media (prefers-reduced-motion: reduce) { .tt-content * { scroll-behavior: auto; } }
/* Route/query tabs use both legacy colour classes and semantic ARIA states. */
.tt-content :is(nav a,[role=tab])[aria-current=true],
.tt-content :is(nav a,[role=tab]).bg-leaf,
.tt-content :is(nav a,[role=tab],button)[class*="bg-leaf/"] { background: #005ecb; border-color: #005ecb; color: #fff; }
.tt-content form.grid:not([method=get]):not([method=GET]) { background: linear-gradient(135deg,#fff,#edf2ff); border: 1px solid #cbd8ef; border-radius: 18px; padding: 20px; }
.tt-content .btn.bg-clay { background: #b42318; border-color: #b42318; color: #fff; }
.tt-content .tt-brand { margin-bottom: 18px; }
.tt-content :is(article,section,div,ul,form)[class*="bg-card/"] { background: linear-gradient(135deg,#fff,#edf2ff); border-color: #cbd8ef; }
.tt-content summary { color: #005ecb; }
.tt-content [class*="bg-ink/"][class*="rounded-full"] { background: #e8edf5; color: #3c4d68; }

/* ===== Release 13.9.8: mobile (360–414px) ergonomics for owner, Operator workspace, sign-in and central pages =====
   Targets ≥44–48px, 16px form text (stops iOS zoom), full-width primary actions, drawer navigation,
   scrollable tables, no horizontal overflow. Blue TrotroTech palette unchanged. */
html, body { max-width: 100%; overflow-x: clip; }
.tt-content img, .tt-content svg, .tt-content video, .tt-content iframe { max-width: 100%; height: auto; }
.tt-content :is(pre, code) { white-space: pre-wrap; overflow-wrap: anywhere; }
.tt-content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea),
.tt-auth :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea),
.workspace-ui .field, .owner-ui .field { font-size: 16px; min-height: 48px; }
.tt-content :is(input[type=checkbox], input[type=radio]) { width: 22px; height: 22px; }
.tt-content label:has(> input[type=checkbox]), .tt-content label:has(> input[type=radio]),
.tt-auth label:has(> input[type=checkbox]) { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
.tt-content summary, .tt-auth summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.tt-content .btn, .tt-auth .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }

/* Mobile drawer navigation (Operator workspace + owner console). */
.tt-menu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 14px; border: 1px solid #a9bcdf; border-radius: 14px; background: #edf2ff; color: #005ecb; font-weight: 650; font-size: 15px; }
.tt-menu-btn .tt-burger, .tt-menu-btn .tt-burger::before, .tt-menu-btn .tt-burger::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative; content: ''; }
.tt-menu-btn .tt-burger::before { position: absolute; top: -6px; } .tt-menu-btn .tt-burger::after { position: absolute; top: 6px; }
.tt-menu-btn[aria-expanded=true] .tt-burger { background: transparent; }
.tt-menu-btn[aria-expanded=true] .tt-burger::before { top: 0; transform: rotate(45deg); } .tt-menu-btn[aria-expanded=true] .tt-burger::after { top: 0; transform: rotate(-45deg); }
html.tt-nav-open { overflow: hidden; }

@media (max-width: 1023px) {
  .workspace-sidebar, .owner-sidebar { position: sticky; top: 0; z-index: 40; }
  .workspace-sidebar .tt-platform-brand { display: none; }
  .owner-sidebar { padding: 8px 16px; }
  .owner-sidebar .owner-sidebar-brand { display: none; }
  [data-nav-panel]:not(.hidden) { position: fixed; left: 0; right: 0; top: var(--tt-nav-top, 64px); bottom: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain; background: #fff; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 18px 40px #17243b30; }
  [data-nav-panel] a { min-height: 48px; display: flex; align-items: center; padding: 10px 14px; font-size: 16px; border-radius: 12px; }
  [data-nav-panel] .grid-cols-2 { grid-template-columns: 1fr; }
  [data-nav-panel] form button { min-height: 48px; width: 100%; text-align: left; padding: 0 14px; font-size: 16px; border: 1px solid #d9e1ec; border-radius: 12px; }
  .owner-sidebar [data-nav-panel] { display: none; }
  .owner-sidebar [data-nav-panel]:not(.hidden) { display: grid; gap: 4px; align-content: start; }
  .owner-sidebar [data-nav-panel] a[aria-current=page] { background: #005ecb; color: #fff; }
}

@media (max-width: 640px) {
  .tt-content { padding-left: 16px !important; padding-right: 16px !important; }
  [data-operator-main], .owner-main { padding-top: 20px !important; padding-bottom: 32px !important; }
  /* Primary actions full width; inline table/row actions keep their size. */
  .tt-content .btn, .tt-content .workspace-primary, .tt-content .owner-primary,
  .tt-content form:not([method=get]):not([method=GET]) button[type=submit]:not(.text-sm):not([class*="text-xs"]),
  .tt-auth .btn, .tt-auth button[type=submit].btn { width: 100%; }
  .tt-content :is(td, th, li, [data-inline-actions]) :is(.btn, button) { width: auto; }
  .tt-content :is(td, th, li) :is(a, button) { min-height: 44px; display: inline-flex; align-items: center; }
  /* Tables: scroll sideways inside their own box instead of widening the page. */
  .tt-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .tt-content table td { white-space: normal; min-width: 7rem; }
  /* GET filter bars stack. */
  .tt-content :is(form[method=get], form[method=GET]) { display: grid; gap: 10px; }
  .tt-content :is(form[method=get], form[method=GET]) > * { width: 100%; }
  /* Page tabs scroll horizontally rather than wrapping into a wall of chips. */
  .tt-content :is(nav, [role=tablist]) { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tt-content :is(nav a, [role=tab]) { flex-shrink: 0; white-space: nowrap; }
  /* Sticky primary submit at the bottom of long forms. */
  .tt-content form.grid:not([method=get]):not([method=GET]) > button[type=submit]:last-child,
  .tt-content form.grid:not([method=get]):not([method=GET]) > div:last-child:has(> button[type=submit]) { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -10px 18px #f7f8fc; }
  .tt-content h1 { font-size: 1.6rem; padding: 16px; border-radius: 16px; }
  .tt-content :is(.grid) { min-width: 0; }
  .tt-content .grid > * { min-width: 0; }
  /* Sign-in pages: form first, compact hero. */
  .workspace-login-shell, .owner-login-shell { display: flex; flex-direction: column-reverse; }
  .workspace-login-hero h2, .owner-login-hero h2, .owner-login-hero .owner-login-tagline { font-size: 22px; }
  .workspace-hero-description, .owner-hero-description { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tt-menu-btn .tt-burger, .tt-menu-btn .tt-burger::before, .tt-menu-btn .tt-burger::after { transition: none; } }
