@font-face {
  font-family: Montserrat;
  src: url('/assets/brand/montserrat.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0b1930;
  --navy-deep: #071326;
  --blue: #1260d8;
  --blue-dark: #084bb1;
  --ink: #182b45;
  --muted: #53657c;
  --line: #dce3ec;
  --canvas: #f4f6f9;
  --radius: 16px;
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
  color-scheme: light;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.65; background: var(--canvas); }
body.dialog-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid #3688ff;
  outline-offset: 4px;
}
button:disabled:focus-visible { outline: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { 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; left: 16px; top: 12px; transform: translateY(-160%); padding: 12px 18px; background: #fff; z-index: 100; border: 2px solid var(--blue); border-radius: 8px; }
.skip-link:focus { transform: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.brand > img { flex: 0 0 auto; }
.brand > span { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -1px; }
.brand > span > span { color: #65adff; }
.brand small { display: block; font-size: 10px; letter-spacing: 1.2px; margin-top: 7px; font-weight: 500; color: #b9cce4; }
.eyebrow { display: inline-block; font-size: 12px; line-height: 1.6; letter-spacing: 1.3px; font-weight: 700; color: #526b8a; overflow-wrap: anywhere; }
.boot-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; background: var(--navy); color: #d1ddef; padding: 24px; text-align: center; }
.boot-screen img { animation: pulse 1.8s infinite; }

/* Login uses the same readable type and control sizes as the workspace. */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 45%) minmax(0, 1fr); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; background: var(--navy-deep); padding: 40px clamp(28px, 4vw, 64px) 28px; color: #fff; overflow: hidden; }
.auth-story::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 100% 67%, #103a75a1, transparent 65%), linear-gradient(130deg, transparent 63%, #1368e21c 63%, transparent 63.2%); pointer-events: none; }
.auth-story .brand, .auth-story-body, .auth-story-foot { position: relative; }
.auth-story-body { padding-top: 64px; }
.light-eyebrow { color: #b7cceb; display: flex; align-items: center; gap: 10px; }
.light-eyebrow > i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #68b1ff; box-shadow: 0 0 0 5px #4c9eff13; }
.auth-story h2 { font-size: clamp(36px, 3.4vw, 56px); line-height: 1.22; letter-spacing: -1.8px; font-weight: 650; margin: 24px 0; }
.auth-story h2 span { color: #65adff; }
.auth-story-body > p { font-size: 16px; line-height: 1.85; color: #b8cae1; max-width: 410px; margin: 0; }
.inbox-art { height: 270px; position: relative; margin: 32px -12px 0; }
.art-orbit { border: 1px solid #7397cc35; position: absolute; width: 320px; height: 220px; top: 5px; left: 30px; border-radius: 50%; transform: rotate(-24deg); }
.art-orbit::before { content: ""; position: absolute; inset: 25px; border: 1px solid #7397cc35; border-radius: 50%; }
.art-orbit::after { content: ""; position: absolute; width: 9px; height: 9px; left: 23px; top: 25px; background: #65adff; border-radius: 50%; box-shadow: 0 0 24px #58a3ff; }
.art-ticket { border: 1px solid #7393be4d; background: linear-gradient(140deg, #203c64, #0d2341); position: absolute; border-radius: 14px; box-shadow: 0 16px 50px #0003; }
.ticket-back { width: 280px; height: 123px; left: 59px; top: 39px; transform: rotate(9deg); opacity: .5; padding: 20px; }
.ticket-back i { display: block; width: 26px; height: 26px; background: #4a6b96; border-radius: 8px; margin-bottom: 12px; }
.ticket-back > span { height: 5px; width: 60%; display: block; background: #456389; margin: 6px 0; border-radius: 6px; }
.ticket-back > span:last-child { width: 40%; }
.ticket-front { left: 18px; top: 86px; width: min(390px, calc(100% - 30px)); min-height: 112px; display: flex; align-items: center; padding: 20px; gap: 14px; transform: rotate(-5deg); background: linear-gradient(130deg, #183e72, #122c50); }
.ticket-mark { height: 44px; width: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #216fe9; font-size: 24px; font-weight: 700; }
.ticket-front strong { display: block; font-size: 16px; font-weight: 600; }
.ticket-front > div > span { font-size: 12px; color: #bfd1e8; display: block; margin-top: 6px; }
.ticket-front > b { font-size: 28px; color: #70b7ff; margin-left: auto; font-weight: 400; }
.art-chip { position: absolute; right: 10px; top: 220px; font-size: 11px; letter-spacing: 1px; color: #b1cceb; display: flex; align-items: center; gap: 8px; }
.art-chip i { width: 5px; height: 5px; background: #78b5ff; border-radius: 50%; }
.auth-story-foot { border-top: 1px solid #d4e3fa26; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; color: #a6bfdf; font-size: 12px; gap: 12px; }
.auth-story-foot > span:last-child { font-size: 24px; }
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: 36px clamp(28px, 5vw, 90px) 24px; background: #fbfcfe; }
.back-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--muted); align-self: flex-start; }
.back-link > span { font-size: 22px; }
.auth-card { margin: auto 0; padding: 48px 0; max-width: 460px; width: 100%; align-self: center; }
.auth-card h1 { font-size: clamp(32px, 3vw, 44px); letter-spacing: -1.3px; font-weight: 650; margin: 14px 0; line-height: 1.2; }
.auth-description { font-size: 16px; line-height: 1.8; color: var(--muted); margin: 0 0 30px; }
.login-form > label, .order-edit > label { display: block; font-size: 14px; font-weight: 650; margin: 22px 0 8px; }
.login-form input, .order-edit select, .order-edit textarea { width: 100%; background: #fff; border: 1px solid #bbc8d9; border-radius: 9px; padding: 13px 14px; min-height: 52px; color: var(--ink); font-size: 16px; }
.login-form input::placeholder, .order-edit textarea::placeholder { color: #5b6e83; opacity: 1; }
.login-form input:focus, .order-edit select:focus, .order-edit textarea:focus { border-color: var(--blue); }
[aria-invalid="true"] { border-color: #b23628 !important; }
.password-field { position: relative; }
.password-field input { padding-right: 100px; }
.password-field button { position: absolute; right: 5px; top: 4px; min-height: 44px; min-width: 82px; padding: 6px 9px; font-size: 16px; color: #425c7b; border: 0; border-radius: 6px; background: transparent; }
.password-field button:hover { background: #edf3fc; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; border: 1px solid transparent; padding: 11px 18px; font-size: 16px; font-weight: 650; border-radius: 9px; transition: background .18s; line-height: 1.45; text-align: center; }
.button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.button.secondary { background: #fff; border-color: #bdcadc; color: #334d6d; }
.button.secondary:hover:not(:disabled) { background: #edf3fc; }
.button.wide { width: 100%; margin-top: 26px; justify-content: space-between; min-height: 54px; }
.button.wide > span:last-child { font-size: 24px; font-weight: 400; }
.auth-note { display: flex; align-items: flex-start; justify-content: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 20px 0 0; }
.auth-note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; stroke: currentColor; stroke-width: 1.3; }
.auth-footer { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.auth-footer > span { padding: 0 6px; }
.form-message { font-size: 14px; line-height: 1.7; border-radius: 8px; padding: 12px 14px; border: 1px solid #db9d91; background: #fff1ed; color: #942f22; margin-top: 16px; overflow-wrap: anywhere; }
.setup-card, .connection-card { background: #eef4fe; border: 1px solid #cbdcf5; border-radius: 12px; padding: 24px; margin-top: 25px; }
.setup-icon { font-size: 28px; color: var(--blue); margin-bottom: 12px; }
.setup-card h3, .connection-card h3 { font-size: 20px; line-height: 1.4; margin: 0 0 12px; }
.setup-card p, .connection-card p { font-size: 16px; color: #425a79; line-height: 1.8; margin: 0 0 16px; overflow-wrap: anywhere; }
.setup-card code { font-size: .9em; background: #dae8ff; padding: 2px 4px; border-radius: 3px; }
.setup-card .button, .connection-card .button { margin-top: 4px; }

/* The workspace has one page scroll; rows become cards before columns get cramped. */
.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--navy); padding: 32px 18px 24px; display: flex; flex-direction: column; z-index: 2; }
.sidebar .brand { padding-left: 6px; gap: 9px; }
.sidebar .brand > span { font-size: 24px; }
.sidebar .brand small { font-size: 10px; letter-spacing: 1px; }
.sidebar-kicker { font-size: 12px; color: #a2b8d5; letter-spacing: 1.4px; margin: 52px 14px 16px; }
.sidebar-link { display: flex; align-items: center; gap: 11px; color: #b1c5e0; font-size: 14px; font-weight: 550; min-height: 52px; padding: 12px; border-radius: 9px; margin-bottom: 8px; }
.sidebar-link svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidebar-link.active { background: #1b3761; color: #f1f6ff; box-shadow: inset 3px 0 #6bb0ff; }
.sidebar-link:not(.active):hover { background: #142743; color: #fff; }
.sidebar-link > span:last-child { margin-left: auto; }
.sidebar-count { background: #2b528c; border: 1px solid #668cbe; color: #fff; border-radius: 6px; font-size: 12px; padding: 1px 6px; min-width: 24px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 28px 12px 0; }
.sidebar-spark { font-size: 44px; color: #75a9ef; display: block; font-weight: 300; line-height: 1; }
.sidebar-bottom p { font-size: 14px; color: #b1c5e0; line-height: 1.85; margin: 16px 0 24px; }
.sidebar-version { font-size: 10px; letter-spacing: 1px; color: #a3bbdc; }
.workspace-body { display: flex; flex-direction: column; min-width: 0; }
.workspace-header { min-height: 88px; background: #fff; border-bottom: 1px solid var(--line); padding: 12px clamp(24px, 3vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-location { min-width: 0; }
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb i { padding: 0 12px; color: #788ba4; font-style: normal; }
.breadcrumb strong { color: #334d6d; font-weight: 600; }
.mobile-wordmark { display: none; font-weight: 800; letter-spacing: -.8px; font-size: 24px; }
.mobile-wordmark > span { color: var(--blue); }
.account-area { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; background: #edf3fc; border: 1px solid #c6d8f0; border-radius: 50%; font-size: 14px; color: #315b90; font-weight: 700; }
.account-name { font-size: 14px; color: #425b7a; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { margin-left: 8px; padding: 8px 4px 8px 18px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: #425b7a; background: transparent; border: 0; border-left: 1px solid var(--line); }
.logout-button > span { font-size: 20px; }
.dashboard { padding: 36px clamp(24px, 3vw, 48px) 32px; max-width: 1600px; width: 100%; margin: 0 auto; flex: 1; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading h1 { font-size: clamp(34px, 3.1vw, 46px); font-weight: 650; letter-spacing: -1.5px; margin: 8px 0 10px; line-height: 1.2; overflow-wrap: anywhere; }
.page-heading h1 > span { color: var(--blue); }
.page-heading p { font-size: 16px; color: var(--muted); margin: 0; line-height: 1.75; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 22px 20px; min-width: 0; }
.stat-card > span { font-size: 14px; color: #425a79; font-weight: 600; display: block; padding-right: 24px; line-height: 1.5; }
.stat-card > strong { display: block; font-size: 38px; color: #1b3354; font-weight: 650; letter-spacing: -1px; line-height: 1.3; margin: 14px 0 10px; overflow-wrap: anywhere; }
.stat-card > small { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.stat-icon { position: absolute; top: 22px; right: 16px; width: 26px; height: 26px; display: grid; place-items: center; color: #577ba9; border-radius: 7px; font-size: 22px; font-style: normal; font-weight: 400; }
.stat-new { background: #eaf2ff; border-color: #c9dcfc; }
.stat-new > strong { color: #125bc6; }
.stat-new .stat-icon { color: #236bcf; }
.stat-new > small { color: #3e608e; }
.stat-new > small > i { background: #2870d1; border-radius: 50%; height: 6px; width: 6px; margin-top: 6px; flex: 0 0 auto; }
.orders-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 26px 24px 22px; gap: 16px; }
.panel-heading > div:first-child { min-width: 0; }
.panel-heading h2 { font-size: 22px; font-weight: 650; letter-spacing: -.5px; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; line-height: 1.4; }
.panel-heading h2 > span { font-size: 14px; color: #425d80; background: #edf2f8; padding: 2px 9px; min-width: 30px; border-radius: 6px; text-align: center; font-weight: 550; }
.panel-heading p { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.panel-indicator { display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: 1px; color: var(--muted); flex: 0 0 auto; }
.panel-indicator > i { width: 6px; height: 6px; border-radius: 50%; background: #3b7456; }
.search-toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 0 24px 20px; }
.search-box { display: flex; align-items: center; border: 1px solid #bccadd; border-radius: 9px; width: min(560px, 100%); min-height: 50px; gap: 10px; padding-left: 14px; background: #fbfcfe; min-width: 0; }
.search-box > svg { width: 20px; height: 20px; stroke: #526e91; stroke-width: 1.5; flex: 0 0 auto; }
.search-box > input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline-offset: 5px; padding: 12px 0; }
.search-box > input::placeholder { color: #61758e; opacity: 1; }
.search-submit { background: #edf3fc; border: 0; border-left: 1px solid #d4dfef; border-radius: 0 8px 8px 0; color: #245798; min-height: 48px; padding: 8px 13px; font-size: 16px; font-weight: 600; flex: 0 0 auto; }
.search-submit:hover { background: #e0ecff; }
.sort-label { min-width: 200px; }
.sort-label select { width: 100%; font-size: 16px; color: #3e5677; border: 1px solid #bccadd; border-radius: 9px; background: #fff; padding: 12px 30px 12px 14px; min-height: 50px; }
.status-filters { display: flex; align-items: center; gap: 8px; padding: 0 24px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.status-filter { display: inline-flex; gap: 8px; justify-content: center; align-items: center; min-height: 44px; padding: 9px 12px; border: 1px solid #d3deeb; border-radius: 8px; background: #fff; font-size: 16px; font-weight: 550; color: #4d6481; line-height: 1.5; }
.status-filter > span { font-size: 12px; line-height: 1.5; background: #edf1f7; color: #4b6281; padding: 1px 5px; min-width: 22px; border-radius: 4px; text-align: center; }
.status-filter:hover { background: #f2f6fd; }
.status-filter.active { color: #1256b7; border-color: #7ca7e9; background: #edf4ff; }
.status-filter.active > span { background: #d8e8ff; color: #225b9f; }
.table-head, .order-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(165px, 1.2fr) minmax(130px, .9fr) minmax(112px, .8fr) 22px; gap: 16px; align-items: center; }
.table-head { padding: 16px 24px; background: #f7f9fc; border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: .6px; color: #506781; font-weight: 650; }
.order-row { border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; width: 100%; text-align: left; background: #fff; padding: 22px 21px; position: relative; color: inherit; }
.order-row:hover { background: #f2f7ff; }
.order-row:focus-visible { z-index: 1; outline-offset: -3px; }
.order-row:last-child { border-bottom: 0; }
.order-row.row-new { border-left-color: #3379dd; }
.customer-cell { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.customer-avatar { width: 40px; height: 40px; border-radius: 11px; background: #edf2f9; color: #496c98; display: grid; place-items: center; font-size: 16px; font-weight: 650; flex: 0 0 auto; }
.row-new .customer-avatar { background: #e7f0ff; color: #1d61bd; }
.customer-copy, .service-cell { min-width: 0; }
.customer-copy strong { display: block; font-size: 16px; line-height: 1.5; font-weight: 650; color: #2b4567; overflow-wrap: anywhere; }
.customer-copy small { font-size: 12px; line-height: 1.6; color: #5b6f89; display: block; margin-top: 5px; overflow-wrap: anywhere; }
.service-cell strong { font-size: 14px; display: block; color: #435d7e; font-weight: 550; line-height: 1.65; overflow-wrap: anywhere; }
.service-cell small { font-size: 12px; color: #5e728b; display: block; margin-top: 5px; line-height: 1.65; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 5px 9px; border-radius: 6px; font-size: 12px; line-height: 1.55; font-weight: 600; background: #edf1f6; color: #4e6481; overflow-wrap: anywhere; }
.status-badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; flex: 0 0 auto; }
.status-new { background: #eaf2ff; color: #195bb9; }
.status-contacted { background: #f0edff; color: #62469d; }
.status-proposal { background: #fff3df; color: #80540b; }
.status-in_progress { background: #e5f4f2; color: #21675f; }
.status-completed { background: #eaf4ee; color: #2c6b43; }
.status-archived { background: #edf0f4; color: #526174; }
.date-cell { font-size: 14px; color: #4f6583; line-height: 1.7; }
.date-cell small { display: block; font-size: 12px; color: #61758e; margin-top: 4px; }
.row-arrow { font-size: 23px; color: #4d6f9c; text-align: right; font-weight: 400; }
.list-message { margin: 20px 24px; padding: 14px 16px; color: #355980; background: #eef4ff; border: 1px solid #cbdcf5; border-radius: 8px; font-size: 16px; overflow-wrap: anywhere; }
.list-message.is-error { color: #8d3826; background: #fff3ed; border-color: #e6b7a4; }
.list-footer { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; gap: 16px; flex-wrap: wrap; }
.list-footer > p { font-size: 14px; color: var(--muted); margin: 0; }
.pagination { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #4b6484; }
.pagination-arrow { width: 44px; height: 44px; background: #fff; border: 1px solid #bfcddf; border-radius: 8px; color: #3e608d; font-size: 21px; display: grid; place-items: center; }
.pagination-arrow:disabled { opacity: .4; }
.empty-state { text-align: center; padding: 52px 28px; background: radial-gradient(ellipse at 50% 10%, #f1f6ff, transparent 70%); }
.empty-art { height: 64px; width: 64px; display: grid; place-items: center; color: #3c70b6; border: 1px solid #c3d9f8; border-radius: 18px; background: #eaf2ff; margin: 0 auto 24px; font-size: 34px; }
.empty-state h3 { font-size: 24px; line-height: 1.4; color: #344f72; font-weight: 600; margin: 0 0 16px; letter-spacing: -.5px; }
.empty-state p { max-width: 540px; margin: 0 auto 24px; font-size: 16px; color: var(--muted); line-height: 1.85; }
.text-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; background: transparent; color: #1b5cb8; font-size: 16px; font-weight: 600; padding: 8px 4px; }
.dashboard-footnote { display: flex; gap: 8px; align-items: flex-start; justify-content: center; font-size: 12px; color: var(--muted); margin: 22px 0 0; }
.dashboard-footnote > span { font-size: 18px; flex: 0 0 auto; line-height: 1.2; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 18px clamp(24px, 3vw, 48px); color: var(--muted); font-size: 12px; gap: 16px; flex-wrap: wrap; }
.workspace-footer > span { font-weight: 550; }
.workspace-footer i { font-style: normal; padding: 0 6px; }
.workspace-footer > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }

/* The dialog itself scrolls, keeping long briefs and the form in one flow. */
.order-dialog { border: 1px solid #cad5e5; border-radius: 18px 0 0 18px; position: fixed; inset: 0 0 0 auto; margin: 0; width: min(680px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; padding: 0; color: var(--ink); box-shadow: -15px 0 80px #05234c25; background: #fff; overflow: auto; overscroll-behavior: contain; }
.order-dialog[open] { animation: drawer-in .22s ease-out; }
.order-dialog::backdrop { background: #06142699; backdrop-filter: blur(3px); }
.detail-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; border-bottom: 1px solid var(--line); gap: 16px; background: #fff; }
.detail-header > div { min-width: 0; }
.detail-header .eyebrow { font-size: 12px; letter-spacing: .8px; }
.detail-header h2 { font-size: 26px; font-weight: 650; letter-spacing: -.7px; margin: 8px 0 0; line-height: 1.3; }
.close-dialog { width: 44px; height: 44px; display: grid; place-items: center; line-height: 1; border: 1px solid #bccbdd; border-radius: 50%; color: #46668f; background: #fff; flex: 0 0 auto; font-size: 30px; font-weight: 400; }
.close-dialog:hover { background: #edf3fc; }
.detail-scroll { padding: 28px 32px 32px; }
.detail-person { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-avatar { width: 52px; height: 52px; border-radius: 14px; background: #e9f2ff; color: #2769c1; display: grid; place-items: center; font-size: 23px; font-weight: 650; flex: 0 0 auto; }
.detail-person > div { min-width: 0; flex: 1 1 180px; }
.detail-person h3 { font-size: 22px; line-height: 1.4; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.detail-person p { font-size: 14px; color: var(--muted); margin: 6px 0 0; overflow-wrap: anywhere; }
.detail-person > .status-badge { font-size: 14px; }
.detail-contact { display: flex; align-items: center; gap: 12px; padding: 22px 0; color: #3f608a; font-size: 16px; overflow-wrap: anywhere; flex-wrap: wrap; }
.contact-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; color: #1c5eb8; font-weight: 600; background: #edf4ff; border: 1px solid #bfd6f8; border-radius: 8px; padding: 9px 13px; font-size: 16px; max-width: 100%; overflow-wrap: anywhere; }
.contact-action > span { flex: 0 0 auto; }
.contact-plain { font-size: 16px; color: #425f85; max-width: 100%; overflow-wrap: anywhere; }
.detail-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; background: #f5f8fc; border: 1px solid #dce5f1; border-radius: 12px; padding: 24px; }
.detail-facts > div > span { display: block; font-size: 12px; letter-spacing: .7px; color: #536b8b; margin-bottom: 8px; }
.detail-facts strong { font-weight: 600; color: #334e72; font-size: 16px; display: block; overflow-wrap: anywhere; line-height: 1.7; }
.brief-section { margin: 30px 0 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.brief-section h3, .edit-heading h3 { font-size: 20px; margin: 0 0 14px; font-weight: 650; line-height: 1.4; }
.brief-section > p { font-size: 16px; line-height: 1.9; color: #425b7c; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.reference-project { display: flex; flex-direction: column; gap: 5px; border-left: 3px solid #4984d8; padding-left: 14px; margin-top: 24px; }
.reference-project > span { font-size: 14px; color: var(--muted); }
.reference-project > strong { font-size: 16px; font-weight: 600; color: #3b5f8e; overflow-wrap: anywhere; }
.order-edit { padding-top: 28px; }
.edit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.edit-heading h3 { margin: 0; }
.edit-heading > span { font-size: 12px; letter-spacing: .8px; color: var(--muted); }
.order-edit > label { color: #365173; }
.order-edit > label > span { font-size: 12px; color: var(--muted); font-weight: 400; padding-left: 5px; }
.order-edit textarea { resize: vertical; min-height: 160px; line-height: 1.8; }
.field-hint { font-size: 14px; color: var(--muted); margin: 9px 0 0; }
.detail-updated { font-size: 12px; color: var(--muted); margin-top: 18px; }
.detail-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.save-status { font-size: 14px; text-align: right; color: #2d704a; margin: 14px 0 0; }
.save-status:empty { display: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #18304d; color: #fff; box-shadow: 0 8px 28px #142a4026; z-index: 20; border: 1px solid #6b89b0; border-radius: 10px; padding: 16px 22px; width: max-content; max-width: min(600px, calc(100% - 32px)); font-size: 16px; text-align: center; overflow-wrap: anywhere; }
.noscript-note { position: fixed; inset: auto 15px 15px; background: #fff; border: 1px solid #c4d2e5; border-radius: 8px; padding: 20px; color: #263a56; text-align: center; z-index: 30; }

@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(25px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 1279px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .workspace-header { min-height: 76px; }
  .breadcrumb { display: none; }
  .mobile-wordmark { display: inline-block; }
  .page-heading { align-items: flex-start; }
  .page-actions { padding-top: 16px; }
  .panel-indicator { display: none; }
}

@media (min-width: 1280px) and (max-height: 680px) {
  .sidebar-bottom { display: none; }
  .sidebar-kicker { margin-top: 28px; }
}

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: minmax(300px, 42%) minmax(0, 1fr); }
  .auth-story { padding: 32px 28px; }
  .auth-story h2 { font-size: 36px; }
  .inbox-art { margin-left: -20px; transform: scale(.85); transform-origin: left center; }
  .page-heading { display: block; }
  .page-actions { padding-top: 22px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-head { display: none; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 16px 20px; padding: 24px; }
  .customer-cell { grid-column: 1; grid-row: 1; }
  .service-cell { grid-column: 1; grid-row: 2; padding-left: 52px; }
  .order-row > .status-badge { grid-column: 2; grid-row: 1; justify-self: end; }
  .date-cell { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; text-align: right; }
  .row-arrow { display: none; }
}

@media (max-width: 760px) {
  .auth-shell { display: block; background: #fbfcfe; }
  .auth-story { padding: 26px 24px 30px; }
  .auth-story-body { padding-top: 32px; }
  .auth-story h2 { font-size: clamp(30px, 6vw, 40px); letter-spacing: -1px; margin: 18px 0; }
  .auth-story h2 br { display: none; }
  .auth-story-body > p { max-width: 580px; }
  .inbox-art, .auth-story-foot { display: none; }
  .auth-main { padding: 20px 24px 28px; }
  .auth-card { padding: 32px 0 40px; max-width: 580px; }
  .auth-description { margin-bottom: 24px; }
  .workspace-header { padding: 12px 24px; }
  .dashboard { padding: 28px 24px; }
  .workspace-footer { padding: 16px 24px; }
  .search-toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-box { width: 100%; }
  .sort-label { min-width: 0; width: 100%; }
  .panel-heading h2 { font-size: 20px; }
  .detail-header { padding: 22px 24px; }
  .detail-scroll { padding: 24px; }
}

@media (max-width: 600px) {
  .auth-story { padding: 18px 24px; }
  .auth-story-body { display: none; }
  .auth-main { padding-top: 16px; }
  .auth-card { padding-top: 20px; }
}

@media (max-width: 540px) {
  .workspace-header { padding: 10px 16px; gap: 10px; }
  .account-avatar, .account-name { display: none; }
  .logout-button { margin-left: 0; padding: 8px; border-left: 0; }
  .dashboard { padding: 26px 16px; }
  .page-heading h1 { font-size: clamp(32px, 9vw, 40px); }
  .page-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .page-actions .button { padding: 12px 8px; font-size: 16px; gap: 6px; }
  .page-actions .button svg { width: 18px; height: 18px; }
  .stats-grid { gap: 12px; margin-bottom: 24px; }
  .stat-card { padding: 18px 14px; }
  .stat-card > span { padding-right: 0; font-size: 14px; }
  .stat-card > strong { font-size: 34px; }
  .stat-icon { display: none; }
  .orders-panel { border-radius: 12px; }
  .panel-heading { padding: 22px 16px; }
  .panel-heading h2 { gap: 8px; font-size: 20px; }
  .panel-heading p { font-size: 12px; }
  .search-toolbar { padding: 0 16px 18px; }
  .search-box { padding-left: 10px; gap: 8px; }
  .search-box > svg { display: none; }
  .search-box > input { font-size: 16px; }
  .search-submit { padding: 8px 10px; font-size: 16px; }
  .status-filters { padding: 0 16px 18px; gap: 8px; }
  .status-filter { font-size: 16px; padding: 8px 10px; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; padding: 22px 16px; gap: 16px 10px; }
  .customer-cell { grid-column: 1 / -1; grid-row: 1; }
  .service-cell { grid-column: 1 / -1; grid-row: 2; padding-left: 0; }
  .service-cell strong { font-size: 16px; }
  .service-cell small { font-size: 14px; }
  .order-row > .status-badge { grid-column: 1; grid-row: 3; justify-self: start; }
  .date-cell { grid-column: 2; grid-row: 3; font-size: 14px; }
  .date-cell small { display: none; }
  .list-message { margin: 18px 16px; }
  .list-footer { padding: 16px; gap: 14px; }
  .pagination { margin-left: auto; }
  .empty-state { padding: 36px 20px; }
  .empty-state h3 { font-size: 22px; }
  .dashboard-footnote { justify-content: flex-start; }
  .workspace-footer { padding: 16px; gap: 4px 16px; }
  .order-dialog { width: 100%; border: 0; border-radius: 0; }
  .detail-header { padding: 18px 20px; gap: 12px; }
  .detail-header .eyebrow { font-size: 12px; letter-spacing: .4px; }
  .detail-header h2 { font-size: 22px; }
  .detail-scroll { padding: 24px 20px; }
  .detail-person { gap: 12px; }
  .detail-person > div { flex-basis: calc(100% - 64px); }
  .detail-person h3 { font-size: 22px; }
  .detail-person > .status-badge { margin-top: 4px; }
  .detail-facts { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 20px; }
  .edit-heading > span { font-size: 12px; }
  .detail-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .detail-actions .primary { grid-row: 1; }
  .detail-actions .button { width: 100%; }
  .save-status { text-align: left; }
  .toast { bottom: 16px; font-size: 14px; padding: 14px 16px; }
}

/* Account management stays in one scrollable, keyboard-accessible dialog. */
.team-dialog { width: min(1100px, calc(100% - 48px)); max-width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #c8d6e9; border-radius: 20px; color: var(--ink); background: #f7f9fc; box-shadow: 0 32px 120px #03122f55; overflow: auto; overscroll-behavior: contain; }
.team-dialog::backdrop { background: #061426ad; backdrop-filter: blur(5px); }
.team-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 32px; background: var(--navy); color: #fff; }
.team-header > div { min-width: 0; }
.team-header .eyebrow { color: #abc5e9; font-size: 12px; letter-spacing: 1px; }
.team-header h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; font-weight: 650; letter-spacing: -.9px; margin: 8px 0 0; overflow-wrap: anywhere; }
.team-header h2 > span { color: #71b6ff; }
.team-header .close-dialog { border-color: #526c8f; background: #ffffff0a; color: #d3e7ff; }
.team-header .close-dialog:hover { background: #ffffff1a; }
.team-content { padding: 28px 32px 32px; }
.team-description { font-size: 16px; color: #49607e; max-width: 780px; margin: 0 0 28px; line-height: 1.85; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.team-create, .team-members { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: #fff; }
.team-section-heading { display: flex; align-items: flex-start; gap: 14px; }
.team-section-heading > div { min-width: 0; }
.team-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: #eaf2ff; color: #2164bd; font-size: 26px; line-height: 1; }
.team-section-heading h3, .team-list-heading h3 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.45; letter-spacing: -.4px; }
.team-section-heading p { font-size: 14px; color: var(--muted); margin: 8px 0 0; line-height: 1.8; }
.team-form { margin-top: 24px; }
.team-form fieldset, .access-confirm fieldset { border: 0; min-width: 0; padding: 0; margin: 0; }
.team-form label, .access-confirm label { font-size: 14px; color: #344e70; font-weight: 600; display: block; margin: 20px 0 8px; line-height: 1.6; }
.team-form fieldset > label:first-of-type { margin-top: 0; }
.team-form input, .access-confirm input { display: block; width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; color: var(--ink); border: 1px solid #b7c8df; background: #fcfdff; border-radius: 8px; font-size: 16px; line-height: 1.5; }
.team-form input::placeholder { color: #6a7c93; opacity: 1; }
.team-form .field-hint { font-size: 13px; line-height: 1.75; }
.owner-confirm { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 2px; }
.team-form > .button { margin-top: 24px; }
.team-form .form-message { margin-bottom: 0; }
.team-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-list-heading .eyebrow { font-size: 11px; letter-spacing: .8px; margin-bottom: 6px; }
.team-list-heading h3 > span { font-size: 14px; font-weight: 600; color: #3e6492; background: #eaf1fc; padding: 3px 9px; margin-left: 5px; border-radius: 6px; }
.team-refresh { width: 44px; height: 44px; border: 1px solid #bfcee1; border-radius: 10px; background: #fff; color: #456995; flex: 0 0 auto; font-size: 26px; line-height: 1; }
.team-refresh:hover { background: #edf4ff; }
.team-permissions { font-size: 14px; color: #526984; line-height: 1.85; margin: 20px 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.team-list { list-style: none; margin: 0; padding: 0; }
.team-member { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.team-member:first-child { padding-top: 0; }
.member-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #2f65ab; background: #edf3fc; font-size: 16px; font-weight: 650; }
.member-copy { min-width: 0; }
.member-copy > strong { font-size: 16px; font-weight: 650; display: block; overflow-wrap: anywhere; line-height: 1.6; }
.member-login { display: block; font-size: 14px; color: #536d8e; overflow-wrap: anywhere; line-height: 1.7; margin: 2px 0 8px; }
.member-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.member-role, .member-state { display: inline-block; font-size: 12px; line-height: 1.6; font-weight: 600; background: #edf1f7; color: #4d6585; border-radius: 5px; padding: 3px 7px; }
.owner-role { color: #22599e; background: #e9f2ff; }
.member-state { color: #2a6843; background: #eaf5ed; }
.member-state.access-closed { color: #8b4a31; background: #fff0e9; }
.member-date { display: block; margin-top: 9px; color: #61758e; font-size: 12px; line-height: 1.7; }
.member-disabled .member-avatar { background: #edf0f4; color: #6c7787; }
.member-toggle { grid-column: 2; justify-self: start; min-height: 44px; padding: 8px 12px; border: 1px solid #becce0; border-radius: 8px; font-size: 14px; color: #3f608a; background: #fff; text-align: left; }
.member-toggle:hover { background: #edf3fc; }
.team-limit { font-size: 13px; color: #61738b; margin: 18px 0 0; line-height: 1.8; }
.access-confirm { margin-top: 24px; padding: 20px; border: 1px solid #abc6ed; border-radius: 12px; background: #f1f6fe; }
.access-confirm h4 { font-size: 18px; line-height: 1.5; margin: 0 0 12px; }
.access-confirm > p { font-size: 14px; line-height: 1.9; margin: 0; color: #456183; overflow-wrap: anywhere; }
.access-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.access-actions .button { flex: 1 1 140px; padding: 11px 12px; font-size: 14px; }

@media (min-width: 1051px) {
  .page-heading:has(#manage-admins-button:not([hidden])) { flex-wrap: wrap; }
}
@media (max-width: 800px) {
  .team-layout { grid-template-columns: minmax(0, 1fr); }
  .team-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .team-header { padding: 24px; }
  .team-content { padding: 24px; }
}
@media (max-width: 540px) {
  #manage-admins-button { grid-column: 1 / -1; }
  .team-dialog { width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .team-header { padding: 20px 16px; gap: 10px; }
  .team-header .eyebrow { font-size: 10px; letter-spacing: .6px; }
  .team-header h2 { font-size: clamp(22px, 6vw, 28px); }
  .team-content { padding: 24px 16px; }
  .team-create, .team-members { padding: 20px 16px; }
  .team-section-heading { gap: 10px; }
  .team-section-heading h3, .team-list-heading h3 { font-size: 19px; }
  .team-icon { width: 32px; height: 32px; font-size: 23px; }
  .team-form label, .access-confirm label { font-size: 14px; }
  .team-form > .button { font-size: 16px; padding: 13px 10px; }
  .access-confirm { padding: 16px; }
}

.form-message { color: #315b8b; border-color: #bbd2f1; background: #edf4ff; }
.form-message.is-error { color: #942f22; border-color: #db9d91; background: #fff1ed; }
.auth-help-link { display: block; width: fit-content; max-width: 100%; margin: 14px auto 0; padding: 10px 4px; min-height: 44px; background: transparent; border: 0; color: #255caa; font-size: 14px; font-weight: 600; line-height: 1.7; text-align: center; }
.auth-help-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.recovery-form .field-hint { font-size: 14px; line-height: 1.85; }
.recovery-explanation { font-size: 16px; color: var(--muted); line-height: 1.85; }
.recovery-seal { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 0 24px; border: 1px solid #bfd6f6; border-radius: 18px; color: #2465bd; background: #eaf2ff; font-size: 32px; font-weight: 600; }
.security-dialog { width: min(1080px, calc(100% - 48px)); }
.security-dialog .team-layout { align-items: stretch; }
.security-dialog.recovery-disabled .team-layout { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 801px) {
  .security-dialog.recovery-disabled { width: min(640px, calc(100% - 48px)); }
}
.security-dialog .team-description { margin-bottom: 24px; }
.recovery-email-state { margin-top: 24px; padding: 18px; border: 1px solid #d5e1f0; border-radius: 10px; background: #f5f8fd; }
.email-status { display: inline-block; background: #e8edf5; color: #536882; border-radius: 5px; padding: 3px 7px; font-size: 12px; font-weight: 600; line-height: 1.7; }
.email-status.email-verified { color: #2a6843; background: #e5f3e9; }
.recovery-email-state > strong { display: block; font-size: 16px; line-height: 1.8; margin-top: 9px; font-weight: 600; color: #344f72; overflow-wrap: anywhere; }
.recovery-email-state > p { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #d5e1f0; font-size: 14px; color: #4f6582; line-height: 1.85; overflow-wrap: anywhere; }
.mail-service-note { margin: 20px 0 0; font-size: 14px; color: #79500e; background: #fff6e6; border: 1px solid #e4cc9d; border-radius: 9px; padding: 14px; line-height: 1.85; }
.security-dialog .team-form .field-hint { font-size: 14px; }
@media (max-width: 800px) {
  .security-dialog { width: min(620px, calc(100% - 32px)); }
}
@media (max-width: 540px) {
  #security-button { grid-column: 1 / -1; }
  .security-dialog { width: 100%; }
  .recovery-email-state { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
