/* Print Signs Promo office: black type, red accent from the logo. */
:root { --ink: #111; --muted: #5f6368; --rule: #e3e3e3; --soft: #f6f6f4; --card: #fff; --red: #d1000a; --red-text: #b0000a; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body.spo-office { background: var(--soft); color: var(--ink); font: 14px/1.45 Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.spo-office a { color: var(--ink); }
.spo-office a:hover { color: var(--red); }
.o-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.o-skip { position: absolute; left: -999px; top: 8px; background: #111; color: #fff !important; padding: 8px 12px; border-radius: 6px; z-index: 99; }
.o-skip:focus { left: 8px; }
.spo-office :focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* Frame */
.o-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.o-side { flex: 0 0 236px; background: #fff; border-right: 1px solid var(--rule); padding: 20px 14px; display: flex; flex-direction: column; gap: 16px; }
.o-logo { display: block; padding: 0 8px; }
.o-logo img { width: 180px; max-width: 100%; height: auto; display: block; }
.o-nav { display: flex; flex-direction: column; gap: 2px; }
.o-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.o-nav a:hover { background: #f1f1ef; color: var(--ink); }
.o-nav a.on { background: #111; color: #fff; font-weight: 600; }
.o-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.o-nav a.on .o-count { color: #d0d0d0; }
.o-me { margin-top: auto; border-top: 1px solid var(--rule); padding: 12px 8px 0; display: grid; grid-template-columns: 32px 1fr; gap: 4px 10px; align-items: center; }
.o-avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.o-me-text { display: flex; flex-direction: column; line-height: 1.25; }
.o-me-text span { font-size: 12px; color: var(--muted); }
.o-me-links { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 13px; padding-top: 6px; }
.o-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.o-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--rule); }
.o-search { flex: 1 1 320px; max-width: 640px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid #d0d0d0; border-radius: 10px; background: #fafafa; color: var(--muted); }
.o-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.o-content { padding: 24px 28px 48px; }
.o-page { max-width: 1240px; display: flex; flex-direction: column; gap: 18px; }
.o-narrow { max-width: 560px; }

/* Buttons */
.o-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid #d0d0d0; border-radius: 8px; background: #fff; color: var(--ink) !important; font: 600 13px/1 Inter, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.o-btn:hover { border-color: #111; }
.o-btn-dark { background: #111; border-color: #111; color: #fff !important; }
.o-btn-red { background: var(--red); border-color: var(--red); color: #fff !important; min-height: 44px; padding: 0 18px; font-size: 14px; }
.o-btn-red:hover, .o-btn-dark:hover { filter: brightness(1.12); }
.o-btn-big { width: 100%; min-height: 48px; font-size: 15px; }

/* Headings, notes */
.o-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.spo-office h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.spo-office h2 { margin: 0; font-size: 16px; font-weight: 700; }
.o-muted { color: var(--muted); }
.o-small { font-size: 12px; }
.o-center { text-align: center; }
.o-red { color: var(--red-text) !important; font-weight: 700; }
.o-note { padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.o-note-ok { background: #e5f4e4; color: #1e5b1a; }
.o-note-err { background: #fbebeb; color: #8a1f1f; }
.o-empty { color: var(--muted); padding: 10px 0; margin: 0; }

/* Segmented control and tabs */
.o-seg { display: inline-flex; border: 1px solid #d0d0d0; border-radius: 10px; overflow: hidden; background: #fff; }
.o-seg a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; text-decoration: none; font-weight: 600; font-size: 13px; }
.o-seg a.on { background: #111; color: #fff; }
.o-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.o-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid #d0d0d0; border-radius: 20px; background: #fff; text-decoration: none; font-weight: 600; font-size: 13px; }
.o-tabs a span { color: var(--muted); font-weight: 600; font-size: 12px; }
.o-tabs a.on { background: #111; color: #fff; border-color: #111; }
.o-tabs a.on span { color: #d0d0d0; }
.o-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.o-filter input[type=search] { flex: 1 1 260px; max-width: 420px; min-height: 40px; border: 1px solid #d0d0d0; border-radius: 8px; padding: 0 12px; font: inherit; background: #fff; }

/* Tiles and cards */
.o-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.o-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: #fff; border: 1px solid var(--rule); border-radius: 12px; text-decoration: none; }
.o-tile:hover { border-color: #111; color: var(--ink) !important; }
.o-tile-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.o-tile-v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.o-tile-s { font-size: 13px; color: var(--muted); }
.o-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.o-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px 20px; }
.o-card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.o-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid #efefef; text-decoration: none; }
.o-row-link:hover { color: var(--ink) !important; background: #fafaf8; }
.o-row-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; text-decoration: none; }
.o-row-actions { display: flex; gap: 8px; flex-basis: 100%; }
.o-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.o-day { flex: none; width: 52px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 6px 0; background: #f1f1ef; }
.o-day-late { background: var(--red); color: #fff; }
.o-act { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid #efefef; font-size: 13px; }
.o-act-when { flex: none; width: 112px; color: var(--muted); font-variant-numeric: tabular-nums; }
.o-act-what { display: flex; flex-direction: column; min-width: 0; }
.o-act-what a { text-decoration: none; }

/* Pills */
.o-pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 12px; padding: 3px 10px; white-space: nowrap; background: #f0f0f0; color: #3c3c3c; }
.o-pill-sent { background: #e7f1fb; color: #0a4b78; }
.o-pill-approved { background: #e5f4e4; color: #1e5b1a; }
.o-pill-complete { background: #111; color: #fff; }
.o-pill-declined { background: #fbebeb; color: #8a1f1f; }
.o-pill-expired { background: #fdf0d5; color: #7a4b00; }

/* Tables */
.o-table-wrap { background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow-x: auto; }
.o-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.o-table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.o-table td { padding: 12px 16px; border-bottom: 1px solid #efefef; vertical-align: middle; }
.o-table tbody tr:hover td { background: #fafaf8; }
.o-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.o-table a { text-decoration: none; }
.o-cell-main { display: flex; flex-direction: column; }
.o-cell-main span { font-size: 13px; color: var(--muted); }
.o-user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.o-inline { display: inline-flex; gap: 6px; align-items: center; }
.o-inline input, .o-inline select { min-height: 40px; border: 1px solid #d0d0d0; border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; max-width: 170px; }

/* Forms */
.o-add { padding: 0; }
.o-add summary { list-style: none; margin: 12px; display: inline-flex; }
.o-add summary::-webkit-details-marker { display: none; }
.o-add[open] summary { margin-bottom: 0; }
.o-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; padding: 16px 20px 20px; }
.o-form-stack { display: flex; flex-direction: column; gap: 14px; }
.o-form-grid label, .o-form-stack label, .o-login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.o-form-grid input, .o-form-grid select, .o-form-stack input, .o-login-form input[type=text], .o-login-form input[type=password] { min-height: 44px; border: 1px solid #d0d0d0; border-radius: 10px; padding: 0 12px; font: 400 15px Inter, sans-serif; background: #fff; width: 100%; }
.o-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; color: #3c3c3c; }
.o-check input { width: 18px; height: 18px; accent-color: var(--red); }

/* Sign-in */
.o-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.o-login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--rule); border-top: 6px solid var(--red); border-radius: 14px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.o-login-card h1 { font-size: 24px; }
.o-login-card p { margin: 0; }
.o-login-logo { width: 220px; max-width: 100%; height: auto; }
.o-login-form { display: flex; flex-direction: column; gap: 16px; }
.o-login-foot { max-width: 420px; margin: 16px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* Existing pages shown inside the office (estimate builder, customers, products, vendors, settings) */
.spo-office .wrap { max-width: 1240px; margin: 0; }
.spo-office .wrap > h1, .spo-office .wp-heading-inline { display: inline-block; margin: 0 12px 12px 0; }
.spo-office .page-title-action, .spo-office .button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid #d0d0d0; border-radius: 8px; background: #fff; color: var(--ink); font: 600 13px/1 Inter, sans-serif; text-decoration: none; cursor: pointer; vertical-align: middle; }
.spo-office .page-title-action { position: relative; top: -6px; }
.spo-office .button:hover, .spo-office .page-title-action:hover { border-color: #111; color: var(--ink); }
.spo-office .button-primary { background: #111; border-color: #111; color: #fff; }
.spo-office .button-primary:hover { color: #fff; filter: brightness(1.15); }
.spo-office .button-large { min-height: 44px; padding: 0 18px; font-size: 14px; }
.spo-office .description { color: var(--muted); font-size: 13px; }
.spo-office .notice { margin: 8px 0 14px; padding: 10px 14px; border-radius: 10px; background: #e5f4e4; color: #1e5b1a; border: 0; }
.spo-office .notice p { margin: 0; }
.spo-office .notice-error, .spo-office .notice-warning { background: #fbebeb; color: #8a1f1f; }
.spo-office .widefat { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.spo-office .widefat th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.spo-office .widefat td { padding: 10px 12px; border-bottom: 1px solid #efefef; vertical-align: top; }
.spo-office .striped > tbody > tr:nth-child(odd) td { background: #fbfbfa; }
.spo-office .spo-box { border-color: var(--rule); border-radius: 12px; max-width: 1240px; }
.spo-office .spo input[type=text], .spo-office .spo input[type=number], .spo-office .spo input[type=email], .spo-office .spo input[type=tel], .spo-office .spo input[type=date], .spo-office .spo input[type=search], .spo-office .spo input[type=url], .spo-office .spo select, .spo-office .spo textarea {
	min-height: 38px; border: 1px solid #c8c8c8; border-radius: 8px; padding: 6px 10px; font: 14px Inter, sans-serif; background: #fff; color: var(--ink); max-width: 100%;
}
.spo-office .spo textarea { min-height: 0; }
.spo-office .spo-sticky { background: var(--soft); }
.spo-office .spo-card { border-radius: 12px; }

@media (max-width: 760px) {
	.o-side { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--rule); padding: 14px 16px; gap: 10px; }
	.o-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
	.o-nav a { white-space: nowrap; }
	.o-me { display: flex; flex-wrap: wrap; padding-top: 10px; }
	.o-top { padding: 12px 16px; }
	.o-content { padding: 18px 16px 40px; }
	.o-grid { grid-template-columns: 1fr; }
	.o-btn-red { padding: 0 14px; }
}
/* Orders: QuickBooks list, bulk tools, pages */
.o-bulk { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: 10px 0 12px; }
.o-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.o-field input { height: 40px; border: 1px solid #d0d0d0; border-radius: 8px; padding: 0 10px; font: inherit; }
.o-qb-summary, .o-qb-cutoff { margin: 16px 0; }
.o-qb-summary h2, .o-qb-cutoff h2 { font-size: 16px; margin: 0 0 8px; }
.o-dl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.o-pages { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.o-pages a, .o-pages span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: 8px; background: #fff; text-decoration: none; color: var(--ink); font-weight: 600; }
.o-pages span[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.o-table input.o-qb-box { width: 20px; height: 20px; accent-color: var(--red); }
/* Search-as-you-type dropdown */
.o-search { position: relative; }
.o-q-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: #fff; border: 1px solid #d0d0d0; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 70vh; overflow-y: auto; padding: 6px 0; }
.o-q-group { padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.o-q-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; text-decoration: none; color: var(--ink); }
.o-q-item span { font-size: 13px; color: var(--muted); }
.o-q-item:hover, .o-q-item.on { background: #f1f1ef; }
.o-q-none { padding: 10px 14px; color: var(--muted); }

/* Stage filter and quick stage change */
.o-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.o-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--o-line, #e3e3e3); border-radius: 999px; color: inherit; text-decoration: none; font-size: 13px; background: #fff; }
.o-chips a span { color: #6b7280; font-weight: 600; }
.o-chips a.on { background: #111; border-color: #111; color: #fff; }
.o-chips a.on span { color: #ddd; }
.o-stage-form { margin: 0; }
.o-stage-form select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid #d0d0d0; border-radius: 6px; background: #fff; max-width: 190px; }

/* Reports */
.o-rep-form { margin: 14px 0; }
.o-rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 18px; }
.o-rep-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.o-rep-f > span { font-weight: 600; }
.o-rep-f select, .o-rep-f input[type=text], .o-rep-f input[type=date] { min-height: 38px; padding: 0 8px; border: 1px solid #ccc; border-radius: 6px; font: inherit; max-width: 100%; }
.o-rep-f input[type=date]:disabled { opacity: .45; }
.o-rep-radios { display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 38px; align-items: center; }
.o-rep-radios label { display: inline-flex; gap: 5px; align-items: center; font-weight: 400; }
.o-rep-out { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.o-rep-table td.n, .o-rep-table th.n { text-align: right; white-space: nowrap; }
.o-rep-table tfoot td { border-top: 2px solid #222; background: #fafafa; }
.o-rep-chart { padding: 8px 0; display: grid; gap: 6px; }
.o-rep-bar { display: grid; grid-template-columns: 90px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; }
.o-rep-track { background: #f1f1f1; border-radius: 4px; height: 18px; overflow: hidden; }
.o-rep-track span { display: block; height: 100%; background: #c8102e; border-radius: 4px; }
.o-rep-bv { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .o-rep-bar { grid-template-columns: 70px 1fr 90px; } }
@media print { .o-rep-form, .o-tabs, .o-side, .o-top, nav { display: none !important; } }

.o-rep-wide { grid-column: 1 / -1; max-width: 640px; }
.o-rep-dates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.o-rep-dates input { flex: 1 1 150px; }

/* Status colors (Oct 27): light blue = to-do, gray = done, outline = normal, dark red = needs attention. */
.o-pill.o-pill-qb-needs, .spo .spo-status.spo-qb-needs { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.o-pill.o-pill-qb-done, .spo .spo-status.spo-qb-entered { background: #ececec; color: #444; border: 1px solid #d0d0d0; }
.o-pill.o-pill-pay-open, .spo .spo-status.spo-st-pay-open { background: #fff; color: #333; border: 1px solid #9a9a9a; }
.o-pill.o-pill-pay-overdue, .spo .spo-status.spo-st-pay-overdue { background: #8b1a1a; color: #fff; border: 1px solid #8b1a1a; }
.o-pill.o-pill-pay-partial, .spo .spo-status.spo-st-pay-partial { background: #fde2b8; color: #7a3e00; border: 1px solid #f0b35e; }
.o-pill.o-pill-pay-done, .spo .spo-status.spo-st-pay-done { background: #ececec; color: #444; border: 1px solid #d0d0d0; }

/* Printed reports: letter paper, header row repeats on each page, rows never split. */
@media print {
	@page { size: letter; margin: 0.5in; }
	body { background: #fff !important; }
	.o-main, .o-page { padding: 0 !important; margin: 0 !important; }
	.o-head .o-muted, .o-card-h a, .o-rep-out { display: none !important; }
	.o-card { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
	.o-rep-table { font-size: 9.5px; width: 100%; }
	.o-rep-table th, .o-rep-table td { padding: 3px 5px !important; }
	.o-rep-table thead { display: table-header-group; }
	.o-rep-table tfoot { display: table-row-group; }
	.o-rep-table tr { break-inside: avoid; page-break-inside: avoid; }
	.o-table-wrap { overflow: visible !important; }
}

/* Buttons that DO something (send, add, record, mark, save) are black with white text.
   Links that only open or show something (Customer view, Print, folders) stay white. */
.spo-office button.button, .spo-office summary.button, .spo-office input[type=submit].button { background: #111; border-color: #111; color: #fff; }
.spo-office button.button:hover, .spo-office summary.button:hover, .spo-office input[type=submit].button:hover { background: #111; border-color: #111; color: #fff; filter: brightness(1.25); }
.spo-office button.button:disabled { background: #a3a3a3; border-color: #a3a3a3; color: #fff; cursor: not-allowed; filter: none; }
.spo-office button.button.spo-del { background: #fff; border-color: #8b1a1a; color: #8b1a1a; }
.spo-office button.button.spo-del:hover { background: #8b1a1a; color: #fff; filter: none; }
