:root {
  --brand-coral: #E8575A;
  --brand-navy: #1B2B4B;
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-400: #cbd5e0;
  --gray-600: #718096;
  --gray-800: #2d3748;
  --red-500: #e53e3e;
  --green-500: #38a169;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  min-height: 100vh;
  color: var(--gray-800);
}

/* Auth Pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brand-navy);
}

.logo-accent {
  color: var(--brand-coral);
}

.auth-title {
  color: var(--gray-800);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-error {
  background: #fff5f5;
  border: 1px solid var(--red-500);
  color: var(--red-500);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* EduID SSO Button */
.btn-eduid {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #003399;
  color: white;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s;
  margin-bottom: 1rem;
}

.btn-eduid:hover {
  background: #002266;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.auth-divider span {
  padding: 0 0.75rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-coral);
}

.form-input:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--brand-coral);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #d14a4d;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--brand-coral);
  color: var(--brand-coral);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--brand-coral);
  color: white;
}

/* Dashboard */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.dashboard-header h1 {
  color: var(--brand-navy);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.role-badge {
  background: var(--brand-coral);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.dashboard-main {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-main ul {
  margin-top: 1rem;
  margin-left: 1.5rem;
}

.dashboard-main li {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

/* Dashboard Navigation */
.dashboard-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.dashboard-card:hover {
  border-color: var(--brand-coral);
  transform: translateY(-2px);
}

.dashboard-card h2 {
  color: var(--brand-navy);
  margin-bottom: 0.5rem;
}

.dashboard-card p {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Page Container */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.page-header h1 {
  color: var(--brand-navy);
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.back-link {
  display: inline-block;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.back-link:hover {
  color: var(--brand-coral);
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  width: auto;
  padding: 0.75rem 1.5rem;
  background: var(--brand-coral);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s;
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--gray-400);
}

.btn-danger {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--red-500);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover:not(:disabled) {
  background: #c53030;
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-warning {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
}

.btn-warning:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 8px;
  border: 2px dashed var(--gray-200);
}

.empty-state h2 {
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-400);
  margin-bottom: 1.5rem;
}

/* Newsletter Grid */
.newsletter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.newsletter-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.newsletter-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.newsletter-card-header {
  margin-bottom: 0.75rem;
}

.newsletter-card h3 {
  color: var(--brand-navy);
  margin-bottom: 0.25rem;
}

.newsletter-card-segment {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.newsletter-card-meta {
  color: var(--gray-400);
  font-size: 0.75rem;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-draft {
  background: var(--gray-200);
  color: var(--gray-600);
}

.status-progress {
  background: #fef3c7;
  color: #92400e;
}

.status-review {
  background: #dbeafe;
  color: #1e40af;
}

.status-published {
  background: #d1fae5;
  color: #065f46;
}

/* Form Card */
.form-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 500px;
}

.form-error {
  background: #fff5f5;
  border: 1px solid var(--red-500);
  color: var(--red-500);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.field-error {
  color: var(--red-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 1rem;
  background: white;
}

.form-select:focus {
  outline: none;
  border-color: var(--brand-coral);
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brand-coral);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Newsletter Sections */
.newsletter-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.section-header h2 {
  color: var(--brand-navy);
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.section-description {
  color: var(--gray-400);
  font-size: 0.875rem;
}

.no-data {
  color: var(--gray-400);
  font-style: italic;
  margin-bottom: 1rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-item {
  background: var(--gray-100);
  padding: 1rem;
  border-radius: 4px;
}

.metric-label {
  display: block;
  color: var(--gray-600);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.metric-value {
  display: block;
  color: var(--brand-navy);
  font-size: 1.5rem;
  font-weight: 600;
}

/* Danger Zone */
.danger-zone {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #fff5f5;
  border: 1px solid var(--red-500);
  border-radius: 8px;
}

.danger-zone h3 {
  color: var(--red-500);
  margin-bottom: 1rem;
}

/* Status Form */
.status-form {
  display: inline-block;
}

.status-form .form-select {
  width: auto;
  padding: 0.5rem 1rem;
}

/* Content Form */
.content-form {
  margin-bottom: 1.5rem;
}

.content-form .form-group {
  margin-bottom: 1rem;
}

/* Metrics Section */
.metrics-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.metrics-section h4 {
  color: var(--gray-600);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* Metrics Editor */
.metrics-editor {
  max-width: 800px;
}

.metrics-editor h2 {
  color: var(--brand-navy);
  margin-bottom: 1.5rem;
}

.metrics-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.data-table th {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  color: var(--gray-800);
}

.data-table.editable td:last-child {
  width: 40px;
  text-align: center;
}

/* SOC Daily Section */
.soc-daily-section {
  margin-top: 1rem;
}

.soc-daily-editor h2 {
  color: var(--brand-navy);
  margin-bottom: 1.5rem;
}

.soc-daily-editor h3 {
  color: var(--gray-600);
  font-size: 1rem;
  margin: 1.5rem 0 1rem;
}

.soc-daily-add-form .form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.soc-daily-add-form .form-group {
  flex: 1;
  min-width: 100px;
}

.soc-daily-add-form .form-group:first-child {
  flex: 2;
  min-width: 150px;
}

/* Icon Buttons */
.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--red-500);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon-danger:hover {
  background: #fff5f5;
}

/* AI Generation */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.generate-form {
  display: flex;
  justify-content: flex-end;
}

.btn-ai {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-ai:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ai:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.content-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-form .form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Archives */
.archive-year-group {
  margin-bottom: 2rem;
}

.archive-year-title {
  font-size: 1.5rem;
  color: var(--brand-navy);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-coral);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.archive-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
}

.archive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.archive-card-header h3 {
  font-size: 1.125rem;
  color: var(--brand-navy);
  margin: 0;
}

.archive-segment {
  font-size: 0.75rem;
  background: var(--gray-100);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--gray-600);
}

.archive-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.archive-card-actions {
  display: flex;
  gap: 0.5rem;
}

.archives-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-100);
  border-radius: 4px;
}

.archive-version {
  font-weight: 600;
  color: var(--brand-navy);
}

.archive-date {
  color: var(--gray-600);
  flex: 1;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Ragent Integration */
.ragent-articles {
  padding: 1rem 0;
}

.ragent-info {
  margin-bottom: 1.5rem;
  color: var(--gray-600);
}

.ragent-section {
  margin-bottom: 2rem;
}

.ragent-section h4 {
  margin-bottom: 1rem;
  color: var(--brand-navy);
  font-size: 1rem;
}

.ragent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ragent-article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 4px;
  gap: 1rem;
}

.ragent-article-info {
  flex: 1;
  min-width: 0;
}

.ragent-article-title {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ragent-article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.ragent-score {
  color: var(--brand-teal);
  font-weight: 500;
}

.ragent-link {
  color: var(--brand-navy);
  text-decoration: none;
}

.ragent-link:hover {
  text-decoration: underline;
}

.ragent-import-form {
  flex-shrink: 0;
}

.ragent-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-600);
}

/* Ragent imported states */
.ragent-article-imported {
  background: var(--brand-teal-10, #e6f7f5);
  border-left: 3px solid var(--brand-teal);
}

.ragent-imported-badge {
  display: inline-block;
  background: var(--brand-teal);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.ragent-imported-count {
  color: var(--brand-teal);
  font-weight: 600;
}

.btn-imported {
  background: var(--brand-teal);
  color: white;
  border: 1px solid var(--brand-teal);
  cursor: default;
}

.btn-imported:hover {
  background: var(--brand-teal);
}

/* Ragent checkbox selection */
.ragent-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ragent-selection-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--brand-navy);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  text-decoration: underline;
}

.btn-text:hover {
  color: var(--brand-teal);
}

.ragent-article {
  cursor: pointer;
}

.ragent-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--brand-teal);
}

.ragent-article-selected {
  background: var(--brand-teal-10, #e6f7f5);
  border-left: 3px solid var(--brand-teal);
}

.ragent-generate-form {
  margin-top: 1rem;
}

.ragent-success {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  color: #155724;
  font-size: 0.875rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

.modal-close:focus {
  outline: 2px solid var(--brand-coral);
  outline-offset: 2px;
}

.modal-content {
  padding: 1.5rem;
}

/* ConfirmDialog */
.confirm-dialog-message {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Danger modal variant */
.modal-danger .modal-title {
  color: var(--red-500);
}

.modal-danger .modal-header {
  border-bottom-color: #fed7d7;
}

/* Warning modal variant */
.modal-warning .modal-title {
  color: #92400e;
}

.modal-warning .modal-header {
  border-bottom-color: #fef3c7;
}

/* ============================================================================
   Tabs Component
   ============================================================================ */

.tabs {
  display: flex;
  flex-direction: column;
}

.tab-list {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: var(--brand-navy);
}

.tab:focus {
  outline: none;
}

.tab:focus-visible {
  outline: 2px solid var(--brand-coral);
  outline-offset: -2px;
  border-radius: 4px 4px 0 0;
}

.tab-active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-coral);
}

.tab-label {
  white-space: nowrap;
}

/* Completion indicator */
.tab-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
}

.tab-indicator-complete {
  background: var(--green-500);
  color: white;
}

.tab-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
}

/* Badge (count) */
.tab-badge {
  font-size: 0.75rem;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.tab-active .tab-badge {
  background: var(--brand-coral);
  color: white;
}

/* Tab panel */
.tab-panel {
  outline: none;
}

.tab-panel:focus-visible {
  outline: 2px solid var(--brand-coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mobile responsive - dropdown mode */
@media (max-width: 640px) {
  .tab-list {
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: none;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 0.5rem;
  }

  .tab {
    margin-bottom: 0;
    border-bottom: none;
    border-radius: 6px;
    justify-content: space-between;
  }

  .tab-active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .tab:focus-visible {
    border-radius: 6px;
  }
}

/* Preview actions */
.preview-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Segment Badge
   Color-coded badges for newsletter segments (Higher Education, Banking, Energy)
   ========================================================================== */

.segment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Size variants */
.segment-badge-sm {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
}

.segment-badge-sm svg {
  width: 12px;
  height: 12px;
}

.segment-badge-md {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.segment-badge-md svg {
  width: 16px;
  height: 16px;
}

.segment-badge-lg {
  padding: 0.375rem 1rem;
  font-size: 1rem;
}

.segment-badge-lg svg {
  width: 20px;
  height: 20px;
}

/* Segment color variants */
.segment-badge-higher_education {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.segment-badge-banking {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.segment-badge-energy {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

/* Badge icon */
.segment-badge svg {
  flex-shrink: 0;
}

/* Label */
.segment-badge-label {
  line-height: 1;
}

/* Header title row with badge */
.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Segment selector */
.segment-selector {
  display: inline-flex;
  align-items: center;
}

.segment-select {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid var(--gray-400);
  background: white;
  cursor: pointer;
}

.segment-select:focus {
  outline: 2px solid var(--brand-coral);
  outline-offset: 2px;
}

.segment-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Settings Page - API Keys Management
   ========================================================================== */

/* Settings tabs customization */
.settings-tabs {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.settings-tab-list {
  margin-bottom: 1.5rem;
}

.settings-tab-panel {
  min-height: 400px;
}

/* Profile Panel */
.profile-panel {
  max-width: 600px;
}

.profile-panel h2 {
  color: var(--brand-navy);
  margin-bottom: 1.5rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 4px;
}

.info-label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.info-value {
  color: var(--brand-navy);
  font-weight: 500;
}

/* API Keys Panel */
.api-keys-panel {
  width: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  color: var(--brand-navy);
}

/* API Keys Table */
.api-keys-table {
  width: 100%;
  border-collapse: collapse;
}

.api-keys-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
}

.api-keys-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
}

.api-keys-table--revoked {
  opacity: 0.6;
}

/* API Key Row */
.api-key-row {
  transition: background 0.2s;
}

.api-key-row:hover {
  background: var(--gray-100);
}

.api-key-row--revoked {
  color: var(--gray-400);
}

.api-key-row--revoked:hover {
  background: transparent;
}

.api-key-row--expanded {
  background: var(--gray-100);
}

.key-prefix {
  background: var(--gray-200);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
}

.revoked-badge {
  display: inline-block;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.revoked-section-header {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 1.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* Audit Log Row */
.audit-log-row td {
  padding: 0;
  border-bottom: 1px solid var(--gray-200);
}

/* Audit Log Panel */
.audit-log-panel {
  padding: 1rem;
  background: var(--gray-100);
  border-radius: 4px;
  margin: 0.5rem 0;
}

.audit-log-panel h4 {
  color: var(--brand-navy);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 4px;
  overflow: hidden;
}

.audit-log-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.audit-log-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.method-badge {
  background: var(--brand-navy);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.status-code {
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
}

.status-success {
  background: #d1fae5;
  color: #065f46;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.pagination-info {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.btn-pagination {
  background: white;
  border: 1px solid var(--gray-200);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
  border-color: var(--gray-400);
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal Styles (Settings-specific) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--gray-600);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-success .modal-header {
  border-bottom-color: #d1fae5;
}

.modal-danger .modal-header {
  border-bottom-color: #fee2e2;
}

.modal-danger .modal-header h3 {
  color: var(--red-500);
}

/* Form elements for modals */
.form-hint {
  color: var(--gray-400);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Key Display (for newly created keys) */
.key-name {
  margin-bottom: 1rem;
}

.key-display {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.key-input {
  flex: 1;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: var(--gray-100);
}

.btn-copy {
  padding: 0.75rem 1rem;
  background: var(--brand-navy);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #152238;
}

.btn-copy--copied {
  background: var(--green-500);
}

.key-warning {
  padding: 0.75rem;
  background: #fef3c7;
  border-radius: 4px;
  color: #92400e;
  font-size: 0.875rem;
}

.warning-text {
  color: var(--red-500);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
