*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f1f2ef; color: #333333; min-height: 100vh;
}
.header {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 50%, #3858e9 100%);
  padding: 24px 0; text-align: center;
}
.header h1 { color: #fff; font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.header p { color: #a0aec0; font-size: 13px; margin-top: 4px; }
.container { max-width: 700px; margin: 32px auto; padding: 0 16px; }
.card {
  background: #fff; border-radius: 8px; padding: 28px 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 16px; color: #333333; }
.card h3 { font-size: 15px; margin-bottom: 10px; color: #444; }
.report-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 6px;
  margin-bottom: 10px; transition: border-color 0.15s;
}
.report-item:hover { border-color: #3858e9; }
.report-info { flex: 1; }
.report-name { font-weight: 600; font-size: 14px; color: #333333; }
.report-desc { font-size: 12px; color: #666666; margin-top: 2px; }
.report-schedule { font-size: 11px; color: #999; margin-top: 2px; }
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #3858e9; color: #fff; }
.btn-danger { background: #fff; color: #e53e3e; border: 2px solid #e53e3e; padding: 6px 16px; }
.btn-success { background: #12a252; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-microsoft {
  background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c;
  padding: 12px 24px; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; border-radius: 4px; cursor: pointer; transition: background 0.15s;
}
.btn-microsoft:hover { background: #f3f3f3; }
.btn-microsoft svg { width: 21px; height: 21px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.form-group select, .form-group input[type="text"], .form-group input[type="email"] {
  width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 14px; color: #333; outline: none; transition: border-color 0.15s;
}
.form-group select:focus, .form-group input:focus { border-color: #3858e9; }
.subscriber-list { list-style: none; }
.subscriber-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.subscriber-list li:last-child { border-bottom: none; }
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
  border-radius: 8px; color: #fff; font-size: 14px; font-weight: 500;
  transform: translateY(100px); opacity: 0; transition: all 0.3s;
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #12a252; }
.toast.error { background: #e53e3e; }
.login-card { text-align: center; padding: 48px 32px; }
.login-card p { color: #666; margin-bottom: 24px; font-size: 14px; }
.hidden { display: none; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid #e2e8f0; background: #fff; color: #555;
}
.tab.active { background: #3858e9; color: #fff; border-color: #3858e9; }
.add-email-row { display: flex; gap: 8px; margin-top: 12px; }
.add-email-row input {
  flex: 1; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 14px; color: #333; outline: none;
}
.add-email-row input:focus { border-color: #3858e9; }
.badge {
  display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px;
  margin-left: 8px; font-weight: 600;
}
.badge-admin { background: #fef3c7; color: #92400e; }
.badge-manager { background: #dbeafe; color: #1e40af; }
.toggle-manager {
  font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid #3858e9; background: #fff; color: #3858e9; margin-left: 6px;
  transition: all 0.15s;
}
.toggle-manager:hover { background: #3858e9; color: #fff; }
.toggle-manager.is-mgr { background: #3858e9; color: #fff; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid #e2e8f0; border-top-color: #3858e9;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.unsub-banner {
  padding: 20px 24px; border-radius: 8px; text-align: center;
  font-size: 15px; font-weight: 500; margin-bottom: 20px;
}
.unsub-banner.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.unsub-banner.already { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.unsub-banner.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.unsub-banner .unsub-email { font-weight: 700; }
.footer { text-align: center; padding: 24px; color: #999; font-size: 12px; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #3858e9;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.role-badge-header {
  display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.admin-panel-section { border-left: 3px solid #3858e9; padding-left: 16px; margin-top: 16px; }
.admin-panel-section h3 { margin-bottom: 12px; }
.admin-list { list-style: none; margin-bottom: 12px; }
.admin-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.admin-list li:last-child { border-bottom: none; }
.new-report-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
button.tab { font-family: inherit; }
.spinner-lg { width: 24px; height: 24px; margin: 0 auto 16px; }
.user-bar { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.user-name { font-size: 14px; }
.user-email { font-size: 12px; color: #666; }
.btn-muted { background: #edf2f7; color: #555; }
.btn-xs { padding: 4px 10px; font-size: 11px; }
.spaced { margin-top: 24px; }
.hint { font-size: 12px; color: #666; margin-bottom: 8px; }
.error-text { color: #e53e3e; }
.muted-text { color: #666; }
button:disabled { opacity: 0.5; cursor: wait; }
@media (max-width: 520px) {
  .card { padding: 20px 16px; }
  .report-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .user-bar { padding: 12px 16px; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
