.relative-time {
    display: block;
    margin-top: 3px;
    color: #3f5d7e;
}

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

.contact-grid article {
    display: grid;
    gap: 7px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
}

.contact-grid a {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

.contact-grid small,
.price-verification-note {
    color: var(--muted);
}

.price-verification-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff8e8;
    border: 1px solid #ecd99e;
    font-size: 13px;
}

.manual-sync-form {
    margin-top: 10px;
}

button.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-inline-start-color: transparent;
    border-radius: 50%;
    animation: sync-spin .75s linear infinite;
}

@keyframes sync-spin {
    to { transform: rotate(360deg); }
}

.connections-panel {
    padding: 18px;
}

.connections-title,
.system-readiness,
.connection-heading,
.sync-interval-form,
.sync-interval-form label {
    display: flex;
    align-items: center;
}

.connections-title {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 9px;
}

.connections-title h2 {
    margin: 0;
}

.connections-title-copy {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.connection-health-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.connection-health-badge.has-issues {
    color: #a3261d;
    background: #fff0ee;
    border: 1px solid #f4b5af;
}

.connection-health-badge.healthy {
    color: #087a45;
    background: #effaf4;
    border: 1px solid #b8d9c8;
}

.connections-title small,
.connection-card small {
    color: var(--muted);
}

.sync-interval-form,
.sync-interval-form label {
    gap: 8px;
}

.sync-interval-form select {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.system-readiness {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.system-chip {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.system-chip.ready {
    color: #087a45;
    background: #effaf4;
}

.system-chip.not-ready {
    color: #8a5a00;
    background: #fff8e8;
}

.connections-panel .connections {
    gap: 8px;
}

.connections-panel .connection-card {
    min-height: 0;
    padding: 10px 11px;
}

.connection-heading {
    justify-content: space-between;
    gap: 10px;
}

.connection-heading strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.connection-heading > span,
.connection-capability {
    font-size: 12px;
    color: var(--muted);
}

.connection-capability {
    margin: 7px 0 0;
}

.connection-error,
.compact-error {
    margin: 7px 0 0;
    color: #b42318;
    font-size: 12px;
}

.connect-help {
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.readiness {
    margin: 9px 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.readiness.ready {
    color: #087a45;
    background: #effaf4;
}

.readiness.not-ready {
    color: #8a5a00;
    background: #fff8e8;
}

.readiness span {
    display: block;
    margin-top: 5px;
    font-weight: 400;
}

.preflight-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.connection-timeline {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.connection-timeline summary {
    width: max-content;
    color: var(--blue);
    font-size: 12px;
}

.connection-timeline ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 11px 0 0;
    padding: 0;
    list-style: none;
}

.connection-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fbff;
}

.connection-timeline li strong {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
}

.timeline-marker {
    display: grid;
    grid-row: 1 / span 2;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #d53d35;
    font-weight: 800;
}

.connection-timeline li.passed .timeline-marker {
    background: #1a9b60;
}

.connection-timeline li.pending .timeline-marker {
    background: #d09b22;
}

.notification-settings {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px 20px;
    padding-block: 15px;
}

.notification-settings > div {
    margin-inline-end: auto;
}

.notification-settings h2 {
    margin: 0 0 3px;
}

.notification-settings small,
.notification-example {
    color: var(--muted);
}

.notification-settings label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
}

.notification-settings input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.notification-example {
    font-size: 12px;
}

.preflight-control .readiness {
    flex: 1;
    margin: 0;
}

.manual-sync-form .secondary,
.order-more-grid .secondary {
    background: #fff;
    color: var(--blue);
    border: 1px solid #b9cde6;
}

.order-more-actions {
    margin-top: 16px;
}

.order-more-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
}

.order-more-grid a,
.order-more-grid button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #b9cde6;
    border-radius: 9px;
    background: #fff;
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.tracking-number-link {
    display: grid;
    gap: 2px;
    min-width: 230px;
    padding: 9px 12px;
    border: 1px solid #b9cde6;
    border-radius: 9px;
    background: #fff;
    color: var(--blue);
    text-decoration: none;
}

.tracking-number-link span,
.tracking-number-link small {
    color: var(--muted);
}

.tracking-number-link strong {
    letter-spacing: .04em;
}

.tracking-link-group {
    display: flex;
    align-items: stretch;
    gap: 7px;
    min-width: 230px;
}

.tracking-link-group .tracking-number-link {
    flex: 1;
    min-width: 0;
}

.copy-tracking-link {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 43px;
    min-width: 43px;
    padding: 0;
    border: 1px solid #b9cde6;
    border-radius: 9px;
    background: #fff;
    color: var(--blue);
    cursor: pointer;
}

.copy-tracking-link:hover,
.copy-tracking-link:focus-visible {
    border-color: var(--blue);
    background: #f4f8fd;
}

.copy-tracking-link.is-copied {
    border-color: #69b58c;
    background: #edf9f2;
    color: #157347;
}

.copy-tracking-link svg,
.inline-copy-icon {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.copy-feedback {
    position: absolute;
    inset-block-end: calc(100% + 6px);
    inset-inline-end: 0;
    padding: 4px 7px;
    border-radius: 7px;
    background: #173b66;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.copy-feedback:empty { display: none; }

.copy-tracking {
    gap: 7px;
}

.whatsapp-action {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 9px;
    background: #157347;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.order-head-tools {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.order-action-menu {
    position: relative;
    padding: 0;
    border: 0;
}

.order-action-menu > summary {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #cbd8e8;
    border-radius: 10px;
    background: #f8fbff;
    color: var(--navy);
    font-size: 23px;
    line-height: 1;
    list-style: none;
}

.order-action-menu > summary::-webkit-details-marker {
    display: none;
}

.order-action-menu[open] > summary,
.order-action-menu > summary:hover {
    border-color: #8eb4df;
    background: #eef5fd;
}

.order-action-popover {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 7px);
    z-index: 25;
    display: grid;
    width: min(330px, calc(100vw - 48px));
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(17, 39, 70, .18);
}

.order-action-popover form {
    display: grid;
    gap: 8px;
    margin: 0;
}

.order-action-popover form + form {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.order-action-popover label {
    display: grid;
    gap: 5px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.order-action-popover input {
    width: 100%;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid #cbd8e8;
    border-radius: 9px;
}

.order-action-popover button {
    min-height: 39px;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.order-action-popover .confirm-shipped-form button {
    border: 1px solid #b9cde6;
    background: #fff;
    color: var(--blue);
}

.customer-whatsapp {
    background: #128c7e;
}

.customer-detail-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

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

.source-order-link {
    color: inherit;
    text-decoration: none;
}

.source-order-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

.order-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #eef6ff;
    color: var(--navy);
    font-weight: 700;
}

.order-total-row strong {
    color: var(--blue);
    font-size: 18px;
}

.item-pricing span:last-child {
    color: var(--ink);
    font-size: .95rem;
    font-weight: 700;
}

.confirmation-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(10, 32, 61, .3);
}

.confirmation-dialog::backdrop {
    background: rgba(13, 31, 54, .55);
}

.confirmation-dialog-card {
    padding: 24px;
}

.confirmation-dialog-card h2 {
    margin: 0 0 8px;
}

.confirmation-dialog-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.confirmation-dialog-actions {
    display: flex;
    justify-content: flex-start;
    gap: 9px;
}

.confirmation-dialog-actions form {
    margin: 0;
}

.confirmation-dialog-actions button {
    min-width: 96px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.confirmation-dialog-actions .secondary {
    border: 1px solid #b9cde6;
    background: #fff;
    color: var(--blue);
}

.topbar-brand {
    display: grid;
    gap: 5px;
}

.developer-credit {
    width: max-content;
    color: #b9d9ff;
    font-size: 12px;
    text-decoration: none;
}

.developer-credit:hover {
    color: #fff;
    text-decoration: underline;
}

.release-info {
    color: rgba(255, 255, 255, .68);
    font-size: 11px;
}

.header-actions,
.header-menu {
    position: relative;
}

.header-menu {
    border: 0;
    padding: 0;
}

.header-menu > summary {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 11px;
    color: #fff;
    font-size: 21px;
    list-style: none;
}

.header-menu > summary::-webkit-details-marker {
    display: none;
}

.header-menu-popover {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 9px);
    z-index: 30;
    display: grid;
    min-width: 250px;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 16px 40px rgba(17, 39, 70, .18);
}

.header-menu-popover strong {
    padding: 4px 7px 9px;
    border-bottom: 1px solid var(--line);
}

.header-menu-popover a,
.header-menu-popover button {
    display: block;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--navy);
    font-weight: 700;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.header-menu-popover a:hover,
.header-menu-popover button:hover {
    background: #eef5fd;
}

.header-menu-popover form {
    margin: 0;
}

.order-filter-panel {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(280px, 1.7fr) minmax(160px, .8fr);
    align-items: end;
    gap: 12px;
}

.order-filter-panel h2 {
    margin-bottom: 5px;
}

.order-filter-panel small {
    color: var(--muted);
}

.order-filter-panel label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}

.order-filter-panel input,
.order-filter-panel select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd8e8;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}

.filtered-orders-empty {
    margin-bottom: 14px;
}

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

@media (max-width: 800px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .order-more-grid > * {
        width: 100%;
        justify-content: center;
    }

    .connections-title,
    .sync-interval-form {
        align-items: stretch;
        flex-direction: column;
    }

    .connection-timeline ol {
        grid-template-columns: 1fr;
    }

    .notification-settings {
        align-items: flex-start;
    }

    .notification-settings > div {
        flex-basis: 100%;
    }

    .order-head {
        align-items: flex-start;
    }

    .order-head-tools {
        flex-direction: column-reverse;
        align-items: flex-end;
    }

    .order-action-popover {
        position: fixed;
        inset: auto 16px 18px;
        width: auto;
        max-height: calc(100vh - 36px);
        overflow-y: auto;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
    }

    .topbar h1 {
        font-size: 20px;
    }

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

    .header-menu-popover {
        position: fixed;
        inset: 74px 16px auto;
        min-width: 0;
    }
}
