/* =========================================================
   Legacy Compatibility Bridge
   Maps old class names to the new Executive Ops system
   so non-migrated templates continue to render.
   ========================================================= */

/* Layout shell aliases */
.app-shell { min-height: 100vh; display: flex; }
.app-main  { margin-left: var(--eh-sidebar-width); width: calc(100% - var(--eh-sidebar-width)); min-height: 100vh; display: flex; flex-direction: column; }
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { text-align: center; padding: 1.5rem 0; border-top: 1px solid var(--eh-border); color: var(--eh-muted); font-size: 0.82rem; font-weight: 650; }
@media (max-width: 991.98px) { .app-main { margin-left: 0; width: 100%; } }

/* Legacy cards — padded by default so content never hugs the edge */
.app-card { background: var(--eh-card); border: 1px solid var(--eh-border); border-radius: var(--eh-radius-2xl); box-shadow: var(--eh-shadow-card); padding: 1.6rem 1.75rem; }
.app-card + .app-card { margin-top: 1.5rem; }
/* Cards that manage their own header/body spacing opt out of the default padding */
.app-card:has(> .app-card-header) { padding: 0; }
.app-card-header { padding: 1.5rem 1.75rem 0; }
.app-card-title { margin: 0; font-size: 1.05rem; font-weight: 950; letter-spacing: -0.04em; }

/* Legacy stat card (non-dashboard pages) */
.stat-card { background: var(--eh-card); border: 1px solid var(--eh-border); border-radius: var(--eh-radius-xl); box-shadow: var(--eh-shadow-soft); padding: 1.25rem; }

/* Legacy icon-badge system */
.icon-badge { width: 44px; height: 44px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.15rem; }
.icon-sm { width: 32px; height: 32px; border-radius: 11px; font-size: 0.95rem; }
.icon-lg { width: 56px; height: 56px; border-radius: 22px; font-size: 1.45rem; }
.icon-blue { background: var(--eh-soft-blue); color: var(--eh-blue); }
.icon-cyan { background: var(--eh-soft-cyan); color: #0891b2; }
.icon-teal { background: var(--eh-soft-teal); color: #0f9f8f; }
.icon-green { background: var(--eh-soft-green); color: #16a34a; }
.icon-amber { background: var(--eh-soft-amber); color: #d97706; }
.icon-orange { background: var(--eh-soft-orange); color: #ea580c; }
.icon-red { background: var(--eh-soft-red); color: #dc2626; }
.icon-purple { background: var(--eh-soft-purple); color: #7c3aed; }
.icon-pink { background: var(--eh-soft-pink); color: #db2777; }
.icon-slate { background: var(--eh-soft-slate); color: #475569; }

/* Legacy sidebar nav (for any template that might still reference it directly) */
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 16px; color: rgba(255,255,255,0.72); font-weight: 800; margin-bottom: 0.25rem; transition: 0.16s ease; text-decoration: none; }
.sidebar-link:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.sidebar-link.active { color: #ffffff; background: linear-gradient(135deg, rgba(6,182,212,0.22), rgba(15,111,255,0.24)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.sidebar-section-title { margin: 1.1rem 0 0.4rem; padding: 0 0.65rem; color: rgba(255,255,255,0.42); font-size: 0.7rem; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-icon { width: 32px; height: 32px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.08); color: #67e8f9; }

/* Legacy user chip / avatar */
.user-chip { display: flex; align-items: center; gap: 0.5rem; }
.avatar { width: 38px; height: 38px; border-radius: 14px; background: linear-gradient(135deg, var(--eh-blue), var(--eh-purple)); color: #ffffff; display: grid; place-items: center; font-weight: 950; }

/* Legacy global search */
.global-search { max-width: 640px; height: 46px; border-radius: var(--eh-radius-pill); border: 1px solid #dfeaf5; background: #f8fbff; display: flex; align-items: center; gap: 0.65rem; padding: 0 1rem; color: var(--eh-muted); }
.global-search input { border: none; background: transparent; outline: none; width: 100%; color: var(--eh-text); font-weight: 650; }

/* Legacy soft buttons */
.btn-soft-blue { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-blue); color: var(--eh-blue); }
.btn-soft-teal { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-teal); color: #0f9f8f; }
.btn-soft-green { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-green); color: #16a34a; }
.btn-soft-purple { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-purple); color: #7c3aed; }
.btn-soft-slate { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-slate); color: #475569; }
.btn-soft-cyan { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-cyan); color: #0891b2; }
.btn-soft-amber { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-amber); color: #d97706; }
.btn-soft-orange { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-orange); color: #ea580c; }
.btn-soft-red { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-red); color: #dc2626; }
.btn-soft-pink { border-radius: var(--eh-radius-pill); font-weight: 900; border: 1px solid var(--eh-border); background: var(--eh-soft-pink); color: #db2777; }

/* Page header — a bold colored banner so every page has punch, not just the dashboard */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.85rem; flex-wrap: wrap;
  position: relative; overflow: hidden;
  padding: 1.6rem 1.85rem;
  border-radius: var(--eh-radius-2xl);
  border: 1px solid color-mix(in srgb, var(--eh-primary) 22%, transparent);
  border-left: 6px solid var(--eh-primary);
  /* All tints derive from the active theme's --eh-primary so the banner
     re-colours instantly when the theme changes (navy/forest/maroon/…). */
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--eh-primary) 30%, transparent), transparent 45%),
    radial-gradient(circle at 0% 120%, color-mix(in srgb, var(--eh-primary-hover, var(--eh-primary)) 18%, transparent), transparent 48%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--eh-primary) 22%, transparent) 0%,
      color-mix(in srgb, var(--eh-primary) 9%, transparent) 40%,
      #ffffff 78%);
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--eh-primary) 50%, transparent);
}
.page-header > div:first-child { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.page-header .page-actions { position: relative; z-index: 1; }
.page-header .page-kicker { color: var(--eh-primary); font-weight: 800; letter-spacing: 0.08em; }
.page-header h1 { margin-bottom: 0.15rem; font-weight: 950; letter-spacing: -0.045em; }
.page-header p { margin-bottom: 0; color: var(--eh-slate, #475569); font-weight: 600; }
@media (max-width: 767.98px) {
  /* Compact the banner on phones so it doesn't eat the first screen */
  .page-header {
    flex-direction: column; align-items: stretch;
    padding: 1.05rem 1.15rem; border-radius: 20px; margin-bottom: 1.15rem;
    border-left-width: 5px;
  }
  .page-header h1 { font-size: 1.45rem; }
  .page-header p { font-size: 0.84rem; }
  .page-header .page-kicker { font-size: 0.68rem; }
  .page-header .page-actions { width: 100%; margin-top: 0.85rem; }
  .page-header .page-actions .btn { flex: 1 1 auto; }
}

/* Vivid card titles + section accents for more colour across pages */
.app-card-title { color: var(--eh-navy-900, #0f172a); }
.app-card-title i { color: var(--eh-primary); }
.stat-card .stat-value, .eh-stat-value { letter-spacing: -0.04em; }

/* Legacy focus-visible already in design-system.css, keep there */
.card-hover { transition: transform 0.16s ease, box-shadow 0.16s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--eh-shadow-card); }
