/* ============================================================
   MEDIA ROSTER AI — Global Stylesheet
   Pure CSS, no framework needed.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --brand-50: #eef4ff;  --brand-100: #dbe7ff; --brand-200: #bcd2ff;
  --brand-300: #8eb3ff; --brand-400: #5b8aff; --brand-500: #3b66f5;
  --brand-600: #2747e6; --brand-700: #2138c8; --brand-800: #1f30a1; --brand-900: #1d2e7f;
  --slate-50: #f8fafc;  --slate-100: #f1f5f9; --slate-200: #e2e8f0;
  --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b;
  --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --green-50: #ecfdf5;  --green-500: #10b981; --green-600: #059669; --green-700: #047857;
  --amber-50: #fffbeb;  --amber-500: #f59e0b; --amber-600: #d97706; --amber-700: #b45309;
  --rose-50: #fff1f2;   --rose-500: #f43f5e;  --rose-600: #e11d48; --rose-700: #be123c;
  --purple-500: #a855f7; --violet-500: #8b5cf6; --fuchsia-500: #d946ef;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(15,23,42,.07);
  --shadow-lg: 0 20px 40px -10px rgba(15,23,42,.18);
  --radius: 12px;
}

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.grid { display: grid; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }   .gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 {margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}
.mb-1 {margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}
.text-center { text-align: center; }
.hidden { display: none !important; }
.relative{position:relative} .absolute{position:absolute}
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Type ---------- */
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; line-height: 1.5; }
.text-xl { font-size: 1.25rem; line-height: 1.5; }
.text-2xl { font-size: 1.5rem; line-height: 1.3; }
.text-3xl { font-size: 1.875rem; line-height: 1.2; }
.text-4xl { font-size: 2.25rem; line-height: 1.1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; letter-spacing: .06em; }

.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-700 { color: var(--slate-700); }
.text-slate-800 { color: var(--slate-800); }
.text-brand-600 { color: var(--brand-600); }
.text-green-600 { color: var(--green-600); }
.text-amber-600 { color: var(--amber-600); }
.text-rose-600 { color: var(--rose-600); }
.text-white { color: white; }

.gradient-text {
  background: linear-gradient(135deg, #3b66f5, #8b5cf6, #d946ef);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Header / Nav ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
}
.app-header .row { padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem; }
.app-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  background-size: 200% 200%; animation: aiGrad 6s ease infinite;
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; box-shadow: var(--shadow);
}
@keyframes aiGrad { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.app-title { font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.app-subtitle { font-size: .7rem; color: var(--slate-500); line-height: 1.1; }
.live-pill {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .2rem .6rem; border-radius: 999px;
  background: #d1fae5; color: #065f46; font-size: .7rem; font-weight: 600;
}
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.tab-nav {
  display: flex; gap: 2px; overflow-x: auto; padding: 0 .5rem;
  scrollbar-width: thin;
}
.tab-nav::-webkit-scrollbar { height: 4px; }
.tab-nav::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 2px; }
.tab-btn {
  padding: .55rem .9rem; border-bottom: 2px solid transparent;
  color: var(--slate-600); font-size: .85rem; font-weight: 500;
  white-space: nowrap; display: flex; align-items: center; gap: .4rem; transition: all .15s;
}
.tab-btn:hover { color: var(--slate-900); }
.tab-btn.active { border-color: var(--brand-600); color: var(--brand-700); }

/* ---------- Cards ---------- */
.card {
  background: white; border: 1px solid var(--slate-200);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-p { padding: 1.25rem; }
.card:hover { box-shadow: var(--shadow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--brand-600); color: white; }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--slate-100); color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-200); }
.btn-ghost { color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-danger { background: var(--rose-600); color: white; }
.btn-danger:hover { background: var(--rose-700); }
.btn-success { background: var(--green-600); color: white; }
.btn-success:hover { background: var(--green-700); }
.btn-outline { background: white; border-color: var(--slate-300); color: var(--slate-700); }
.btn-outline:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-ai {
  background: linear-gradient(120deg, #8b5cf6, #d946ef);
  color: white;
  background-size: 200% 200%; animation: aiGrad 5s ease infinite;
}
.btn-ai:hover { filter: brightness(1.1); }
.btn-sm { padding: .35rem .65rem; font-size: .75rem; }
.btn-xs { padding: .25rem .5rem; font-size: .7rem; gap: .25rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { padding: .4rem .55rem; }

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

/* ---------- Inputs ---------- */
.field { display: block; }
.field-label {
  display: block; font-size: .8rem; font-weight: 500;
  color: var(--slate-700); margin-bottom: .3rem;
}
.input, .select, .textarea {
  width: 100%; padding: .55rem .75rem;
  border: 1px solid var(--slate-300); border-radius: 8px;
  background: white; font-size: .875rem; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,102,245,.15);
}
.textarea { min-height: 60px; resize: vertical; font-family: inherit; }

/* ---------- Tags / Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px;
  font-size: .7rem; font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-rose { background: #ffe4e6; color: #9f1239; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-slate { background: var(--slate-100); color: var(--slate-700); }

/* Skill chips */
.chip {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 999px;
  background: var(--slate-100); color: var(--slate-700);
  font-size: .7rem; font-weight: 500;
}
.chip-primary { background: var(--brand-100); color: var(--brand-800); font-weight: 600; }
.chip-btn {
  cursor: pointer; border: 1px solid var(--slate-200);
  background: white; transition: all .15s;
}
.chip-btn:hover { border-color: var(--brand-400); }
.chip-btn.active { background: var(--brand-600); color: white; border-color: var(--brand-600); }

/* ---------- Grid systems ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Hero (dashboard) ---------- */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white; border-radius: 16px;
  padding: 1.75rem; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.hero .bg-emoji {
  position: absolute; right: -1.5rem; top: -1.5rem;
  font-size: 8rem; opacity: .12;
}
.hero h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: .25rem; }
.hero p { color: rgba(255,255,255,.85); max-width: 580px; }
.hero .btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hero .btn { background: white; color: #4338ca; }
.hero .btn:hover { background: var(--slate-100); }
.hero .btn.ghost { background: rgba(255,255,255,.15); color: white; border: 1px solid rgba(255,255,255,.3); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.25); }

/* ---------- Stat cards ---------- */
.stat {
  background: white; border-radius: 12px; padding: 1.1rem;
  border: 1px solid var(--slate-200);
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: .65rem;
}
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--slate-800); }
.stat-label { font-size: .75rem; color: var(--slate-500); margin-top: .15rem; }

/* gradient stats (insights) */
.stat-gradient { color: white; border: 0; padding: 1.25rem; border-radius: 14px; box-shadow: var(--shadow); }
.stat-gradient .stat-value { color: white; font-size: 2.5rem; }
.stat-gradient .stat-label { color: rgba(255,255,255,.8); font-size: .7rem; text-transform: uppercase; }
.bg-grad-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-violet { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.bg-grad-amber { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.bg-grad-blue { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.bg-grad-rose { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* ---------- Roster card ---------- */
.roster-card { background: white; border: 1px solid var(--slate-200); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.roster-head { color: white; padding: 1rem 1.25rem; }
.gradient-blue { background: linear-gradient(135deg,#3b82f6,#6366f1); }
.gradient-purple { background: linear-gradient(135deg,#a855f7,#ec4899); }
.gradient-emerald { background: linear-gradient(135deg,#10b981,#14b8a6); }
.gradient-amber { background: linear-gradient(135deg,#f59e0b,#ea580c); }
.gradient-rose { background: linear-gradient(135deg,#f43f5e,#e11d48); }
.gradient-cyan { background: linear-gradient(135deg,#06b6d4,#3b82f6); }
.gradient-fuchsia { background: linear-gradient(135deg,#d946ef,#a855f7); }
.gradient-slate { background: linear-gradient(135deg,#64748b,#334155); }

.roster-head h3 { font-weight: 800; font-size: 1.15rem; }
.roster-head .meta { font-size: .75rem; opacity: .9; }
.roster-head .icon { font-size: 1.8rem; }
.roster-head-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.roster-head-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.roster-head .iconbtn {
  background: rgba(255,255,255,.15); padding: .3rem .65rem;
  border-radius: 8px; font-size: .72rem; color: white; font-weight: 600;
  display: inline-flex; align-items: center; gap: .3rem;
  backdrop-filter: blur(4px); transition: background .15s;
}
.roster-head .iconbtn:hover { background: rgba(255,255,255,.25); }
.roster-head .iconbtn.danger:hover { background: var(--rose-600); }

.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; margin-top: .65rem; }
.progress > div { height: 100%; background: white; border-radius: 999px; transition: width .3s; }

/* Roster body */
.roster-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.assignment {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; border: 1px solid var(--slate-200); border-radius: 10px;
  transition: background .15s;
  flex-wrap: wrap;
}
.assignment:hover { background: var(--slate-50); }
.assignment-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand-50); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.assignment-info { flex: 1 1 140px; min-width: 0; }
.assignment-task { font-weight: 700; color: var(--slate-800); }
.assignment-assignee { font-size: .75rem; color: var(--slate-500); }
.assignment-controls { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.assignment .select { min-width: 180px; }

/* attendance status pill */
.att-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700;
}
.att-pending { background: var(--slate-100); color: var(--slate-600); }
.att-present { background: #d1fae5; color: #065f46; }
.att-late { background: #fef3c7; color: #92400e; }
.att-absent { background: #ffe4e6; color: #9f1239; }
.att-completed { background: #ddd6fe; color: #5b21b6; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: fadeIn .2s ease;
}
.modal {
  background: white; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .25s ease;
}
.modal.wide { max-width: 720px; }
.modal-head {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-weight: 700; }
.modal-body { padding: 1.25rem; overflow: auto; }
.modal-foot { padding: 1rem 1.25rem; border-top: 1px solid var(--slate-200);
  display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

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

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 100;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  padding: .65rem 1rem; border-radius: 10px;
  color: white; font-size: .85rem; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .5rem;
  min-width: 240px; animation: slideUp .2s ease;
}
.toast-info { background: var(--brand-600); }
.toast-success { background: var(--green-600); }
.toast-error { background: var(--rose-600); }
.toast-ai { background: linear-gradient(120deg, #8b5cf6, #d946ef); }

/* ---------- Member card ---------- */
.member-card {
  background: white; border: 1px solid var(--slate-200);
  border-radius: 12px; padding: 1.1rem; transition: box-shadow .15s;
}
.member-card:hover { box-shadow: var(--shadow); }
.member-avatar { font-size: 2.5rem; }
.member-name { font-weight: 700; }
.member-skills { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }

/* ---------- Service card (gradient tile) ---------- */
.service-tile {
  position: relative; overflow: hidden;
  border-radius: 14px; color: white; padding: 1.25rem;
  min-height: 160px; box-shadow: var(--shadow);
}
.service-tile .bg-emoji { position: absolute; right: -1rem; bottom: -2rem; font-size: 8rem; opacity: .15; }

/* ---------- Task tile ---------- */
.task-tile {
  display: flex; align-items: center; gap: .75rem;
  background: white; border: 1px solid var(--slate-200);
  border-radius: 10px; padding: .85rem;
}

/* ---------- Insights bars ---------- */
.bar-row { display: flex; align-items: center; gap: .65rem; }
.bar-track { flex: 1; height: 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b66f5, #8b5cf6); }
.bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #ea580c); }
.bar-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.bar-fill.rose { background: linear-gradient(90deg, #f43f5e, #e11d48); }

/* ---------- Clock-in page ---------- */
.clock-wrap {
  min-height: 100vh; padding: 1.5rem 1rem;
  background: linear-gradient(135deg,#1e293b,#0f172a,#1e1b4b);
  color: white; display: flex; flex-direction: column; align-items: center;
}
.clock-card {
  background: white; color: var(--slate-800);
  border-radius: 18px; padding: 1.5rem;
  width: 100%; max-width: 520px; box-shadow: var(--shadow-lg);
}
.clock-time {
  font-size: 2.5rem; font-weight: 800; text-align: center;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg,#3b66f5,#8b5cf6,#d946ef);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.clock-date { text-align: center; color: var(--slate-500); font-size: .85rem; }

.pin-input {
  font-size: 1.5rem; text-align: center; letter-spacing: .5rem;
  padding: .75rem; border-radius: 12px; border: 2px solid var(--slate-200);
}
.pin-input:focus { border-color: var(--brand-500); outline: 0; }

/* Member selector grid */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .65rem; }
.member-pick {
  background: white; border: 2px solid var(--slate-200);
  border-radius: 12px; padding: .75rem .5rem; text-align: center;
  transition: all .15s; cursor: pointer;
}
.member-pick:hover { border-color: var(--brand-400); transform: translateY(-2px); }
.member-pick .em { font-size: 2rem; display: block; margin-bottom: .25rem; }
.member-pick .nm { font-size: .75rem; font-weight: 600; line-height: 1.2; }

/* Duty list (clock-in) */
.duty {
  background: white; border: 2px solid var(--slate-200);
  border-radius: 14px; padding: 1rem; margin-top: .75rem;
}
.duty-task { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.duty-meta { font-size: .8rem; color: var(--slate-500); margin-top: .25rem; }
.duty-actions { display: flex; gap: .5rem; margin-top: .85rem; flex-wrap: wrap; }
.duty-actions .btn { flex: 1; min-width: 110px; justify-content: center; }

/* ---------- Public view ---------- */
.page-public { background: linear-gradient(180deg,#fafbff,#f1f5f9); min-height: 100vh; }
/* Clock-in page body */
.page-clock { background: linear-gradient(135deg,#1e293b,#0f172a,#1e1b4b); min-height: 100vh; }
.public-hero {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white; padding: 2rem 1rem;
  position: relative; overflow: hidden;
}
.public-hero h1 { font-size: 2rem; font-weight: 800; }
.public-hero p { color: #cbd5e1; }
.public-hero .deco { position: absolute; right: -3rem; top: -3rem; font-size: 14rem; opacity: .1; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 1.25rem; }
  .hero h2 { font-size: 1.35rem; }
  .stat-value { font-size: 1.25rem; }
  .assignment .select { min-width: 0; flex: 1 1 100%; }
}

/* ---------- Print ---------- */
@media print {
  body { background: white; }
  .app-header, .no-print, .tab-nav, footer, .btn { display: none !important; }
  .roster-card { page-break-inside: avoid; box-shadow: none; border: 1px solid #999; }
}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--slate-200); margin: .75rem 0; }
.empty {
  border: 2px dashed var(--slate-300); border-radius: 14px;
  padding: 3rem 1rem; text-align: center; color: var(--slate-500);
}

.scroll-x { overflow-x: auto; }
.spinner {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 3px solid var(--slate-200); border-top-color: var(--brand-500);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   AUTH SCREENS (setup / login)
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(99,102,241,.15), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(139,92,246,.15), transparent 45%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 60px -10px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden;
}
.auth-brand {
  text-align: center;
  padding: 2rem 1.5rem 1.25rem;
  background: linear-gradient(135deg, #eef4ff, #ede9fe);
  border-bottom: 1px solid var(--slate-100);
}
.auth-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg,#3b66f5,#8b5cf6);
  color: white;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  box-shadow: 0 10px 25px -5px rgba(59,102,245,.4);
}
.auth-brand h1 {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg,#3b66f5,#8b5cf6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .25rem;
}
.auth-brand p { font-size: .85rem; color: var(--slate-500); }
.auth-body { padding: 1.5rem; }
.auth-tip {
  background: linear-gradient(135deg, #f0f9ff, #ede9fe);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: .75rem;
  font-size: .75rem;
  color: #4338ca;
  margin-top: 1rem;
  display: flex; align-items: flex-start; gap: .5rem;
}
.auth-tip i { margin-top: 2px; }
.auth-links {
  display: flex; justify-content: center; gap: 1.25rem;
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
  font-size: .8rem;
}
.auth-links a { color: var(--slate-500); text-decoration: none; }
.auth-links a:hover { color: var(--brand-600); }
.auth-links i { margin-right: .25rem; }

/* ============================================================
   BOOT LOADER (in HTML shell)
   ============================================================ */
.boot-loader {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
  color: var(--slate-500);
}
.spinner-lg {
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 4px solid var(--slate-200); border-top-color: var(--brand-500);
  animation: spin .9s linear infinite;
}

/* ============================================================
   ONBOARDING CHECKLIST
   ============================================================ */
.onboard-step {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: .75rem;
  background: linear-gradient(135deg, #fafbff, #f5f3ff);
  border: 1px solid var(--slate-200);
}
.onboard-num {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg,#3b66f5,#8b5cf6);
  color: white; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px -2px rgba(59,102,245,.4);
}

/* ============================================================
   MISC HELPERS
   ============================================================ */
.btn-lg { padding: .85rem 1.25rem; font-size: 1rem; font-weight: 600; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.hide-sm { display: inline; }
@media (max-width: 480px) {
  .hide-sm { display: none; }
  .auth-wrap { padding: 1rem; }
  .auth-card { border-radius: 16px; }
  .auth-brand { padding: 1.5rem 1rem 1rem; }
  .auth-body { padding: 1.25rem; }
  .onboard-step { padding: .75rem; gap: .75rem; }
  .onboard-num { width: 30px; height: 30px; font-size: .85rem; }
}

/* Improve empty state look (override) */
.empty {
  border: 2px dashed var(--slate-300);
  border-radius: 16px;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--slate-500);
  background: linear-gradient(180deg, #fafbff, white);
}

/* ============================================================
   PENDING MEMBER (self-registration awaiting approval)
   ============================================================ */
.member-card { position: relative; }
.member-pending {
  background: linear-gradient(180deg, #fffbeb, white);
  border-color: #fde68a !important;
}
.pending-ribbon {
  position: absolute;
  top: 8px; right: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .05em;
  padding: .2rem .55rem;
  border-radius: 999px;
  box-shadow: 0 4px 10px -2px rgba(245,158,11,.35);
}
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.btn-success:hover { filter: brightness(1.05); }

/* ============================================================
   Recovery Code Display & Input
   ============================================================ */
.recovery-code {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  padding: 1.1rem 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 2px dashed var(--brand-500, #8b5cf6);
  border-radius: 12px;
  color: #4c1d95;
  margin: 1rem 0;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
@media (max-width: 480px) {
  .recovery-code { font-size: 1.05rem; letter-spacing: 1px; padding: .9rem .5rem; }
}
.recovery-input {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}
.recovery-input::placeholder {
  letter-spacing: 1px;
  text-transform: none;
  font-weight: 400;
  color: var(--slate-400, #94a3b8);
}

/* ============================================================
   Member PIN inline controls (admin member card)
   ============================================================ */
.pin-row {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .55rem;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  font-size: .85rem;
}
.pin-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #6b21a8;
  text-transform: uppercase;
}
.pin-value {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #4c1d95;
  letter-spacing: 1px;
  user-select: all;
}
.pin-mini-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b21a8;
  font-size: .75rem;
  transition: background .15s, border-color .15s;
}
.pin-mini-btn:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}
.pin-mini-btn:active { transform: scale(.92); }

/* ============================================================
   Admin PIN Manager Table
   ============================================================ */
.pin-table {
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-height: 60vh;
  overflow-y: auto;
}
.pin-row-head {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .65rem .85rem;
  background: var(--slate-100, #f1f5f9);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate-600, #475569);
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 1;
}
.pin-table-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
  transition: background .15s;
}
.pin-table-row:last-child { border-bottom: none; }
.pin-table-row:hover { background: #faf5ff; }
.pin-table-row.pin-pending {
  background: #fffbeb;
}
.pin-table-row.pin-pending:hover {
  background: #fef3c7;
}
.pin-big {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: #4c1d95;
  user-select: all;
}
.pin-pending .pin-big { color: #b45309; }
@media (max-width: 560px) {
  .pin-row-head, .pin-table-row {
    grid-template-columns: 1fr auto;
  }
  .pin-row-head > :nth-child(2),
  .pin-table-row > :nth-child(2) {
    grid-column: 1 / -1;
  }
  .pin-big { font-size: 1rem; }
}

/* ============================================================
   Clock-in page Join Banner (onboarding CTA)
   ============================================================ */
.join-banner {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.25rem;
  background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, .55);
  position: relative;
  overflow: hidden;
}
.join-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,.15), transparent 60%);
  pointer-events: none;
}
.join-banner > * { position: relative; z-index: 1; }
.join-banner .btn {
  background: #fff;
  color: #4c1d95;
  font-weight: 700;
  border: none;
  white-space: nowrap;
}
.join-banner .btn:hover {
  background: #f5f3ff;
  color: #3b0764;
}
.join-banner-icon {
  font-size: 1.85rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
@media (max-width: 480px) {
  .join-banner { flex-direction: column; text-align: center; }
  .join-banner .btn { width: 100%; }
}
