* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f5f7fa;
    color: #172033;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e4e8ef;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 5px 8px 25px;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand small {
    display: block;
    color: #7b8495;
    margin-top: 2px;
}

.brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 9px;
    background: #1473e6;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

.brand-mark.large {
    width: 52px;
    height: 52px;
    margin: auto;
    font-size: 24px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #445066;
    text-decoration: none;
    font-size: 14px;
}

.nav-item:hover {
    background: #f1f5fa;
}

.nav-item.active {
    background: #eaf3ff;
    color: #1263c4;
    font-weight: 600;
}

.nav-item.disabled {
    color: #9da5b3;
    cursor: default;
}

.sidebar-bottom {
    margin-top: auto;
}

.main {
    margin-left: 240px;
}

.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e4e8ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.search {
    width: 360px;
    border: 1px solid #dce1e8;
    border-radius: 20px;
    padding: 9px 17px;
    color: #9ba3af;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.logout {
    border: 0;
    background: transparent;
    color: #687386;
    cursor: pointer;
}

.content {
    padding: 30px;
}

.page-header h1 {
    margin: 0;
    font-size: 26px;
}

.page-header p {
    margin-top: 7px;
    color: #768195;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 25px;
}

.stat-card {
    background: white;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
    padding: 22px;
}

.stat-label {
    color: #667286;
    font-size: 14px;
}

.stat-number {
    font-size: 34px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card.blue {
    border-top: 3px solid #3887e8;
}

.stat-card.red {
    border-top: 3px solid #e45757;
}

.stat-card.green {
    border-top: 3px solid #36aa72;
}

.stat-card.gray {
    border-top: 3px solid #8e98a8;
}

.panel {
    background: white;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
    margin-top: 24px;
    min-height: 420px;
}

.panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e8ebf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 17px;
    margin: 0;
}

.import-panel { min-height: 0; overflow: hidden; }
.environment-banner { padding: 10px 24px; background: #fff3c4; color: #624600; border-bottom: 1px solid #e6ca72; font-size: 13px; line-height: 1.6; }
.backup-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr); gap:20px; align-items:start; margin-bottom:20px; }
.backup-panel { padding:22px; min-width:0; min-height:0; }
.backup-panel h2 { display:flex; gap:10px; align-items:center; margin:0 0 18px; font-size:17px; }
.backup-panel .menu-icon { width:20px; height:20px; }
.backup-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 20px; }
.backup-full { grid-column:1/-1; }
.backup-side { display:grid; gap:20px; }
.backup-status { display:grid; gap:6px; font-size:13px; }
.backup-status dt { color:var(--ui-muted,#74849e); }
.backup-status dd { margin:0 0 9px; overflow-wrap:anywhere; font-weight:600; }
.backup-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.backup-notice { padding:16px 22px; margin-bottom:20px; }
.backup-panel input[type=password] { margin-bottom:12px; }
.backup-panel .field-help { display:block; line-height:1.5; }
.backup-panel .table-scroll { overflow-x:auto; }
.backup-panel .data-table { width:100%; border-collapse:collapse; }
.backup-panel .data-table th,.backup-panel .data-table td { padding:12px 14px; text-align:left; font-size:13px; border-bottom:1px solid var(--ui-border,#e2e7ee); }
.backup-panel .data-table th { background:var(--ui-raised,#f8fafc); color:var(--ui-muted,#687386); font-size:12px; white-space:nowrap; }
.backup-panel .data-table tr:last-child td { border-bottom:0; }
@media(max-width:1050px) { .backup-layout { grid-template-columns:1fr; } .backup-side { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) { .backup-fields,.backup-side { grid-template-columns:1fr; } .backup-panel { padding:16px; } }
.import-panel .import-table { min-width: 0; overflow-wrap: anywhere; }
.import-body { padding: 18px 22px; overflow-wrap: anywhere; }
.import-body p:first-child { margin-top: 0; }
.import-body p:last-child { margin-bottom: 0; }
.import-body li { margin: 7px 0; }
.import-body details { margin-top: 14px; }
.import-body summary { cursor: pointer; font-weight: 600; }
.import-body input[type="file"] { max-width: 100%; }

.filters {
    display: flex;
    gap: 7px;
}

.filters button {
    background: white;
    border: 1px solid #dce1e8;
    border-radius: 7px;
    padding: 7px 12px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    color: #778297;
    padding: 110px 20px;
}

.empty-icon {
    width: 55px;
    height: 55px;
    margin: auto;
    border-radius: 50%;
    background: #e7f6ee;
    color: #249c62;
    font-size: 30px;
    line-height: 55px;
}

.empty-state h3 {
    color: #344054;
    margin-bottom: 5px;
}


/* LOGIN */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6fa;
}

.login-card {
    width: 390px;
    background: white;
    border: 1px solid #e1e6ed;
    border-radius: 12px;
    padding: 36px;
    box-shadow: 0 8px 30px rgba(0,0,0,.05);
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand h1 {
    margin: 12px 0 4px;
}

.login-brand p {
    color: #788397;
    font-size: 14px;
}

.login-card label {
    display: block;
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: 500;
}

.login-card input {
    width: 100%;
    border: 1px solid #ccd3dd;
    border-radius: 7px;
    padding: 11px;
    font-size: 15px;
}

.login-button {
    width: 100%;
    margin-top: 22px;
    padding: 11px;
    background: #1473e6;
    border: 0;
    border-radius: 7px;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

.login-error {
    padding: 10px;
    background: #fff0f0;
    color: #b42318;
    border-radius: 6px;
    font-size: 14px;
}

@media (max-width: 970px) {
    .sidebar {
        width: 240px;
    }

    .main {
        margin-left: 240px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search {
        width: 220px;
    }
}

.filters a {
    background: white;
    border: 1px solid #dce1e8;
    border-radius: 7px;
    padding: 7px 12px;
    color: #344054;
    text-decoration: none;
    font-size: 13px;
}

.filters a:hover {
    background: #f3f6fa;
}

.task-list {
    width: 100%;
}

.task-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 22px;
    border-bottom: 1px solid #edf0f4;
}

.task-row:last-child {
    border-bottom: 0;
}

.task-meta {
    margin-top: 5px;
    color: #7a8494;
    font-size: 13px;
}
/* SETTINGS */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 25px;
    max-width: 1000px;
}

.settings-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
    padding: 22px;
    text-decoration: none;
    color: #172033;
    transition: 0.15s ease;
}

a.settings-card:hover {
    border-color: #b8d4f6;
    box-shadow: 0 4px 16px rgba(20, 115, 230, 0.08);
    transform: translateY(-1px);
}

.settings-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #eaf3ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.settings-card-icon .menu-icon { width: 24px; height: 24px; }

.account-limit-panel { max-width: 760px; }
.account-limit-panel h2 { font-size: 20px; }
.account-limit-panel form { display: grid; gap: 18px; margin-top: 22px; }
.account-limit-panel .form-field { display: grid; gap: 6px; }
.account-limit-panel form p { margin: 0; }

.settings-card h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.settings-card p {
    margin: 0;
    color: #768195;
    font-size: 13px;
}

.disabled-setting {
    opacity: 0.55;
}

.settings-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.back-link {
    display: inline-block;
    color: #1473e6;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 9px;
}

.primary-button {
    background: #1473e6;
    color: #fff;
    border: 0;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
}

.users-panel {
    min-height: 0;
    overflow: hidden;
}

.user-table {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 1.3fr;
    gap: 18px;
    align-items: center;
}

.user-table-header {
    padding: 12px 20px;
    background: #f8fafc;
    color: #687386;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #e8ebf0;
}

.user-table-row {
    min-height: 64px;
    padding: 10px 20px;
    border-bottom: 1px solid #edf0f4;
    font-size: 14px;
}

.user-table-row:last-child {
    border-bottom: 0;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-name small {
    display: block;
    margin-top: 2px;
    color: #8992a1;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eaf3ff;
    color: #1473e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.tag,
.status-pill,
.role-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
}

.tag {
    background: #f1f4f8;
    color: #536075;
}

.active-user {
    background: #e8f7ef;
    color: #197249;
}

.inactive-user {
    background: #f1f3f5;
    color: #687386;
}

.admin-role {
    background: #fff0ed;
    color: #b42318;
}

.user-role {
    background: #eaf3ff;
    color: #1263c4;
}

@media (max-width: 1000px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .user-table {
        grid-template-columns: 2fr 2fr 1fr;
    }

    .user-table > :nth-child(3),
    .user-table > :nth-child(5) {
        display: none;
    }
}


/* ORDERS */

.page-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #1473e6;
    color: #fff;
    border: 0;
    border-radius: 7px;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.button-link.secondary {
    background: #fff;
    color: #344054;
    border: 1px solid #d9e0e8;
}

.order-filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(170px, 1fr) minmax(200px, 1.2fr) auto;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #e8ebf0;
}

.order-filters input,
.order-filters select,
.form-control {
    width: 100%;
    min-height: 40px;
    border: 1px solid #ccd4df;
    border-radius: 7px;
    padding: 9px 10px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.order-filters button {
    min-height: 40px;
}

.order-result-count {
    padding: 10px 20px;
    color: #7a8494;
    font-size: 13px;
    border-bottom: 1px solid #edf0f4;
}

.order-table-wrap {
    overflow-x: auto;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.order-table th {
    text-align: left;
    padding: 11px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e7ee;
    color: #687386;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.order-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
    vertical-align: middle;
}

.order-table tr:last-child td {
    border-bottom: 0;
}

.order-table tbody tr:hover {
    background: #fafcff;
}

.order-link {
    color: #1263c4;
    text-decoration: none;
    font-weight: 600;
}

.order-link:hover {
    text-decoration: underline;
}

.order-status {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    padding: 2px 10px;
    background: var(--status-color, #6b7280);
    color: var(--status-text, #ffffff);
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.order-form-card {
    max-width: 1100px;
}

.form-section {
    padding: 22px;
    border-bottom: 1px solid #edf0f4;
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section h2 {
    margin: 0 0 17px;
    font-size: 17px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px 20px;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    color: #445066;
    font-size: 13px;
    font-weight: 600;
}

.form-field textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.field-error,
.form-errors {
    margin-top: 6px;
    color: #b42318;
    font-size: 12px;
}

.form-errors {
    margin: 0 22px 10px;
    padding: 10px 12px;
    background: #fff1f0;
    border-radius: 7px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
    gap: 20px;
    margin-top: 24px;
}

.detail-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-card {
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
    overflow: hidden;
}

.detail-card h2 {
    margin: 0;
    padding: 15px 18px;
    border-bottom: 1px solid #e8ebf0;
    font-size: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-item {
    padding: 14px 18px;
    border-bottom: 1px solid #edf0f4;
}

.detail-item:nth-last-child(-n+2) {
    border-bottom: 0;
}

.detail-label {
    color: #7a8494;
    font-size: 12px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.status-form {
    display: flex;
    gap: 8px;
    padding: 16px 18px;
}

.status-form select {
    flex: 1;
}

.document-list,
.timeline-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-item {
    padding: 12px 18px;
    border-bottom: 1px solid #edf0f4;
}

.document-item:last-child {
    border-bottom: 0;
}

.document-item a {
    color: #1263c4;
    text-decoration: none;
}

.timeline-item {
    position: relative;
    margin-left: 25px;
    padding: 0 18px 20px 24px;
    border-left: 2px solid #e5e9ef;
}

.timeline-item:first-child {
    padding-top: 18px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1473e6;
    border: 2px solid #fff;
}

.timeline-item:first-child::before {
    top: 22px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
}

.timeline-meta {
    margin-top: 4px;
    color: #8a94a4;
    font-size: 12px;
}

.timeline-description {
    margin-top: 6px;
    color: #5f6b7c;
    font-size: 13px;
}

.muted {
    color: #8a94a4;
}

@media (max-width: 1100px) {
    .order-filters {
        grid-template-columns: 1fr 1fr;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .form-grid,
    .detail-grid,
    .order-filters {
        grid-template-columns: 1fr;
    }

    .page-header-row {
        align-items: stretch;
        flex-direction: column;
    }
}


/* TWO FACTOR */

.otp-card {
    width: 430px;
}

.otp-qr {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

.otp-qr img {
    width: 220px;
    height: 220px;
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 10px;
    padding: 10px;
}

.otp-secret {
    margin: 12px 0 18px;
    padding: 11px 12px;
    background: #f5f7fa;
    border-radius: 7px;
    text-align: center;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.otp-secret span {
    display: block;
    color: #778297;
    margin-bottom: 4px;
}

.otp-secret strong {
    letter-spacing: 1px;
}


/* UPDATE CENTER */

.settings-card-content {
    flex: 1;
    min-width: 0;
}

.settings-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.update-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
}

.update-badge.available {
    background: #fff3d6;
    color: #9a6700;
}

.update-badge.current {
    background: #e8f7ef;
    color: #197249;
}

.update-badge.setup {
    background: #f1f3f5;
    color: #687386;
}

.update-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    gap: 20px;
    margin-top: 24px;
}

.update-state {
    margin: 18px;
    padding: 15px 16px;
    border-radius: 9px;
}

.update-state p {
    margin: 5px 0 0;
    font-size: 13px;
}

.update-state.available {
    background: #fff8e6;
    color: #805500;
}

.update-state.current {
    background: #eaf8f0;
    color: #17643f;
}

.update-state.working {
    background: #eaf3ff;
    color: #125aa7;
}

.update-state.warning {
    background: #fff1f0;
    color: #9f2d20;
}

.update-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: #edf0f4;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
}

.update-info-grid.single {
    grid-template-columns: 1fr;
}

.update-info-grid > div {
    background: #fff;
    padding: 14px 18px;
}

.update-info-grid span {
    display: block;
    color: #7a8494;
    font-size: 12px;
    margin-bottom: 5px;
}

.update-info-grid strong {
    display: block;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px;
}

.update-actions form {
    margin: 0;
}

.update-actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.update-help {
    padding: 18px;
    color: #697586;
    font-size: 13px;
    line-height: 1.55;
}

.update-notice {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.update-notice.success {
    background: #eaf8f0;
    color: #17643f;
}

.update-notice.info {
    background: #eaf3ff;
    color: #125aa7;
}

.update-notice.error {
    background: #fff1f0;
    color: #9f2d20;
}

@media (max-width: 1000px) {
    .update-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .update-info-grid {
        grid-template-columns: 1fr;
    }
}


/* PARTNER DATABASE */
.partner-filters { display:grid; grid-template-columns:minmax(260px,2fr) minmax(180px,.8fr) auto; gap:10px; padding:16px 20px; border-bottom:1px solid #e8ebf0; }
.partner-filters input,.partner-filters select { width:100%; min-height:40px; border:1px solid #ccd4df; border-radius:7px; padding:9px 10px; background:#fff; color:#172033; font:inherit; }
.partner-table { min-width:980px; }
.partner-form-card { max-width:1180px; }
.checkbox-field { display:flex; align-items:center; gap:8px; min-height:40px; }
.checkbox-field input { width:auto; }
.checkbox-field label { margin:0; }
.partner-detail-layout { display:grid; grid-template-columns:minmax(0,2fr) minmax(320px,.9fr); gap:20px; margin-top:24px; }
.full-detail-item { grid-column:1/-1; }
.partner-contact { padding:14px 18px; border-bottom:1px solid #edf0f4; font-size:13px; line-height:1.55; }
.partner-contact strong { font-size:14px; margin-right:6px; }
.partner-contact-form { padding:16px 18px 18px; border-top:1px solid #edf0f4; }
.partner-contact-form h3 { margin:0 0 12px; font-size:14px; }
.partner-contact-form .form-field { margin-bottom:11px; }
.partner-contact-form .checkbox-field { min-height:30px; font-size:13px; }
.partner-contact-form .button-link { margin-top:8px; width:100%; }
@media (max-width:1000px){ .partner-detail-layout{grid-template-columns:1fr;} }
@media (max-width:760px){ .partner-filters{grid-template-columns:1fr;} }


/* AUTOMATIONS */

.automation-email-status {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 9px;
    border: 1px solid #dbe3ec;
    background: #fff;
}

.automation-email-status.configured {
    background: #eef9f3;
    border-color: #ccebd9;
}

.automation-email-status.test-mode {
    background: #fff8e8;
    border-color: #f2dfae;
}

.automation-email-status strong,
.automation-email-status span,
.automation-email-status small {
    display: block;
}

.automation-email-status span {
    margin-top: 4px;
    color: #5f6b7c;
    font-size: 13px;
}

.automation-email-status small {
    color: #7a8494;
    white-space: nowrap;
}

.automation-panel {
    overflow: hidden;
}

.automation-table {
    display: grid;
    grid-template-columns: 1.45fr 1fr .65fr .65fr .75fr 1fr;
    gap: 14px;
    align-items: center;
    padding: 13px 18px;
}

.automation-table-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e7ee;
    color: #687386;
    font-size: 12px;
    font-weight: 600;
}

.automation-table-row {
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

.automation-table-row:last-child {
    border-bottom: 0;
}

.automation-table strong,
.automation-table small {
    display: block;
}

.automation-table small {
    margin-top: 4px;
    color: #7b8595;
}

.automation-actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.automation-actions-cell form {
    margin: 0;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d3dae4;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    padding: 7px 9px;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.automation-success {
    color: #17724a !important;
}

.automation-warning {
    color: #9a6700 !important;
}

.automation-error {
    color: #b42318 !important;
}

.automation-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
    align-items: start;
    margin-top: 22px;
}

.automation-form {
    overflow: hidden;
}

.automation-subheading {
    margin: 16px 0 9px;
    font-size: 13px;
}

.automation-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.automation-check-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px;
    border: 1px solid #e0e5eb;
    border-radius: 7px;
    background: #fafbfc;
    font-size: 13px;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #7a8494;
    font-size: 12px;
}

.automation-help-card {
    position: sticky;
    top: 78px;
}

.automation-help-card code {
    display: block;
    margin: 5px 0;
    padding: 5px 7px;
    border-radius: 5px;
    background: #f5f7fa;
    color: #344054;
    font-size: 12px;
}

@media (max-width: 1150px) {
    .automation-table {
        grid-template-columns: 1.4fr 1fr .7fr .8fr;
    }

    .automation-table > :nth-child(5),
    .automation-table-header > :nth-child(5) {
        display: none;
    }

    .automation-form-layout {
        grid-template-columns: 1fr;
    }

    .automation-help-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .automation-email-status {
        flex-direction: column;
    }

    .automation-table {
        grid-template-columns: 1fr;
    }

    .automation-table-header {
        display: none;
    }

    .automation-actions-cell {
        justify-content: flex-start;
    }

    .automation-check-grid {
        grid-template-columns: 1fr;
    }
}


.account-form { padding: 24px; margin-bottom: 20px; }
.account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field label { display: block; margin-bottom: 6px; }
.errorlist, .login-error { color: #a32222; }
.notice { padding: 12px 18px; margin-bottom: 16px; background: #e9f3ee; border-radius: 8px; }
.notice.error { background: #ffecec; }
.access-table-wrap { overflow-x: auto; }
.auth-qr { max-width: 100%; width: 260px; }
.secret-key { overflow-wrap: anywhere; }
.recovery-codes { padding: 16px; line-height: 1.8; background: #f5f7fa; }
.pagination { display: flex; gap: 18px; align-items: center; padding: 18px; }
@media (max-width: 760px) { .account-fields { grid-template-columns: 1fr; } .user-area { flex-wrap: wrap; } }

/* Editable record cards and validation */
.record-form-grid { padding: 20px; }
.required-mark, .field-error, .form-errors, .errorlist { color: #b91c1c; }
.has-error .form-control, .form-control.is-invalid { border: 2px solid #dc2626; background: #fef2f2; }
.has-error label { color: #b91c1c; }
.inline-form { display: inline-block; margin: 4px 8px; }
.timeline-description { overflow-wrap: anywhere; white-space: normal; }
.timeline-pagination { display: flex; justify-content: space-between; gap: 8px; padding: 16px; }
.record-form-grid .form-field { min-width: 0; }
.record-form-grid textarea { width: 100%; }

.order-create-card, .configuration-form { min-height: 0; }
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #e4e8ef; }
  .brand { padding: 0 0 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar nav .disabled { display: none; }
  .sidebar-bottom { margin-top: 8px; }
  .main { margin-left: 0; min-width: 0; }
  .topbar { height: auto; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .topbar .search { display: none; }
  .user-area { gap: 12px; }
  .content { padding: 16px; }
  .page-header-row { align-items: flex-start; flex-direction: column; }
  .record-form-grid { padding: 16px; }
  .status-form { flex-wrap: wrap; }
  .status-form select { min-width: 0; }
  .document-item { overflow-wrap: anywhere; }
}
/* Module configuration and colored, keyboard-accessible status selectors. */
.module-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.colored-status-select { position: relative; min-width: 0; width: 100%; }
.detail-card:has(.colored-status-select) { overflow: visible; }
.detail-card:has(.colored-status-select) > h2 { border-radius: 12px 12px 0 0; }
.status-select-button, .status-select-option { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: #14304e; background: white; cursor: pointer; }
.status-select-button { min-height: 42px; border: 1px solid #cbd7e5; border-radius: 6px; padding: 10px 12px; }
.status-select-button::after { content: '▾'; margin-left: auto; }
.status-select-button:disabled { cursor: default; background: #f5f7fb; }
.status-select-button[aria-invalid="true"] { border-color: #dc3545; }
.status-select-options { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; border: 1px solid #cbd7e5; border-radius: 8px; box-shadow: 0 8px 24px rgba(15,35,65,.15); padding: 4px; background: white; max-height: 280px; overflow-y: auto; }
.status-select-options[hidden] { display: none; }
.status-select-option { border: 0; border-radius: 4px; padding: 10px; }
.status-select-option:hover, .status-select-option:focus, .status-select-option[aria-selected="true"] { background: #edf4ff; }
.status-select-button:focus-visible, .status-select-option:focus-visible { outline: 2px solid #1875f0; outline-offset: 2px; }

.timeline-comment-form { padding: 18px; border-bottom: 1px solid #e7edf5; }
.timeline-comment-form textarea { margin-top: 8px; width: 100%; box-sizing: border-box; }
.timeline-comment-form .muted { font-size: 12px; }

/* Task and history workspace. */
.record-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 20px; align-items: start; }
.record-fields-side .record-form-grid, .record-fields-side .detail-grid { grid-template-columns: minmax(0,1fr); }
.record-fields-side .form-grid { padding: 14px 18px; gap: 8px; }
.record-fields-side .form-field label { margin-bottom: 3px; }
.record-fields-side .field-error:empty { display: none; }
.record-fields-side .detail-item { padding: 9px 18px; }
.record-fields-side .detail-label { margin-bottom: 3px; }
.record-form-grid .form-control, .record-editor .form-control { height: 32px; min-height: 32px; padding: 6px 10px; font-size: 14px; line-height: 18px; }
.record-form-grid select.form-control, .record-editor select.form-control { padding: 3px 10px; line-height: normal; }
.record-form-grid .status-select-button, .record-editor .status-select-button { min-height: 32px; padding: 4px 9px; }
.record-form-grid .form-field textarea.form-control, .record-editor .form-field textarea.form-control { height: 64px; min-height: 64px; }
.record-form-grid input[type="file"].form-control, .record-editor input[type="file"].form-control { height: auto; padding: 4px 6px; }
@media (pointer: coarse) { .record-form-grid .form-control, .record-editor .form-control, .record-form-grid .status-select-button, .record-editor .status-select-button { min-height: 40px; } }
.record-fields-side .form-actions { padding: 0 18px 18px; }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid #e7edf5; flex-wrap: wrap; }
.timeline-heading h2 { padding: 0; border: 0; margin: 0; font-size: 16px; }
.timeline-actions, .timeline-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.timeline-filters input, .timeline-filters select { min-height: 36px; padding: 7px 9px; border: 1px solid #cbd7e5; border-radius: 6px; background: white; min-width: 0; }
.timeline-filters input { width: 180px; }
.timeline-heading .button-link { padding: 9px 12px; }
.timeline-days { padding: 18px; }
.timeline-day { color: #8390a2; font-size: 12px; font-weight: 500; border-bottom: 1px solid #e7edf5; padding-bottom: 10px; margin: 12px 0 15px; }
.timeline-events { list-style: none; padding: 0; margin: 0; }
.timeline-event { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; margin-bottom: 20px; position: relative; }
.timeline-event::before { content: ''; position: absolute; left: 16px; top: 38px; bottom: -10px; width: 1px; background: #dce5ef; }
.timeline-avatar { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1977ed; color: white; font-size: 13px; font-weight: 600; }
.type-comment .timeline-avatar { background: #556cd6; }
.type-task .timeline-avatar { background: #16a168; }
.type-system .timeline-avatar { background: #7c899b; }
.timeline-event-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin: 6px 0 10px; }
.timeline-event-heading time { color: #8692a4; white-space: nowrap; }
.timeline-rich-body { font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.timeline-rich-body p, .timeline-rich-body div { margin: 0 0 8px; }
.timeline-rich-body table, .editor-content table { border-collapse: collapse; width: 100%; }
.timeline-rich-body th, .timeline-rich-body td, .editor-content th, .editor-content td { border: 1px solid #d4deeb; padding: 6px; }
.timeline-rich-body pre, .editor-content pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f3f6fb; padding: 8px; }
.timeline-rich-body blockquote, .editor-content blockquote { border-left: 3px solid #ccd9ed; margin-left: 0; padding-left: 12px; }
.timeline-task-meta, .timeline-changes { color: #6b7b90; font-size: 12px; margin-top: 8px; }
.timeline-changes summary { cursor: pointer; }
.timeline-changes div { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-attachment { display: block; margin-top: 10px; font-size: 12px; overflow-wrap: anywhere; }
.timeline-attachment span { color: #8692a4; }
.timeline-task-link { display: block; font-size: 13px; margin-bottom: 8px; }
.worklist-row { display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #edf1f7; }
.worklist-row a { color: #174b85; text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.worklist-row .muted { font-size: 12px; margin-top: 5px; }
.task-state-dot { width: 12px; height: 12px; border: 2px solid #2981e9; border-radius: 50%; margin-top: 4px; flex: 0 0 12px; }
.task-state-dot.overdue { border-color: #dc5265; }
.worklist-empty, .task-description, .task-checklist { padding: 20px; }
.worklist-empty { color: #8592a6; font-size: 13px; }
.task-checklist div { padding: 5px 0; }
.timeline-dialog { width: min(850px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); border: 0; border-radius: 10px; padding: 0; color: #233650; box-shadow: 0 20px 90px rgba(16,36,65,.25); }
.timeline-dialog::backdrop { background: rgba(26,44,77,.5); }
.entry-dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e7edf5; position: sticky; top: 0; background: white; z-index: 2; }
.entry-dialog-header h2 { font-size: 17px; font-weight: 500; margin: 0; }
.entry-dialog-header button { background: none; border: 0; font-size: 25px; cursor: pointer; color: #66768e; }
.entry-dialog-body { padding: 24px; display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 26px; }
.entry-main { min-width: 0; }
.entry-aside .primary-button { width: 100%; }
.entry-aside p { font-size: 13px; line-height: 1.6; color: #6c7b90; }
.entry-aside > button:not(.primary-button) { display: block; background: none; border: 0; color: #146be4; padding: 12px 0; text-align: left; cursor: pointer; font: inherit; font-size: 14px; }
.entry-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 24px; margin-top: 20px; }
.entry-fields-grid label { display: block; font-size: 13px; margin-bottom: 7px; }
.entry-optional-grid details { margin-top: 12px; border: 1px solid #e2e9f3; border-radius: 6px; padding: 10px; }
.entry-optional-grid details:not([open]) { display: none; }
.entry-optional-grid summary { font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.entry-optional-grid select, .entry-optional-grid textarea, .entry-optional-grid input { width: 100%; margin-bottom: 6px; }
.entry-optional-grid small { display: block; color: #8592a6; font-size: 12px; }
.rich-editor { border: 1px solid #cbd7e5; border-radius: 6px; overflow: hidden; }
.rich-editor > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 7px; background: #fafbfd; border-bottom: 1px solid #e7edf5; }
.editor-toolbar button, .editor-toolbar select { border: 0; background: transparent; padding: 5px; min-width: 27px; height: 29px; font-size: 14px; color: #596b86; cursor: pointer; }
.editor-toolbar button:hover { background: #e8effc; border-radius: 4px; }
.editor-content { min-height: 140px; padding: 14px; line-height: 1.6; font-size: 14px; outline: none; overflow-wrap: anywhere; }
.editor-content[data-empty='true']::before { content: attr(data-placeholder); color: #8a96a9; pointer-events: none; }
.editor-link-panel { padding: 10px; border-top: 1px solid #e7edf5; font-size: 12px; }
.editor-link-panel input { width: 70%; max-width: 100%; }
.entry-upload { margin-top: 20px; padding: 15px; border: 1px dashed #cbd7e5; border-radius: 6px; }
.entry-upload label { display: block; font-size: 13px; cursor: pointer; }
.entry-upload input { max-width: 100%; margin: 10px 0; }
.entry-upload small { display: block; color: #8592a6; font-size: 11px; }
.entry-upload.dragging { background: #edf4ff; }
.upload-file-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 5px 0; overflow-wrap: anywhere; }
.upload-file-list button { border: 0; background: transparent; cursor: pointer; }
.form-errors:empty { display: none; }
@media (max-width: 1150px) { .record-workbench { grid-template-columns: minmax(0,1fr) 405px; gap: 14px; } }
@media (max-width: 1020px) { .record-workbench { grid-template-columns: minmax(0,1fr); } .record-fields-side { order: 2; } }
@media (max-width: 600px) { .entry-dialog-body { grid-template-columns: minmax(0,1fr); padding: 16px; gap: 16px; } .entry-aside { display: flex; flex-wrap: wrap; gap: 4px 15px; } .entry-aside .primary-button { width: 100%; } .entry-aside p { margin: 0; } .entry-fields-grid { grid-template-columns: minmax(0,1fr); gap: 12px; } .timeline-actions, .timeline-filters { width: 100%; } .timeline-filters input { flex: 1; width: 130px; } .timeline-heading { padding: 15px; } .timeline-days { padding: 15px; } .timeline-event-heading { flex-wrap: wrap; } .timeline-dialog { max-height: calc(100dvh - 20px); width: calc(100vw - 20px); } }

.rich-editor.is-invalid { border-color: #dc3545; }

/* Compact configuration lists and pointer/keyboard ordering. */
.compact-settings { min-height: 0; margin-top: 10px; }
.compact-settings .order-table { min-width: 0; }
.compact-settings .order-table td { padding: 6px 12px; }
.compact-settings .order-table th { padding: 9px 12px; }
.compact-settings .inline-form { margin: 0 0 0 8px; }
.compact-settings .button-link { padding: 6px 10px; font-size: 12px; }
.compact-settings td:last-child { white-space: nowrap; }
.compact-settings .sort-column, .compact-settings td:first-child:has(.sort-handle) { width: 36px; padding: 4px 6px; }
.sort-handle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 5px; color: #6e8099; background: transparent; font-size: 22px; cursor: grab; touch-action: none; }
.sort-handle:hover, .sort-handle:focus-visible { background: #eaf2ff; border-color: #a9c8f1; color: #1875f0; }
.sort-handle:disabled { cursor: wait; opacity: .5; }
.sorting-active { user-select: none; }
.sorting-active .sort-handle { cursor: grabbing; }
.sorting-row { background: #edf4ff !important; outline: 2px solid #a9c8f1; outline-offset: -2px; }
.sort-help, .sort-status { font-size: 13px; color: #718198; margin: 8px 0; }
.sort-status:empty { display: none; }
.sort-status { color: #188354; }
.sort-status.error { color: #bd3047; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px) { .compact-settings { overflow-x: auto; } .compact-settings .order-table { min-width: 610px; } }

/* Header status saves independently of the editable record fields. */
.record-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0; }
.record-title-row h1 { margin: 0; }
.header-status { min-width: 0; max-width: 100%; }
.header-status form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.header-status .colored-status-select { width: auto; min-width: 170px; max-width: 340px; }
.header-status .status-select-button { min-height: 34px; padding: 5px 9px; }
.header-status small { display: block; margin-top: 4px; font-size: 12px; }
.status-save-feedback { color: #188354; font-size: 12px; max-width: 360px; }
.status-save-feedback.error { color: #b91c1c; }
.status-save-feedback:empty { display: none; }
[data-status-fallback][hidden] { display: none; }
.header-status [aria-busy="true"] .status-select-button { cursor: wait; }
.timeline-avatar svg { width: 19px; height: 19px; }
.type-created .timeline-avatar { background: #168555; }
.type-file .timeline-avatar { background: #a9650e; }
.type-updated .timeline-avatar { background: #6972c7; }
.type-comment .timeline-avatar { background: #64748b; }
.timeline-status-transition { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.status-transition-arrow { color: #6d819c; font-size: 18px; }
.timeline-changes[open] summary { margin-bottom: 8px; }
@media (max-width: 760px) { .header-status .colored-status-select { max-width: 280px; } .record-title-row { align-items: flex-start; } }

/* Configurable record boxes, status totals and account images. */
.record-data-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.record-box > summary { padding: 15px 18px; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.record-box > summary::after { content: '⌄'; float: right; color: #718198; }
.record-box[open] > summary { border-bottom: 1px solid #e8ebf0; }
.record-box[open] > summary::after { content: '⌃'; }
.record-box .form-grid:empty, .box-documents:empty { display: none; }
.box-documents { padding: 8px 18px; }
.box-file { display: block; padding: 5px 0; color: #1263c4; text-decoration: none; font-size: 13px; overflow-wrap: anywhere; }
.box-upload { padding: 10px 18px 16px; }
.box-upload > summary { cursor: pointer; color: #1263c4; font-size: 13px; }
.box-upload-body { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; }
.box-upload input { width: 100%; max-width: 100%; min-width: 0; font-size: 12px; }
.box-upload small, .box-upload-status { width: 100%; font-size: 12px; }
.box-upload-status { color: #188354; }
.box-upload-status:empty { display: none; }
.box-upload-status.error { color: #b91c1c; }
.module-list-workbench { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; align-items: start; }
.module-list-workbench > div { min-width: 0; }
.status-summary h2 { padding: 16px; margin: 0; font-size: 16px; border-bottom: 1px solid #e8ebf0; }
.status-summary ul { list-style: none; padding: 8px 12px; margin: 0; }
.status-summary a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px; min-height: 28px; box-sizing: border-box; color: #174b85; text-decoration: none; font-size: 13px; }
.status-summary a[aria-current] { background: #eaf2ff; border-radius: 5px; }
.status-summary .status-summary-total { padding: 14px 16px; border-bottom: 1px solid #edf0f4; }
.status-summary strong { min-width: 22px; text-align: right; }
.profile-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.user-avatar, .event-author-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.event-author-avatar { width: 24px; height: 24px; }
.timeline-event-heading strong { flex: 1; }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 10px; }
.brand-logo { max-width: 100%; width: 220px; max-height: 70px; object-fit: contain; object-position: left; }
.company-logo-preview { display: block; max-width: 320px; max-height: 140px; object-fit: contain; margin: 20px 0; }
.profile-current { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.avatar-crop canvas { display: block; width: 320px; max-width: 100%; aspect-ratio: 1; touch-action: none; cursor: grab; border: 1px solid #dce4ef; }
.avatar-crop label { display: block; width: 320px; max-width: 100%; margin-top: 14px; }
.avatar-crop input[type=range] { width: 100%; }
.avatar-crop[hidden] { display: none; }
[data-crop-error] { color: #b91c1c; }
.header-status .colored-status-select { width: clamp(260px, 28vw, 420px); max-width: 100%; min-width: 0; }
.status-select-options { width: max-content; min-width: 100%; max-width: calc(100vw - 32px); right: auto; overflow-x: auto; }
.status-select-option .order-status { white-space: nowrap; max-width: none; flex-shrink: 0; }
.status-select-button .order-status { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1250px) { .module-list-workbench { grid-template-columns: minmax(0,1fr); } .status-summary { order: -1; } .status-summary ul { display: flex; flex-wrap: wrap; gap: 5px 14px; } }
@media (max-width: 760px) { .header-status { width: 100%; } .header-status form { width: 100%; } .header-status .colored-status-select { width: 100%; max-width: 100%; } .company-logo-preview { max-width: 100%; } }

.profile-editor { max-width: 850px; }
.box-file-delete { border: 0; background: none; color: #b91c1c; cursor: pointer; font-size: 12px; padding: 0 0 5px; }

.account-form input[type=file] { max-width: 100%; }

[data-box-upload], form[id^="document-trash-"] { display: none; }

.module-list-workbench .order-filters > *, .module-list-workbench .partner-filters > * { min-width: 0; }
@media (max-width: 1150px) { .partner-filters { grid-template-columns: minmax(0,1fr); } }

.record-editor .record-box { margin-bottom: 14px; }

/* Grouped field customization */
.field-builder { max-width: 900px; margin: 0 auto; }
.builder-add-box,.builder-new-field { display:block; text-align:center; padding:12px; text-decoration:none; color:var(--primary,#1875f0); }
.builder-add-box { border:1px solid #bfd5ff; background:#f0f5ff; border-radius:7px; margin:16px 0; }
.builder-group { background:#f4f6f9; border:1px solid #e1e7f0; border-radius:8px; margin:20px 0; overflow:hidden; }
.builder-group>header { display:flex; gap:10px; align-items:center; background:#edf3fc; border-bottom:1px solid #d7e2f4; padding:10px 12px; }
.builder-group>header>a { margin-left:auto; text-decoration:none; font-size:20px; }
.builder-fields { min-height:16px; padding:6px; }
.builder-field { background:white; border:1px solid #e1e7f0; border-radius:6px; margin:5px 0; }
.builder-field-preview { display:grid; grid-template-columns:24px minmax(130px,1fr) minmax(120px,1.5fr) 24px; gap:10px; align-items:center; padding:9px; }
.builder-field-preview>a { text-decoration:none; font-size:20px; }
.builder-preview-control { display:block; min-height:28px; border:1px solid #d5ddea; color:#7c8da6; background:#f5f7fa; border-radius:5px; padding:4px 10px; font-size:13px; }
.builder-handle { border:0; background:transparent; color:#8b9bb1; padding:3px; cursor:grab; touch-action:none; }
.field-inactive { opacity:.65; }
.field-editor { margin:10px 0; padding:16px; border:1px solid #d3e1fa; border-radius:7px; }
.field-editor-title>label { position:absolute; width:1px; height:1px; overflow:hidden; }
.field-editor-title small { display:block; margin:7px 0 14px; }
.field-editor-grid { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.field-editor-grid .form-field { margin-bottom:12px; }
.field-editor .form-control { min-width:0; width:100%; box-sizing:border-box; }
.check-field { display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.check-field input { width:auto; }
.option-toolbar { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:10px; }
.option-row { display:grid; grid-template-columns:20px minmax(60px,1fr) 30px 24px; gap:6px; align-items:center; margin:8px 0; }
.option-row input[type=text] { width:100%; min-width:0; height:32px; border:1px solid #ccd7e6; border-radius:5px; padding:4px 8px; box-sizing:border-box; }
.option-row input[type=color] { padding:1px; width:30px; height:30px; border:1px solid #d5ddea; border-radius:4px; background:white; }
.option-row button,.dialog-heading button { border:0; background:transparent; font-size:22px; color:#64748b; cursor:pointer; }
.option-grip { cursor:grab; color:#8b9bb1; }
.filename-variables { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.filename-variables button { border:1px solid #d5ddea; border-radius:4px; background:#f6f8fb; font-size:11px; padding:4px; }
.field-type-dialog { width:min(580px,calc(100vw - 32px)); max-height:85vh; box-sizing:border-box; border:1px solid #dce3ef; border-radius:10px; padding:20px; }
.field-type-dialog::backdrop { background:#17284088; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.dialog-heading h2 { font-size:18px; }
.field-type-list>a { display:grid; grid-template-columns:120px 1fr auto; gap:16px; align-items:center; padding:14px 0; border-bottom:1px solid #edf0f5; text-decoration:none; color:#182b49; }
.field-type-list strong { font-weight:500; }
.field-type-page { max-width:650px; margin:0 auto; padding:20px; }
.field-file-upload { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.field-file-upload input[type=file] { min-width:0; max-width:100%; width:100%; }
.record-box .box-documents:empty { display:none; }
.record-box .form-field ul { list-style:none; padding:0; margin:0; }
.record-box .form-field input[type=checkbox] { width:auto; min-height:0; }
@media(max-width:700px) { .field-editor-grid { grid-template-columns:1fr; gap:10px; } .builder-field-preview { grid-template-columns:20px minmax(0,1fr) 24px; gap:6px; }.builder-field-preview .builder-preview-control { display:none; }.field-type-list>a { grid-template-columns:70px 1fr auto; gap:8px; }.field-type-list .button-link { padding:5px; font-size:12px; }.field-type-list .builder-preview-control { overflow:hidden; white-space:nowrap; }.field-editor { padding:10px; } }

.brand strong, .login-card h1 { overflow-wrap:anywhere; }
.brand>div { min-width:0; }

/* Compact status controls and unobtrusive, persistent save state. */
.header-status .status-select-button { background:var(--status-color,#edf2f7); color:var(--status-text,#24364b); border:1px solid rgba(20,40,65,.12); border-radius:5px; padding:8px 12px; min-height:36px; font-weight:600; box-shadow:0 1px 2px #172b4610; transition:box-shadow .15s; }
.header-status .status-select-button:hover { box-shadow:0 2px 7px #172b4622; }
.header-status .status-select-button .order-status { background:transparent; color:inherit; padding:0; border-radius:0; font-size:13px; line-height:18px; font-weight:600; }
.header-status .status-select-button::after { border-left:1px solid currentColor; padding-left:12px; opacity:.75; }
.header-status .status-select-options { padding:5px; border-radius:6px; box-shadow:0 8px 24px #18315024; }
.header-status .status-select-option { padding:5px 6px; border-radius:3px; }
.status-summary .order-status { padding:1px 8px; border-radius:3px; }
.record-save-feedback { order:-1; position:sticky; top:12px; z-index:2; margin:0; padding:8px 12px; background:#f5f9fd; border:1px solid #dce6f0; border-radius:5px; color:#62738a; font-size:12px; display:flex; gap:10px; align-items:center; }
.record-save-feedback.error { color:#a52222; background:#fff5f5; border-color:#efc5c5; }
.autosave-retry { border:1px solid currentColor; border-radius:4px; background:transparent; color:inherit; cursor:pointer; padding:3px 7px; }
.autosave-retry[hidden] { display:none; }
[data-field-save-error] { color:#b91c1c; font-size:12px; margin-top:4px; }
[data-record-field].is-saving { border-left:2px solid #8db8ec; padding-left:6px; }
@media(pointer:coarse) { .status-summary a { min-height:40px; } }

/* Compact navigation and record overviews. */
.sidebar { padding:16px 10px; }
.sidebar .nav-item { padding:9px 10px; font-size:13px; }
.sidebar .brand strong { font-size:16px; }
.sidebar .brand { padding-bottom:20px; }
.list-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.list-title-row h1 { margin:0; }
.list-title-row .button-link { font-size:13px; padding:8px 12px; white-space:nowrap; }
.module-toolbar { align-items:center; }
.module-trash-action { margin-left:auto; }
.module-list-workbench { grid-template-columns:minmax(0,1fr) 250px; gap:16px; }
.module-list-workbench .panel { min-height:0; margin-top:0; }
.compact-record-table { min-width:0; table-layout:fixed; }
.compact-record-table th:first-child { width:42%; }
.compact-record-table td { padding:10px 14px; overflow-wrap:anywhere; }
.compact-record-table .order-link { font-weight:500; }
.compact-record-table th:not(:first-child) { width:auto; }
.module-list-workbench .order-filters { padding:14px 16px; gap:8px; }
.module-list-workbench .order-filters input, .module-list-workbench .order-filters select { height:36px; min-height:36px; padding:6px 10px; font-size:13px; }
.record-deadline { color:#52667f; text-decoration:none; font-size:12px; }
.record-deadline.overdue { color:#c72d2d; }
@media(max-width:1250px) { .module-list-workbench { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
 .compact-record-table thead { display:none; }
 .compact-record-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); border-bottom:1px solid #e7edf5; padding:6px; }
 .compact-record-table td { border:0; padding:6px 8px; font-size:13px; }
 .compact-record-table td:first-child,.compact-record-table td:last-child { grid-column:1/-1; }
 .compact-record-table td::before { content:attr(data-label); display:block; color:#7b8798; font-size:11px; margin-bottom:3px; }
 .compact-record-table td:first-child::before { display:none; }
 .module-trash-action { margin-left:0; }
}

.record-title-row h1, .list-title-row h1 { min-width:0; max-width:100%; overflow-wrap:anywhere; }

/* Compact menu icon chooser; details also works without JavaScript. */
.menu-icon { width:20px; height:20px; flex:0 0 20px; vertical-align:middle; }
.icon-picker { position:relative; margin:0; width:fit-content; }
.icon-picker-trigger { display:grid; place-items:center; width:36px; height:36px; list-style:none; cursor:pointer; border:1px solid #cdd8e6; border-radius:5px; color:#45566f; background:white; }
.icon-picker-trigger::-webkit-details-marker { display:none; }
.icon-picker-trigger [data-icon-preview] { display:flex; }
.icon-picker[open] .icon-picker-trigger { border-color:#1875f0; background:#edf5ff; color:#1564d1; }
.icon-picker-trigger:focus-visible { outline:2px solid #1875f0; outline-offset:3px; }
.icon-picker-panel { position:absolute; top:42px; left:0; z-index:100; box-sizing:border-box; width:min(568px,calc(100vw - 24px)); max-height:420px; overflow:auto; padding:12px; border:1px solid #dfe6ef; border-radius:7px; background:white; box-shadow:0 8px 28px #152b4826; }
.icon-picker.is-enhanced .icon-picker-panel { position:fixed; }
.icon-picker:not([open]) .icon-picker-panel { display:none; }
.icon-picker-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.icon-picker-header .form-control { min-width:0; }
.icon-picker-close { flex:none; width:30px; height:30px; padding:0; border:0; border-radius:4px; background:transparent; color:#65758c; font-size:24px; cursor:pointer; }
.icon-picker-close:hover { background:#eef3fa; }
.icon-picker-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(30px,1fr)); gap:4px; padding:2px; }
.icon-picker-grid .icon-option { display:grid; place-items:center; position:relative; cursor:pointer; height:32px; padding:0; margin:0; border:1px solid transparent; border-radius:4px; color:#26364d; background:white; }
.icon-option input { position:absolute; opacity:0; width:1px; height:1px; }
.icon-picker-grid .icon-option:has(input:checked) { color:white; background:#1875f0; border-color:#1875f0; }
.icon-option:has(input:focus-visible) { outline:2px solid #111827; outline-offset:2px; }
.icon-picker-grid .icon-option:hover { background:#edf4ff; border-color:#a5c6f3; color:#1263cf; }
.icon-picker-grid .icon-option[hidden] { display:none; }
@media(pointer:coarse) { .icon-picker-grid { grid-template-columns:repeat(auto-fill,minmax(40px,1fr)); } .icon-picker-grid .icon-option { height:42px; } }

/* Record email archive and focused reader */
.worklist-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.record-email-button { display:inline-flex; align-items:center; gap:7px; }
.record-email-button svg { width:17px; height:17px; }
.record-email-button:disabled { opacity:.5; cursor:default; }
.archived-email-subject { display:block; margin:7px 0 3px; color:#0766d8; font-weight:500; overflow-wrap:anywhere; }
.email-toast { position:fixed; bottom:24px; right:24px; z-index:10000; display:flex; align-items:center; gap:10px; padding:14px 20px; border:1px solid #b4e2c8; background:#f5fff8; color:#14633d; box-shadow:0 8px 32px #18334826; border-radius:8px; max-width:calc(100vw - 48px); }
.email-toast>span:first-child { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; color:white; background:#1c9b5e; font-weight:700; }
.email-toast.error { color:#963636; background:#fff7f7; border-color:#efc9c9; }
.email-toast.error>span:first-child { background:#c74646; }
.email-reader { width:min(960px,calc(100vw - 32px)); height:min(850px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); padding:0; border:1px solid #dbe3ee; border-radius:10px; box-shadow:0 24px 90px #10243b40; color:#172439; }
.email-reader[open] { display:flex; flex-direction:column; }
.email-reader::backdrop { background:#13264080; backdrop-filter:blur(2px); }
.email-reader header { display:flex; justify-content:space-between; gap:16px; padding:18px 24px; border-bottom:1px solid #e5eaf1; }
.email-reader h2 { margin:4px 0 0; font-size:18px; line-height:1.4; overflow-wrap:anywhere; }
.email-kicker { color:#78899f; font-size:12px; }
.email-close { border:0; background:none; font-size:28px; color:#65758c; cursor:pointer; align-self:flex-start; }
.email-metadata { padding:16px 24px; background:#fafbfd; max-height:30vh; overflow:auto; flex-shrink:0; }
.email-metadata dl { display:grid; grid-template-columns:90px minmax(0,1fr); gap:6px 12px; margin:0; font-size:13px; }
.email-metadata dt { color:#75849a; }
.email-metadata dd { margin:0; overflow-wrap:anywhere; white-space:pre-line; }
.email-attachments { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.email-attachments a { padding:6px 10px; background:white; border:1px solid #dce4ef; border-radius:4px; overflow-wrap:anywhere; font-size:12px; }
.email-attachments span { color:#8592a6; }
.email-reader iframe { border:0; border-top:1px solid #e6ebf2; width:100%; flex:1; min-height:180px; background:white; }
.email-reader footer { padding:12px 24px; display:flex; justify-content:flex-end; border-top:1px solid #e5eaf1; }
@media(max-width:600px) { .email-reader header,.email-metadata { padding:14px; } .email-metadata dl { grid-template-columns:72px minmax(0,1fr); } }

