:root {
    --bg: #f5f6f7;
    --panel: #ffffff;
    --text: #242424;
    --muted: #6b7280;
    --line: #dedede;
    --dark: #171717;
    --accent: #f47b20;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login {
    width: min(420px, calc(100vw - 32px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-weight: 700;
}

.login .brand {
    margin-bottom: 24px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: #111;
    font-weight: 800;
}

.login .brand-mark {
    width: 40px;
    height: 40px;
}

h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

p {
    margin: 0 0 22px;
    color: var(--muted);
}

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 11px 12px;
    font: inherit;
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(244, 123, 32, 0.28);
    border-color: var(--accent);
}

.button {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    min-height: 44px;
    padding: 9px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    text-decoration: none;
}

.button:hover {
    border-color: var(--accent);
}

.button-primary {
    width: 100%;
    margin-top: 20px;
    border: 0;
    background: var(--dark);
    color: #fff;
    padding: 12px;
}

.button-inline {
    width: auto;
    margin-top: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-primary.button-inline {
    padding: 9px 12px;
}

.button-danger {
    border-color: #f1b8b2;
    color: var(--danger);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-primary:hover {
    background: #2a2a2a;
}

.error {
    padding: 10px 12px;
    background: #fff1f0;
    color: var(--danger);
    border: 1px solid #ffcdc7;
    margin-bottom: 16px;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--dark);
    color: #fff;
    padding: 22px 18px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 10px 12px;
    border-left: 3px solid transparent;
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #e5e7eb;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nav a.active,
.nav a:hover,
.nav-toggle.active,
.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent);
}

.nav-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(225deg);
}

.nav-sub {
    display: none;
    gap: 2px;
    margin: -2px 0 4px 12px;
}

.nav-sub.is-open {
    display: grid;
}

.nav-sub a {
    padding: 7px 10px;
    color: #cbd5e1;
    font-size: 14px;
}

.main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.logout-form {
    margin: 0;
}

.content {
    padding: 28px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-wide {
    width: 100%;
    overflow-x: auto;
}

.panel h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.panel-header h2 {
    margin: 0;
}

.panel-fieldset {
    margin: 0;
}

.panel-fieldset legend,
.quote-subfieldset legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.quote-subfieldset {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px 16px;
    margin: 14px 0 12px;
    background: #fff;
}

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

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.status-item {
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    padding: 14px;
    background: #fff;
}

.status-item strong {
    display: block;
}

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

.dashboard-main {
    display: grid;
    gap: 18px;
}

.dashboard-section {
    width: 100%;
}

.dashboard-section h2,
.dashboard-actions h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-card {
    display: grid;
    align-content: space-between;
    min-height: 112px;
    border: 1px solid var(--line);
    border-left: 5px solid #9ca3af;
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 16px;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 28px rgba(17, 17, 17, 0.08);
    transform: translateY(-1px);
}

.dashboard-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-card strong {
    margin-top: 16px;
    font-size: 28px;
    line-height: 1.1;
}

.dashboard-card-danger {
    border-left-color: var(--danger);
}

.dashboard-card-warning {
    border-left-color: var(--accent);
}

.dashboard-card-positive {
    border-left-color: #15803d;
}

.dashboard-actions {
    position: sticky;
    top: 18px;
}

.quick-action-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.quick-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 700;
}

.quick-action::after {
    content: ">";
    color: var(--accent);
    font-weight: 800;
}

.quick-action:hover {
    border-color: var(--accent);
    background: #fff7f1;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-actions .button,
.page-actions .inline-form .button {
    padding: 0 14px;
    line-height: 1;
}

.page-actions-left,
.page-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-actions-left {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: auto;
}

.page-actions-right {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
}

.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 960px;
}

.search-form input {
    min-width: 260px;
}

.search-form select {
    width: auto;
    min-width: 150px;
}

.ajax-search {
    position: relative;
}

.ajax-search.is-loading input {
    border-color: var(--accent);
}

.table-summary {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination-link,
.pagination-gap {
    min-width: 34px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    padding: 7px 9px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
}

.pagination-link:hover,
.pagination-link.is-active {
    border-color: var(--accent);
    background: #fff7f1;
}

.pagination-link.is-disabled {
    color: var(--muted);
    pointer-events: none;
    opacity: 0.55;
}

.pagination-gap {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    background: #fafafa;
}

.data-table tbody tr:nth-child(even) {
    background: #fcfcfc;
}

.data-table tbody tr.clickable-row:hover {
    background: #fff7f1;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus {
    outline: 2px solid rgba(244, 123, 32, 0.35);
    outline-offset: -2px;
}

.compact-table th,
.compact-table td {
    padding: 7px 8px;
    font-size: 13px;
}

@media (max-width: 1180px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-actions {
        position: static;
    }
}

@media (max-width: 980px) {
    .dashboard-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-card-grid {
        grid-template-columns: 1fr;
    }
}

.helper-table {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
}

.text-block-editor {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
    margin-top: 14px;
    overflow-anchor: none;
}

[data-text-block-list] {
    overflow-anchor: none;
}

[data-template-category-list] {
    overflow-anchor: none;
}

.template-category-editor {
    margin-top: 10px;
}

.template-category-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    gap: 12px;
    align-items: end;
}

.template-category-row label {
    margin: 0;
}

.template-category-row .autosave-status {
    justify-content: flex-end;
}

.quote-template-picker {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
    margin-bottom: 14px;
}

.quote-add-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.quote-add-heading strong {
    color: var(--text);
    font-size: 15px;
}

.quote-add-heading span {
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.quote-add-heading.is-locked {
    background: #fafafa;
}

.quote-relation-note {
    border-left: 4px solid var(--accent);
    color: var(--muted);
}

.quote-template-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.quote-template-toolbar label {
    margin: 0;
    font-size: 13px;
}

.quote-template-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quote-template-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    margin: 12px 0;
    padding-right: 4px;
}

.quote-template-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
}

.quote-template-choice[hidden] {
    display: none;
}

.quote-template-choice:hover {
    border-color: var(--accent);
}

.quote-template-choice input {
    width: auto;
    margin-top: 3px;
}

.quote-template-choice strong,
.quote-template-choice em,
.quote-template-choice small {
    display: block;
}

.quote-template-choice em {
    margin-top: 3px;
    color: var(--accent);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.quote-template-choice small {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 400;
}

.quote-category-editor {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    margin-top: 14px;
    padding: 14px;
}

.quote-category-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--accent);
}

.quote-category-heading span {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

.quote-category-heading strong {
    font-size: 18px;
}

.quote-template-choice.is-disabled {
    opacity: 0.58;
    cursor: default;
}

.text-block-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr);
    gap: 10px 12px;
}

.text-block-grid label {
    margin: 0;
    font-size: 13px;
}

.text-block-grid textarea {
    min-height: 82px;
}

.text-block-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.text-block-move {
    display: flex;
    align-items: center;
    gap: 6px;
}

.button-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.button-icon.button-primary {
    margin-top: 0;
    border: 0;
    color: #fff;
}

.text-block-save-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.manual-text-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.manual-text-block-form {
    margin-top: 12px;
}

.quote-text-preview {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.quote-text-preview.is-editable {
    cursor: pointer;
}

.quote-text-preview.is-editable:hover {
    background: #fff7f1;
}

.quote-text-preview.is-editing {
    cursor: default;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
    margin: 8px 0;
}

.quote-text-preview-content {
    padding: 0 4px;
}

.quote-inline-text-form textarea {
    min-height: 120px;
}

.quote-text-preview:last-child {
    border-bottom: 0;
}

.quote-text-preview h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.quote-text-preview p {
    margin: 0;
    color: var(--text);
}

.data-table a {
    color: var(--dark);
}

.badge {
    display: inline-block;
    border: 1px solid var(--line);
    padding: 3px 8px;
    background: #fff;
    font-size: 13px;
}

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

.detail-grid dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-grid dd {
    margin: 0;
}

.compact-detail-grid {
    max-width: 520px;
    margin: 10px 0 14px;
    gap: 6px 14px;
}

.quote-option-list {
    display: grid;
    gap: 8px;
    max-width: 620px;
    margin: 12px 0 16px;
}

.quote-option-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafafa;
    padding: 10px 12px;
}

.quote-option-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quote-option-toggle input:checked + .switch {
    background: var(--accent);
}

.quote-option-toggle input:checked + .switch::after {
    transform: translateX(20px);
}

.quote-payment-options {
    display: grid;
    gap: 8px;
    max-width: 620px;
    margin: 8px 0 16px;
}

.quote-payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    font-weight: 700;
}

.quote-payment-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.totals-panel {
    max-width: 520px;
}

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

.form-grid h2 {
    margin: 0;
}

.form-grid fieldset {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px 16px;
    margin: 0;
    background: #fff;
}

.form-grid legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

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

.address-grid {
    grid-template-columns: 2fr 1fr 1fr;
}

.form-section-grid label {
    margin: 0;
    font-size: 13px;
}

.form-section-grid input,
.form-section-grid select,
.form-section-grid textarea {
    margin-top: 4px;
    padding: 9px 10px;
}

.span-2 {
    grid-column: span 2;
}

.full-span,
.form-errors,
.form-actions {
    grid-column: 1 / -1;
}

.form-errors {
    border: 1px solid #ffcdc7;
    background: #fff1f0;
    color: var(--danger);
    margin-bottom: 18px;
    padding: 10px 12px;
}

.form-success {
    grid-column: 1 / -1;
    border: 1px solid #b7e4c7;
    background: #f0fff4;
    color: #166534;
    margin-bottom: 18px;
    padding: 10px 12px;
}

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

.invoice-create-form {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px;
    margin: 12px 0 18px;
    background: #fff;
}

.invoice-create-summary,
.invoice-create-controls {
    display: grid;
    gap: 10px 12px;
    align-items: end;
}

.invoice-create-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.invoice-create-summary strong {
    color: var(--text);
}

.invoice-create-controls {
    grid-template-columns: 1.3fr 1fr 1fr auto;
}

.invoice-create-controls label {
    margin: 0;
    font-size: 13px;
}

.invoice-create-controls input,
.invoice-create-controls select {
    margin-top: 4px;
    padding: 9px 10px;
}

.invoice-create-controls input:disabled {
    background: #f3f4f6;
    color: var(--muted);
    cursor: not-allowed;
}

.autosave-status {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.autosave-status.is-saving {
    color: var(--accent);
}

.autosave-status.is-error {
    color: var(--danger);
}

.warning-box {
    margin-top: 18px;
    margin-bottom: 18px;
    border: 1px solid #f6c66f;
    background: #fff8e6;
    color: #714b00;
    padding: 10px 12px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.42);
}

.modal {
    width: min(460px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.modal h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.mail-modal {
    width: min(760px, 100%);
}

.modal-wide {
    width: min(960px, 100%);
}

.mail-modal textarea {
    min-height: 180px;
}

.compact-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.compact-list li {
    margin: 4px 0;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-line input {
    width: auto;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
}

.switch-line input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 160ms ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
    transition: transform 160ms ease;
}

.switch-line input:checked + .switch {
    background: var(--accent);
}

.switch-line input:checked + .switch::after {
    transform: translateX(20px);
}

.switch-line input:focus-visible + .switch {
    outline: 2px solid rgba(244, 123, 32, 0.35);
    outline-offset: 2px;
}

.article-autocomplete {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    z-index: 15;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.autocomplete-option {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.autocomplete-option:last-child {
    border-bottom: 0;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
    background: #fff7f1;
}

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

.autocomplete-option span,
.autocomplete-empty {
    color: var(--muted);
    font-size: 12px;
}

.autocomplete-empty {
    padding: 10px;
}

.form-actions,
.delete-form,
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-actions {
    justify-content: flex-end;
}

.inline-form {
    margin: 0;
}

.delete-form {
    margin-top: 20px;
}

@media (max-width: 760px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 18px;
    }

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

    .topbar,
    .content {
        padding: 18px;
    }

    .page-actions,
    .page-actions-left,
    .page-actions-right,
    .search-form {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .page-actions .button,
    .page-actions .inline-form,
    .page-actions .inline-form .button {
        width: 100%;
    }

    .form-grid,
    .form-section-grid,
    .address-grid,
    .detail-grid,
    .invoice-create-summary,
    .invoice-create-controls {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .data-table {
        min-width: 680px;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }
}
