@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    color-scheme: light;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f6f8fa;
    color: #1c2938;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    min-width: 320px;
    width: 100%;
}

body {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    font-size: 13px;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

h1:focus {
    outline: none;
}

::selection {
    background: #c7e1e9;
}

.section-placeholder {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    margin: 13vh auto 0;
    max-width: 430px;
    padding: 36px 28px;
}

.placeholder-mark {
    align-items: center;
    background: #e8f0f3;
    border-radius: 10px;
    color: #648a97;
    display: inline-flex;
    font-size: 19px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.placeholder-eyebrow {
    color: #78919a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.1px;
    margin: 23px 0 8px;
}

.section-placeholder h1 {
    color: #202e3d;
    font-family: Manrope, 'DM Sans', sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.6px;
    margin: 0;
}

.placeholder-copy {
    color: #7e8b98;
    font-size: 12px;
    line-height: 1.7;
    margin: 10px 0 20px;
}

.placeholder-link {
    color: #3b7383;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.placeholder-link:hover {
    text-decoration: underline;
}

.placeholder-link span {
    font-size: 14px;
    margin-left: 3px;
}

/* Status colours shared by work order and item badges. Companies pick one of these tones for each status. */
.status-tone-blue { background: #e8f1f8; color: #2b5f86; }
.status-tone-amber { background: #fff4dd; color: #8a6111; }
.status-tone-purple { background: #f3eefb; color: #6a4c93; }
.status-tone-teal { background: #e3f4f2; color: #1f6b63; }
.status-tone-orange { background: #fff0e3; color: #a1561b; }
.status-tone-green { background: #e8f4ec; color: #3a7150; }
.status-tone-red { background: #fdecea; color: #a23b2c; }
.status-tone-gray { background: #f1f3f4; color: #6d7780; }

/* Company settings and the user guide. Kept global so the status editor component and both pages share them. */
.settings-page, .help-page {
    margin: 0 auto;
    max-width: 1100px;
    padding: 35px 38px 60px;
}

.settings-heading h1, .help-heading h1 {
    color: #202e3d;
    font-family: Manrope, 'DM Sans', sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.75px;
    margin: 0;
}

.settings-heading p, .help-heading p {
    color: #8693a0;
    font-size: 12px;
    margin: 5px 0 0;
}

.settings-heading, .help-heading {
    margin-bottom: 20px;
}

.settings-eyebrow {
    align-items: center;
    color: #84919e;
    display: flex;
    font-size: 9px;
    font-weight: 700;
    gap: 8px;
    letter-spacing: 1.1px;
    margin-bottom: 9px;
}

.settings-eyebrow span {
    background: #8cafb6;
    border-radius: 2px;
    height: 2px;
    width: 17px;
}

.settings-jump, .help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-jump a, .help-toc a {
    background: #fff;
    border: 1px solid #dfe7eb;
    border-radius: 999px;
    color: #3b7383;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    text-decoration: none;
}

.settings-jump a:hover, .help-toc a:hover {
    background: #f2f8f9;
}

.settings-tabs {
    box-shadow: inset 0 -1px 0 #dfe7eb;
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.settings-tab {
    align-items: center;
    border-bottom: 2px solid transparent;
    color: #5f6f7c;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.settings-tab:hover {
    color: #1d5568;
}

.settings-tab[aria-current="page"] {
    border-bottom-color: #1d5568;
    color: #1d5568;
}

.settings-tab-dot {
    background: #d39b2a;
    border-radius: 50%;
    height: 7px;
    width: 7px;
}

.settings-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-field-wide {
    grid-column: 1 / -1;
}

.settings-form-grid textarea {
    background: #fff;
    border: 1px solid #d5dee3;
    border-radius: 6px;
    color: #22313f;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    padding: 8px 9px;
    resize: vertical;
    width: 100%;
}

.settings-form-grid input:focus-visible, .settings-form-grid select:focus-visible, .settings-form-grid textarea:focus-visible {
    outline: 2px solid #8bb0ba;
    outline-offset: 1px;
}

.settings-form-grid .invalid {
    border-color: #c2513f;
}

.settings-form-grid .validation-message {
    color: #a23b2c;
    font-size: 11px;
    font-weight: 500;
}

.settings-panel, .help-section {
    background: #fff;
    border: 1px solid #e9edf0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgb(27 46 61 / 2%);
    margin-bottom: 16px;
    padding: 18px 18px 16px;
    scroll-margin-top: 70px;
}

.settings-panel h2, .help-section h2 {
    color: #22313f;
    font-family: Manrope, 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.settings-panel-heading {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.settings-panel-heading p {
    color: #6f7d89;
    font-size: 12px;
    margin: 4px 0 0;
    max-width: 680px;
}

.settings-unsaved {
    background: #fff4dd;
    border-radius: 999px;
    color: #8a6111;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 9px;
}

.settings-muted {
    color: #8693a0;
    font-size: 11px;
}

.settings-builtins {
    align-items: center;
    color: #6f7d89;
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 6px;
    margin-bottom: 12px;
}

.settings-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    white-space: nowrap;
}

.status-rows {
    border-top: 1px solid #eef2f4;
    list-style: none;
    margin: 0;
    padding: 0;
}

.status-row {
    align-items: end;
    border-bottom: 1px solid #eef2f4;
    display: grid;
    gap: 10px 12px;
    grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.4fr) minmax(120px, .8fr) minmax(110px, .7fr) auto;
    padding: 11px 0;
}

.status-row-retired .settings-badge {
    opacity: .55;
}

.status-row-preview {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-height: 36px;
}

.status-field {
    color: #6f7d89;
    display: grid;
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
}

.status-field input, .status-field select {
    background: #fff;
    border: 1px solid #d5dee3;
    border-radius: 6px;
    color: #22313f;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    min-height: 36px;
    padding: 0 9px;
    width: 100%;
}

.status-field input:disabled, .status-field select:disabled {
    background: #f6f8f9;
    color: #8693a0;
}

.status-row-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    min-height: 36px;
}

.settings-page .icon-button {
    background: #fff;
    border: 1px solid #d9e2e6;
    border-radius: 6px;
    color: #497686;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    height: 34px;
    width: 34px;
}

.settings-page .link-button {
    background: none;
    border: 0;
    color: #3b7383;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    min-height: 34px;
    padding: 0 6px;
}

.settings-page .icon-button:disabled, .settings-page .link-button:disabled {
    cursor: default;
    opacity: .45;
}

.settings-help {
    color: #6f7d89;
    font-size: 11px;
    line-height: 1.55;
    margin: 12px 0 0;
}

.settings-message {
    background: #edf5f1;
    border: 1px solid #d9e9de;
    border-radius: 6px;
    color: #51755f;
    font-size: 12px;
    margin-top: 12px;
    padding: 10px 12px;
}

.settings-message-error {
    background: #fff3ef;
    border-color: #edcfc4;
    color: #8f4134;
}

.settings-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.settings-actions-spacer {
    flex: 1 1 auto;
}

.settings-page .primary-button, .settings-page .secondary-button {
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    min-height: 36px;
    padding: 0 13px;
}

.settings-page .primary-button {
    background: #1d5568;
    border: 1px solid #1d5568;
    color: #fff;
}

.settings-page .secondary-button {
    background: #fff;
    border: 1px solid #d9e2e6;
    color: #497686;
}

.settings-page .primary-button:disabled, .settings-page .secondary-button:disabled {
    cursor: default;
    opacity: .6;
}

.settings-roles {
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    margin: 0;
    padding: 0;
}

.settings-role {
    align-items: center;
    border: 1px solid #e3e9ec;
    border-radius: 6px;
    color: #22313f;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
}

.settings-role small {
    color: #8693a0;
    margin-left: auto;
}

.settings-role-locked {
    background: #f6f8f9;
    cursor: default;
}

.settings-sr-only {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.help-section h3 {
    color: #22313f;
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 6px;
}

.help-section p, .help-section li {
    color: #44525f;
    font-size: 13px;
    line-height: 1.6;
}

.help-section p {
    margin: 6px 0;
}

.help-section ol, .help-section ul {
    margin: 6px 0;
    padding-left: 20px;
}

.help-section a {
    color: #2f6f80;
}

.help-tip {
    background: #f2f8f9;
    border-left: 3px solid #8cafb6;
    border-radius: 4px;
    color: #44525f;
    font-size: 12px;
    margin: 10px 0;
    padding: 8px 12px;
}

@media (max-width: 900px) {
    .status-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .status-row-preview, .status-field-name {
        grid-column: 1 / -1;
    }

    .status-row-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .settings-page, .help-page {
        padding: 22px 14px 40px;
    }

    .settings-panel, .help-section {
        padding: 14px 12px;
    }

    .settings-panel-heading {
        flex-direction: column;
    }

    .settings-actions .primary-button, .settings-actions .secondary-button {
        flex: 1 1 auto;
        min-height: 42px;
    }

    .settings-actions-spacer {
        display: none;
    }

    .settings-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-form-grid input, .settings-form-grid select {
        min-height: 42px;
    }
}
