* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f4f6f8; color: #1f2937; }
a { color: #155eef; }
.cp-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cp-card { width: 100%; max-width: 520px; background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12); }
.cp-card h1, .cp-page h1 { margin-top: 0; margin-bottom: 8px; }
.cp-muted { color: #667085; margin-top: 0; }
.cp-small { font-size: 14px; }
.cp-form { display: grid; gap: 16px; }
.cp-form label { display: grid; gap: 6px; font-weight: 600; }
.cp-form input, .cp-form select, .cp-form textarea { width: 100%; border: 1px solid #cfd6df; border-radius: 10px; padding: 11px 12px; font: inherit; background: #fff; }
.cp-form input:focus, .cp-form select:focus, .cp-form textarea:focus { outline: 3px solid rgba(21, 94, 239, 0.16); border-color: #155eef; }
.cp-button, button { border: 0; border-radius: 10px; padding: 11px 15px; font: inherit; font-weight: 700; cursor: pointer; background: #155eef; color: #fff; text-decoration: none; display: inline-block; }
button.danger { background: #c03434; }
.cp-actions { white-space: nowrap; }
.cp-actions button { margin: 2px; padding: 7px 9px; font-size: 13px; }
.cp-message { min-height: 22px; margin-top: 8px; font-weight: 600; }
.cp-message.success { color: #087443; }
.cp-message.error { color: #b42318; }
.cp-topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.cp-topbar nav { display: flex; gap: 14px; }
.cp-page { max-width: 1100px; margin: 0 auto; padding: 30px 24px; }
.cp-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.cp-table-wrap { overflow-x: auto; background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; }
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th, .cp-table td { text-align: left; border-bottom: 1px solid #eef0f3; padding: 12px; vertical-align: middle; }
.cp-table th { background: #f9fafb; font-size: 13px; color: #475467; }
.cp-table tr:last-child td { border-bottom: 0; }
.cp-pill { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #eef4ff; color: #155eef; font-size: 13px; font-weight: 700; }
.cp-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.45); padding: 24px; }
.cp-modal.open { display: flex; }
.cp-modal-card { position: relative; width: 100%; max-width: 520px; background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22); }
.cp-modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border-radius: 999px; background: #eef0f3; color: #111827; }
@media (max-width: 680px) {
    .cp-card { padding: 22px; }
    .cp-page-header { display: block; }
    .cp-topbar { align-items: flex-start; height: auto; padding: 14px 18px; gap: 8px; flex-direction: column; }
}

.cp-dashboard-page { max-width: 1240px; }
.cp-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.cp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-stat-card, .cp-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 18px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05); }
.cp-stat-card { padding: 20px; display: grid; gap: 7px; }
.cp-stat-card strong { font-size: clamp(26px, 4vw, 38px); line-height: 1; letter-spacing: -0.04em; }
.cp-stat-label { color: #667085; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.cp-stat-note { color: #667085; font-size: 14px; }
.cp-panel { padding: 22px; margin-bottom: 18px; }
.cp-panel h2 { margin: 0 0 5px; }
.cp-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cp-credentials-panel { background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.cp-credential-row { display: grid; gap: 8px; margin-top: 16px; }
.cp-credential-row label { color: #344054; font-weight: 800; }
.cp-copy-line { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.cp-copy-line code { flex: 1 1 360px; min-width: 240px; display: flex; align-items: center; border: 1px solid #d0d5dd; border-radius: 12px; padding: 11px 13px; background: #0b1220; color: #e6edf7; overflow-x: auto; white-space: nowrap; }
.cp-secondary-button, .cp-danger-outline-button { border: 1px solid #cfd6df; color: #344054; background: #fff; }
.cp-secondary-button:hover { background: #f9fafb; }
.cp-danger-outline-button { color: #b42318; border-color: #f0b5af; }
.cp-danger-outline-button:hover { background: #fff5f3; }
.cp-inline-form { grid-template-columns: 1fr auto; align-items: end; }
.cp-inline-form button { height: 44px; }
.cp-buckets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-buckets div { border: 1px solid #eaecf0; border-radius: 14px; padding: 16px; background: #f9fafb; display: grid; gap: 7px; }
.cp-buckets span { color: #667085; font-weight: 700; }
.cp-buckets strong { font-size: 28px; }
.cp-chart { width: 100%; height: 360px; }
@media (max-width: 900px) {
    .cp-grid-4, .cp-grid-2 { grid-template-columns: 1fr; }
    .cp-inline-form { grid-template-columns: 1fr; }
}

.cp-checkbox-label { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px; font-weight: 600; }
.cp-checkbox-label input { width: auto; margin-top: 3px; }
.cp-pill.success { background: #ecfdf3; color: #087443; }
.cp-pill.muted { background: #f2f4f7; color: #667085; }
.cp-addin-panel { background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%); }
.cp-install-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-install-options div { border: 1px solid #eaecf0; border-radius: 14px; padding: 16px; background: rgba(255,255,255,0.72); display: grid; gap: 6px; }
.cp-install-options strong { color: #101828; }
.cp-install-options span { color: #667085; }
.cp-steps { margin: 0; padding-left: 22px; color: #344054; }
.cp-steps li { margin-bottom: 10px; }
.cp-download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cp-download-card { display: grid; gap: 6px; padding: 18px; border: 1px solid #d0d5dd; border-radius: 14px; background: #fff; text-decoration: none; color: inherit; }
.cp-download-card:hover { border-color: #155eef; box-shadow: 0 12px 28px rgba(21, 94, 239, 0.10); }
.cp-download-card strong { color: #155eef; }
.cp-download-card span { color: #667085; }
@media (max-width: 900px) {
    .cp-install-options, .cp-download-grid { grid-template-columns: 1fr; }
}
