/* FariDocs 1.22.1 — fixed portal navigation, table-first master data, live delivery */
:root { --ws-sidebar-width: 210px; }

@media (min-width: 801px) {
    .workspace-app { display: block; min-height: calc(100dvh - 72px); }
    .workspace-sidebar {
        position: fixed;
        z-index: 38;
        inset: 72px auto 0 0;
        width: var(--ws-sidebar-width);
        height: auto;
        min-height: 0;
        overflow: hidden;
    }
    .workspace-sidebar nav {
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-color: #3a6978 transparent;
        scrollbar-width: thin;
        padding: 0 3px 8px 0;
    }
    .workspace-sidebar nav::-webkit-scrollbar { width: 5px; }
    .workspace-sidebar nav::-webkit-scrollbar-thumb { border-radius: 10px; background: #3a6978; }
    .workspace-sidebar > div,
    .workspace-create-link { flex: 0 0 auto; }
    .workspace-main { margin-left: var(--ws-sidebar-width); min-height: calc(100dvh - 72px); }
}

.workspace-section-tabs {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: -8px 0 20px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid #d5e3e8;
    border-radius: 12px;
    background: #edf4f6;
    scrollbar-width: thin;
}
.workspace-section-tabs a {
    min-height: 39px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #5b7583;
    font-size: 10px;
    font-weight: 850;
}
.workspace-section-tabs a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.workspace-section-tabs a b { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: #d9e8ec; font-size: 8px; }
.workspace-section-tabs a.active { border-color: #b9d7dc; background: #fff; color: #0d5468; box-shadow: 0 3px 10px rgba(15, 57, 77, .09); }
.workspace-section-tabs a.active svg { color: #0c978a; }

.workspace-tab-form-panel { width: min(880px, 100%); margin-bottom: 18px; }
.workspace-tab-form { max-width: 790px; }
.workspace-data-panel { min-width: 0; }
.catalog-edit-panel { margin-top: 18px; }
.workspace-directory-table-wrap { width: 100%; overflow: auto; border: 1px solid #e0eaed; border-radius: 10px; }
.workspace-data-table { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: fixed; font-size: 10px; }
.workspace-data-table th,
.workspace-data-table td { padding: 12px 11px; border-bottom: 1px solid #e3ecef; vertical-align: middle; text-align: left; overflow-wrap: anywhere; }
.workspace-data-table th { background: #f3f7f8; color: #728994; font-size: 8px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
.workspace-data-table tbody tr:last-child td { border-bottom: 0; }
.workspace-data-table tbody tr:hover td { background: #f9fcfc; }
.workspace-data-table td strong,
.workspace-data-table td small { display: block; }
.workspace-data-table td strong { color: #143b55; }
.workspace-data-table td small { margin-top: 3px; color: #718692; }
.workspace-data-table .address-cell,
.workspace-data-table .description-cell,
.workspace-data-table .events-cell,
.workspace-data-table .endpoint-cell { white-space: normal; line-height: 1.48; }
.workspace-data-table .endpoint-cell { word-break: break-all; }
.table-stage { margin-top: 6px; }
.table-icon-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.table-icon-actions form { margin: 0; }
.table-icon-actions .document-icon-action,
.delivery-history .document-icon-action,
.webhook-table .document-icon-action {
    position: relative;
    width: 32px;
    height: 32px;
    min-height: 32px;
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #c8dce2;
    border-radius: 8px;
    background: #f5fafb;
    color: #15516d;
    cursor: pointer;
}
.table-icon-actions .document-icon-action:hover,
.delivery-history .document-icon-action:hover,
.webhook-table .document-icon-action:hover { border-color: #68bfb5; background: #eaf8f6; color: #087d72; }
.table-icon-actions .delete-action,
.webhook-table .delete-action { border-color: #ecc8cc; background: #fff6f6; color: #ad3d48; }
.table-icon-actions svg,
.delivery-history .document-icon-action svg,
.webhook-table .document-icon-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.customer-directory-table th:nth-child(1) { width: 15%; }
.customer-directory-table th:nth-child(2) { width: 12%; }
.customer-directory-table th:nth-child(3) { width: 16%; }
.customer-directory-table th:nth-child(4) { width: 18%; }
.customer-directory-table th:nth-child(5) { width: 19%; }
.customer-directory-table th:nth-child(6) { width: 7%; }
.customer-directory-table th:nth-child(7) { width: 13%; }
.customer-workflow-detail-row > td { padding: 0 11px 14px !important; background: #f9fcfc; }
.customer-workflow-detail-row .customer-workflow-history { padding-top: 12px; }
.product-catalog-table { min-width: 1020px; }
.product-catalog-table th:nth-child(1) { width: 10%; }
.product-catalog-table th:nth-child(2) { width: 17%; }
.product-catalog-table th:nth-child(3) { width: 24%; }
.product-catalog-table th:nth-child(4) { width: 8%; }
.product-catalog-table th:nth-child(5) { width: 12%; }
.product-catalog-table th:nth-child(6) { width: 8%; }
.product-catalog-table th:nth-child(7) { width: 10%; }
.product-catalog-table th:nth-child(8) { width: 11%; }
.webhook-table { min-width: 1050px; }
.webhook-table th:nth-child(1) { width: 14%; }
.webhook-table th:nth-child(2) { width: 25%; }
.webhook-table th:nth-child(3) { width: 28%; }
.webhook-table th:nth-child(4),
.webhook-table th:nth-child(5) { width: 13%; }
.webhook-table th:nth-child(6) { width: 7%; }
.webhook-form-panel fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #d5e4e8; border-radius: 10px; }
.webhook-form-panel legend { padding: 0 7px; color: #4f6d7b; font-size: 9px; font-weight: 850; }

.delivery-history td:last-child form { margin: 0; }
.delivery-history .send-action { border-color: #83d0c7; background: #edfaf8; color: #087b70; }
.delivery-error { overflow-wrap: anywhere; }

html[data-theme="dark"] .workspace-section-tabs { border-color: #2c4c59; background: #0a222e; }
html[data-theme="dark"] .workspace-section-tabs a { color: #a1b8c2; }
html[data-theme="dark"] .workspace-section-tabs a b { background: #1c3e4b; color: #bcd0d7; }
html[data-theme="dark"] .workspace-section-tabs a.active { border-color: #39606e; background: #143441; color: #eff8fa; }
html[data-theme="dark"] .workspace-directory-table-wrap,
html[data-theme="dark"] .webhook-form-panel fieldset { border-color: #294855; }
html[data-theme="dark"] .workspace-data-table th { background: #102b38; color: #91aab5; }
html[data-theme="dark"] .workspace-data-table td { border-color: #294855; color: #c7dbe2; }
html[data-theme="dark"] .workspace-data-table td strong { color: #eff8fa; }
html[data-theme="dark"] .workspace-data-table td small { color: #9bb0b9; }
html[data-theme="dark"] .workspace-data-table tbody tr:hover td { background: #102d39; }
html[data-theme="dark"] .table-icon-actions .document-icon-action,
html[data-theme="dark"] .delivery-history .document-icon-action,
html[data-theme="dark"] .webhook-table .document-icon-action { border-color: #355765; background: #102c39; color: #c4dce3; }
html[data-theme="dark"] .table-icon-actions .delete-action,
html[data-theme="dark"] .webhook-table .delete-action { border-color: #6b4149; background: #35252b; color: #ffafb7; }

@media (max-width: 800px) {
    .workspace-topbar { position: sticky; top: 0; z-index: 60; }
    .workspace-app { display: block; min-height: 0; }
    .workspace-sidebar {
        position: sticky;
        z-index: 44;
        top: 64px;
        width: 100%;
        height: auto;
        max-height: none;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 9px;
        overflow: hidden;
        padding: 9px 12px;
        box-shadow: 0 7px 18px rgba(4, 24, 34, .16);
    }
    .workspace-sidebar nav { display: flex; flex: 1 1 auto; gap: 5px; min-width: 0; margin: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; }
    .workspace-sidebar nav a { min-width: 82px; flex: 0 0 auto; }
    .workspace-sidebar .workspace-create-link { min-width: 44px; width: 44px; height: 42px; flex: 0 0 44px; margin: 0; padding: 0; font-size: 0; }
    .workspace-sidebar .workspace-create-link > span { font-size: 19px; }
    .workspace-main { margin-left: 0; }
    .workspace-section-tabs { margin-top: 0; }
    .workspace-data-panel { padding: 16px; }
}

@media (max-width: 520px) {
    .workspace-sidebar { top: 62px; padding: 8px; }
    .workspace-sidebar nav a { min-width: 76px; font-size: 9px; }
    .workspace-section-tabs { width: calc(100% + 4px); }
    .workspace-tab-form-panel { padding: 17px; }
    .workspace-tab-form .form-two { grid-template-columns: 1fr; }
}
