* {
    box-sizing: border-box;
}

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

body {
    background: #f5f7fb;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, #e9efff 0, transparent 38%),
        #f5f7fb;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 16px 45px rgba(25, 39, 70, 0.08);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #315efb;
    color: #ffffff;
    font-size: 23px;
    font-weight: 700;
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.login-brand p {
    margin: 5px 0 0;
    color: #8490a5;
    font-size: 13px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4c5870;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #dce1eb;
    border-radius: 8px;
    outline: none;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
    border-color: #315efb;
    box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.10);
}

.login-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #fff1f0;
    color: #cf3f36;
    font-size: 13px;
}

#login-button {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #315efb;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

#login-button:hover {
    background: #244ee8;
}

#login-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.login-footer {
    margin-top: 26px;
    text-align: center;
    color: #a0a8b8;
    font-size: 12px;
}


/* Dashboard temporary shell */

.dashboard-page {
    min-height: 100vh;
    background: #f5f7fb;
}

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

.topbar-brand {
    font-size: 18px;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #667085;
    font-size: 14px;
}

.logout-button {
    padding: 7px 13px;
    border: 1px solid #dce1eb;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
}

.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

.dashboard-content h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.dashboard-content p {
    margin: 0;
    color: #7a8497;
}

.placeholder-card {
    margin-top: 28px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 12px;
}


/* =========================================================
   Game BI Dashboard
   ========================================================= */

:root {
    --primary: #315efb;
    --primary-soft: #eef3ff;
    --background: #f6f8fc;
    --surface: #ffffff;
    --border: #e8ecf3;
    --text-primary: #172033;
    --text-secondary: #667085;
    --text-muted: #98a2b3;
    --sidebar-width: 228px;
}

.app-page {
    min-height: 100vh;
    background: var(--background);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border);
    z-index: 20;
}

.sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 19px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.sidebar-nav {
    padding: 18px 12px;
}

.nav-section {
    margin: 24px 12px 8px;
    color: #a4abba;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-item {
    min-height: 42px;
    margin-bottom: 4px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 8px;
    color: #596579;
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

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

.nav-icon {
    width: 18px;
    text-align: center;
}

.app-shell {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.app-header {
    height: 72px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
}

.header-subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.user-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 90px;
}

.user-info span {
    font-size: 13px;
    font-weight: 600;
}

.user-info small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
}

.text-button {
    margin-left: 5px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.main-content {
    max-width: 1700px;
    margin: 0 auto;
    padding: 26px 30px 40px;
}

.filter-panel {
    padding: 17px 18px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.filter-group {
    min-width: 170px;
}

.filter-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    height: 38px;
    padding: 0 11px;
    border: 1px solid #dfe4ec;
    border-radius: 7px;
    background: #ffffff;
    color: var(--text-primary);
    outline: none;
}

.filter-group select {
    min-width: 170px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs span {
    color: var(--text-muted);
    font-size: 12px;
}

.primary-button {
    height: 38px;
    padding: 0 21px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.page-error {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #f5c2c0;
    border-radius: 8px;
    background: #fff5f5;
    color: #c53b32;
    font-size: 13px;
}

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

.kpi-card {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.kpi-value {
    margin-top: 10px;
    color: #111827;
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.6px;
}

.kpi-note {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.content-card {
    margin-top: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
}

.card-header {
    min-height: 68px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.card-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}

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

.table-medium {
    max-height: 480px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    padding: 11px 18px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    color: #778195;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
}

.data-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f2f6;
    color: #3d4758;
    font-size: 12px;
}

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

.data-table tbody tr:hover {
    background: #fafcff;
}

.data-table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

.empty-cell {
    padding: 35px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

.page-footer {
    padding: 22px 2px 0;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11px;
}

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

    .two-column-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        display: none;
    }

    .app-shell {
        margin-left: 0;
    }

    .app-header {
        padding: 0 16px;
    }

    .main-content {
        padding: 18px 14px 30px;
    }

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

    .filter-panel {
        display: block;
    }

    .filter-group {
        margin-bottom: 13px;
    }

    .filter-group,
    .filter-group select {
        width: 100%;
    }

    .date-inputs input {
        width: 100%;
    }

    .primary-button {
        width: 100%;
    }
}


/* =========================================================
   Dashboard Charts
   ========================================================= */

.chart-card {
    min-width: 0;
}

.chart-large {
    width: 100%;
    height: 380px;
    padding: 8px 10px 6px;
}

.chart-medium {
    width: 100%;
    height: 390px;
    padding: 8px 10px 6px;
}

.chart-donut {
    width: 100%;
    height: 350px;
    padding: 8px 10px 6px;
}

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

.chart-grid .content-card {
    margin-top: 18px;
}

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

    .chart-large,
    .chart-medium {
        height: 340px;
    }
}

@media (max-width: 760px) {
    .chart-large,
    .chart-medium,
    .chart-donut {
        height: 300px;
    }
}
/* Product Analytics */
.product-detail-header { flex-wrap: wrap; gap: 14px; }
.format-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.format-tab { height: 32px; padding: 0 12px; border: 1px solid #dfe4ec; border-radius: 7px; background: #fff; color: #667085; cursor: pointer; font-size: 12px; }
.format-tab:hover { border-color: #b9c6ef; color: #315efb; }
.format-tab.active { border-color: #315efb; background: #eef3ff; color: #315efb; font-weight: 600; }
.format-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: 11px; font-weight: 600; }
.format-reward { background: #eef3ff; color: #315efb; }
.format-inter { background: #f2f4f7; color: #475467; }
.format-banner { background: #f8f5ff; color: #6941c6; }


/* Application Management */
.management-summary { margin-top:18px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.management-summary .kpi-card { padding:17px 20px; }
.management-summary .kpi-value { font-size:24px; }
.management-toolbar { margin-top:18px; }
.management-search { min-width:280px; }
.status-pill { display:inline-flex; align-items:center; min-height:25px; padding:0 9px; border-radius:999px; font-size:11px; font-weight:650; }
.status-enabled { background:#ecfdf3; color:#027a48; }
.status-disabled { background:#f2f4f7; color:#667085; }
.reporting-switch { position:relative; display:inline-flex; width:42px; height:24px; vertical-align:middle; }
.reporting-switch input { position:absolute; opacity:0; pointer-events:none; }
.reporting-slider { width:42px; height:24px; border-radius:999px; background:#d0d5dd; cursor:pointer; transition:background .18s ease; }
.reporting-slider::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(16,24,40,.18); transition:transform .18s ease; }
.reporting-switch input:checked + .reporting-slider { background:var(--primary); }
.reporting-switch input:checked + .reporting-slider::after { transform:translateX(18px); }
.reporting-switch input:disabled + .reporting-slider { opacity:.55; cursor:wait; }
.package-cell { max-width:390px; overflow:hidden; text-overflow:ellipsis; }
.management-note { margin-top:12px; color:var(--text-muted); font-size:11px; }
@media (max-width:900px) { .management-summary { grid-template-columns:1fr; } .management-search { min-width:0; } }


/* Data Source Management */
.source-summary { margin-top:18px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.source-summary .kpi-card { padding:17px 20px; }
.source-summary .kpi-value { font-size:24px; }
.source-type-badge { display:inline-flex; align-items:center; min-height:25px; padding:0 9px; border-radius:999px; background:#eef3ff; color:#315efb; font-size:11px; font-weight:650; text-transform:uppercase; }
.credential-ok { background:#ecfdf3; color:#027a48; }
.credential-missing { background:#fff4e5; color:#b54708; }
.source-key { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#475467; font-size:11px; }
.source-config { display:flex; flex-wrap:wrap; gap:6px; }
.config-chip { display:inline-flex; align-items:center; min-height:24px; padding:0 8px; border-radius:6px; background:#f2f4f7; color:#475467; font-size:11px; }
.source-safe-note { margin-top:12px; padding:12px 14px; border:1px solid #d9e2ff; border-radius:8px; background:#f7f9ff; color:#52617a; font-size:12px; line-height:1.6; }
@media (max-width:900px) { .source-summary { grid-template-columns:1fr; } }


/* Data Source Account Management */
.source-actions { display:flex; align-items:center; gap:8px; }
.secondary-button {
    height:34px; padding:0 12px; border:1px solid #dfe4ec; border-radius:7px;
    background:#fff; color:#475467; cursor:pointer; font-size:12px; font-weight:600;
}
.secondary-button:hover { border-color:#b9c6ef; color:#315efb; }
.danger-button {
    height:34px; padding:0 12px; border:1px solid #f0b8b4; border-radius:7px;
    background:#fff; color:#c43d34; cursor:pointer; font-size:12px; font-weight:600;
}
.danger-button:hover { background:#fff5f5; }
.source-add-button { margin-left:auto; }
.modal-backdrop {
    position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center;
    padding:20px; background:rgba(15,23,42,.42);
}
.modal-backdrop[hidden] { display:none; }
.modal-card {
    width:min(640px,100%); max-height:calc(100vh - 40px); overflow:auto;
    background:#fff; border:1px solid #e5e9f2; border-radius:14px;
    box-shadow:0 24px 70px rgba(15,23,42,.20);
}
.modal-header {
    padding:18px 20px; display:flex; align-items:flex-start; justify-content:space-between;
    border-bottom:1px solid var(--border);
}
.modal-header h2 { margin:0; font-size:17px; }
.modal-header p { margin:5px 0 0; color:var(--text-muted); font-size:11px; }
.modal-close {
    width:32px; height:32px; border:0; border-radius:8px; background:#f5f7fb;
    color:#667085; cursor:pointer; font-size:18px;
}
.modal-body { padding:20px; }
.modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px; }
.modal-field label {
    display:block; margin-bottom:7px; color:var(--text-secondary); font-size:12px; font-weight:600;
}
.modal-field input, .modal-field select {
    width:100%; height:40px; padding:0 11px; border:1px solid #dfe4ec; border-radius:7px;
    background:#fff; color:var(--text-primary); outline:none;
}
.modal-field input:focus, .modal-field select:focus { border-color:var(--primary); }
.modal-field input:disabled { background:#f7f8fa; color:#98a2b3; }
.modal-field-wide { grid-column:1 / -1; }
.modal-help { margin-top:6px; color:var(--text-muted); font-size:10px; line-height:1.5; }
.modal-footer {
    padding:16px 20px; display:flex; justify-content:flex-end; gap:9px;
    border-top:1px solid var(--border);
}
.source-toolbar {
    display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%;
}
.source-toolbar-title h2 { margin:0; font-size:15px; }
.source-toolbar-title p { margin:5px 0 0; color:var(--text-muted); font-size:11px; }
.source-sync-warning {
    margin-top:12px; padding:11px 13px; border-radius:8px;
    border:1px solid #f4d7a3; background:#fffaf0; color:#8a5b13;
    font-size:11px; line-height:1.6;
}
@media (max-width:760px) {
    .modal-grid { grid-template-columns:1fr; }
    .modal-field-wide { grid-column:auto; }
    .source-toolbar { align-items:flex-start; flex-direction:column; }
    .source-add-button { margin-left:0; width:100%; }
}


/* Credential Management */
.credential-button { white-space:nowrap; }
.credential-meta {
    margin-top:14px; padding:12px 14px; border:1px solid #e8ecf3;
    border-radius:8px; background:#fafbfc; color:#667085; font-size:11px; line-height:1.7;
}
.credential-input-wrap { position:relative; }
.credential-input-wrap input { padding-right:70px; }
.credential-toggle {
    position:absolute; right:7px; top:50%; transform:translateY(-50%);
    height:28px; padding:0 9px; border:0; border-radius:6px;
    background:#f2f4f7; color:#667085; cursor:pointer; font-size:11px;
}
.credential-warning {
    margin-top:12px; padding:11px 13px; border:1px solid #d9e2ff;
    border-radius:8px; background:#f7f9ff; color:#52617a; font-size:11px; line-height:1.6;
}


/* Data Source -> Application Mapping */
.mapping-modal-card { width:min(1040px,100%); }
.mapping-toolbar { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.mapping-toolbar .filter-group { min-width:180px; }
.mapping-toolbar .mapping-product-group { min-width:300px; flex:1; }
.mapping-table-wrap { border:1px solid var(--border); border-radius:9px; overflow:auto; max-height:430px; }
.mapping-table td { vertical-align:middle; }
.mapping-date { font-variant-numeric:tabular-nums; }
.mapping-app-name { font-weight:600; color:#344054; }
.mapping-package { margin-top:3px; color:#98a2b3; font-size:10px; }
.mapping-inline-actions { display:flex; align-items:center; gap:7px; }
.mapping-empty { padding:36px 18px; text-align:center; color:var(--text-muted); font-size:12px; }
.mapping-note { margin-top:12px; padding:11px 13px; border:1px solid #d9e2ff; border-radius:8px; background:#f7f9ff; color:#52617a; font-size:11px; line-height:1.65; }
.mapping-edit-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.mapping-edit-grid .modal-field-wide { grid-column:1/-1; }
@media (max-width:760px) {
    .mapping-edit-grid { grid-template-columns:1fr; }
    .mapping-edit-grid .modal-field-wide { grid-column:auto; }
}


/* MAX discovered applications in data-source mapping */
.mapping-discovery-summary {
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:14px;
}
.mapping-discovery-summary > div {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:11px 13px; border:1px solid var(--border); border-radius:8px; background:#fafbfc;
}
.mapping-discovery-summary span { color:#667085; font-size:11px; }
.mapping-discovery-summary strong { color:#172033; font-size:18px; font-variant-numeric:tabular-nums; }
.mapping-discovery-panel { margin-bottom:16px; }
.mapping-section-header { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:8px; }
.mapping-section-header h3 { margin:0; font-size:13px; color:#344054; }
.mapping-section-header p { margin:4px 0 0; color:#98a2b3; font-size:10px; line-height:1.5; }
.mapping-discovery-table-wrap { border:1px solid var(--border); border-radius:9px; overflow:auto; max-height:270px; }
.mapping-discovery-table td { vertical-align:middle; }
.mapping-other-source { max-width:210px; color:#667085; font-size:10px; line-height:1.45; }
@media (max-width:760px) {
    .mapping-discovery-summary { grid-template-columns:1fr; }
}

/* =========================================================
   Mobile Navigation
   ========================================================= */
.mobile-nav { display:none; }

@media (max-width:760px) {
    .mobile-nav {
        display:block;
        position:sticky;
        top:0;
        z-index:950;
        background:#fff;
        border-bottom:1px solid var(--border);
    }
    .mobile-nav summary {
        height:46px;
        padding:0 14px;
        display:flex;
        align-items:center;
        gap:9px;
        list-style:none;
        cursor:pointer;
        color:var(--text-primary);
        font-size:13px;
        font-weight:650;
        user-select:none;
    }
    .mobile-nav summary::-webkit-details-marker { display:none; }
    .mobile-nav-menu-icon { width:20px; text-align:center; font-size:18px; }
    .mobile-nav-panel {
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
        padding:0 12px 12px;
        background:#fff;
        box-shadow:0 10px 20px rgba(16,24,40,.08);
    }
    .mobile-nav-item {
        min-height:40px;
        padding:0 11px;
        display:flex;
        align-items:center;
        gap:8px;
        border:1px solid var(--border);
        border-radius:8px;
        color:var(--text-secondary);
        text-decoration:none;
        font-size:12px;
        background:#fff;
    }
    .mobile-nav-item.active {
        border-color:#cfd9ff;
        background:#eef3ff;
        color:var(--primary);
        font-weight:650;
    }
}

/* =========================================================
   Sync Run History
   ========================================================= */
.sync-history-modal-card { width:min(1180px,100%); }
.sync-history-loading {
    padding:36px 18px;
    text-align:center;
    color:var(--text-muted);
    font-size:12px;
}
.sync-history-table-wrap {
    border:1px solid var(--border);
    border-radius:9px;
    overflow:auto;
    max-height:520px;
}
.sync-history-table { min-width:960px; }
.sync-history-table td { vertical-align:middle; }
.sync-history-run-id { font-weight:650; color:#344054; }
.sync-history-timing { white-space:nowrap; color:#667085; font-size:11px; line-height:1.65; }
.sync-history-error-text {
    max-width:300px;
    max-height:72px;
    overflow:auto;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    color:#b42318;
    font-size:10px;
    line-height:1.45;
}
.sync-history-note {
    margin-top:12px;
    padding:10px 12px;
    border:1px solid #d9e2ff;
    border-radius:8px;
    background:#f7f9ff;
    color:#52617a;
    font-size:10px;
    line-height:1.6;
}



/* =========================================================
   Anomaly Center
   ========================================================= */
.anomaly-page { padding-bottom:34px; }
.anomaly-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:18px; }
.anomaly-summary .kpi-card { padding:17px 20px; }
.anomaly-summary .kpi-value { font-size:24px; }
.anomaly-kpi-critical { border-color:#f4c7c3; background:linear-gradient(180deg,#fff 0%,#fff8f7 100%); }
.anomaly-kpi-critical .kpi-value { color:#b42318; }
.anomaly-filter-panel { align-items:flex-end; flex-wrap:wrap; }
.anomaly-filter-panel .filter-group { min-width:150px; flex:1 1 150px; }
.anomaly-reset-button { margin-left:auto; }
.anomaly-list-card { margin-top:18px; }
.anomaly-list-header { gap:14px; }
.anomaly-list-actions { display:flex; align-items:center; gap:10px; }
.anomaly-table { min-width:1120px; }
.anomaly-table td { vertical-align:middle; }
.anomaly-object-title { max-width:310px; color:#344054; font-weight:650; line-height:1.45; }
.anomaly-object-sub { margin-top:3px; max-width:310px; color:#98a2b3; font-size:10px; overflow-wrap:anywhere; }
.anomaly-period { white-space:nowrap; color:#667085; font-size:11px; line-height:1.55; }
.anomaly-list-note { padding:10px 14px 14px; color:#98a2b3; font-size:10px; line-height:1.55; }
.anomaly-actions { display:flex; align-items:center; gap:7px; white-space:nowrap; }
.anomaly-link-button { border:0; background:transparent; color:var(--primary); cursor:pointer; font-size:11px; font-weight:650; padding:4px 2px; }
.anomaly-link-button:hover { text-decoration:underline; }
.anomaly-pill { display:inline-flex; align-items:center; min-height:25px; padding:0 9px; border-radius:999px; font-size:10px; font-weight:700; white-space:nowrap; }
.anomaly-severity-critical { background:#fef3f2; color:#b42318; }
.anomaly-severity-warning { background:#fff7ed; color:#c2410c; }
.anomaly-severity-info { background:#eff6ff; color:#1d4ed8; }
.anomaly-handling-unreviewed { background:#fef3f2; color:#b42318; }
.anomaly-handling-acknowledged { background:#eef3ff; color:#315efb; }
.anomaly-handling-ignored { background:#f2f4f7; color:#667085; }
.anomaly-lifecycle { background:#f8fafc; color:#475467; border:1px solid #e4e7ec; }
.anomaly-reason-chip { display:inline-flex; max-width:180px; min-height:24px; padding:3px 8px; align-items:center; border-radius:6px; background:#f2f4f7; color:#475467; font-size:10px; line-height:1.35; }
.anomaly-detail-modal { width:min(1240px,100%); }
.anomaly-detail-badges { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.anomaly-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.anomaly-detail-grid > div { padding:11px 12px; border:1px solid var(--border); border-radius:8px; background:#fafbfc; min-width:0; }
.anomaly-detail-grid span,.anomaly-reason-box span { display:block; margin-bottom:5px; color:#98a2b3; font-size:10px; }
.anomaly-detail-grid strong { display:block; color:#344054; font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.anomaly-reason-box { display:grid; grid-template-columns:180px 1fr 1fr; gap:10px; margin-top:12px; padding:12px; border:1px solid #e8ecf3; border-radius:9px; background:#fff; }
.anomaly-reason-box strong { color:#344054; font-size:12px; }
.anomaly-reason-box p { margin:0; color:#52617a; font-size:11px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.anomaly-section-title { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:18px 0 8px; }
.anomaly-section-title h3 { margin:0; color:#344054; font-size:13px; }
.anomaly-section-title span { color:#98a2b3; font-size:10px; }
.anomaly-signal-table-wrap { border:1px solid var(--border); border-radius:9px; overflow:auto; max-height:460px; }
.anomaly-signal-table { min-width:1180px; }
.anomaly-signal-table td { vertical-align:middle; }
.anomaly-signal-code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#475467; font-size:10px; }
.anomaly-signal-value { font-variant-numeric:tabular-nums; white-space:nowrap; }
.anomaly-detail-footer { flex-wrap:wrap; }
.anomaly-detail-footer #detail-ignore-button { margin-right:auto; }
.anomaly-handling-modal { width:min(620px,100%); }
.modal-field textarea { width:100%; padding:10px 11px; border:1px solid #dfe4ec; border-radius:7px; background:#fff; color:var(--text-primary); outline:none; resize:vertical; font-family:inherit; font-size:12px; line-height:1.55; }
.modal-field textarea:focus { border-color:var(--primary); }
.anomaly-loading-row td { padding:34px 18px; text-align:center; color:#98a2b3; }
@media (max-width:1000px) {
    .anomaly-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .anomaly-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .anomaly-reason-box { grid-template-columns:1fr; }
}
@media (max-width:760px) {
    .anomaly-summary { grid-template-columns:1fr 1fr; gap:10px; }
    .anomaly-summary .kpi-card { padding:14px; }
    .anomaly-filter-panel .filter-group { min-width:calc(50% - 6px); flex:1 1 calc(50% - 6px); }
    .anomaly-reset-button { width:100%; margin-left:0; }
    .anomaly-list-header { align-items:flex-start; flex-direction:column; }
    .anomaly-list-actions { width:100%; justify-content:space-between; }
    .anomaly-detail-grid { grid-template-columns:1fr; }
    .anomaly-detail-footer > button { flex:1 1 auto; }
    .anomaly-detail-footer #detail-ignore-button { margin-right:0; }
}
