:root {
  --pfe-primary: #4f46e5;
  --pfe-primary-2: #7c3aed;
  --pfe-bg: #f5f6fb;
  --pfe-card: #ffffff;
  --pfe-border: #e6e8f0;
  --pfe-muted: #6b7280;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body { background: var(--pfe-bg); color: #1f2937; }
.btn-primary { --bs-btn-bg: var(--pfe-primary); --bs-btn-border-color: var(--pfe-primary); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; }
.btn-outline-primary { --bs-btn-color: var(--pfe-primary); --bs-btn-border-color: var(--pfe-primary); --bs-btn-hover-bg: var(--pfe-primary); --bs-btn-hover-border-color: var(--pfe-primary); }
.text-primary { color: var(--pfe-primary) !important; }
.bg-primary-subtle { background: #eef2ff !important; }

/* navbar */
.app-nav { background: linear-gradient(100deg, var(--pfe-primary), var(--pfe-primary-2)); box-shadow: 0 4px 20px rgba(79,70,229,.25); }
.app-nav .navbar-brand { color: #fff; }
.app-nav .nav-link { color: rgba(255,255,255,.8); font-weight: 500; border-radius: 8px; padding: .45rem .8rem !important; }
.app-nav .nav-link:hover, .app-nav .nav-link.active { color: #fff; background: rgba(255,255,255,.15); }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; background: rgba(255,255,255,.18); border-radius: 10px; color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; }
.app-footer { color: var(--pfe-muted); }

/* cards */
.card { border: 1px solid var(--pfe-border); border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--pfe-border); font-weight: 600; padding: .9rem 1.1rem; }
.section-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--pfe-primary); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; font-weight: 700; flex: none; }
.muted { color: var(--pfe-muted); }

/* hero */
.hero { background: linear-gradient(120deg, #eef2ff, #f5f3ff); border: 1px solid #e0e7ff; border-radius: 18px; padding: 1.4rem 1.6rem; }
.stat { background: #fff; border: 1px solid var(--pfe-border); border-radius: 14px; padding: 1rem 1.2rem; height: 100%; }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pfe-muted); font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.stat .sub { font-size: .8rem; color: var(--pfe-muted); }

/* deadlines */
.deadline { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: .3rem .7rem; border-radius: 999px; }
.deadline.passed { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* theme lists */
.theme-list { list-style: none; margin: 0; padding: 0; }
.theme-item { background: #fff; border: 1px solid var(--pfe-border); border-radius: 12px; padding: .7rem .85rem; margin-bottom: .5rem; display: flex; gap: .7rem; align-items: flex-start; transition: box-shadow .15s, border-color .15s; }
.theme-item:hover { border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(79,70,229,.08); }
.theme-item .t-title { font-weight: 600; font-size: .93rem; line-height: 1.35; }
.theme-item .t-meta { font-size: .8rem; color: var(--pfe-muted); margin-top: .15rem; }
.theme-item .t-actions { margin-left: auto; flex: none; }
#myList .theme-item { cursor: grab; border-left: 4px solid var(--pfe-primary); }
#myList .theme-item:active { cursor: grabbing; }
.theme-item.theme-own-pending { background: #fff1f2; border-color: #fda4af; }
#myList .theme-item.theme-own-pending { border-left-color: #fb7185; }
.theme-item.theme-own-accepted { background: #f0fdf4; border-color: #86efac; }
#myList .theme-item.theme-own-accepted { border-left-color: #22c55e; }
.incubator-pending { background: #ffedd5; color: #9a3412; }
.incubator-box { background: #fff7ed; border: 1px solid #fed7aa; }
.own-pending-badge { background: #fda4af; color: #881337; }
.who-list { list-style: none; margin: .35rem 0 0; padding: 0; font-size: .8rem; }
.who-list li { display: inline-flex; align-items: center; gap: .3rem; background: #f1f5f9; border-radius: 999px; padding: .12rem .55rem; margin: 0 .25rem .25rem 0; }
.who-list .pos { font-weight: 700; color: var(--pfe-primary); }
.rank-pill { flex: none; min-width: 30px; height: 30px; border-radius: 8px; background: var(--pfe-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.drag-handle { color: #9ca3af; flex: none; padding-top: .2rem; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 10px 25px rgba(79,70,229,.25) !important; }
.empty-drop { border: 2px dashed #c7d2fe; border-radius: 12px; padding: 2rem 1rem; text-align: center; color: var(--pfe-muted); }
.scroll-box { max-height: 70vh; overflow-y: auto; padding-right: .25rem; }
.save-state { font-size: .8rem; }

/* tags */
.spec-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .12rem .45rem; border-radius: 6px; background: #f1f5f9; color: #475569; margin: .1rem .15rem 0 0; }
.demand { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; border-radius: 999px; padding: .25rem .7rem; font-size: .85rem; background: #eef2ff; color: var(--pfe-primary); transition: transform .3s; }
.demand.zero { background: #f3f4f6; color: #9ca3af; }
.demand.bump { transform: scale(1.15); }
.live-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.6) } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0) } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0) } }

/* auth pages */
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #c7d2fe 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ddd6fe 0%, transparent 60%), #f5f6fb; }
.auth-wrap { min-height: calc(100vh - 70px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(79,70,229,.12); padding: 2.2rem; border: 1px solid #eef0f6; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--pfe-primary), var(--pfe-primary-2)); color: #fff; display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto 1rem; box-shadow: 0 10px 24px rgba(79,70,229,.35); }
.auth-wrap > .alert { width: 100%; max-width: 460px; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .85rem; border-color: #dfe3ec; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(79,70,229,.15); }
.btn { border-radius: 10px; font-weight: 600; }
.btn-lg { padding: .7rem 1.2rem; }

/* tables */
.table-modern { --bs-table-bg: transparent; }
.table-modern thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pfe-muted); font-weight: 700; border-bottom-width: 1px; white-space: nowrap; }
.table-modern td { vertical-align: middle; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; color: #4b5563; }
.nav-pills .nav-link.active { background: var(--pfe-primary); }
.admin-tabs { gap: .35rem; flex-wrap: wrap; }
.badge-soft { background: #eef2ff; color: var(--pfe-primary); }
.method-wish { background: #dcfce7; color: #166534; }
.method-random { background: #fef3c7; color: #92400e; }
.method-proposal { background: #e0e7ff; color: #3730a3; }
.method-manual { background: #f3e8ff; color: #6b21a8; }
.invite-card { border: 2px solid #fcd34d; background: #fffbeb; }
@media (max-width: 576px) { .auth-card { padding: 1.5rem; } .stat .value { font-size: 1.3rem; } }
