/* Additions for the signed-in, shared version of the tracker. styles.css is
   the original design and is left as it came. */

.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-name { color: var(--muted); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.load-error { margin: 48px auto; max-width: 420px; padding: 0 24px; text-align: center; color: var(--muted); }
.load-error strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 1rem; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 32px 30px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px #0b374414; }
.login-card img { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 22px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.25rem; color: var(--ink); }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-field { display: block; margin-bottom: 14px; color: var(--ink); font-weight: 650; }
.login-field input { display: block; width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #ccdde5; border-radius: 7px; font: inherit; font-weight: 400; color: var(--ink); background: white; }
.login-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card .primary-button, .microsoft-button { width: 100%; justify-content: center; margin-top: 6px; min-height: 42px; }
.microsoft-button { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; color: var(--ink); }
.microsoft-button[hidden] { display: none; }
.login-card p.login-error { min-height: 1.3em; margin: 12px 0 0; color: #ae293b; font-weight: 650; }

.nav-button[hidden] { display: none; }
a.nav-button { text-decoration: none; }

/* Pages inside the shared layout: Load orders and Admin settings */
a.breadcrumb-parent { color: inherit; text-decoration: none; }
a.breadcrumb-parent:hover { color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }
a.control { text-decoration: none; }
a.control.is-disabled { opacity: .44; cursor: default; }
.admin-nav { margin-top: 26px; }
.page-main { max-width: 1080px; padding-bottom: 60px; }
.page-head { margin: 10px 0 20px; }
.page-head h1 { color: var(--ink); font-size: 1.75rem; font-weight: 750; line-height: 1.15; letter-spacing: -.035em; }
.page-head p { margin-top: 7px; max-width: 74ch; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.page-card { margin-bottom: 16px; padding: 22px 24px 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { color: var(--ink); font-size: 1.15rem; font-weight: 750; line-height: 1.25; letter-spacing: -.02em; }
.panel-head p { margin-top: 6px; max-width: 72ch; color: var(--muted); line-height: 1.5; }
.panel-foot { margin-top: 22px; padding-top: 16px; max-width: 80ch; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.5; }
.panel-foot strong { color: var(--ink); }

/* Tabs */
.settings-card { overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: #f8fbfc; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 52px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-size: .86rem; font-weight: 680; white-space: nowrap; }
.tab .icon { width: 17px; height: 17px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--teal-ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tab:focus-visible { outline-offset: -4px; border-radius: 8px; }
.tab-count { min-width: 22px; padding: 1px 7px; border-radius: 20px; background: #e6eef2; color: #4d6572; font-size: .72rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: center; }
.tab[aria-selected="true"] .tab-count { background: var(--teal-soft); color: var(--teal-ink); }
.tab-state { padding: 2px 7px; border-radius: 20px; background: #e2f3ea; color: #1d6b4f; font-size: .68rem; font-weight: 750; }
.tab-state.is-problem { background: #fcecef; color: #ae293b; }
.tab-panel { padding: 24px 26px 28px; }
.tab-panel:focus-visible { outline-offset: -3px; border-radius: 0 0 var(--radius) var(--radius); }
.settings-problem { display: flex; align-items: center; gap: 10px; margin: 18px 26px 0; padding: 12px 14px; border: 1px solid #f0c4cb; border-radius: 10px; background: #fcecef; color: #ae293b; font-weight: 650; }

/* Status pills and message boxes */
.state-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 30px; background: var(--canvas); color: var(--muted); font-size: .76rem; font-weight: 720; white-space: nowrap; }
.state-pill:empty { display: none; }
.state-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.state-on { border-color: #b5dcc8; background: #e5f4ec; color: #1d6b4f; }
.state-ready { border-color: #abd5df; background: var(--teal-soft); color: var(--teal-ink); }
.state-warning { border-color: #f0d3a8; background: #fff6e9; color: #8a4b12; }
.state-danger { border-color: #f0c4cb; background: #fcecef; color: #ae293b; }
.notice { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--ink); line-height: 1.5; }
.notice > .icon { width: 18px; height: 18px; margin-top: 1px; }
.notice-body { flex: 1; min-width: 0; }
.notice strong { color: var(--ink); }
.notice-body > strong { display: block; }
.notice p { margin: 2px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.notice small { display: block; margin-top: 6px; color: var(--muted); }
.notice a { color: var(--teal-ink); font-weight: 650; }
.notice .copy-row { margin-top: 12px; }
.notice-ready { border-color: #abd5df; background: var(--teal-soft); }
.notice-ready > .icon { color: var(--teal-ink); }
.notice-done { border-color: #b5dcc8; background: #e5f4ec; }
.notice-done > .icon { color: #1d6b4f; }
.notice-warning { border-color: #f0d3a8; background: #fff6e9; }
.notice-warning > .icon { color: #a35a12; }
.notice-danger { border-color: #f0c4cb; background: #fcecef; }
.notice-danger > .icon { color: #ae293b; }

/* Forms */
#microsoft-form, #onedrive-form { max-width: 640px; }
.field { display: block; margin-bottom: 16px; color: var(--ink); font-size: .84rem; font-weight: 650; }
.field > span { display: block; }
.field small, .check small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.4; }
.field input, .copy-row input, .names-row input { display: block; width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #ccdde5; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-weight: 400; }
.field > input { margin-top: 6px; }
.field input:hover, .copy-row input:hover, .names-row input:hover { border-color: #acc7d1; }
.field input:focus-visible, .copy-row input:focus-visible, .names-row input:focus-visible { outline: 0; border-color: #2c97ae; box-shadow: 0 0 0 3px #d7eef2; }
.field input::placeholder, .names-row input::placeholder { color: #8fa2ad; opacity: 1; }
.copy-row input[readonly] { background: var(--canvas); color: #2f4b58; font-size: .82rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-short { max-width: 170px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field .copy-row { margin-top: 6px; }
.copy-row input { flex: 1 1 240px; width: auto; min-width: 0; }
.copy-row .control { min-height: 40px; padding: 0 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); font-size: .84rem; font-weight: 650; cursor: pointer; }
/* min-height and padding: a tick box inside a .field must not take the text boxes' size. */
.check input { flex: none; width: 17px; min-height: 0; height: 17px; margin: 1px 0 0; padding: 0; accent-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 16px; }
.form-actions-start { justify-content: flex-start; }
.form-actions .control { min-height: 40px; padding: 0 16px; }
.form-feedback { color: var(--muted); font-size: .84rem; line-height: 1.45; }
p.form-feedback { margin: 12px 0 0; }
p.form-feedback:empty { display: none; }
.is-problem { color: #ae293b; }
.sub-panel { margin-top: 22px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfc; }
.sub-panel h3 { margin: 0 0 4px; color: var(--ink); font-size: .95rem; }
.sub-panel > p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.sub-panel > p:last-child { margin-bottom: 0; }
.sub-panel > p.is-problem { color: #ae293b; }
.sub-panel .field { margin-bottom: 0; }
.danger-button { border-color: #ae293b; background: #ae293b; color: white; }
.danger-button:hover:not(:disabled) { border-color: #8f1f2f; background: #8f1f2f; color: white; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }

/* People */
/* styles.css sets every table cell up for the orders table (one line, fixed height); these tables undo that. */
.table-scroll, .import-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.people-table, .import-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
:is(.people-table, .import-table) thead tr { border: 0; }
:is(.people-table, .import-table) th { height: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #f8fbfc; color: var(--subtle); font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
:is(.people-table, .import-table) td { height: auto; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); white-space: normal; vertical-align: middle; }
:is(.people-table, .import-table) tbody tr:last-child td { border-bottom: 0; }
.people-table tbody tr:hover { background: #fafcfd; }
.import-table td { vertical-align: top; overflow-wrap: anywhere; }
.import-table td:first-child { white-space: nowrap; }
details .import-table { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.person { display: flex; align-items: flex-start; gap: 11px; min-width: 190px; }
.avatar { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); font-size: .74rem; font-weight: 750; }
.person-name { min-width: 0; }
.person-name strong, .person-name small { display: block; }
.person-name small { margin-top: 1px; color: var(--muted); overflow-wrap: anywhere; }
.you-badge { margin-left: 4px; padding: 1px 7px; border-radius: 30px; background: var(--teal-soft); color: var(--teal-ink); font-size: .68rem; font-weight: 750; vertical-align: 1px; }
.role-badge { display: inline-block; padding: 3px 9px; border-radius: 6px; background: #eef3f6; color: #415965; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.role-admin { background: #ece8f7; color: #5b4696; }
.access { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #415965; font-size: .76rem; white-space: nowrap; }
.access::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9db0ba; }
.access-ok::before { background: #2f9a6d; }
.access-waiting::before { background: #d9902f; }
.access-off { color: var(--muted); }
.is-off .avatar { background: #eef3f6; color: var(--subtle); }
.is-off .person-name strong { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-action { min-height: 31px; padding: 0 10px; font-size: .77rem; }

/* Microsoft 365 steps */
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 26px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ""; position: absolute; top: 38px; bottom: 6px; left: 15px; width: 2px; border-radius: 2px; background: var(--line); }
.step.is-done:not(:last-child)::before { background: #b5dcc8; }
.step-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid #c5d6de; border-radius: 50%; background: white; color: var(--muted); font-size: .84rem; font-weight: 750; }
.step.is-done .step-mark { border-color: #2f9a6d; background: #2f9a6d; color: white; }
.step-mark .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.step-body h3 { margin: 5px 0 4px; color: var(--ink); font-size: 1rem; letter-spacing: -.01em; }
.step-body > p { margin: 0 0 14px; max-width: 72ch; color: var(--muted); line-height: 1.5; }
.step-body .form-actions { margin-top: 0; }
.step-body form .form-actions { margin-top: 18px; }
.step-body .notice { max-width: 640px; margin: 14px 0 0; }

/* Role pickers and the OMBU tick boxes */
.field .select-field, .names-row .select-field { display: flex; }
.field .select-field { margin-top: 6px; }
.field .select-field select, .names-row .select-field select { min-height: 40px; font-size: .875rem; font-weight: 400; color: var(--ink); }
.names-row .select-field { flex: 1 1 260px; min-width: 0; }
.role-field select { min-width: 138px; min-height: 33px; padding-right: 27px; font-weight: 650; }
.manages { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 11px; border: 1px solid #ccdde5; border-radius: 8px; background: white; font-weight: 650; cursor: pointer; }
.chip:hover { border-color: #acc7d1; }
.chip:has(input:checked) { border-color: #2c97ae; background: var(--teal-soft); color: var(--teal-ink); }
.chip input { display: inline-block; width: 16px; min-height: 0; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.chip small { display: inline; margin: 0 0 0 3px; }
.form-actions-end { justify-content: flex-end; }
.chip.is-fixed { background: var(--canvas); cursor: default; }
.invite-owners { margin: 16px 0 0; }
.sees-cell { min-width: 150px; }
.sees { display: block; font-weight: 650; }
.sees-change { display: block; margin-top: 4px; padding: 0; font-size: .78rem; }
.small-dialog { width: min(100% - 32px, 520px); padding: 24px 26px; border: 0; border-radius: 16px; background: white; color: var(--ink); box-shadow: 0 18px 60px #06263340; }
.small-dialog::backdrop { background: #102e42a6; }
.small-dialog h2 { margin-bottom: 18px; font-size: 1.2rem; letter-spacing: -.02em; }
.small-dialog .form-feedback { margin: 0; }
.sub-panel .field-row + .field-row { margin-top: 16px; }

/* Account manager names */
.names-list { max-width: 720px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.names-row { display: flex; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.names-row:last-child { border-bottom: 0; }
.names-code { flex: 0 0 150px; font-weight: 700; font-variant-numeric: tabular-nums; }
.names-code small { display: block; color: var(--muted); font-weight: 400; }
.names-row input { flex: 1 1 240px; width: auto; min-width: 0; }
.empty-note { margin: 0; padding: 18px 16px; color: var(--muted); }

/* Load orders */
.import-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.import-pick input { flex: 1 1 260px; min-width: 0; padding: 9px; border: 1px dashed #b9cfd9; border-radius: 8px; background: var(--canvas); color: var(--ink); font: inherit; }
.import-pick .control { min-height: 40px; padding: 0 16px; }
.import-outcome { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); line-height: 1.5; }
.import-outcome h3 { margin: 0 0 6px; color: var(--ink); font-size: .95rem; }
.import-outcome p { margin: 0 0 8px; color: var(--ink); }
.import-outcome p:last-child { margin-bottom: 0; }
.import-outcome a { color: var(--teal-ink); font-weight: 650; }
.import-outcome summary { margin: 4px 0 8px; color: var(--teal-ink); font-weight: 650; cursor: pointer; }
.import-ready { border-color: #abd5df; background: var(--teal-soft); }
.import-done { border-color: #b5dcc8; background: #e5f4ec; }
.import-problem { border-color: #f0c4cb; background: #fcecef; }
.import-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.import-note { margin: 0 0 12px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
#history .import-note { margin: 0; }
.import-note:empty { display: none; }
.import-note-problem, .import-cell-problem { color: #ae293b; }

@media (max-width: 760px) {
  .page-card { padding: 16px; }
  .tabs { padding: 0 6px; }
  .tab { padding: 0 11px; }
  .tab-panel { padding: 18px 16px 22px; }
  .panel-head { flex-direction: column; gap: 10px; }
  .field-row { grid-template-columns: 1fr; }
  .step { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .step-mark { width: 28px; height: 28px; }
  .step:not(:last-child)::before { top: 34px; left: 13px; }

  .names-row { flex-wrap: wrap; }
  .field input, .copy-row input, .names-row input, .import-pick input { font-size: 1rem; }
}

/* Customer link controls in the order details */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-row input { flex: 1 1 240px; min-width: 0; padding: 8px 9px; border: 1px solid #ccdde5; border-radius: 7px; color: var(--ink); background: var(--canvas); font: inherit; font-size: .8rem; }
.share-note { display: block; margin-top: 8px; color: var(--muted); }

/* The customer's order status page */
.status-body { min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); }
.status-top { padding: 18px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.status-top img { display: block; height: 40px; width: auto; margin: 0 auto; }
.status-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 8px; }
.status-card { margin-bottom: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.status-card h1 { margin: 0 0 10px; font-size: 1.45rem; line-height: 1.25; text-wrap: balance; }
.status-card h2 { margin: 0 0 12px; font-size: 1rem; }
.status-message p, .status-loading { margin: 0; color: var(--muted); }
.status-loading { padding: 40px 0; text-align: center; }
.status-overline { margin: 0 0 4px; color: var(--teal-ink); font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.status-badge { display: inline-block; margin: 0 0 14px; padding: 4px 11px; border-radius: 30px; background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; font-size: .8rem; }
.status-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 6px 0 0; }
.status-facts dt { color: var(--muted); font-size: .76rem; }
.status-facts dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.status-track { height: 8px; border-radius: 8px; background: #e4edf0; overflow: hidden; margin-bottom: 16px; }
.status-track span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.status-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.status-stages li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.status-stages li.is-done { color: var(--ink); font-weight: 650; }
.status-mark { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #c5d6de; font-size: .8rem; line-height: 1; }
.is-done .status-mark { border-color: var(--accent); background: var(--accent); color: white; }
.status-tracking { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-tracking a { color: var(--teal-ink); font-weight: 650; }
.status-items { width: 100%; border-collapse: collapse; }
.status-items th, .status-items td { padding: 8px 12px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.status-items th { color: var(--muted); font-size: .76rem; font-weight: 680; }
.status-items tr:last-child td { border-bottom: 0; }
.status-items td:nth-child(2), .status-items th:nth-child(2) { text-align: right; padding-right: 0; white-space: nowrap; }
.status-items td:nth-child(3), .status-items th:nth-child(3) { padding-left: 16px; white-space: nowrap; }
.status-updated, .status-foot { color: var(--muted); font-size: .8rem; text-align: center; }
.status-updated { margin: 4px 0 0; }
.status-foot { padding: 18px 16px 28px; }

/* The customer lookup page */
.track-lead { margin: 0 0 18px; color: var(--muted); }
#lookup-form { max-width: 380px; }
#lookup-form .primary-button { min-height: 42px; padding-inline: 22px; }
.track-help { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.track-again { margin: 14px 0 0; text-align: center; }
.login-card p.login-track { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .86rem; text-align: center; }
.login-track a { color: var(--teal-ink); font-weight: 650; }

@media (max-width: 660px) {
  .account-name { display: none; }
}

/* The fold button belongs to the wide layout only; on a phone the menu has its own close button. */
@media (max-width: 1000px) {
  .sidebar .sidebar-toggle { display: none; }
}

/* The banner photo: placed so the stitched logo stays whole, and no wider than
   900px so a very wide screen does not crop it out of the short banner. */
.hero-photo { object-position: 68% 77%; max-width: 900px; }
