/* ─── Novus Actus — shared.css ─────────────────────────────────────────────── */

/* ─── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  --bg:           #0f1117;
  --card:         #1a1d27;
  --card-hover:   #1f2335;
  --border:       rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text:         #f9fafb;
  --text-muted:   #9ca3af;
  --text-subtle:  #6b7280;
  --green:        #4ade80;
  --amber:        #f59e0b;
  --red:          #f87171;
  --green-light:  #86efac;
  --amber-light:  #fcd34d;
  --red-light:    #fca5a5;
  --teal:         #2dd4bf;
  --teal-dim:     rgba(45,212,191,0.12);
  --teal-hover:   rgba(45,212,191,0.2);
  --transition:   cubic-bezier(0.4,0,0.2,1);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.7), 0 4px 16px rgba(0,0,0,0.4);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    6px;
}

/* ─── Global Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter',
               'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 200ms var(--transition);
}
a:hover { color: #fff; }

img, svg { display: block; }

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: 2rem;    font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem;  font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem;font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.9375rem;font-weight: 600; line-height: 1.5; }
p  { color: var(--text-muted); line-height: 1.7; }

/* ─── Wordmark ───────────────────────────────────────────────────────────────── */
.wordmark {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.03em;
  user-select: none;
}
.wordmark span { color: var(--text); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}
.card-sm { padding: 1rem; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms var(--transition), color 180ms var(--transition),
              border-color 180ms var(--transition), transform 120ms var(--transition),
              box-shadow 180ms var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-primary {
  background: var(--teal);
  color: #0f1117;
  font-weight: 600;
}
.btn-primary:hover {
  background: #5eead4;
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.1);
  border-color: var(--red);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-full { width: 100%; justify-content: center; }

/* mailto / Outlook buttons */
.btn-mailto {
  background: rgba(0,120,212,0.15);
  color: #60a5fa;
  border-color: rgba(96,165,250,0.25);
}
.btn-mailto:hover {
  background: rgba(0,120,212,0.25);
  border-color: #60a5fa;
}

/* ─── Badge / Status ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Signal badges (Strong / Mixed / Risk) */
.badge-strong {
  background: rgba(74,222,128,0.12);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.2);
}
.badge-strong .badge-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

.badge-mixed {
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.2);
}
.badge-mixed .badge-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

.badge-risk {
  background: rgba(248,113,113,0.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
}
.badge-risk .badge-dot { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* Status badges (campaign statuses) */
.badge-draft    { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }
.badge-active   { background: rgba(45,212,191,0.12);  color: var(--teal); border: 1px solid rgba(45,212,191,0.2); }
.badge-completed{ background: rgba(74,222,128,0.12);  color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.badge-archived { background: rgba(107,114,128,0.1);  color: var(--text-subtle); border: 1px solid rgba(107,114,128,0.15); }
.badge-excluded { background: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.badge-event    { background: rgba(167,139,250,0.14); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); font-size: 0.65rem; padding: 0.12rem 0.5rem; vertical-align: middle; }

/* Request status chips */
.status-pending   { color: #9ca3af; }
.status-sent      { color: #60a5fa; }
.status-opened    { color: var(--amber); }
.status-completed { color: var(--green); }
.status-excluded  { color: var(--red); }

/* ─── Form Inputs ────────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  padding: 0.6rem 0.85rem;
  width: 100%;
  transition: border-color 200ms var(--transition), box-shadow 200ms var(--transition),
              background 200ms var(--transition);
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
input::placeholder,
textarea::placeholder { color: var(--text-subtle); }

select { padding-right: 2rem; }
select option { background: #1a1d27; color: var(--text); }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: rgba(255,255,255,0.03);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 150ms var(--transition);
  --row-index: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: rowIn 320ms var(--transition) forwards;
  animation-delay: calc(var(--row-index) * 40ms);
}

@keyframes rowIn {
  to { opacity: 1; transform: translateY(0); }
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--card-hover); }
tbody td { padding: 0.75rem 1rem; vertical-align: middle; }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms var(--transition);
  pointer-events: none;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 220ms var(--transition);
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

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

/* ─── Confirm / Delete dialog ────────────────────────────────────────────────── */
.confirm-dialog {
  max-width: 400px;
  text-align: center;
  padding: 2rem 2rem 1.75rem;
}
.confirm-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--red);
}
.confirm-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.confirm-dialog-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}
.confirm-dialog-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ─── Loading Spinner ────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ─── Skeleton Shimmer ───────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: 0.5rem;
}
.skeleton-line:last-child { width: 60%; }
.skeleton-block {
  height: 48px;
  margin-bottom: 0.75rem;
}

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  pointer-events: all;
  animation: toastIn 300ms var(--transition) both;
  max-width: 340px;
}
.toast.out { animation: toastOut 250ms var(--transition) both; }

@keyframes toastIn  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toastOut { to   { opacity:0; transform:translateY(8px); } }

.toast-success { background: rgba(74,222,128,0.15); color: var(--green); border: 1px solid rgba(74,222,128,0.25); }
.toast-error   { background: rgba(248,113,113,0.15); color: var(--red);   border: 1px solid rgba(248,113,113,0.25); }
.toast-info    { background: rgba(45,212,191,0.13);  color: var(--teal);  border: 1px solid rgba(45,212,191,0.2); }

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-green   { color: var(--green); }
.text-amber   { color: var(--amber); }
.text-red     { color: var(--red); }
.text-teal    { color: var(--teal); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.font-mono    { font-family: 'Menlo','Consolas','Monaco',monospace; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mt-4   { margin-top: 1rem; }
.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-4   { margin-bottom: 1rem; }
.sr-only {
  position: absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); border:0;
}

/* ─── Error state ────────────────────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  text-align: center;
}
.error-state h3 { color: var(--red); }
.error-state p  { color: var(--text-muted); max-width: 380px; }

/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; opacity: 0.3; }

/* ─── Scroll-reveal animation ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms var(--transition), transform 450ms var(--transition);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
