:root {
    --ink: #1f2924;
    --ink-soft: #52605a;
    --muted: #75817b;
    --line: #dfe5e1;
    --line-strong: #cbd4ce;
    --surface: #ffffff;
    --surface-soft: #f5f7f5;
    --canvas: #edf1ee;
    --brand: #2f6b4f;
    --brand-dark: #24523d;
    --brand-soft: #e6f0ea;
    --blue: #356fa3;
    --blue-soft: #e9f1f8;
    --amber: #a96a18;
    --amber-soft: #f9efdf;
    --red: #ad4941;
    --red-soft: #f8e9e7;
    --shadow: 0 8px 24px rgba(29, 43, 35, 0.08);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a,
input,
select,
textarea {
    outline-color: var(--brand);
    outline-offset: 2px;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 66px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner,
.nav-inner,
.content-container,
.footer {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar-inner {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(280px, 520px) minmax(260px, 1fr);
    align-items: center;
    gap: 22px;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: white;
    font-size: 22px;
    flex: 0 0 36px;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 17px;
}

.brand-copy small {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search {
    position: relative;
}

.global-search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    color: var(--muted);
    font-size: 19px;
    transform: translateY(-50%);
    pointer-events: none;
}

.global-search input[type="search"] {
    width: 100%;
    height: 40px;
    padding: 0 46px 0 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
}

.global-search input:focus {
    border-color: var(--brand);
    background: white;
}

.global-search kbd {
    position: absolute;
    top: 9px;
    right: 10px;
    min-width: 23px;
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: white;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.search-results {
    display: none;
    position: absolute;
    top: 46px;
    left: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    box-shadow: var(--shadow);
    z-index: 100;
}

.search-results.open {
    display: block;
}

.search-results a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
}

.search-results a:last-child {
    border-bottom: 0;
}

.search-results a:hover {
    background: var(--surface-soft);
}

.search-results a > i {
    width: 28px;
    color: var(--brand);
    font-size: 20px;
    text-align: center;
}

.search-results a span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.search-results small {
    color: var(--muted);
}

.search-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    height: 44px;
    padding: 3px 5px;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 12px;
    font-weight: 700;
}

.profile-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.profile-copy strong {
    font-size: 13px;
}

.profile-copy small {
    color: var(--muted);
    font-size: 11px;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    width: 190px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    box-shadow: var(--shadow);
    z-index: 100;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown a {
    display: flex;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 4px;
}

.profile-dropdown a:hover {
    background: var(--surface-soft);
}

.mobile-menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    color: var(--ink);
    font-size: 21px;
}

.main-nav {
    height: 49px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 66px;
    z-index: 40;
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 3px;
}

.nav-link {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link i {
    font-size: 18px;
}

.nav-link:hover {
    color: var(--brand);
    background: var(--surface-soft);
}

.nav-link.active {
    color: var(--brand-dark);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    background: var(--brand);
}

.nav-settings-menu {
    margin-left: auto;
}

.nav-menu {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

.nav-settings {
    margin: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.nav-chevron {
    margin-left: 1px;
    font-size: 15px !important;
    transition: transform 160ms ease;
}

.nav-menu.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    width: 224px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    display: none;
    z-index: 60;
}

.nav-menu.open .nav-submenu {
    display: block;
}

.nav-submenu a {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 4px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
}

.nav-submenu a i {
    color: var(--muted);
    font-size: 17px;
}

.nav-submenu a:hover,
.nav-submenu a.active {
    background: var(--surface-soft);
    color: var(--brand-dark);
}

.nav-submenu a.active i {
    color: var(--brand);
}

.page-content {
    flex: 1;
    padding: 26px 0 46px;
}

.page-header {
    min-height: 50px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 25px;
    line-height: 1.2;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.btn {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.btn i {
    font-size: 18px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-secondary {
    background: white;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.btn-compact {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    min-height: 36px;
    padding: 0;
}

.text-link {
    color: var(--brand);
    font-weight: 650;
}

.text-link:hover {
    text-decoration: underline;
}

.stats-grid {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-grid.adaptive {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stat-card {
    min-height: 112px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: 8px;
}

.stat-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin: 8px 0 3px;
    font-size: 25px;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 21px;
}

.stat-icon.blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.stat-icon.amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.stat-icon.red {
    background: var(--red-soft);
    color: var(--red);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
    gap: 18px;
}

.content-grid.equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid.single,
.content-grid.equal.single,
.detail-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.surface {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.surface-header {
    min-height: 58px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.surface-header h2,
.surface-header h3 {
    margin: 0;
    font-size: 15px;
}

.surface-header p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.surface-body {
    padding: 16px;
}

.surface-body.flush {
    padding: 0;
}

.toolbar {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-search {
    position: relative;
    min-width: 240px;
    max-width: 420px;
    flex: 1;
}

.toolbar-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    color: var(--muted);
    font-size: 18px;
    transform: translateY(-50%);
}

.toolbar-search input[type="search"] {
    padding: 8px 12px 8px 40px;
}

.view-tabs {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line-strong);
    display: flex;
    gap: 18px;
}

.view-tabs a {
    min-height: 38px;
    padding: 8px 2px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.view-tabs a.active {
    border-bottom-color: var(--brand);
    color: var(--brand-dark);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: white;
    color: var(--ink);
}

textarea {
    min-height: 86px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.form-label-actions,
.inline-customer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-label-actions {
    margin-bottom: 5px;
}

.form-label-actions label {
    margin-bottom: 0;
}

.inline-form-action {
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.inline-form-action:hover {
    color: var(--brand-dark);
}

.inline-form-action:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.inline-customer-fields {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8faf8;
}

.inline-customer-header {
    margin-bottom: 14px;
}

.inline-customer-header strong,
.inline-customer-header small {
    display: block;
}

.inline-customer-header strong {
    font-size: 13px;
}

.inline-customer-header small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.inline-customer-more,
.job-more-options {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.inline-customer-more summary,
.job-more-options summary {
    width: fit-content;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.inline-customer-more[open] summary,
.job-more-options[open] summary {
    margin-bottom: 12px;
}

.form-hint {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.recurrence-control {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 7px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    text-align: left;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #fafcfb;
}

.data-table .primary-cell {
    min-width: 190px;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.primary-cell strong,
.stacked-cell strong {
    display: block;
    font-size: 13px;
}

.primary-cell small,
.stacked-cell small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    white-space: nowrap;
}

.text-right {
    text-align: right !important;
}

.text-muted {
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.success {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.status-badge.info {
    background: var(--blue-soft);
    color: var(--blue);
}

.status-badge.warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-badge.danger {
    background: var(--red-soft);
    color: var(--red);
}

.inline-status {
    width: auto;
    min-width: 126px;
    min-height: 34px;
    padding: 5px 27px 5px 8px;
    font-size: 12px;
}

.team-access-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.team-access-form select {
    width: auto;
    min-width: 112px;
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.invite-result {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.invite-result p {
    margin: 3px 0 11px;
    color: var(--muted);
    font-size: 12px;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 7px;
}

.invite-name-grid {
    margin-bottom: 15px;
}

.empty-state {
    padding: 42px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state i {
    display: block;
    margin-bottom: 8px;
    font-size: 34px;
}

.activity-list,
.agenda-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-item,
.agenda-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 11px;
}

.activity-item:first-child,
.agenda-item:first-child {
    padding-top: 0;
}

.activity-item:last-child,
.agenda-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    background: var(--surface-soft);
    color: var(--brand);
    font-size: 17px;
}

.activity-copy {
    min-width: 0;
}

.activity-copy p {
    margin: 0 0 2px;
    font-size: 13px;
}

.activity-copy small {
    color: var(--muted);
}

.agenda-time {
    width: 48px;
    flex: 0 0 48px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.agenda-copy {
    min-width: 0;
    flex: 1;
}

.agenda-copy strong {
    display: block;
}

.agenda-copy small {
    color: var(--muted);
}

.revenue-chart {
    height: 240px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding-top: 18px;
}

.chart-column {
    min-width: 0;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.chart-bar-wrap {
    width: 100%;
    height: 180px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--brand);
    position: relative;
}

.chart-bar:hover {
    background: var(--brand-dark);
}

.chart-bar span {
    position: absolute;
    left: 50%;
    top: -24px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    transform: translateX(-50%);
    white-space: nowrap;
}

.chart-column > small {
    color: var(--muted);
    font-size: 11px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 1px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--line);
}

.schedule-day {
    min-height: 430px;
    padding: 11px;
    background: var(--surface-soft);
}

.schedule-day.today {
    background: #f0f7f3;
}

.schedule-day-header {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.schedule-day-header strong {
    font-size: 12px;
    text-transform: uppercase;
}

.schedule-day-header span {
    color: var(--muted);
    font-size: 18px;
}

.schedule-job {
    margin-bottom: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 5px;
    background: white;
}

.schedule-job.priority-high {
    border-left-color: var(--amber);
}

.schedule-job time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.schedule-job strong,
.schedule-job small {
    display: block;
    margin-top: 3px;
}

.schedule-job small {
    color: var(--muted);
}

.route-date-control {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: auto 180px auto;
    align-items: center;
    justify-content: start;
    gap: 9px;
}

.route-date-control label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.route-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
}

.route-board > .empty-state {
    grid-column: 1 / -1;
}

.route-lane {
    min-width: 0;
}

.route-lane-header {
    min-height: 52px;
    margin-bottom: 9px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.route-lane-header > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.route-lane-header h2,
.route-lane-header p {
    margin: 0;
}

.route-lane-header h2 {
    font-size: 15px;
}

.route-lane-header p {
    color: var(--muted);
    font-size: 11px;
}

.route-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 18px;
}

.route-stop-list {
    display: grid;
    gap: 8px;
}

.route-stop {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 6px;
    background: white;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
}

.route-stop.complete {
    border-left-color: var(--line-strong);
    background: var(--surface-soft);
}

.route-sequence {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 5px;
}

.route-sequence > strong {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
}

.route-sequence > div {
    display: grid;
}

.route-sequence button {
    width: 28px;
    height: 25px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
}

.route-sequence button:disabled {
    opacity: 0.25;
    cursor: default;
}

.route-stop-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.route-stop-heading time {
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 750;
}

.route-stop-heading h3,
.route-stop-heading p {
    margin: 0;
}

.route-stop-heading h3 {
    margin-top: 2px;
    font-size: 14px;
}

.route-stop-heading p {
    color: var(--muted);
    font-size: 11px;
}

.route-stop-address {
    margin: 10px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 12px;
}

.route-stop-address i {
    flex: 0 0 17px;
    color: var(--muted);
    font-size: 17px;
}

.route-stop-address span,
.route-stop-address small {
    display: block;
}

.route-stop-address small {
    color: var(--muted);
}

.route-stop-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.route-stop-footer select {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.field-schedule {
    display: grid;
    gap: 22px;
}

.field-day-header {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.field-day-header div {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.field-day-header strong {
    font-size: 16px;
}

.field-day-header span {
    color: var(--muted);
    font-size: 12px;
}

.field-job-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-job {
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 6px;
    background: white;
}

.field-job.complete {
    border-left-color: var(--line-strong);
    background: var(--surface-soft);
}

.field-job-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.field-job-head time {
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 750;
}

.field-job-head h2 {
    margin: 3px 0 1px;
    font-size: 16px;
}

.field-job-head p {
    margin: 0;
    color: var(--muted);
}

.field-job-meta {
    margin: 14px 0;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 9px;
}

.field-job-meta > div {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-soft);
}

.field-job-meta i {
    width: 18px;
    flex: 0 0 18px;
    color: var(--muted);
    font-size: 18px;
}

.field-job-meta span,
.field-job-meta small {
    display: block;
}

.field-job-meta small {
    color: var(--muted);
}

.field-job-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 18px;
    align-items: start;
}

.catalog-groups {
    display: grid;
    gap: 18px;
}

.catalog-group h3 {
    margin: 0 0 10px;
    font-size: 13px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.catalog-item {
    min-height: 95px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.catalog-item:hover {
    border-color: var(--brand);
    box-shadow: 0 3px 12px rgba(47, 107, 79, 0.1);
}

.catalog-item strong,
.catalog-item small,
.catalog-item span {
    display: block;
}

.catalog-item small {
    margin-top: 2px;
    color: var(--muted);
}

.catalog-item span {
    margin-top: 10px;
    color: var(--brand-dark);
    font-weight: 750;
}

.pos-cart {
    position: sticky;
    top: 132px;
}

.cart-items {
    min-height: 170px;
    max-height: 330px;
    overflow-y: auto;
}

.cart-item {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.cart-item-copy strong,
.cart-item-copy small {
    display: block;
}

.cart-item-copy small {
    color: var(--muted);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quantity-control button {
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.quantity-control span {
    width: 22px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.cart-summary {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.cart-summary div {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.cart-summary .cart-total {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 18px;
    font-weight: 750;
}

.segmented-control {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control label {
    padding: 7px 4px;
    border-radius: 4px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.segmented-control input:checked + label {
    background: white;
    color: var(--brand-dark);
    box-shadow: 0 1px 4px rgba(31, 41, 36, 0.1);
}

dialog {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: white;
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(20, 35, 27, 0.28);
}

dialog.dialog-wide {
    width: min(980px, calc(100% - 28px));
}

.document-builder {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.document-builder-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.document-builder-header strong,
.document-builder-header small {
    display: block;
}

.document-builder-header small {
    margin-top: 2px;
    color: var(--muted);
}

.document-line-labels,
.document-line {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.4fr) 84px 108px 86px 36px;
    gap: 8px;
    align-items: center;
}

.document-line-labels {
    padding: 7px 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.document-line {
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.document-builder.simple .document-line-labels,
.document-builder.simple .document-line {
    grid-template-columns: minmax(170px, 1fr) 84px 108px 86px 36px;
}

.document-line input,
.document-line select {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.document-line > strong {
    text-align: right;
    white-space: nowrap;
}

.document-totals {
    width: min(310px, 100%);
    margin: 12px 0 14px auto;
}

.document-totals > div {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.document-totals .document-total {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 17px;
}

.document-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 18px;
    align-items: start;
}

.document-sheet {
    min-height: 820px;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
}

.document-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

.document-heading > div:first-child {
    min-width: 0;
}

.document-heading .brand-mark {
    float: left;
    margin-right: 11px;
}

.document-heading h2 {
    margin: 0 0 3px;
    font-size: 19px;
}

.document-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.document-title {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.document-title > span:first-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.document-title > strong {
    font-size: 21px;
}

.document-parties {
    margin: 42px 0 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 30px;
}

.document-parties small,
.document-notes small {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.document-parties strong {
    font-size: 15px;
}

.document-parties p {
    margin: 5px 0 0;
    color: var(--ink-soft);
}

.document-meta {
    margin: 0;
}

.document-meta > div {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.document-meta dt {
    color: var(--muted);
}

.document-meta dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
}

.document-table th {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-soft);
    color: var(--muted);
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
}

.document-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.document-table td:first-child {
    width: 55%;
}

.document-table td strong,
.document-table td small {
    display: block;
}

.document-table td small {
    margin-top: 2px;
    color: var(--muted);
}

.document-summary {
    width: min(330px, 100%);
    margin: 20px 0 0 auto;
}

.document-summary > div {
    padding: 5px 3px;
    display: flex;
    justify-content: space-between;
}

.document-summary .grand-total {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line-strong);
    font-size: 18px;
}

.document-notes {
    margin-top: 42px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.document-notes p {
    margin: 0;
    color: var(--ink-soft);
}

.document-sidebar {
    position: sticky;
    top: 132px;
}

.related-list,
.payment-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list li,
.payment-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.related-list li:last-child,
.payment-list li:last-child {
    border-bottom: 0;
}

.related-list li > i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    background: var(--surface-soft);
    color: var(--muted);
}

.related-list li.complete > i {
    background: var(--brand-soft);
    color: var(--brand);
}

.related-list span,
.payment-list li > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.related-list small,
.payment-list small {
    color: var(--muted);
}

.payment-entry-main {
    min-width: 0;
    flex: 1;
}

.payment-entry-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.payment-entry-heading .status-badge {
    flex: 0 0 auto;
}

.payment-entry.reversed .activity-icon {
    background: var(--red-soft);
    color: var(--red);
}

.payment-entry .payment-reason {
    margin-top: 3px;
    color: var(--red);
}

.payment-entry-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.payment-entry-actions .btn-icon {
    width: 31px;
    height: 31px;
    min-height: 31px;
}

.dialog-value {
    display: block;
    color: var(--ink);
    font-size: 24px;
}

.receipt-layout {
    grid-template-columns: minmax(0, 780px);
    justify-content: center;
}

.receipt-sheet {
    min-height: 720px;
}

.receipt-amount {
    margin: 34px 0 24px;
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface-soft);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 18px;
}

.receipt-amount small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.receipt-amount strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    font-size: 32px;
}

.receipt-amount span {
    color: var(--ink-soft);
    font-size: 13px;
}

.receipt-details {
    margin: 0;
    border-top: 1px solid var(--line);
}

.receipt-details > div {
    min-height: 44px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.receipt-details dt {
    color: var(--muted);
}

.receipt-details dd {
    margin: 0;
    text-align: right;
}

.receipt-reversal {
    margin-top: 24px;
    padding: 14px;
    border: 1px solid #e6b8b8;
    border-radius: 6px;
    background: var(--red-soft);
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--red);
}

.receipt-reversal > i {
    font-size: 24px;
}

.receipt-reversal p {
    margin: 2px 0 0;
    color: var(--ink-soft);
}

.receipt-reversal small {
    display: block;
    margin-top: 5px;
}

.stat-card .compact-stat {
    min-height: 34px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.work-timing,
.work-log-surface {
    margin-top: 18px;
}

.work-order-copy {
    display: grid;
    gap: 20px;
}

.work-order-copy small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.work-order-copy p {
    margin: 0;
    color: var(--ink-soft);
}

.work-log-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-log-list li {
    position: relative;
    padding: 0 0 22px 42px;
}

.work-log-list li:not(:last-child)::before {
    position: absolute;
    top: 30px;
    bottom: 0;
    left: 14px;
    width: 1px;
    background: var(--line-strong);
    content: "";
}

.work-log-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-size: 17px;
}

.work-log-list header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.work-log-list time,
.work-log-list small {
    color: var(--muted);
    font-size: 11px;
}

.work-log-list p {
    margin: 7px 0 0;
    color: var(--ink-soft);
}

dialog::backdrop {
    background: rgba(20, 29, 24, 0.52);
}

.dialog-header,
.dialog-footer {
    min-height: 62px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dialog-header {
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
    margin: 0;
    font-size: 17px;
}

.dialog-body {
    max-height: calc(100vh - 190px);
    padding: 18px;
    overflow-y: auto;
}

.dialog-footer {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
}

.dialog-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 21px;
}

.dialog-close:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.toast-region {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    display: grid;
    gap: 8px;
}

.toast {
    width: min(360px, calc(100vw - 36px));
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast i {
    color: var(--brand);
    font-size: 20px;
}

.toast-error {
    border-left-color: var(--red);
}

.toast-error i {
    color: var(--red);
}

.footer {
    min-height: 54px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #eaf0ec;
}

.login-panel {
    width: min(920px, 100%);
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.login-brand {
    padding: 48px;
    background: var(--brand-dark);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-brand .brand-mark {
    background: white;
    color: var(--brand-dark);
}

.login-brand h1 {
    max-width: 400px;
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.15;
}

.login-brand p {
    max-width: 390px;
    margin: 0;
    color: #d6e6dc;
    font-size: 16px;
}

.login-brand small {
    color: #b9d0c1;
}

.login-form-wrap {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-wrap h2 {
    margin: 0 0 5px;
    font-size: 23px;
}

.login-form-wrap > p {
    margin: 0 0 26px;
    color: var(--muted);
}

.login-form-wrap .form-group {
    margin-bottom: 15px;
}

.login-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid #ebc7c4;
    border-radius: 5px;
    background: var(--red-soft);
    color: var(--red);
}

.login-submit {
    width: 100%;
    margin-top: 5px;
}

.login-secondary-link {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.login-secondary-link a {
    color: var(--brand);
    font-weight: 650;
}

.register-panel {
    width: min(1040px, 100%);
    min-height: 640px;
}

.register-form-wrap {
    padding-top: 38px;
    padding-bottom: 38px;
}

.register-name-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.register-location-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 72px minmax(0, 0.9fr);
    gap: 12px;
}

.register-mode-fieldset,
.workspace-mode-fieldset,
.workspace-feature-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.register-mode-fieldset {
    margin-bottom: 16px;
}

.register-mode-fieldset legend,
.workspace-mode-fieldset legend,
.workspace-feature-group legend {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.register-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.register-mode-option {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8faf8;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
}

.register-mode-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.register-mode-option input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

.register-mode-option span,
.register-mode-option strong,
.register-mode-option small {
    min-width: 0;
    display: block;
}

.register-mode-option strong {
    font-size: 13px;
}

.register-mode-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.page-actions form {
    margin: 0;
}

.preference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.check-option {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8faf8;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
}

.check-option:hover {
    border-color: #aebdb4;
}

.check-option input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

.check-option span,
.check-option strong,
.check-option small {
    min-width: 0;
    display: block;
}

.check-option strong {
    color: var(--text);
    font-size: 13px;
}

.check-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.check-option.compact {
    width: 100%;
}

.workspace-experience-surface {
    margin-bottom: 18px;
}

.workspace-mode-control {
    width: fit-content;
    max-width: 100%;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f4f7f5;
    display: flex;
    gap: 2px;
}

.workspace-mode-control label {
    min-width: 0;
    cursor: pointer;
}

.workspace-mode-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.workspace-mode-control span {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.workspace-mode-control input:checked + span {
    background: white;
    color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(25, 43, 33, .1);
}

.workspace-mode-control input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.workspace-mode-description {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.workspace-feature-details {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.workspace-feature-details summary {
    width: fit-content;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.workspace-feature-details > p {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 12px;
}

.workspace-feature-group + .workspace-feature-group {
    margin-top: 18px;
}

.workspace-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-feature-option > i {
    margin-top: 1px;
    color: var(--brand);
    font-size: 20px;
    flex: 0 0 auto;
}

.settings-profile-grid {
    align-items: start;
}

.billing-defaults-details {
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.billing-defaults-details summary {
    width: fit-content;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.billing-defaults-details[open] summary {
    margin-bottom: 14px;
}

.communication-switches {
    margin-bottom: 20px;
}

.communication-settings-grid {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.communication-notice-option {
    justify-content: flex-end;
}

.communication-toolbar {
    gap: 18px;
}

.segmented-control {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f4f7f5;
    display: flex;
    gap: 2px;
}

.segmented-control a {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.segmented-control a:hover {
    color: var(--text);
}

.segmented-control a.active {
    background: white;
    color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(25, 43, 33, .1);
}

.communication-table .date-cell,
.communication-table .message-preview {
    min-width: 0;
}

.communication-table .date-cell strong,
.communication-table .date-cell small,
.communication-table .message-preview strong,
.communication-table .message-preview small {
    display: block;
}

.communication-table .date-cell {
    width: 120px;
    white-space: nowrap;
}

.communication-table .message-preview {
    width: 42%;
    max-width: 520px;
}

.communication-table .message-preview small {
    max-width: 520px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.communication-table .message-preview .text-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
}

.channel-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.channel-label i {
    color: var(--brand);
    font-size: 17px;
}

.failure-copy {
    max-width: 180px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--red);
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.detail-note {
    max-width: 230px;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.4;
    display: block;
}

@media (max-width: 1050px) {
    .topbar-inner {
        grid-template-columns: minmax(210px, 1fr) minmax(250px, 400px) auto;
    }

    .profile-copy,
    .profile-trigger > .mdi-chevron-down {
        display: none;
    }

    .nav-link {
        padding: 0 10px;
    }

    .nav-link span {
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .route-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .topbar-inner,
    .nav-inner,
    .content-container,
    .footer {
        width: min(100% - 24px, 1480px);
    }

    .topbar-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .global-search {
        display: none;
    }

    .topbar-actions .btn {
        display: none;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
    }

    .main-nav {
        display: none;
        height: auto;
        position: fixed;
        top: 66px;
        left: 0;
        right: 0;
        padding: 8px 0 12px;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: block;
    }

    .nav-inner {
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-link,
    .nav-settings {
        min-height: 44px;
        margin: 0;
        padding: 0 12px;
    }

    .nav-link span {
        font-size: 13px;
    }

    .nav-link.active::after {
        top: 8px;
        right: auto;
        bottom: 8px;
        left: 0;
        width: 3px;
        height: auto;
    }

    .nav-menu,
    .nav-settings-menu {
        margin: 0;
        grid-column: 1 / -1;
        display: grid;
    }

    .nav-settings {
        width: 100%;
    }

    .nav-submenu {
        width: 100%;
        padding: 4px 0 8px 12px;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px;
    }

    .nav-menu.open .nav-submenu {
        display: grid;
    }

    .nav-submenu a {
        min-width: 0;
    }

    .content-grid,
    .content-grid.equal,
    .detail-grid,
    .pos-layout,
    .document-layout {
        grid-template-columns: 1fr;
    }

    .pos-cart {
        position: static;
    }

    .document-sidebar {
        position: static;
    }

    .document-sheet {
        min-height: 0;
        padding: 24px;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .preference-grid {
        grid-template-columns: 1fr;
    }

    .workspace-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .communication-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .segmented-control {
        width: 100%;
        overflow-x: auto;
    }

    .segmented-control a {
        flex: 1 0 auto;
        justify-content: center;
    }

    .login-brand {
        min-height: 250px;
        padding: 32px;
    }

    .login-brand h1 {
        margin-top: 30px;
        font-size: 28px;
    }

    .register-mode-options,
    .workspace-feature-grid {
        grid-template-columns: 1fr;
    }

    .workspace-mode-control {
        width: 100%;
    }

    .workspace-mode-control label,
    .workspace-mode-control span {
        flex: 1;
    }

    .login-form-wrap {
        padding: 32px;
    }

    .document-line-labels {
        display: none;
    }

    .document-line {
        grid-template-columns: 1fr 1fr 80px 100px 78px 36px;
        overflow-x: auto;
    }
}

@media (max-width: 560px) {
    .brand-copy small {
        display: none;
    }

    .page-content {
        padding-top: 20px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions,
    .page-actions .btn {
        width: 100%;
    }

    .stats-grid,
    .form-grid,
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .inline-customer-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-job-grid {
        grid-template-columns: 1fr;
    }

    .field-day-header div,
    .field-job-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .field-job-actions .btn,
    .field-job-actions .inline-status {
        width: 100%;
    }

    .route-date-control {
        grid-template-columns: 1fr;
    }

    .document-line {
        grid-template-columns: 1fr 36px;
        padding: 12px 0;
    }

    .document-builder.simple .document-line {
        grid-template-columns: 1fr 36px;
    }

    .document-line > :not([data-remove-document-line]) {
        grid-column: 1;
    }

    .document-line [data-remove-document-line] {
        grid-column: 2;
        grid-row: 1;
    }

    .document-line > strong {
        text-align: left;
    }

    .document-heading,
    .document-parties {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .document-title {
        align-items: flex-start;
    }

    .document-parties {
        margin: 28px 0 22px;
    }

    .receipt-amount {
        grid-template-columns: 1fr;
    }

    .receipt-amount strong {
        grid-row: auto;
        grid-column: 1;
        font-size: 27px;
    }

    .receipt-details > div,
    .work-log-list header {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .receipt-details dd {
        text-align: left;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-search {
        width: 100%;
        max-width: none;
    }

    .footer {
        flex-direction: column;
        gap: 3px;
    }

    .login-page {
        padding: 0;
    }

    .login-panel {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .login-brand,
    .login-form-wrap {
        padding: 25px;
    }
}

@media print {
    @page {
        margin: 0.45in;
    }

    body,
    html,
    .wrapper,
    .page-content {
        background: white !important;
    }

    .topbar,
    .main-nav,
    .footer,
    .no-print,
    .toast-region {
        display: none !important;
    }

    .page-content {
        padding: 0;
    }

    .content-container {
        width: 100%;
    }

    .document-layout {
        display: block;
    }

    .document-sheet {
        min-height: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .document-table th {
        background: #f5f7f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .route-board {
        grid-template-columns: 1fr;
    }

    .route-lane {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .route-stop {
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .route-sequence > div,
    .route-stop-footer {
        display: none !important;
    }
}
