* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; }

/* Top navigation */
.top-nav { display: flex; align-items: center; background: #fff; border-bottom: 1px solid #e0e0e0; padding: 0 24px; height: 48px; gap: 0; transition: background 0.2s; }
.top-nav a { padding: 12px 20px; font-size: 14px; font-weight: 500; color: #666; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.top-nav a:hover { color: #1a73e8; background: #f0f4ff; }
.top-nav a.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.top-nav .spacer { flex: 1; }
.top-nav .env-area { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.env-select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; background: #fff; }
.prod-badge { background: #e8710a; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; display: none; }
.user-email { color: #666; font-size: 13px; }
.btn-link { background: none; border: none; color: #1a73e8; cursor: pointer; font-size: 13px; text-decoration: underline; }
.role-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 500; }
.role-write { background: #e6f4ea; color: #1e8e3e; }
.role-readonly { background: #f0f0f0; color: #666; }

/* PROD environment */
.top-nav.prod-env { background: #e8710a; border-bottom-color: #d06008; }
.top-nav.prod-env a { color: rgba(255,255,255,0.85); }
.top-nav.prod-env a:hover { color: #fff; background: rgba(255,255,255,0.15); }
.top-nav.prod-env a.active { color: #fff; border-bottom-color: #fff; }
.top-nav.prod-env .user-email { color: rgba(255,255,255,0.9); }
.top-nav.prod-env .btn-link { color: #fff; }
.top-nav.prod-env .env-select { background: rgba(255,255,255,0.9); }

/* Page container */
.page { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page h1 { font-size: 22px; font-weight: 600; margin-bottom: 20px; }

/* Summary cards */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; }
.summary-card .label { font-size: 13px; color: #888; margin-bottom: 6px; }
.summary-card .value { font-size: 28px; font-weight: 600; color: #333; }
.summary-card .value.blue { color: #1a73e8; }
.summary-card .value.green { color: #1e8e3e; }
.summary-card .value.orange { color: #e8710a; }

/* Cards */
.card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; background: #fafafa; border-bottom: 2px solid #e0e0e0; font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
tr:hover td { background: #fafafa; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-push { background: #e8f0fe; color: #1a73e8; }
.badge-email { background: #fce8e6; color: #c5221f; }
.badge-both { background: #e6f4ea; color: #1e8e3e; }
.badge-active { background: #e6f4ea; color: #1e8e3e; }
.badge-inactive { background: #f0f0f0; color: #888; }
.badge-executed { background: #fef7e0; color: #e37400; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: #333; transition: all 0.15s; }
.btn:hover { border-color: #bbb; background: #fafafa; }
.btn-primary { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.btn-primary:hover { background: #1557b0; }
.btn-danger { color: #c5221f; border-color: #c5221f; }
.btn-danger:hover { background: #fce8e6; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 4px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }

/* Channel checkboxes */
.channel-checks { display: flex; gap: 20px; }
.channel-check { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; cursor: pointer; padding: 8px 0; }
.channel-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: #1a73e8; cursor: pointer; }
.field-error { color: #c5221f; font-size: 12px; margin-top: 4px; }

/* Collapsible sections */
.collapsible { border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: 8px; }
.collapsible-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 14px; font-weight: 500; background: #fafafa; border-radius: 6px; }
.collapsible-header:hover { background: #f0f0f0; }
.collapsible-body { padding: 14px; display: none; border-top: 1px solid #e0e0e0; }
.collapsible.open .collapsible-body { display: block; }
.collapsible-toggle { width: 36px; height: 20px; border-radius: 10px; background: #ccc; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.collapsible-toggle.on { background: #1a73e8; }
.collapsible-toggle::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: left 0.2s; }
.collapsible-toggle.on::after { left: 18px; }

/* Wizard */
.wizard-steps { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #e0e0e0; }
.wizard-step { flex: 1; padding: 12px 16px; text-align: center; font-size: 13px; font-weight: 500; color: #888; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.wizard-step.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.wizard-step.completed { color: #1e8e3e; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid #e0e0e0; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Filter bar */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.filter-bar input { max-width: 300px; }
.filter-bar label { font-size: 13px; display: flex; align-items: center; gap: 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 24px; border-radius: 8px; font-size: 14px; z-index: 1000; animation: toastIn 0.3s; }
.toast-info { background: #1a73e8; color: #fff; }
.toast-success { background: #1e8e3e; color: #fff; }
.toast-error { background: #c5221f; color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Loading */
.loading { text-align: center; padding: 40px; color: #888; }

/* Tooltip */
.label-with-tip { display: inline-flex; align-items: center; gap: 4px; }
.tip-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #e0e0e0; color: #666; font-size: 11px; font-weight: 600; cursor: help; position: relative; flex-shrink: 0; line-height: 1; }
.tip-icon:hover { background: #1a73e8; color: #fff; }
.tip-icon .tip-text { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 400; white-space: normal; width: 260px; z-index: 100; line-height: 1.4; box-shadow: 0 2px 8px rgba(0,0,0,0.2); text-align: left; }
.tip-icon .tip-text::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #333; }
.tip-icon:hover .tip-text { display: block; }

/* Section description */
.section-desc { font-size: 12px; color: #888; margin-bottom: 12px; line-height: 1.4; }

/* Recipe cards */
.recipe-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; }
.recipe-modal { background: #fff; border-radius: 12px; padding: 28px; max-width: 720px; width: 90%; max-height: 80vh; overflow-y: auto; }
.recipe-modal h2 { font-size: 18px; margin-bottom: 4px; }
.recipe-modal .recipe-subtitle { font-size: 13px; color: #888; margin-bottom: 20px; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.recipe-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; cursor: pointer; transition: all 0.15s; }
.recipe-card:hover { border-color: #1a73e8; background: #f0f4ff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(26,115,232,0.1); }
.recipe-card .recipe-icon { font-size: 24px; margin-bottom: 8px; }
.recipe-card .recipe-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #333; }
.recipe-card .recipe-desc { font-size: 12px; color: #888; line-height: 1.3; }
.recipe-card.recipe-custom { border-style: dashed; background: #fafafa; }
.recipe-section-title { font-size: 13px; font-weight: 600; color: #888; text-transform: uppercase; margin: 16px 0 8px; letter-spacing: 0.5px; }
.recipe-section-title:first-child { margin-top: 0; }

/* Estimated Reach */
.reach-bar { background: #f0f4ff; border: 1px solid #c2d7fe; border-radius: 8px; padding: 12px 16px; margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.reach-bar .reach-icon { font-size: 20px; }
.reach-bar .reach-label { font-size: 13px; color: #555; }
.reach-bar .reach-value { font-size: 18px; font-weight: 600; color: #1a73e8; }
.reach-bar .reach-note { font-size: 11px; color: #888; margin-left: auto; }
.reach-bar.loading .reach-value { color: #888; }
.reach-bar .reach-spinner { width: 16px; height: 16px; border: 2px solid #c2d7fe; border-top-color: #1a73e8; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reach-details { font-size: 12px; color: #888; margin-top: 4px; }

/* Review step */
#reviewCard strong { color: #555; font-weight: 500; font-size: 13px; }
#reviewCard em { font-style: italic; }

/* Login */
.login-container { max-width: 400px; margin: 80px auto; padding: 40px; background: #fff; border-radius: 12px; border: 1px solid #ddd; text-align: center; }
.login-container h1 { font-size: 24px; margin-bottom: 8px; }
.login-container p { color: #666; margin-bottom: 24px; }
