* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #172033;
    background: #f5f7fb;
}

body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #101a2b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.brand {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2878ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.brand-name {
    font-size: 19px;
    font-weight: 750;
}

.brand-subtitle {
    color: #8793a8;
    font-size: 12px;
}

nav {
    padding: 14px 12px;
    flex: 1;
}

.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #627089;
    padding: 18px 12px 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin: 3px 0;
    border-radius: 8px;
    text-decoration: none;
    color: #c6d0df;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255,255,255,.05);
}

.nav-item.active {
    background: #2878ff;
    color: white;
}

.nav-item.disabled {
    opacity: .55;
    cursor: default;
}

.soon {
    margin-left: auto;
    font-size: 9px;
    border:
        1px solid rgba(255,255,255,.2);
    padding: 2px 5px;
    border-radius: 5px;
}

.sidebar-bottom {
    padding: 18px 22px;
    color: #657289;
    font-size: 11px;
}

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
}

.topbar {
    height: 76px;
    background: white;
    border-bottom: 1px solid #e7eaf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e4efff;
    color: #2878ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 650;
}

.user-role {
    color: #8993a4;
    font-size: 11px;
}

.logout-button {
    border: 0;
    background: none;
    color: #8993a4;
    cursor: pointer;
    margin-left: 10px;
}

.content {
    padding: 30px 34px 60px;
    max-width: 1600px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.page-header h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #778195;
}

.master-pill {
    background: white;
    border: 1px solid #e2e6ed;
    border-radius: 9px;
    padding: 10px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card,
.panel,
.admin-card {
    background: white;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
}

.metric-card {
    padding: 20px;
}

.metric-label {
    color: #717c90;
    font-size: 13px;
}

.metric-value {
    font-size: 29px;
    font-weight: 750;
    margin: 8px 0 4px;
}

.metric-note {
    color: #8993a4;
    font-size: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

.panel-header p {
    margin: 0;
    color: #8993a4;
    font-size: 12px;
}

.readiness-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.readiness-row strong {
    font-size: 13px;
    margin-right: 8px;
}

.readiness-row span {
    color: #8993a4;
    font-size: 12px;
}

.progress {
    height: 7px;
    background: #edf0f5;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
}

.progress-fill.ready {
    background: #2eaa63;
}

.bi-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bi-preview div {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 14px;
}

.bi-preview span {
    display: block;
    color: #8993a4;
    font-size: 11px;
}

.bi-preview strong {
    display: block;
    font-size: 22px;
    margin-top: 6px;
}

.empty-info {
    color: #8993a4;
    font-size: 12px;
    margin-top: 14px;
    line-height: 1.6;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 11px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b95a7;
    border-bottom: 1px solid #e7eaf0;
}

.table td {
    padding: 13px 12px;
    font-size: 13px;
    border-bottom: 1px solid #eef1f5;
}

.badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.badge.green {
    color: #1f8a4d;
    background: #e6f7ed;
}

.badge.blue {
    color: #216fe5;
    background: #e8f1ff;
}

.good {
    color: #27945a !important;
}

.bad {
    color: #d44a4a !important;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot.green {
    background: #25a85a;
}

.status-text {
    font-size: 12px;
}

.url-cell {
    color: #4771b8;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-button,
.secondary-button {
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: 0;
    background: #2878ff;
    color: white;
}

.primary-button:disabled {
    opacity: .5;
}

.secondary-button {
    background: white;
    border: 1px solid #d9dee7;
    color: #334158;
}

.full {
    width: 100%;
}

.notice {
    background: #edf4ff;
    border: 1px solid #ccddfa;
    padding: 14px 16px;
    border-radius: 9px;
    color: #4e678d;
    font-size: 13px;
}

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

.admin-card {
    padding: 22px;
}

.admin-card h3 {
    margin-top: 0;
}

.admin-card p {
    color: #7c879a;
    line-height: 1.5;
    margin-bottom: 0;
}

/* AUTH */

.auth-body {
    background: #eff3f8;
    min-height: 100vh;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 430px 1fr;
}

.auth-card {
    background: white;
    padding: 90px 58px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 18px;
    margin-bottom: 25px;
}

.auth-card label,
.setup-card label {
    display: block;
    font-size: 12px;
    margin: 14px 0 6px;
    color: #566176;
}

.auth-card input,
.setup-card input {
    width: 100%;
    height: 42px;
    border: 1px solid #d6dce6;
    border-radius: 7px;
    padding: 0 11px;
    font-size: 14px;
}

.auth-card button,
.setup-card button {
    margin-top: 20px;
    height: 42px;
}

.auth-hero {
    background:
        linear-gradient(
            135deg,
            #101b2f,
            #172c50
        );
    color: white;
    padding: 100px;
    display: flex;
    align-items: center;
}

.auth-hero h1 {
    font-size: 42px;
    margin: 0 0 12px;
}

.auth-hero p {
    color: #b9c7dc;
    font-size: 17px;
    margin-bottom: 35px;
}

.hero-point {
    padding: 8px 0;
    color: #d9e5f4;
}

.setup-card {
    width: 460px;
    margin: 70px auto;
    background: white;
    padding: 38px;
    border-radius: 14px;
    border: 1px solid #e0e5ed;
}

.setup-card h1 {
    margin-bottom: 5px;
}

.muted {
    color: #8590a2;
}

.alert {
    padding: 11px 13px;
    border-radius: 7px;
    margin: 14px 0;
    font-size: 13px;
}

.alert.error {
    background: #fff0f0;
    color: #b93939;
}

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.breadcrumbs {
    color: #8a96a9;
    font-size: 12px;
    margin-bottom: 7px;
}

.title-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-line h1 {
    margin: 0;
}

.wizard-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 820px);
    gap: 22px;
    align-items: start;
}

.wizard-steps {
    background: white;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    padding: 12px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    font-size: 13px;
    color: #8894a8;
}

.wizard-step span {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #eef1f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.wizard-step.active {
    color: #1b2a43;
    font-weight: 650;
}

.wizard-step.active span {
    background: #2878ff;
    color: white;
}

.wizard-panel {
    padding: 26px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h2 {
    font-size: 17px;
    margin: 0 0 17px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
}

.field input,
.field select {
    width: 100%;
    height: 42px;
    border: 1px solid #d7dde7;
    border-radius: 7px;
    background: white;
    padding: 0 11px;
    font-size: 13px;
}

.field small {
    display: block;
    color: #8c97a9;
    margin-top: 6px;
    font-size: 11px;
}

.full-field {
    grid-column: 1 / -1;
}

.security-note {
    background: #f1f6ff;
    border: 1px solid #d9e6fb;
    color: #536b90;
    font-size: 12px;
    padding: 11px 13px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #edf0f4;
    padding-top: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-row,
.capability-row {
    min-height: 46px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

.detail-row span {
    color: #8290a5;
}

.capability-ok {
    color: #239557;
    font-weight: 600;
}

.capability-bad {
    color: #cc4e4e;
    font-weight: 600;
}

.sync-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.sync-card {
    background: #f7f9fc;
    border-radius: 9px;
    padding: 16px;
}

.sync-card span,
.sync-card small {
    display: block;
    color: #8490a3;
}

.sync-card span {
    font-size: 12px;
}

.sync-card strong {
    display: block;
    font-size: 24px;
    margin: 7px 0;
}

.sync-card small {
    font-size: 10px;
}

@media (max-width: 1100px) {
    .wizard-layout,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .sync-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.probe-panel {
    margin-top: 18px;
}

.probe-message {
    color: #66758b;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.capabilities-list {
    margin-top: 10px;
}

.probe-button {
    background: #f7f9fc;
}

.badge.red {
    color: #b83f3f;
    background: #ffeded;
}

.chain-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.chain-actions form {
    margin: 0;
}

.danger-zone {
    border-color: #f0cccc;
}

.danger-zone h2 {
    color: #a63737;
}

.delete-confirm {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.delete-confirm .field {
    flex: 1;
    max-width: 420px;
}

.danger-button {
    height: 42px;
    border: 1px solid #d34c4c;
    background: #fff;
    color: #bd3535;
    border-radius: 7px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
}

.danger-button:hover {
    background: #fff0f0;
}

.chain-link {
    color: #172033;
    text-decoration: none;
}

.chain-link:hover {
    color: #2878ff;
}

.compact-button {
    display: inline-flex;
    padding: 6px 10px;
    font-size: 12px;
}

.back-link {
    color: #2878ff;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #a3adbd;
}

.sync-status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

.sync-status-line span {
    color: #8290a5;
}

.compare-chain-strip {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.compare-chain {
    background: #fff;
    border: 1px solid #e2e7ef;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.compare-chain span,
.cell-muted {
    color: #8a96a9;
    font-size: 12px;
}

.compare-label {
    color: #2878ff;
    font-size: 11px;
    font-weight: 700;
}

.compare-arrow {
    font-size: 26px;
    color: #8a96a9;
}

.compare-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.compare-stat {
    background: #fff;
    border: 1px solid #e2e7ef;
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: #172033;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compare-stat strong {
    font-size: 24px;
}

.compare-stat.selected {
    border-color: #2878ff;
    box-shadow: 0 0 0 1px #2878ff;
}

.compare-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.compare-filters input {
    flex: 1;
    min-width: 240px;
}

.table-scroll {
    overflow-x: auto;
}

.compare-badge {
    display: inline-flex;
    white-space: nowrap;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
}

.status-same {
    background: #e8f7ee;
    color: #23934d;
}

.status-different {
    background: #fff3d9;
    color: #9a6a00;
}

.status-candidate {
    background: #eaf2ff;
    color: #2878ff;
}

.status-missing_in_target,
.status-broken_mapping {
    background: #feecec;
    color: #b43b3b;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.compare-note {
    margin-top: 20px;
}

/* Compare table v2 */

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    vertical-align: top;
    border-bottom: 1px solid #edf0f4;
}

.data-table th {
    font-size: 12px;
    color: #7f8ba0;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.col-status {
    width: 155px;
}

.col-master {
    width: 28%;
}

.col-code {
    width: 110px;
}

.col-type {
    width: 100px;
}

.col-match {
    width: 90px;
}

.col-target {
    width: 28%;
}

.col-diff {
    width: 180px;
}

.entity-main {
    font-weight: 600;
    color: #172033;
    line-height: 1.35;
}

.entity-id {
    margin-top: 4px;
    color: #9aa5b5;
    font-size: 10px;
    line-height: 1.25;
    word-break: break-all;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 7px;
    background: #eef4ff;
    color: #2878ff;
    font-size: 10px;
    font-weight: 700;
}

.diff-chip {
    display: inline-flex;
    margin: 0 4px 4px 0;
    padding: 4px 7px;
    border-radius: 7px;
    background: #fff3d9;
    color: #8f6500;
    font-size: 10px;
    font-weight: 600;
}

.cell-empty {
    color: #a3adbd;
    font-size: 12px;
}

.compare-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compare table header alignment fix */

.col-status {
    width: 150px;
}

.col-master {
    width: 24%;
}

.col-code {
    width: 115px;
}

.col-type {
    width: 110px;
}

.col-match {
    width: 150px;
    min-width: 150px;
}

.col-target {
    width: 24%;
}

.col-diff {
    width: 170px;
}

.data-table th.col-match,
.data-table td.col-match {
    padding-left: 18px;
    padding-right: 18px;
}

.data-table th {
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-badge {
    white-space: nowrap;
    padding: 4px 9px;
}

.compare-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-list > div {
    min-height: 48px;
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #edf0f4;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list span {
    color: #8491a5;
    font-size: 12px;
}

.detail-list strong {
    color: #172033;
    font-size: 13px;
    overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
    .compare-detail-grid {
        grid-template-columns: 1fr;
    }
}

.compare-row {
    cursor: pointer;
}

.compare-row:hover td {
    background: #f8fbff;
}

.decision-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.decision-actions form {
    margin: 0;
}

.decision-current {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f6f8fb;
    border-radius: 9px;
    font-size: 13px;
}

.dry-run-stats {
    grid-template-columns: repeat(4, 1fr);
}

.dry-run-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 8px;
    background: #eef4ff;
    color: #2878ff;
    font-size: 11px;
    font-weight: 800;
}

.operation-badge {
    display: inline-flex;
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
}

.op-create {
    background: #e8f7ee;
    color: #218848;
}

.op-update {
    background: #fff3d9;
    color: #916500;
}

.op-link_only {
    background: #eaf2ff;
    color: #2878ff;
}

.op-skip {
    background: #f0f2f5;
    color: #758093;
}

.dry-run-warning {
    margin-top: 20px;
}

.dry-run-table td:nth-child(5) {
    font-size: 10px;
    word-break: break-all;
}

.preflight-stats {
    grid-template-columns: repeat(4, 1fr);
}

.preflight-ready,
.preflight-blocked {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
}

.preflight-ready {
    background: #e8f7ee;
    color: #218848;
}

.preflight-blocked {
    background: #feecec;
    color: #b43b3b;
}

.preflight-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
}

.pf-ready {
    background: #e8f7ee;
    color: #218848;
}

.pf-warning {
    background: #fff3d9;
    color: #916500;
}

.pf-blocked {
    background: #feecec;
    color: #b43b3b;
}

.preflight-error-text {
    color: #b43b3b;
    font-size: 11px;
    margin-bottom: 3px;
}

.preflight-warning-text {
    color: #916500;
    font-size: 11px;
    margin-bottom: 3px;
}

.preflight-ok-text {
    color: #218848;
    font-size: 11px;
}

.publication-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.decision-panel {
    margin-top: 20px;
}

.decision-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.decision-actions form {
    margin: 0;
}

.decision-current {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f6f8fb;
    border-radius: 9px;
    font-size: 13px;
}


/* Change monitoring */

.change-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.changes-filter-panel {
    margin-bottom: 22px;
}

.changes-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.changes-filters > div {
    min-width: 180px;
}

.changes-filters label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #7f8da3;
}

.changes-filters select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #dbe2ec;
    border-radius: 9px;
    background: #fff;
    font: inherit;
    color: #172033;
}

.changes-filter-action {
    min-width: auto !important;
}

.changes-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.changes-table {
    width: 100%;
    border-collapse: collapse;
}

.changes-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #8190a6;
    border-bottom: 1px solid #e7ebf1;
    white-space: nowrap;
}

.changes-table td {
    padding: 15px 14px;
    vertical-align: top;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

.changes-table tbody tr:last-child td {
    border-bottom: 0;
}

.changes-time {
    white-space: nowrap;
    color: #39465a;
}

.changes-time span {
    color: #8b98aa;
    font-size: 12px;
}

.change-object-meta {
    margin-top: 4px;
    color: #738198;
    font-size: 12px;
}

.change-object-id {
    margin-top: 4px;
    color: #9aa5b6;
    font-size: 10px;
    font-family: monospace;
}

.change-source,
.change-type,
.change-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.change-source.source-master {
    background: #eaf2ff;
    color: #2f78e9;
}

.change-source.source-target {
    background: #fff2e5;
    color: #b86816;
}

.change-type.type-create {
    background: #eaf8ef;
    color: #25844b;
}

.change-type.type-update {
    background: #fff4df;
    color: #a56a08;
}

.change-type.type-delete {
    background: #ffebea;
    color: #c74740;
}

.change-type.type-restore {
    background: #edf2ff;
    color: #506ac9;
}

.change-status.open {
    background: #fff0e8;
    color: #bd5f25;
}

.change-status.resolved {
    background: #eaf8ef;
    color: #25844b;
}

.change-fields {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.change-fields span {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f4f8;
    color: #5c697d;
    font-size: 11px;
}

@media (max-width: 1100px) {
    .change-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Change event detail */

.change-row {
    cursor: pointer;
    transition: background .15s ease;
}

.change-row:hover {
    background: #f8fafc;
}

.change-row:focus {
    outline: 2px solid #d9e5ff;
    outline-offset: -2px;
}

.change-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.change-diff-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.change-diff-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.change-diff-table th {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e7ebf1;
    color: #8390a4;
    font-size: 12px;
    font-weight: 600;
}

.change-diff-table th:first-child {
    width: 180px;
}

.change-diff-table td {
    padding: 14px;
    vertical-align: top;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
    word-break: break-word;
}

.change-diff-field {
    font-weight: 700;
    color: #283548;
}

.change-diff-before {
    background: #fff9f7;
}

.change-diff-after {
    background: #f6fbf8;
}

.change-diff-table pre {
    margin: 0;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.5;
}

.change-empty {
    color: #a1abba;
}

.change-actions-panel {
    margin-top: 20px;
}

.change-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.change-actions-note {
    margin-top: 12px;
    color: #8491a4;
    font-size: 12px;
}

@media (max-width: 900px) {
    .change-detail-meta {
        grid-template-columns: 1fr;
    }
}


/* Change journal actor */

.change-actor-name {
    display: block;
    max-width: 190px;
    line-height: 1.35;
}

.change-actor-source {
    margin-top: 3px;
    color: #8a96a8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.changes-time {
    white-space: nowrap;
}


/* Manual Franchise sync */

.changes-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.changes-header-actions form {
    margin: 0;
}

.sync-notice {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.sync-notice.success {
    background: #f5faf7;
    border-color: #d7eadf;
}

.sync-notice.error {
    background: #fff7f7;
    border-color: #efdada;
}

@media (max-width: 700px) {
    .changes-header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 12px;
    }
}


/* TARGET synchronization live status */

.target-sync-summary {
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    background: #ffffff;
}

.target-sync-summary-main {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #657287;
    font-size: 13px;
}

.target-sync-summary strong {
    color: #273448;
}

.target-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #aeb7c5;
}

.target-sync-dot.status-running {
    background: #e5a72f;
    animation: target-sync-pulse 1.3s infinite;
}

.target-sync-dot.status-success {
    background: #35a76f;
}

.target-sync-dot.status-failed {
    background: #d45c5c;
}

@keyframes target-sync-pulse {
    0% {
        opacity: .35;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: .35;
    }
}

.changes-header-actions button:disabled {
    opacity: .65;
    cursor: wait;
}


/* ==========================================================
   FoodHub notifications
   ========================================================== */

.notification-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid #dfe5ef;
    border-radius: 12px;
    background: #fff;
    color: #526079;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease;
}

.notification-bell:hover {
    background: #f7f9fc;
    border-color: #cfd8e7;
}

.notification-bell svg {
    width: 21px;
    height: 21px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e5484d;
    color: #fff;
    border: 2px solid #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}

.notification-dropdown {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    max-height: 520px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe5ef;
    border-radius: 16px;
    box-shadow:
        0 18px 50px
        rgba(24, 37, 66, .16);
}

.notification-dropdown-head {
    min-height: 58px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf0f5;
}

.notification-dropdown-head strong {
    color: #172238;
    font-size: 16px;
}

.notification-dropdown-head button {
    border: 0;
    background: transparent;
    color: #2878f0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

.notification-list {
    overflow-y: auto;
    max-height: 460px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f6;
    background: #fff;
}

.notification-item:hover {
    background: #f8fafe;
}

.notification-item.unread {
    background: #f6f9ff;
}

.notification-severity-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: #8a96a8;
}

.notification-item.severity-warning
.notification-severity-dot {
    background: #e99519;
}

.notification-item.severity-critical
.notification-severity-dot {
    background: #e5484d;
}

.notification-item-body {
    min-width: 0;
    flex: 1;
}

.notification-item-title {
    color: #182338;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.notification-item-message {
    margin-top: 4px;
    color: #69778f;
    font-size: 13px;
    line-height: 1.4;
}

.notification-item-time {
    margin-top: 7px;
    color: #9aa6b8;
    font-size: 12px;
}

.notification-empty,
.notification-loading {
    padding: 28px 20px;
    text-align: center;
    color: #8b98ac;
    font-size: 14px;
}

@media (max-width: 720px) {
    .notification-dropdown {
        position: fixed;
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
