/* ==========================================================================
   dashboard-theme.css — shared design system for CreatorHub
   ==========================================================================
   Brand colors and typography sourced from wedomarketing.co.in (primary
   orange #F46423, Nunito for display/UI type, Poppins for body copy) and
   adapted into a professional dashboard design language — the marketing
   site's cream/pill/decorative aesthetic works for a hero section, not a
   dense data table, so this keeps the brand identity (color, type, warmth)
   while using layout patterns suited to an actual internal tool: a real
   sidebar, compact data tables, clear status color-coding.

   Shared across login.html, employee-dashboard.html, manager-dashboard.html
   and super-admin-dashboard.html so it's parsed and cached once instead of
   duplicated (and re-downloaded) on every page — part of the same "load
   faster" pass as the server-side pagination/search work.
   ========================================================================== */

:root {
  /* ---- Brand ---- */
  --brand-orange: #F4641E;
  --brand-orange-dark: #D9531A;
  --brand-orange-light: #FFF1E8;

  /* ---- Neutrals (warm-tinted, not cold blue-gray) ---- */
  --gray-50: #FAF9F7;
  --gray-100: #F4F1ED;
  --gray-200: #E7E2DC;
  --gray-300: #D3CCC3;
  --gray-400: #A69C90;
  --gray-500: #7C7268;
  --gray-600: #5B5349;
  --gray-700: #423C34;
  --gray-800: #2B2621;
  --gray-900: #1A1613;

  /* ---- Semantic tokens ---- */
  --bg: var(--gray-50);
  --surface: #FFFFFF;
  --surface-sunken: var(--gray-100);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --text-faint: var(--gray-400);

  --primary: var(--brand-orange);
  --primary-hover: var(--brand-orange-dark);
  --primary-soft: var(--brand-orange-light);
  --primary-contrast: #FFFFFF;

  --success: #1D8A5D;
  --success-soft: #E6F6EE;
  --warning: #B4780F;
  --warning-soft: #FDF3DC;
  --danger: #C13A2E;
  --danger-soft: #FBEAE8;
  --info: #2563A8;
  --info-soft: #E9F2FB;
  --purple: #7C4DBE;
  --purple-soft: #F1EAFB;

  --sidebar-bg: var(--gray-900);
  --sidebar-text: #C9C2B9;
  --sidebar-text-active: #FFFFFF;
  --sidebar-border: rgba(255, 255, 255, .08);

  /* ---- Typography ---- */
  --font-display: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Poppins', 'Segoe UI', system-ui, sans-serif;

  /* ---- Shape & elevation ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 22, 19, .05);
  --shadow-md: 0 6px 20px rgba(26, 22, 19, .08);
  --shadow-lg: 0 16px 40px rgba(26, 22, 19, .14);
}

/* ---- Reset & base ---- */
* {
  box-sizing: border-box
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased
}

h1, h2, h3, strong, .value, .btn, .nav-item, .sidebar-logo {
  font-family: var(--font-display)
}

a {
  color: var(--primary)
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px
}

/* ==========================================================================
   App shell — sidebar + topbar + content
   ========================================================================== */

body {
  min-height: 100vh;
  display: flex
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0
}

.sidebar-logo {
  padding: 24px 22px;
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center
}

.sidebar-logo span {
  color: var(--primary)
}

.sidebar-logo-img {
  height: 64px;
  width: auto;
  display: block
}

.nav {
  flex: 1;
  padding: 14px 10px
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  margin-bottom: 2px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease
}

.nav-item:hover {
  background: rgba(255, 255, 255, .06);
  color: #FFFFFF
}

.nav-item.active {
  background: rgba(244, 100, 30, .16);
  color: var(--sidebar-text-active);
  border-left-color: var(--primary)
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11.5px;
  color: var(--text-faint);
  overflow-wrap: break-word
}

/* A small persistent trust signal at the base of every dashboard sidebar —
   same visual language (pulse glow, orange accent) as the login page's
   security panel, scaled down so it doesn't compete with real content. */
.sidebar-secure-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 22px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .5)
}

.sidebar-secure-icon {
  font-size: 12px;
  filter: drop-shadow(0 0 4px rgba(244, 100, 30, .55))
}

.sidebar-secure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: sidebar-secure-pulse 2.2s ease-in-out infinite
}

@keyframes sidebar-secure-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(29, 138, 93, .5);
    opacity: .7
  }
  50% {
    box-shadow: 0 0 0 5px rgba(29, 138, 93, 0);
    opacity: 1
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-secure-dot {
    animation: none
  }
}

.main {
  flex: 1;
  min-width: 0;
  overflow: auto
}

.topbar {
  padding: 16px 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em
}

.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap
}

.content {
  padding: 26px 30px
}

/* Tab-switching for the content panels (Overview / Creators Database /
   Wishlists / Security Events, etc.) — showSection() in each dashboard's JS
   toggles the "active" class on exactly one of these at a time. Without this
   rule every panel is visible simultaneously, just stacked vertically. */
.panel {
  display: none
}

.panel.active {
  display: block
}

@media(max-width:900px) {
  .sidebar {
    display: none
  }
}

@media(max-width:600px) {
  .content {
    padding: 16px
  }

  .topbar {
    padding: 14px 16px
  }
}

/* ==========================================================================
   Status chips (role / mode indicators in the topbar)
   ========================================================================== */

.employee-chip, .manager-chip, .admin-chip, .secure-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap
}

.employee-chip, .manager-chip {
  background: var(--primary-soft);
  color: var(--primary-hover)
}

.admin-chip {
  background: var(--purple-soft);
  color: var(--purple)
}

.secure-chip {
  background: var(--success-soft);
  color: var(--success)
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  white-space: nowrap
}

.btn:hover {
  background: var(--primary-hover)
}

.btn:active {
  transform: translateY(1px)
}

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

.btn-sm {
  padding: 7px 13px;
  font-size: 12px;
  border-radius: var(--radius-sm)
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text)
}

.btn-outline:hover {
  background: var(--surface-sunken);
  border-color: var(--text-faint)
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1.5px solid transparent
}

.btn-danger:hover {
  background: #F6D9D5
}

button {
  font-family: inherit
}

/* ==========================================================================
   KPI cards & grid
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm)
}

.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  font-weight: 700
}

.value {
  font-size: 32px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -.02em;
  color: var(--text)
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm)
}

.table-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px
}

.table-head strong {
  font-size: 15.5px;
  font-weight: 800
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center
}

.search, .select, input[type="text"], input[type="email"], input[type="password"] {
  padding: 9px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text)
}

.search:focus, .select:focus, input:focus {
  border-color: var(--primary);
  outline: none
}

.search {
  min-width: 240px
}

.table-wrap {
  overflow: auto;
  max-height: 72vh
}

table {
  width: 100%;
  border-collapse: collapse
}

th, td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap
}

th {
  position: sticky;
  top: 0;
  background: var(--gray-100);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--text-muted)
}

tr:hover td {
  background: var(--surface-sunken)
}

.hidden-field {
  filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
  color: var(--text-faint)
}

.table-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px
}

/* ==========================================================================
   Badges (status / category tags)
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .01em
}

.badge-gray {
  background: var(--gray-200);
  color: var(--gray-700)
}

.badge-blue {
  background: var(--info-soft);
  color: var(--info)
}

.badge-green {
  background: var(--success-soft);
  color: var(--success)
}

.badge-yellow {
  background: var(--warning-soft);
  color: var(--warning)
}

.badge-purple {
  background: var(--purple-soft);
  color: var(--purple)
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger)
}

/* ==========================================================================
   Avatar / creator cell / user card
   ========================================================================== */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-hover);
  flex-shrink: 0;
  font-family: var(--font-display)
}

.creator-cell {
  display: flex;
  align-items: center;
  gap: 10px
}

.creator-name {
  font-weight: 600;
  color: var(--text)
}

.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm)
}

.user-left {
  display: flex;
  align-items: center;
  gap: 14px
}

.user-name {
  font-weight: 700;
  font-size: 14.5px;
  font-family: var(--font-display)
}

.user-email {
  font-size: 12.5px;
  color: var(--text-muted)
}

.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 19, .55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.modal-overlay.open {
  display: flex
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg)
}

.modal h2 {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 800
}

.form-group {
  margin-bottom: 16px
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted)
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit
}

.form-group textarea {
  min-height: 100px;
  resize: vertical
}

/* CH-P1-034 — inline warning shown under YT Link when it matches an
   existing creator's link (Add/Edit Creator modals, all 3 dashboards). */
.dup-warning {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4
}

/* CH-P1-036 — marks a mandatory field's label on the Add/Edit Creator form. */
.required-mark {
  color: var(--danger);
  font-weight: 800;
  margin-left: 2px
}

/* CH-P1-019 — sub-tabs (Activity Summary / Restricted Activity) and the
   interval selector (1D/7D/15D/30D) on the Manager Dashboard's Employee
   Activity panel. */
.subtab-group {
  display: flex;
  gap: 6px
}

.subtab {
  padding: 7px 14px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12.5px;
  font-family: var(--font-display);
  cursor: pointer
}

.subtab:hover {
  background: var(--surface-sunken)
}

.subtab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast)
}

.interval-group {
  display: flex;
  gap: 6px;
  padding: 16px 20px 0
}

.interval-btn {
  padding: 6px 13px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-display);
  cursor: pointer
}

.interval-btn:hover {
  background: var(--surface-sunken)
}

.interval-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover)
}

/* CH-P1-023 — date-range filter on the Creators Database table (filters on
   created_at, the row's system timestamp — see schema notes on why date_raw
   isn't used for this). */
.date-range-group {
  display: flex;
  align-items: center;
  gap: 6px
}

.date-range-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted)
}

.date-range-sep {
  color: var(--text-faint)
}

.date-range-input {
  padding: 7px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text)
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px
}

/* CH-P1-042 — Bulk Upload Creators wizard (3 steps: upload file, map
   columns, review & import). Reuses .modal/.form-group/.table-wrap/.badge/
   .grid/.card from elsewhere in this file rather than inventing parallel
   styles, since it's the same visual language as every other modal/table. */
.modal-wide {
  max-width: 960px
}

.bulk-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 14px
}

.bulk-step {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-faint);
  background: var(--surface-sunken)
}

.bulk-step.active {
  background: var(--primary-soft);
  color: var(--primary-hover)
}

.bulk-step.done {
  background: var(--success-soft);
  color: var(--success)
}

.bulk-step-panel {
  display: none
}

.bulk-step-panel.active {
  display: block
}

.bulk-map-select {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit
}

.bulk-sample-cell {
  color: var(--text-muted);
  font-size: 12.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.bulk-review-section {
  margin-top: 18px
}

.bulk-review-section h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 800
}

.bulk-issue-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--danger)
}

.bulk-row-more {
  padding: 10px 4px;
  font-size: 12.5px;
  color: var(--text-faint)
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width .2s ease
}

/* ==========================================================================
   Event rows (notifications / security log)
   ========================================================================== */

.event-row {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start
}

.event-row:last-child {
  border-bottom: 0
}

.event-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  margin-top: 5px;
  flex-shrink: 0
}

.event-dot.high {
  background: var(--danger)
}

.event-dot.low {
  background: var(--success)
}

.event-title {
  font-weight: 700;
  font-size: 13.5px
}

.event-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px
}

.event-time {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: right;
  white-space: nowrap
}

/* ==========================================================================
   Wishlists
   ========================================================================== */

.wishlist-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px
}

.wishlist-item strong {
  display: block
}

.wishlist-item small {
  color: var(--text-muted)
}

/* ==========================================================================
   Employee dashboard extras
   ========================================================================== */

.overview-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 24px
}

.campaign-note {
  margin-bottom: 24px;
  background: var(--primary-soft);
  border-color: transparent
}

.campaign-note .label {
  color: var(--primary-hover)
}

.list-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border)
}

.list-summary-item:first-child {
  border-top: 0
}

.empty-state {
  padding: 18px 20px;
  color: var(--text-muted);
  font-size: 13px
}

@media(max-width:900px) {
  .overview-row {
    grid-template-columns: 1fr
  }
}

.watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  opacity: .04
}

.wm {
  position: absolute;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  transform: rotate(-28deg);
  color: #000
}

/* ==========================================================================
   Super admin extras
   ========================================================================== */

.role-select {
  padding: 6px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface)
}

/* ==========================================================================
   Toast
   ========================================================================== */

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  transform: translateY(6px);
  z-index: 200;
  box-shadow: var(--shadow-lg)
}

#toast.show {
  opacity: 1;
  transform: translateY(0)
}

/* ==========================================================================
   Login page
   ========================================================================== */

.login-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top left, var(--primary-soft), var(--bg) 60%)
}

.login-frame {
  display: flex;
  width: min(920px, 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg)
}

.login-card {
  width: min(420px, 100%);
  flex: 1 1 380px;
  background: var(--surface);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.login-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center
}

.login-logo span {
  color: var(--primary)
}

.login-logo-img {
  height: 84px;
  width: auto;
  display: block
}

.login-card h1 {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em
}

.field {
  margin-bottom: 15px
}

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted)
}

.field input {
  width: 100%
}

.login-card > button, .field + button, #loginBtn {
  width: 100%;
  margin-top: 4px
}

.msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px
}

.msg.show {
  display: block
}

.err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #F3C6C1
}

.ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #BEE5D2
}

/* ==========================================================================
   Login page — security panel
   Left half of the split login frame: an animated "encrypted vault" visual
   (rotating dashed rings around a pulsing lock, orbiting connection nodes,
   ambient particles drifting upward) plus a short list of the app's actual
   security properties (RLS, encryption in transit, audit trail) — not
   decorative claims, these match what's really implemented (see
   creators_staging RLS policies, CH-P1-033 updated_by/created_by tracking,
   security_events logging).
   ========================================================================== */

.security-panel {
  flex: 1 1 380px;
  background: linear-gradient(160deg, var(--gray-900) 0%, #241d17 100%);
  color: #FFFFFF;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden
}

.security-particles {
  position: absolute;
  inset: 0;
  pointer-events: none
}

.security-particle {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(244, 100, 30, .6);
  animation: security-float-up linear infinite
}

.security-particle.p1 {
  left: 12%;
  animation-duration: 7s;
  animation-delay: 0s
}

.security-particle.p2 {
  left: 28%;
  animation-duration: 9s;
  animation-delay: 1.5s
}

.security-particle.p3 {
  left: 46%;
  animation-duration: 6.5s;
  animation-delay: .5s
}

.security-particle.p4 {
  left: 64%;
  animation-duration: 8s;
  animation-delay: 2.5s
}

.security-particle.p5 {
  left: 80%;
  animation-duration: 7.5s;
  animation-delay: 3.5s
}

.security-particle.p6 {
  left: 92%;
  animation-duration: 6s;
  animation-delay: 1s
}

@keyframes security-float-up {
  0% {
    transform: translateY(0);
    opacity: 0
  }
  10% {
    opacity: 1
  }
  90% {
    opacity: 1
  }
  100% {
    transform: translateY(-360px);
    opacity: 0
  }
}

.security-visual {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 4px 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1
}

.security-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(244, 100, 30, .45)
}

.security-ring.ring-outer {
  animation: security-spin-cw 18s linear infinite
}

.security-ring.ring-inner {
  inset: 18px;
  border-color: rgba(244, 100, 30, .28);
  animation: security-spin-ccw 13s linear infinite
}

@keyframes security-spin-cw {
  to {
    transform: rotate(360deg)
  }
}

@keyframes security-spin-ccw {
  to {
    transform: rotate(-360deg)
  }
}

.security-badge {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 100, 30, .22), rgba(244, 100, 30, 0) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  animation: security-pulse-glow 2.6s ease-in-out infinite
}

@keyframes security-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(244, 100, 30, .35)
  }
  50% {
    box-shadow: 0 0 0 14px rgba(244, 100, 30, 0)
  }
}

.security-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: security-node-pulse 2.4s ease-in-out infinite
}

.security-node.node-1 {
  top: 2px;
  left: calc(50% - 3.5px);
  animation-delay: 0s
}

.security-node.node-2 {
  bottom: 14px;
  right: 8px;
  animation-delay: .8s
}

.security-node.node-3 {
  bottom: 14px;
  left: 8px;
  animation-delay: 1.6s
}

@keyframes security-node-pulse {
  0%, 100% {
    opacity: .35;
    transform: scale(1)
  }
  50% {
    opacity: 1;
    transform: scale(1.6)
  }
}

.security-heading {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -.01em;
  position: relative;
  z-index: 1
}

.security-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, .65);
  margin: 0 0 30px;
  position: relative;
  z-index: 1
}

.security-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  width: 100%;
  max-width: 280px;
  position: relative;
  z-index: 1
}

.security-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .85)
}

.security-feature-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(244, 100, 30, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px
}

@media (prefers-reduced-motion: reduce) {
  .security-ring, .security-badge, .security-node, .security-particle {
    animation: none
  }
}

@media (max-width: 860px) {
  .security-panel {
    display: none
  }
  .login-frame {
    box-shadow: none
  }
  .login-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(420px, 100%)
  }
}
