.pa-page { max-width: 1280px; }
.pa-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.pa-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.pa-tab:hover { color: #334155; background: rgba(255,255,255,.6); }
.pa-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.pa-tab-panel[hidden] { display: none !important; }
.pa-sec-placeholder { margin: 12px 0 0; text-align: center; }
.pa-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.pa-head h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pa-head p { margin: 6px 0 0; color: #64748b; font-size: 0.92rem; max-width: 720px; }
.pa-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
}
.pa-btn:hover { border-color: #94a3b8; }
.pa-btn.primary { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.pa-btn.primary:hover { background: #4338ca; }
.pa-btn:disabled { opacity: .55; cursor: not-allowed; }
.pa-period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.pa-period label { margin: 0; font-size: 0.82rem; font-weight: 600; color: #475569; }
.pa-period select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
}
.pa-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.pa-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 4px solid #c7d2fe;
}
.pa-kpi.accent { border-left-color: #4f46e5; }
.pa-kpi.ok { border-left-color: #10b981; }
.pa-kpi.warn { border-left-color: #f59e0b; }
.pa-kpi.wa { border-left-color: #22c55e; }
.pa-kpi h3 { margin: 0 0 6px; font-size: 0.75rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pa-kpi .val { font-size: 1.45rem; font-weight: 800; color: #0f172a; line-height: 1.15; }
.pa-kpi .sub { margin-top: 4px; font-size: 0.75rem; color: #94a3b8; }
.pa-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.pa-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.pa-card-head .desc { margin: 4px 0 0; }
.pa-card-head h2 { margin: 0; }
.pa-sync-now { white-space: nowrap; flex-shrink: 0; }
.pa-sync-now.primary-outline {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #eef2ff;
}
.pa-sync-icon {
    padding: 8px 10px;
    min-width: 38px;
    justify-content: center;
}
.pa-card h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pa-card p.desc { margin: 0 0 14px; color: #64748b; font-size: 0.88rem; }
.pa-card-head + .pa-toolbar .pa-card p.desc,
.pa-card-head ~ .pa-toolbar { margin-top: 0; }
.pa-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.pa-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.pa-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.pa-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #f8fafc;
    box-sizing: border-box;
}
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.pa-chip.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.pa-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 640px;
    overflow-y: auto;
}
.pa-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.pa-table th, .pa-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}
.pa-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
    white-space: nowrap;
}
.pa-table tbody tr { cursor: pointer; }
.pa-table tbody tr:hover { background: #f8fafc; }
.pa-table tbody tr.is-active { background: #eef2ff; }
.pa-table .num { font-variant-numeric: tabular-nums; font-weight: 700; color: #0f172a; white-space: nowrap; }
.pa-site-name { font-weight: 700; color: #0f172a; display: block; }
.pa-site-sub { display: block; font-size: 0.74rem; color: #64748b; }
.pa-bar {
    display: block;
    height: 4px;
    border-radius: 99px;
    background: #e2e8f0;
    margin-top: 4px;
    overflow: hidden;
    max-width: 90px;
}
.pa-bar span { display: block; height: 100%; background: #6366f1; border-radius: 99px; }
.pa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}
.pa-badge.ga4 { background: #ecfdf5; color: #047857; }
.pa-badge.fp { background: #eef2ff; color: #4338ca; }
.pa-badge.off { background: #f1f5f9; color: #64748b; }
.pa-badge.err { background: #fef2f2; color: #b91c1c; }
.pa-badge.warn { background: #fffbeb; color: #b45309; }
.pa-row-actions { display: flex; gap: 4px; white-space: nowrap; align-items: center; flex-wrap: wrap; }
.pa-ext-wrap {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    margin-left: 2px;
}
.pa-ext-btn, .pa-ext-more {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    font-size: 0.72rem;
    line-height: 1;
}
.pa-ext-btn { border-radius: 6px 0 0 6px; min-width: 28px; }
.pa-ext-btn:hover { background: #f8fafc; color: #4f46e5; border-color: #c7d2fe; }
.pa-ext-more {
    border-left: none;
    border-radius: 0 6px 6px 0;
    padding: 4px 5px;
    min-width: 22px;
}
.pa-ext-more:hover { background: #f8fafc; }
.pa-ext-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 210px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 4px;
    z-index: 20;
}
.pa-ext-wrap.is-open .pa-ext-menu { display: block; }
.pa-ext-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
}
.pa-ext-menu a:hover { background: #f1f5f9; color: #4f46e5; }
.pa-row-actions a, .pa-row-actions button {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
}
.pa-row-actions button.pa-btn-gads {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pa-row-actions button.pa-btn-gads:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}
.pa-empty { padding: 28px 12px; text-align: center; color: #64748b; }
.pa-flash {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
}
.pa-flash.show { display: block; }
.pa-flash.ok { background: #ecfdf5; color: #065f46; }
.pa-flash.err { background: #fef2f2; color: #991b1b; }
.pa-flash.warn { background: #fffbeb; color: #92400e; }
.pa-sec-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pa-sec-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    font-size: 0.84rem;
}
.pa-sec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.pa-sec-box h3 { margin: 0 0 8px; font-size: 0.82rem; color: #334155; }
.pa-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 12px;
}
.pa-note {
    font-size: 0.78rem;
    color: #64748b;
    margin: 8px 0 0;
}
.pa-col-pin { width: 36px; text-align: center; }
.pa-pin-btn {
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1;
}
.pa-pin-btn:hover { color: #f59e0b; background: #fffbeb; }
.pa-pin-btn.is-pinned { color: #f59e0b; }
.pa-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.pa-pager-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pa-pager-left label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.pa-pager-left select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    color: #0f172a;
}
.pa-pager-meta { font-size: 0.8rem; color: #64748b; }
.pa-pager-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pa-pager-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    min-width: 7rem;
    text-align: center;
}
#pa-detail .analytics-period-wrap { display: none; }
.pa-detail-metrics { margin-top: 4px; }
.pa-detail-metric-tabs { margin-bottom: 8px; }
.pa-detail-metrics-hint {
    margin: 0 0 14px;
    font-size: 0.8rem;
    color: #64748b;
}
.pa-detail-metric-pane[hidden] { display: none !important; }
#pa-detail .ga-bing-tab-card .ga-dashboard-header { margin-top: 0; }
#pa-detail .hs-achievements-card { margin-top: 0; box-shadow: none; border: none; padding: 0; }
#pa-detail .ga-wa-tab-card .ga-dashboard-header { margin-top: 0; }
#pa-detail .hs-gads-dash-card { margin-top: 0; margin-bottom: 0 !important; box-shadow: none; border-top: none; border-right: none; border-bottom: none; }
.hs-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.hs-pill-ok { color: #15803d; background: #dcfce7; }
.hs-pill-warn { color: #b45309; background: #fef3c7; }
.hs-pill-err { color: #b91c1c; background: #fee2e2; }
@media (max-width: 768px) {
    .pa-table th:nth-child(n+6),
    .pa-table td:nth-child(n+6) { display: none; }
    .pa-kpis { grid-template-columns: repeat(2, 1fr); }
}
