/* ==========================================================================
   Event Manager Pro — design system & shared styles
   ========================================================================== */

:root {
  /* Brand */
  --color-primary: #F97316;
  --color-primary-dark: #EA580C;
  --color-primary-light: #FFF1E7;
  --color-primary-50: rgba(249, 115, 22, 0.06);
  --color-primary-100: rgba(249, 115, 22, 0.1);
  --color-primary-200: rgba(249, 115, 22, 0.2);

  /* Neutrals */
  --color-text: #171A1F;
  --color-text-secondary: #565D6D;
  --color-text-muted: #8A919E;
  --color-border: #DEE1E6;
  --color-border-soft: #ECEEF1;
  --color-bg: #FFFFFF;
  --color-bg-app: #FAFAFB;
  --color-bg-subtle: #F3F4F6;
  --color-bg-card: #FFFFFF;

  /* Status */
  --color-success: #16A34A;
  --color-success-bg: rgba(22, 163, 74, 0.1);
  --color-danger: #DC2626;
  --color-danger-bg: rgba(220, 38, 38, 0.08);
  --color-warning: #D97706;
  --color-warning-bg: rgba(217, 119, 6, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(23, 26, 31, 0.06), 0 0 1px rgba(23, 26, 31, 0.08);
  --shadow-sm: 0 1px 3px rgba(23, 26, 31, 0.08), 0 1px 2px rgba(23, 26, 31, 0.06);
  --shadow-md: 0 4px 10px rgba(23, 26, 31, 0.08), 0 1px 3px rgba(23, 26, 31, 0.06);
  --shadow-lg: 0 8px 24px rgba(23, 26, 31, 0.14), 0 2px 6px rgba(23, 26, 31, 0.08);

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 256px;
  --container-max: 1280px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
fieldset { border: 0; padding: 0; margin: 0; }

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-fill { fill: currentColor; stroke: none; }
/* Dot/module-based icons (ellipsis menu, QR chip) are drawn as small filled
   circles/rects in the sprite. The global stroke-only icon style leaves them
   nearly invisible, so force a filled render for this subset without
   touching the stroke-based icons used everywhere else. */
svg.icon:has(use[href$="#ellipsis-vertical"]),
svg.icon:has(use[href$="#qr-code"]) {
  fill: currentColor;
  stroke: none;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
}

@media (min-width: 900px) {
  .only-mobile { display: none !important; }
}
@media (max-width: 899px) {
  .only-desktop { display: none !important; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  padding: 9px 20px;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, opacity .15s ease;
  background: none;
}
.btn .icon { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }

.btn-outline {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover:not(:disabled) { background: var(--color-bg-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--color-bg-subtle); color: var(--color-text); }

.btn-danger-outline {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.btn-danger-outline:hover:not(:disabled) { background: var(--color-danger-bg); }

.btn-lg { padding: 12px 24px; font-size: 16px; line-height: 26px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 14px; font-size: 13px; line-height: 20px; }
.btn-block { width: 100%; }
.btn-icon {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}
.field label, .field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon-leading {
  position: absolute;
  left: 12px;
  color: var(--color-text-secondary);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.input-wrap .icon-trailing {
  position: absolute;
  right: 12px;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  display: flex;
  padding: 2px;
}
.input, textarea.input, select.input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
.input::placeholder { color: var(--color-text-secondary); opacity: .85; }
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-100);
}
.input-wrap .input.has-icon-left { padding-left: 38px; }
.input-wrap .input.has-icon-right { padding-right: 40px; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23565D6D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid var(--color-text-secondary);
  border-radius: 4px;
  margin-top: 3px;
  position: relative;
  cursor: pointer;
  background: #fff;
}
.checkbox-row input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.checkbox-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-row a { color: var(--color-primary); font-weight: 500; }
.checkbox-row a:hover { text-decoration: underline; }

/* Segmented tab switch (Вход / Регистрация) */
.seg-switch {
  display: grid;
  grid-auto-flow: column;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.seg-switch a, .seg-switch button {
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
}
.seg-switch a.active, .seg-switch button.active {
  background: #fff;
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Cards / badges / tags
   ========================================================================== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.table-card { overflow-x: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-neutral { background: var(--color-bg-subtle); color: var(--color-text); border-color: var(--color-border); }
.badge-primary { background: var(--color-primary-100); color: var(--color-primary); border-color: var(--color-primary-200); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-dark { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(217,119,6,.25); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   Site header (public pages)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container,
.brand-bar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand small-mark { }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn-ghost { color: var(--color-text); }

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
@media (max-width: 899px) {
  .hamburger-btn { display: inline-flex; }
}
.hamburger-btn .icon { width: 22px; height: 22px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-bg-app);
  border-top: 1px solid var(--color-border);
  padding: 56px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; text-align: left; }
}
.footer-grid h4 { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.footer-grid p { color: var(--color-text-secondary); font-size: 14px; max-width: 380px; }
.footer-grid ul li { margin-bottom: 12px; }
.footer-grid ul li a, .footer-grid ul li span {
  color: var(--color-text-secondary);
  font-size: 14px;
}
.footer-grid ul li a:hover { color: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   App shell (dashboards): sidebar + topbar + content
   ========================================================================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; background: var(--color-bg-app); }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
@media (max-width: 899px) {
  .app-topbar { padding: 0 12px; }
}

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

.avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--color-bg-subtle);
  position: relative;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-status {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-success); border: 2px solid #fff;
}

.app-body { display: flex; flex: 1; width: 100%; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--color-bg-app);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}
.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 400;
}
.sidebar-link .icon { width: 20px; height: 20px; }
.sidebar-link:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.sidebar-link.active { background: var(--color-primary-100); color: var(--color-primary); font-weight: 500; }
.sidebar-foot { padding: 16px 12px; border-top: 1px solid var(--color-border); }

@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed; inset: 0; background: rgba(23,26,31,.4);
    z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
}

.app-main { flex: 1; min-width: 0; }
.page-head {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 24px;
}
@media (max-width: 640px) { .page-head { padding: 16px; } }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 600; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.content-pad { padding: 24px; }
@media (max-width: 640px) { .content-pad { padding: 16px; } }

/* Section tabs (Информация / Условия участия ...) */
.tabbar {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  background: var(--color-bg);
  padding: 0 24px;
}
@media (max-width: 640px) { .tabbar { padding: 0 16px; gap: 16px; } }
.tabbar a, .tabbar button {
  background: none; border: none;
  padding: 16px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabbar a.active, .tabbar button.active { color: var(--color-primary); border-color: var(--color-primary); }

/* ==========================================================================
   Table (responsive -> stacked cards on mobile)
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--color-text-secondary);
  padding: 14px 16px;
  background: var(--color-bg-app);
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

@media (max-width: 780px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
  .data-table td { padding: 4px 0; border: none; }
  .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
  }
}

/* ==========================================================================
   Misc utilities
   ========================================================================== */
.text-secondary { color: var(--color-text-secondary); }
.text-primary-color { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.divider { height: 1px; background: var(--color-border); border: none; width: 100%; }

.skeleton-loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px; border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg); background: var(--color-bg-app);
}
.skeleton-loader .icon-wrap {
  width: 96px; height: 96px; border-radius: 50%; background: var(--color-bg-subtle);
  display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
  color: var(--color-text-muted);
}
.skeleton-loader .icon-wrap .icon { width: 40px; height: 40px; }
.skeleton-loader h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.skeleton-loader p { color: var(--color-text-secondary); max-width: 440px; margin: 0 auto 24px; }

/* Fade/slide utility for JS-toggled elements */
[data-panel] { }
[data-panel][hidden] { display: none !important; }

/* ==========================================================================
   Marketing header mobile nav drawer
   ========================================================================== */
.mobile-nav {
  display: none;
}
@media (max-width: 899px) {
  .mobile-nav {
    display: block;
    max-height: 0;
    overflow: hidden;
    background: var(--color-bg);
    border-bottom: 1px solid transparent;
    transition: max-height .25s ease, border-color .25s ease;
  }
  .mobile-nav.is-open {
    max-height: 240px;
    border-color: var(--color-border);
  }
  .mobile-nav-inner { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
  .mobile-nav-inner .btn { width: 100%; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: var(--color-bg-app);
  border-bottom: 1px solid var(--color-border);
  padding: 64px 0;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-100);
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 52px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--color-primary); }
.hero-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  background: var(--color-bg-subtle);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 899px) {
  .hero { padding: 32px 0 40px; text-align: center; }
  .hero .container { grid-template-columns: 1fr; gap: 32px; }
  .hero-media { order: -1; aspect-ratio: 4/3; max-width: 420px; margin: 0 auto; border-radius: var(--radius-lg); }
  .hero h1 { font-size: 32px; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-eyebrow { }
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { width: 100%; }
}

/* ==========================================================================
   Sections / headings
   ========================================================================== */
.section { padding: 64px 0; }
.section-alt { background: var(--color-bg-app); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.section-head { margin-bottom: 40px; }
.section-head h2 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.section-head p { color: var(--color-text-secondary); font-size: 16px; max-width: 640px; }
.section-head.center { text-align: center; }
.section-head.center p { margin-left: auto; margin-right: auto; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.link-more { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary); font-weight: 500; font-size: 15px; }
.link-more .icon { width: 16px; height: 16px; }
.link-more:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .section-head h2 { font-size: 24px; }
}

/* ==========================================================================
   Event card (reused: home + org dashboard)
   ========================================================================== */
.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1023px) {
  .event-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .event-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

.event-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}
.event-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-bg-subtle);
}
.event-card-media img,
.event-card-media > .ph-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-card-tag {
  position: absolute; top: 16px; left: 12px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}
.event-card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.event-card-title { font-size: 18px; font-weight: 600; line-height: 1.4; }
.event-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-text-secondary); }
.event-meta .icon { width: 16px; height: 16px; flex-shrink: 0; }
.event-card-foot {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.event-card-org { font-size: 14px; font-weight: 500; }
.event-card-foot .link-more { font-size: 14px; }
.event-card-status { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); }
.event-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.list-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline; margin: 0; }

/* ==========================================================================
   Feature cards
   ========================================================================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 899px) {
  .feature-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}
.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 32px 28px;
  text-align: center;
}
.feature-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-primary-100);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.feature-icon .icon { width: 28px; height: 28px; }
.feature-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.feature-card p { color: var(--color-text-secondary); font-size: 15px; line-height: 1.6; }

/* Auth / registration card layout */
.auth-shell {
  min-height: 100vh;
  background: var(--color-bg-app);
  display: flex;
  flex-direction: column;
}
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card-body { padding: 40px 32px 32px; }
.auth-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--color-primary-100); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.auth-icon .icon { width: 24px; height: 24px; }
.auth-card h1 { font-size: 24px; font-weight: 700; text-align: center; letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-card .auth-lead { text-align: center; color: var(--color-text-secondary); font-size: 14px; margin-bottom: 24px; }
.auth-card .seg-switch { margin-bottom: 28px; }
.field-hint-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.field-hint-row label { margin-bottom: 0; }
.field-hint-row a { font-size: 14px; font-weight: 500; color: var(--color-primary); }
.auth-foot {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-app);
  padding: 16px 32px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.auth-foot a { color: var(--color-primary); font-weight: 500; }
@media (max-width: 480px) {
  .auth-card-body { padding: 32px 20px 24px; }
  .auth-foot { padding: 16px 20px; }
}

/* Organization registration variant (secondary marketing column) */
body.theme-warm {
  --color-bg-app: #FAFAF9;
  --color-bg: #FFFFFF;
  --color-text: #24211E;
  --color-text-secondary: #99948F;
  --color-text-muted: #B4AFA9;
  --color-border: #F6F5F4;
  --color-border-soft: #F6F5F4;
  --color-bg-subtle: #FAFAF9;
  background: var(--color-bg-app);
}
.reg-shell { min-height: 100vh; background: var(--color-bg-app); display: flex; flex-direction: column; }
.reg-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(360px, 480px) 1fr;
  align-items: center;
  padding: 48px 24px;
  gap: 24px;
}
.reg-side { color: var(--color-text); font-size: 14px; font-weight: 500; }
.reg-side.right { text-align: right; }
@media (max-width: 1080px) {
  .reg-main { grid-template-columns: 1fr; padding: 32px 20px; }
  .reg-side { display: none; }
}
.reg-shell .site-header { background: var(--color-bg); }
.reg-shell .auth-card { box-shadow: var(--shadow-md); border-color: var(--color-border); }
.reg-shell .seg-switch { background: var(--color-bg-app); }
.reg-shell .input, .reg-shell textarea.input, .reg-shell select.input { box-shadow: var(--shadow-xs); }

/* ==========================================================================
   Admin master-detail layout (events / applications / organizations)
   ========================================================================== */
.master-detail {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - var(--header-h));
}
@media (max-width: 1080px) {
  .master-detail { grid-template-columns: 300px 1fr; }
}
@media (max-width: 899px) {
  .master-detail.only-desktop { display: none !important; }
  .master-detail { grid-template-columns: 1fr; }
  .master-list-pane { display: none !important; }
  .master-list-pane.is-active { display: flex !important; }
  .master-detail-pane { display: none !important; }
  .master-detail-pane.is-active { display: block !important; }
}

.master-list-pane {
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.master-list-search { position: relative; }
.master-list-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-secondary); width: 16px; height: 16px; }
.master-list-search .input { padding-left: 36px; }
.master-list-filters { display: flex; gap: 10px; }
.master-list-filters .btn { flex-shrink: 0; }
.master-list-items { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }

.list-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.list-card:hover { border-color: var(--color-primary); }
.list-card.is-active { border-color: var(--color-primary); background: var(--color-primary-50); box-shadow: 0 0 0 1px var(--color-primary-200); }
.list-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.list-card-title { font-size: 15px; font-weight: 600; }
.list-card-sub { font-size: 13px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.list-card-sub .icon { width: 14px; height: 14px; }
.list-card-meta { display: flex; flex-direction: column; gap: 3px; }

.master-detail-pane { padding: 24px; overflow-y: auto; }
@media (max-width: 640px) { .master-detail-pane { padding: 16px; } }
.master-detail-pane.flush { padding: 0; }
.master-detail-pane.flush .back-to-list { margin: 16px 16px 0; }

/* Event editor hero */
.event-hero-media { position: relative; height: 220px; background: var(--color-bg-subtle); }
@media (min-width: 900px) { .event-hero-media { height: 192px; } }
.event-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.event-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,0) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px 24px;
  color: #fff;
}
.event-hero-badge { background: rgba(249,115,22,.9); color: #fff; margin-bottom: 10px; align-self: flex-start; }
.event-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.event-hero-row h1 { font-size: 26px; font-weight: 700; color: #fff; }
.event-hero-loc { display: flex; align-items: center; gap: 6px; font-size: 14px; opacity: .9; }
.event-hero-loc .icon { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .event-hero-row { flex-direction: column; align-items: flex-start; }
  .event-hero-row h1 { font-size: 22px; }
  .event-hero-save { width: 100%; }
}

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.detail-header .detail-sub { font-size: 14px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 8px; }
.detail-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.back-to-list { display: none; }
@media (max-width: 899px) {
  .back-to-list { display: inline-flex; margin-bottom: 16px; }
}

.info-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.info-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--color-primary); }
.info-card-title .icon { width: 18px; height: 18px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 480px) { .info-grid { grid-template-columns: 1fr; } }
.info-grid dt { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 4px; }
.info-grid dd { font-size: 14px; font-weight: 500; margin: 0; }
.info-grid .span-2 { grid-column: 1 / -1; }
.info-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .info-card-grid { grid-template-columns: 1fr; } }

.decision-box {
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.decision-box h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.decision-box-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.contact-person { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.contact-person .avatar { width: 44px; height: 44px; background: var(--color-primary-100); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.contact-person-name { font-weight: 600; font-size: 14px; }
.contact-person-role { font-size: 13px; color: var(--color-text-secondary); }
.contact-line { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 10px 0; border-top: 1px solid var(--color-border-soft); }
.contact-line .icon { width: 16px; height: 16px; color: var(--color-text-secondary); }

.section-block { margin-bottom: 24px; }
.section-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.section-block-head h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-block-head h2 .icon { width: 18px; height: 18px; color: var(--color-primary); }
.section-block-head .count { color: var(--color-text-secondary); font-weight: 400; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--color-bg);
}
.list-row:last-child { margin-bottom: 0; }
.list-row-title { font-size: 14px; font-weight: 500; }
.list-row-sub { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }

.table-actions { display: flex; align-items: center; gap: 6px; }
.table-actions button {
  background: none; border: none; padding: 6px; border-radius: var(--radius-sm); color: var(--color-text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.table-actions button:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.table-actions .icon { width: 16px; height: 16px; }
.qr-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--color-primary-100); color: var(--color-primary);
}
.qr-chip .icon { width: 16px; height: 16px; }

.masked-value { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Employee mobile stacked card (reuses list-row look) */
@media (max-width: 780px) {
  .employee-card { display: flex; flex-direction: column; gap: 8px; }
}

/* ==========================================================================
   Org dashboard: page sections, compact segmented toggle, timeline
   ========================================================================== */
.dash-section { padding: 32px 0; border-bottom: 1px solid var(--color-border); }
.dash-section:last-child { border-bottom: none; }
.dash-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-section-head h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.dash-section-head p { color: var(--color-text-secondary); font-size: 14px; }

.seg-switch.compact { display: inline-grid; padding: 3px; }
.seg-switch.compact a, .seg-switch.compact button { padding: 7px 14px; font-size: 13px; }

.event-card-status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.timeline-list { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding: 0 0 24px 26px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: -18px;
  width: 1px; background: var(--color-border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-text-muted); }
.timeline-item.is-new .timeline-dot { background: var(--color-primary); }
.timeline-date { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 4px; }
.timeline-text { font-size: 14px; margin-bottom: 4px; }
.timeline-actor { font-size: 12px; color: var(--color-text-secondary); }
.timeline-actor strong { color: var(--color-text); font-weight: 500; }

.employee-name-cell { display: flex; align-items: center; gap: 12px; }
.employee-name-cell .avatar { width: 36px; height: 36px; }
.row-menu-btn { background: none; border: none; color: var(--color-text-secondary); padding: 6px; border-radius: var(--radius-sm); display: inline-flex; }
.row-menu-btn:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.row-menu-btn .icon { width: 18px; height: 18px; }

/* ==========================================================================
   History / audit log page
   ========================================================================== */
.history-list-pane { border-right: 1px solid var(--color-border); background: var(--color-bg); }
.history-list-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px; font-size: 14px; font-weight: 600; color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border); }
.history-list-head .icon { width: 16px; height: 16px; }
.history-timeline { padding: 8px; display: flex; flex-direction: column; }
.history-entry {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 14px 12px 14px 34px; position: relative; border-radius: var(--radius-md); cursor: pointer;
}
.history-entry:hover { background: var(--color-bg-subtle); }
.history-entry.is-active { background: var(--color-primary-50); }
.history-entry-dot {
  position: absolute; left: 12px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--color-text-muted); background: var(--color-bg);
}
.history-entry.is-active .history-entry-dot { border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-100); }
.history-entry::after {
  content: ""; position: absolute; left: 17px; top: 32px; bottom: -14px; width: 1px; background: var(--color-border);
}
.history-entry:last-child::after { display: none; }
.history-entry-time { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 4px; }
.history-entry-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.history-entry.is-active .history-entry-title { color: var(--color-primary); }
.history-entry-actor { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); }
.history-entry-actor .avatar { width: 22px; height: 22px; }
.history-entry-actor .avatar-initials { font-size: 10px; }

.history-detail-pane { padding: 24px 32px; overflow-y: auto; }
.history-detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.history-detail-actor { display: flex; align-items: center; gap: 10px; }
.history-detail-actor .avatar { width: 40px; height: 40px; }
.history-detail-actor-name { font-size: 14px; font-weight: 600; }
.history-detail-actor-role { font-size: 12px; color: var(--color-text-secondary); }
.history-detail h1 { font-size: 22px; font-weight: 700; margin: 12px 0 8px; }
.history-detail-time { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-secondary); padding-bottom: 20px; border-bottom: 1px solid var(--color-border); margin-bottom: 24px; }
.history-detail-time .icon { width: 14px; height: 14px; }
.history-detail-section-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-secondary); margin-bottom: 16px; }

.diff-field { margin-bottom: 20px; }
.diff-field-label { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.diff-field-label b { font-weight: 600; }
.diff-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
@media (max-width: 640px) { .diff-row { grid-template-columns: 1fr; } .diff-arrow { display: none; } }
.diff-box { border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; border: 1px solid; }
.diff-box .diff-box-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.diff-box .diff-box-label .icon { width: 13px; height: 13px; }
.diff-box.was { background: var(--color-danger-bg); border-color: rgba(220,38,38,.2); color: var(--color-text); }
.diff-box.was .diff-box-label { color: var(--color-danger); }
.diff-box.now { background: var(--color-bg-app); border-color: var(--color-border); }
.diff-box.now .diff-box-label { color: var(--color-success); }
.diff-arrow { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.diff-arrow .icon { width: 18px; height: 18px; }

/* Mobile combined feed */
.history-feed { display: flex; flex-direction: column; }
.history-feed-item { position: relative; padding: 0 0 24px 24px; }
.history-feed-item::before { content: ""; position: absolute; left: 4px; top: 20px; bottom: 0; width: 1px; background: var(--color-border); }
.history-feed-item:last-child::before { display: none; }
.history-feed-item::after { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-primary); }
.history-feed-time { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 8px; }
.history-feed-time .icon { width: 13px; height: 13px; }
.history-feed-actor { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.history-feed-actor .avatar { width: 28px; height: 28px; }
.history-feed-actor-name { font-size: 14px; font-weight: 600; }
.history-feed-actor-role { font-size: 12px; color: var(--color-text-secondary); font-weight: 400; }
.history-feed-desc { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.history-feed-desc .icon { width: 16px; height: 16px; color: var(--color-primary); margin-top: 2px; flex-shrink: 0; }
.history-feed-card { background: var(--color-bg-app); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 14px; }
.history-feed-card + .history-feed-card { margin-top: 10px; }
.history-feed-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-secondary); margin-bottom: 10px; }
.history-feed-was { color: var(--color-text-secondary); text-decoration: line-through; font-size: 14px; margin-bottom: 8px; }
.history-feed-now { font-size: 14px; }
.history-feed-toggle-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.history-feed-toggle-row .arrow { color: var(--color-text-muted); }
.history-feed-toggle-row .on { color: var(--color-success); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.history-feed-toggle-row .on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); }
.history-feed-toggle-row .off { color: var(--color-text-secondary); }
.history-feed-toggle-row .off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-muted); display:inline-block; margin-right:6px; }
.history-feed-foot { text-align: center; font-size: 13px; color: var(--color-text-secondary); padding-top: 12px; }

/* ==========================================================================
   Photo placeholders (source designs reference photography that isn't
   included in the export) & initials avatars
   ========================================================================== */
.ph-media {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-100) 45%, var(--color-primary-200) 100%);
  color: var(--color-primary);
  position: relative;
  overflow: hidden;
}
.ph-media .icon { width: 34%; height: 34%; max-width: 72px; max-height: 72px; opacity: .5; }
.ph-media.ph-dark {
  background: linear-gradient(135deg, #1E2331 0%, #2B3245 55%, #3E4867 100%);
  color: #fff;
}
.ph-media.ph-dark .icon { opacity: .32; }

.avatar-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
}

/* Empty state (favorites) */
.empty-state {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-app);
  padding: 56px 24px;
  text-align: center;
}
.empty-state .icon-wrap {
  width: 128px; height: 128px; border-radius: 50%;
  background: var(--color-bg-subtle);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; overflow: hidden;
}
.empty-state .icon-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.empty-state .icon-wrap .icon { width: 48px; height: 48px; color: var(--color-text-muted); }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.empty-state p { color: var(--color-text-secondary); max-width: 460px; margin: 0 auto 24px; }

/* ==========================================================================
   App additions: alerts, modals, file inputs, editor, install wizard
   ========================================================================== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px;
  margin-bottom: 20px; border: 1px solid transparent;
}
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: rgba(22,163,74,.25); }
.alert-danger { background: var(--color-danger-bg); color: var(--color-danger); border-color: rgba(220,38,38,.2); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(217,119,6,.25); }
.alert-info { background: var(--color-primary-50); color: var(--color-text); border-color: var(--color-primary-200); }

.field-error { color: var(--color-danger); font-size: 13px; margin-top: 6px; }
.input.has-error { border-color: var(--color-danger); }

/* Modal */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(23,26,31,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.modal-scrim.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--color-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  transform: translateY(12px); transition: transform .15s ease;
}
.modal-scrim.is-open .modal { transform: translateY(0); }
.modal.modal-lg { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; background: var(--color-bg); z-index: 1;
}
.modal-head h2 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--color-text-secondary); padding: 6px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.modal-close .icon { width: 20px; height: 20px; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--color-border); background: var(--color-bg-app); }

/* Employee picker (apply to event) */
.employee-picker { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.employee-picker-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer;
}
.employee-picker-item:hover { border-color: var(--color-primary); }
.employee-picker-item input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.employee-picker-item .employee-picker-info { flex: 1; min-width: 0; }
.employee-picker-item .employee-picker-name { font-size: 14px; font-weight: 500; }
.employee-picker-item .employee-picker-role { font-size: 12px; color: var(--color-text-secondary); }

/* File input */
.file-drop {
  border: 2px dashed var(--color-border); border-radius: var(--radius-md);
  padding: 20px; text-align: center; cursor: pointer; background: var(--color-bg-app);
  position: relative; transition: border-color .15s ease, background .15s ease;
}
.file-drop:hover { border-color: var(--color-primary); background: var(--color-primary-50); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .icon { width: 24px; height: 24px; color: var(--color-text-secondary); margin-bottom: 8px; }
.file-drop-text { font-size: 13px; color: var(--color-text-secondary); }
.file-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.file-preview img, .file-preview .avatar { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; background: var(--color-bg-subtle); }

/* Rich text editor (Quill) */
.editor-wrap .ql-toolbar.ql-snow { border: 1px solid var(--color-border); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--color-bg-app); }
.editor-wrap .ql-container.ql-snow { border: 1px solid var(--color-border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-family: var(--font-sans); font-size: 14px; min-height: 200px; }
.editor-wrap .ql-editor { min-height: 200px; }
.editor-wrap .ql-editor img { max-width: 100%; border-radius: var(--radius-sm); }

.richtext-content { font-size: 14px; line-height: 1.7; color: var(--color-text); }
.richtext-content h1, .richtext-content h2, .richtext-content h3 { font-weight: 700; margin: 20px 0 10px; color: var(--color-text); }
.richtext-content h1:first-child, .richtext-content h2:first-child, .richtext-content h3:first-child { margin-top: 0; }
.richtext-content p { margin: 0 0 12px; }
.richtext-content ul, .richtext-content ol { margin: 0 0 12px; padding-left: 22px; }
.richtext-content li { margin-bottom: 4px; }
.richtext-content a { color: var(--color-primary); text-decoration: underline; }
.richtext-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 12px 0; }
.richtext-content strong { font-weight: 600; }

/* Public event detail page */
.event-detail-hero { background: var(--color-bg-app); border-bottom: 1px solid var(--color-border); padding: 32px 0; }
.event-detail-media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 21/8; max-height: 380px; }
.event-detail-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-detail-media .ph-media { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.event-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.event-detail-sidebar { position: sticky; top: 24px; }
@media (max-width: 899px) {
  .event-detail-layout { grid-template-columns: 1fr; }
  .event-detail-sidebar { position: static; }
  .event-detail-media { aspect-ratio: 16/9; max-height: none; }
}

/* Simple dropdown menu (row actions) */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 180px;
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 6px; z-index: 50; display: none;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu.is-fixed {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 200;
}
.dropdown-menu button, .dropdown-menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--color-text);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--color-bg-subtle); }
.dropdown-menu button.danger, .dropdown-menu a.danger { color: var(--color-danger); }
.dropdown-menu .icon { width: 16px; height: 16px; }

/* Install wizard */
.install-shell { min-height: 100vh; background: var(--color-bg-app); padding: 40px 20px; }
.install-card { max-width: 640px; margin: 0 auto; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.install-head { padding: 32px 32px 0; text-align: center; }
.install-head .auth-icon { margin-bottom: 16px; }
.install-steps { display: flex; justify-content: center; gap: 8px; padding: 20px 32px 0; }
.install-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); }
.install-step-dot.is-active { background: var(--color-primary); width: 22px; border-radius: var(--radius-pill); }
.install-step-dot.is-done { background: var(--color-success); }
.install-body { padding: 28px 32px 32px; }
.requirement-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-border-soft); font-size: 14px; }
.requirement-row:last-child { border-bottom: none; }
.requirement-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.requirement-status.ok { color: var(--color-success); }
.requirement-status.fail { color: var(--color-danger); }
.requirement-status .icon { width: 16px; height: 16px; }

/* Misc small helpers */
.text-center { text-align: center; }
.w-full { width: 100%; }
.mb-0 { margin-bottom: 0 !important; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-16 { gap: 16px; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.avatar.avatar-lg { width: 72px; height: 72px; }
.avatar-photo-input { display: flex; align-items: center; gap: 16px; }
.tag-remove { background: none; border: none; padding: 0; display: inline-flex; color: inherit; opacity: .7; }
.tag-remove:hover { opacity: 1; }
.badge-outline-btn { background: none; border: 1px solid var(--color-border); cursor: pointer; }
[hidden] { display: none !important; }
