.enterprise-sync-page,
.enterprise-cash-page {
    --m365-navy: #0b1728;
    --m365-ink: #172235;
    --m365-muted: #667085;
    --m365-line: #e4e8ef;
    --m365-teal: #0f766e;
    --m365-soft: #f6f8fb;
}

.sync-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.sync-kpi,
.sync-command-card,
.sync-table-card,
.cash-enterprise-card,
.cash-context-card {
    background: #fff;
    border: 1px solid var(--m365-line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(11, 23, 40, .055);
}

.sync-kpi {
    min-height: 128px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sync-kpi-label {
    color: var(--m365-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sync-kpi strong {
    color: var(--m365-ink);
    font-size: 28px;
}

.sync-kpi small,
.sync-command-card p,
.sync-table td small {
    color: var(--m365-muted);
}

.sync-state {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-state i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px currentColor;
    opacity: .8;
}

.sync-state.online { color: var(--m365-teal); }
.sync-state.offline { color: #b42318; }
.sync-time { font-size: 23px !important; }

.sync-command-card {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.sync-command-card h2 { margin: 0 0 5px; }
.sync-command-card p { margin: 0; }
.sync-command-actions { display: flex; gap: 10px; }
.sync-command-actions button { min-width: 140px; }

.sync-table-card { overflow: hidden; }
.sync-table-wrap { overflow: auto; }
.sync-table { width: 100%; border-collapse: collapse; }
.sync-table th {
    padding: 13px 16px;
    background: var(--m365-soft);
    color: #475467;
    font-size: 12px;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}
.sync-table td {
    padding: 15px 16px;
    border-top: 1px solid var(--m365-line);
    vertical-align: top;
}
.sync-table td strong,
.sync-table td small { display: block; }
.sync-amount { font-weight: 800; white-space: nowrap; }
.sync-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}
.sync-badge.pending { color: #344054; background: #f2f4f7; }
.sync-badge.failed { color: #b42318; background: #fef3f2; }
.sync-error {
    max-width: 280px;
    margin-top: 5px;
    color: #b42318 !important;
    overflow-wrap: anywhere;
}
.sync-table code { color: #344054; }
.sync-empty { padding: 48px 20px; text-align: center; color: var(--m365-muted); }
.sync-empty span { display: block; color: var(--m365-teal); font-size: 38px; }
.sync-empty strong { display: block; color: var(--m365-ink); font-size: 18px; margin: 6px 0; }
.sync-empty p { margin: 0; }

.cash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
    gap: 18px;
    align-items: start;
}
.cash-enterprise-card { padding: 24px; }
.cash-context-card { padding: 20px; }
.cash-form-title { margin: 0 0 5px; color: var(--m365-ink); }
.cash-form-subtitle { margin: 0 0 22px; color: var(--m365-muted); }
.cash-field { margin-bottom: 18px; }
.cash-field label {
    display: block;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}
.cash-amount-wrap { position: relative; }
.cash-amount-wrap .cash-currency {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--m365-muted);
    font-size: 22px;
    font-weight: 800;
}
.cash-amount-input {
    width: 100%;
    min-height: 72px;
    padding: 10px 70px 10px 18px;
    border: 2px solid #d0d5dd;
    border-radius: 12px;
    color: var(--m365-navy);
    background: #fff;
    font-size: 34px;
    font-weight: 800;
}
.cash-amount-input:focus {
    border-color: var(--m365-teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
    outline: none;
}
.cash-enterprise-select,
.cash-enterprise-textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    padding: 12px 14px;
    font: inherit;
}
.cash-enterprise-textarea { min-height: 104px; resize: vertical; }
.cash-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 10px;
    background: var(--m365-navy);
    color: #fff;
    font-weight: 900;
    letter-spacing: .03em;
}
.cash-submit.out { background: #7a271a; }
.cash-submit:disabled { opacity: .55; cursor: not-allowed; }
.cash-context-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--m365-line);
}
.cash-context-row {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #f0f2f5;
}
.cash-context-row span { color: var(--m365-muted); }
.cash-context-row strong { color: var(--m365-ink); text-align: right; }
.cash-notice {
    margin-top: 16px;
    padding: 12px;
    border-radius: 9px;
    background: var(--m365-soft);
    color: #475467;
    font-size: 13px;
    line-height: 1.45;
}
.cash-confirm {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #f2c94c;
    border-radius: 10px;
    background: #fffaeb;
}
.cash-confirm p { margin: 0 0 12px; color: #7a2e0e; }
.cash-confirm-actions { display: flex; gap: 10px; }

@media (max-width: 980px) {
    .sync-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cash-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .sync-kpi-grid { grid-template-columns: 1fr; }
    .sync-command-card { align-items: stretch; flex-direction: column; }
    .sync-command-actions { flex-direction: column; }
    .sync-command-actions button { width: 100%; }
    .cash-enterprise-card { padding: 18px; }
}
