/* Coleman Efficiency application theme */
:root {
  color-scheme: light;
  --navy: #0a192f;
  --gold: #d4af37;
  --ink: #15263a;
  --muted: #526378;
  --line: #d9e0e7;
  --surface: #fff;
  --canvas: #f5f7f9;
  --radius: 12px;
  --shadow: 0 2px 5px rgba(12, 32, 58, .04);
  --field-border: #bac6d0;
  --sidebar-width: 246px;
  --page-gutter: clamp(22px, 3.4vw, 54px);
  font-family: "Public Sans", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; min-height: 100vh; background: var(--canvas); }
[hidden] { display: none !important; }
button, input, select, textarea, dialog { font: inherit; }
button, .btn, a { -webkit-tap-highlight-color: transparent; }
button, a, label[for] { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
button:disabled { opacity: .55; }
img { display: block; max-width: 100%; height: auto; }
svg.icon, .icon svg { width: 1.18em; height: 1.18em; display: inline-block; flex: none; vertical-align: -.15em; }
a { color: #1d527c; text-underline-offset: .19em; }
a:hover { color: var(--navy); }
button, a, input, select, textarea, summary, [tabindex] { scroll-margin-top: 1rem; }
:focus-visible { outline: 3px solid #2471aa; outline-offset: 3px; }
::selection { background: #f2dfa0; color: var(--navy); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 2.6vw, 2.5rem); letter-spacing: -.044em; font-weight: 700; }
h2 { font-size: clamp(1.25rem, 1.6vw, 1.55rem); letter-spacing: -.03em; font-weight: 700; }
h3 { font-size: 1.08rem; letter-spacing: -.014em; font-weight: 650; }
small { font-size: .8125rem; }
code, kbd, pre { font: inherit; font-variant-numeric: tabular-nums; }
form { margin: 0; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); }
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; z-index: 99; left: 12px; top: 12px; padding: .6rem 1rem; background: white; border-radius: 5px; clip-path: inset(100%); pointer-events: none; }
.skip-link:focus { clip-path: none; pointer-events: auto; }

/* Navigation and workspace */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow-y: auto; color: #e6ecf5;
  background: var(--navy); border-right: 1px solid #172d46; z-index: 12;
}
.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff;
  min-height: 95px; padding: 22px 23px; flex: none;
}
.sidebar .brand { border-bottom: 1px solid #28364b; }
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--gold);
}
.brand-mark img, img.brand-mark { object-fit: contain; }
.brand-mark svg { width: 32px; height: 32px; }
.brand-copy { min-width: 0; }
.brand-name, .brand-endorsement, .brand-company { display: block; }
.brand-name { white-space: nowrap; font-size: 1.18rem; line-height: 1.22; letter-spacing: -.033em; font-weight: 700; }
.brand-endorsement, .brand-company { color: #c9b87c; margin-top: 3px; font-size: .72rem; font-weight: 550; letter-spacing: .018em; }
.sidebar-nav, .nav-group { display: grid; align-content: start; }
.sidebar-nav { gap: 4px; padding: 22px 12px; }
.nav-group { gap: 4px; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-heading {
  margin: 5px 13px 8px; color: #a9b6c7;
  font-size: .69rem; font-weight: 650; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase;
}
.nav-link {
  position: relative; display: flex; min-height: 44px; gap: 13px; align-items: center;
  padding: 10px 14px; border-radius: 7px; border: 0; background: transparent;
  color: #c7d3e1; font: inherit; font-size: .89rem; font-weight: 550; text-decoration: none;
}
.nav-link:hover { background: #162a40; color: #fff; }
.nav-link.active, .nav-link[aria-current="page"], .nav-link.is-active {
  background: #24344a; color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--gold);
}
.nav-link .icon { color: #9fb0c4; }
.nav-link.active .icon, .nav-link[aria-current="page"] .icon, .nav-link.is-active .icon { color: #e7cb75; }
.sidebar :focus-visible { outline-color: #f1d364; }
.sidebar-bottom, .sidebar-foot { margin-top: auto; padding: 16px 18px; border-top: 1px solid #29384a; }
.sidebar .user-chip, .sidebar .user-info, .sidebar .user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar, .avatar {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; background: #e8e1ca; color: #433911; letter-spacing: .02em; font-size: .79rem; font-weight: 700;
}
.user-name, .user-role { display: block; }
.user-name { font-size: .86rem; font-weight: 650; line-height: 1.35; }
.user-role { color: #a5b5c6; font-size: .78rem; margin-top: 2px; line-height: 1.35; }
.main-shell, .workspace { min-width: 0; }
.topbar {
  min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--page-gutter); background: var(--surface); border-bottom: 1px solid var(--line);
}
.breadcrumb, .topbar-title, .topbar-right, .topbar-actions, .workspace-badge { display: inline-flex; align-items: center; gap: .6rem; }
.breadcrumb, .topbar-title { font-size: .86rem; font-weight: 600; color: var(--ink); min-width: 0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .icon, .breadcrumb .sep { color: #8998a7; }
.topbar-right, .topbar-actions { justify-content: flex-end; flex-shrink: 0; }
.workspace-badge {
  min-height: 30px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px;
  font-size: .78rem; font-weight: 600; color: #42546a; background: #fbfcfd;
}
.content {
  width: 100%; max-width: 1580px; margin-inline: auto; padding: clamp(24px,3.2vw,46px) var(--page-gutter) 52px;
}
.mobile-menu, .nav-backdrop { display: none; }

/* Common controls and work surfaces */
.eyebrow {
  display: block; font-size: .71rem; font-weight: 700; line-height: 1.5;
  color: #596a7b; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px;
}
.page-head, .page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 26px; }
.page-header p:not(.eyebrow), .page-head p:not(.eyebrow) { max-width: 68ch; margin-top: 7px; }
.page-header > div:first-child, .page-head > div:first-child { min-width: 0; }
.page-header .eyebrow, .page-head .eyebrow { color: #5a6874; }
.page-actions, .actions, .form-actions, .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn, a.btn, .button, .mobile-menu {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: .55rem;
  min-height: 42px; padding: 9px 15px; margin: 0; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--navy); font-size: .88rem; line-height: 1.45; font-weight: 650;
  text-align: center; text-decoration: none; letter-spacing: -.008em;
  transition: background-color 130ms, border-color 130ms, color 130ms;
}
.mobile-menu { display: none; }
.btn-primary, a.btn-primary, button.primary, .button.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled), a.btn-primary:hover, .primary:hover:not(:disabled) { background: #1d3553; border-color: #1d3553; color: #fff; }
.btn-secondary, a.btn-secondary, .secondary { background: var(--surface); color: var(--ink); border-color: #c6d0db; }
.btn-secondary:hover:not(:disabled), .secondary:hover:not(:disabled) { background: #f2f5f7; border-color: #9fadb9; color: var(--navy); }
.btn-quiet, .btn-ghost, a.btn-quiet { color: #315773; background: transparent; }
.btn-quiet:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: #edf2f6; }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: .805rem; }
.btn-danger { color: #8b2527; background: #fff; border-color: #dec3c5; }
.btn-danger:hover:not(:disabled) { background: #fdf1f1; }
.panel, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(17px, 2.1vw, 28px); min-width: 0;
}
.panel + .panel { margin-top: 16px; }
.panel-head, .section-head { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 19px; }
.panel-head p, .section-head p { margin-top: 5px; }
.muted, .subtle, .help-text, .hint, .field-hint { color: var(--muted); }
.help-text, .hint, .field-hint { font-size: .835rem; }
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  min-height: 26px; border-radius: 5px; color: #415670; background: #edf1f5; font-size: .78rem; font-weight: 650;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.full-width, .field-full { grid-column: 1 / -1; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field label, label.field, .field-label { color: #283c50; font-size: .88rem; font-weight: 600; }
.field .hint, .field small { font-weight: 400; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"])),
select, textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px;
  border: 1px solid var(--field-border); border-radius: 7px; color: var(--navy); background-color: white;
  font-size: .94rem; font-weight: 400; line-height: 1.45;
}
input::placeholder, textarea::placeholder { color: #687988; opacity: 1; }
select { padding-right: 27px; }
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy); width: 17px; height: 17px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #a33b3b !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
fieldset { min-width: 0; }
.notice, .alert { padding: 12px 14px; border: 1px solid #c5d8e5; border-radius: 8px; background: #edf5fa; color: #24465f; font-size: .88rem; }
.notice.error, .alert-error, .notice-error, .error-message { color: #802624; border-color: #e9c5c1; background: #fff3f1; }
.notice.success, .notice-success, .alert-success { color: #185341; border-color: #b9d9ca; background: #eff8f3; }
.notice.warning, .notice-warning { color: #694d0d; border-color: #e5d4a7; background: #fff9e9; }
.empty-state { padding: 32px 24px; text-align: center; }
.empty-state p { max-width: 48ch; margin: 8px auto 0; color: var(--muted); }
.empty-state .btn { margin-top: 14px; }
.team-table { width: 100%; }
.team-table td, .team-table th { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.team-table th { color: var(--muted); font-size: .79rem; font-weight: 650; }
.team-table td { font-size: .88rem; }
.team-table tr:last-child td { border-bottom: 0; }
.team-list { display: grid; }
.team-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.table-wrap, .table-scroll { overflow-x: auto; }
dialog { max-width: min(92vw,640px); max-height: 90dvh; padding: 24px; color: var(--ink); border: 1px solid #d8e1ea; border-radius: 12px; box-shadow: 0 18px 70px #07172d3d; }
dialog::backdrop { background: #0a192f8a; }

/* Sign-in */
.auth-layout, .auth-page {
  min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-content: center;
  grid-template-columns: minmax(300px, 510px) minmax(270px, 410px);
  background: #eef2f5; padding: clamp(24px,6vw,80px);
}
.auth-panel, .auth-aside {
  align-self: stretch; overflow: hidden; position: relative;
  padding: clamp(30px, 4vw, 58px); box-shadow: 0 20px 65px #10263d0d;
}
.auth-panel { background: white; border: 1px solid #d9e0e7; border-radius: 14px 0 0 14px; }
.auth-layout > .auth-panel:only-child, .auth-page > .auth-panel:only-child { border-radius: 14px; grid-column: 1 / -1; width: min(100%,510px); justify-self: center; }
.auth-aside {
  background: radial-gradient(74% 65% at 100% 102%, #253c55 0%, transparent 86%), var(--navy);
  color: #c8d4e1; border-radius: 0 14px 14px 0; display: flex; flex-direction: column; justify-content: flex-end;
}
.auth-aside::before {
  content: ""; position: absolute; pointer-events: none; top: -60px; right: -80px; width: 250px; height: 250px;
  border: 1px solid #d4af3738; border-radius: 50%; box-shadow: 0 0 0 28px #ffffff06, 0 0 0 58px #ffffff04;
}
.auth-aside > * { z-index: 1; position: relative; }
.auth-aside h1, .auth-aside h2, .auth-aside h3 { color: white; }
.auth-aside .eyebrow { color: #e1c169; }
.auth-aside p { color: #c8d4e1; }
.auth-aside h2 + p { margin-top: 12px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; color: var(--navy); }
.auth-brand .brand-endorsement, .auth-brand .brand-company { color: #57697a; }
.auth-brand .brand-mark { border-radius: 8px; }
.auth-intro { margin-bottom: 22px; }
.auth-panel h1 { margin-block: 5px 9px; font-size: clamp(1.9rem, 3.2vw, 2.55rem); }
.auth-panel p { color: var(--muted); }
.auth-form { display: grid; gap: 17px; margin-top: 24px; }
.auth-form .btn-primary { width: 100%; margin-top: 3px; min-height: 45px; }
.auth-footer { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 22px; font-size: .84rem; }
.auth-brand .brand { min-height: 0; padding: 0; color: var(--navy); }
.auth-brand .brand-mark { width: 40px; height: 40px; }
.auth-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.auth-footer small { color: var(--muted); }
.auth-aside > div > .icon { width: 39px; height: 39px; margin: 0 0 19px; color: #e3c464; stroke-width: 1.3; }
.auth-aside h2 { max-width: 12ch; font-size: clamp(1.85rem, 2.9vw, 2.7rem); letter-spacing: -.046em; }
.auth-aside h2 + p { max-width: 34ch; line-height: 1.6; }
.sidebar-nav a + .nav-heading { margin-top: 24px; }
.sidebar .icon-button {
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
  min-width: 36px; min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: #becbd9;
}
.sidebar .icon-button:hover { color: white; background: #26374a; }
.team-list { margin-top: 12px; }
.team-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(70px, .36fr) minmax(55px, .28fr) minmax(100px, .32fr); gap: 14px; }
.team-row > div { min-width: 0; }
.team-row strong, .team-row small { display: block; }
.team-row strong { font-size: .92rem; }
.team-row small { overflow-wrap: anywhere; color: var(--muted); }
.team-row > span { font-size: .84rem; }
.team-row > span:nth-child(2) { text-transform: capitalize; }
.team-row > span:last-child { justify-self: end; color: var(--muted); }
.team-row > button { justify-self: end; min-height: 36px; padding-block: 5px; }
.team-row:last-of-type { border-bottom: 0; }
#add-user .form-grid { margin-block: 18px; }
#team-message { margin-top: 12px; }
.device-panel { display: grid; grid-template-columns: minmax(110px, 164px) minmax(0,1fr); align-items: center; gap: clamp(18px,3vw,36px); }
.device-qr { width: 100%; max-width: 175px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px; }
.device-qr svg, .device-qr img { display: block; width: 100%; height: auto; }
.device-panel h2 + p, .device-panel + .panel h2 + p { margin-top: 7px; color: var(--muted); }
.device-panel + .panel h2 + p { max-width: 75ch; }
.device-url { width: fit-content; max-width: 100%; overflow-wrap: anywhere; margin-block: 11px; font-size: .94rem; color: #244969; }
.device-panel .notice { margin-top: 12px; }
.device-panel + .panel .btn { margin-top: 12px; }

@media (min-width: 1680px) {
  :root { --sidebar-width: 264px; }
}
@media (max-width: 1050px) and (min-width: 761px) {
  :root { --sidebar-width: 210px; --page-gutter: 22px; }
  .brand { padding-inline: 15px; gap: 9px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 1.06rem; }
  .sidebar-nav { padding-inline: 8px; }
}
@media (max-width: 760px) {
  :root { --page-gutter: 17px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 32; inset: 0 auto 0 0; height: 100dvh; width: min(280px, 86vw); transform: translateX(-104%); visibility: hidden; }
  .app-shell.nav-open .sidebar, .nav-open .app-shell .sidebar, .sidebar.is-open { transform: none; visibility: visible; }
  .nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30;
    background: #07142678; border: 0; border-radius: 0; padding: 0; 
  }
  .topbar { min-height: 55px; gap: 10px; padding-inline: 12px; }
  .mobile-menu { display: inline-flex; min-height: 42px; width: 42px; padding: 8px; flex: none; }
  .mobile-menu:hover { background: #edf2f5; }
  .breadcrumb { margin-right: auto; gap: .38rem; font-size: .82rem; }
  .workspace-badge { font-size: .73rem; }
  .content { padding-top: 24px; padding-bottom: 40px; }
  .page-head, .page-header { align-items: flex-start; margin-bottom: 20px; }
  .auth-layout, .auth-page { grid-template-columns: minmax(0,470px); padding: 16px; }
  .auth-aside { display: none; }
  .auth-panel { padding: clamp(23px,6vw,42px); border-radius: 12px; }
  .auth-brand { margin-bottom: 24px; }
  .field input, .field select, .field textarea, :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"])), select, textarea { font-size: 1rem; }
  .btn { min-height: 44px; }
}
@media (max-width: 500px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .content { padding-inline: 14px; }
  .workspace-badge { max-width: 150px; }
  .page-actions { max-width: 100%; }
  .breadcrumb > span:first-of-type, .breadcrumb > .icon { display: none; }
  .team-row { grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .team-row > div { grid-column: 1 / -1; }
  .team-row > span:last-child, .team-row > button { grid-column: 2; grid-row: 2 / span 2; }
  .team-row > span:nth-child(3) { grid-column: 1; }
  .device-panel { grid-template-columns: minmax(0,1fr); }
  .device-qr { width: 148px; }
}
@media (min-width: 501px) and (max-width: 900px) {
  .team-row { grid-template-columns: minmax(105px,1fr) auto auto auto; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .page-actions, .nav-backdrop, .mobile-menu { display: none !important; }
  .app-shell, .main-shell, .content { display: block; width: 100%; max-width: none; padding: 0; }
  body, :root { background: white; color: black; }
  .panel, .card { box-shadow: none; }
}

.language-switch{display:inline-flex;align-items:center;gap:2px;border:1px solid #93a6b6;border-radius:6px;padding:2px;background:#fff;flex-shrink:0}
.language-switch button{color:#243a4d;font:inherit;font-size:.8125rem;border:0;border-radius:4px;padding:.45rem .55rem;min-height:36px;background:transparent;cursor:pointer}
.language-switch [aria-pressed=true]{background:#173854;color:#fff}
.language-switch button:focus-visible{outline:3px solid #d69b36;outline-offset:2px}
.auth-brand{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap}
.workflow-choices{display:flex;flex-wrap:wrap;gap:1rem;margin:1rem 0}
@media(max-width:620px){.topbar-right .workspace-badge{display:none}.topbar{gap:.45rem}.breadcrumb{min-width:0}.breadcrumb span:last-child{overflow-wrap:anywhere}.language-switch button{padding:.4rem}.auth-brand .language-switch{margin-left:auto}.off-packet{flex-wrap:wrap}}
