/* Sift Crawler Dashboard styles (no external libs besides Bootstrap + Google Fonts) */
:root{
  --bg:#f6f7ff;
  --panel:#ffffff;
  --ink:#1f2533;
  --muted:#6d7390;
  --primary:#6b6be6;
  --primary-2:#8b7cff;
  --stroke:rgba(90, 96, 140, .16);
  --shadow:0 18px 55px rgba(34, 38, 70, .12);
  --shadow-soft:0 10px 30px rgba(34, 38, 70, .10);
  --radius:18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body.app-body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 400px at 30% 45%, rgba(107,107,230,.12), transparent 65%),
              radial-gradient(800px 400px at 85% 15%, rgba(139,124,255,.12), transparent 60%),
              var(--bg);
  color:var(--ink);
  overflow-x:hidden;
}

.app-topbar{
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
  padding: 14px 0;
  position: sticky;
  top:0;
  z-index: 50;
  animation: fadeDown .7s ease both;
}

@keyframes fadeDown{
  from{ opacity:0; transform: translateY(-10px); }
  to{ opacity:1; transform: translateY(0); }
}

.brand-mark{
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(107,107,230,.14), rgba(139,124,255,.10));
  display:grid; place-items:center;
  box-shadow: 0 10px 22px rgba(107,107,230,.18);
  border: 1px solid rgba(107,107,230,.18);
}
.brand-title{
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .2px;
  color:#27304a;
}

.search-shell{
  position: relative;
  width: min(520px, 100%);
}
.search-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(39,48,74,.55);
}
.search-input{
  padding-left: 44px !important;
  height: 44px;
  border-radius: 14px;
  border:1px solid rgba(90,96,140,.16);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 26px rgba(34, 38, 70, .06);
}
.search-input:focus{
  border-color: rgba(107,107,230,.45);
  box-shadow: 0 12px 34px rgba(107,107,230,.16);
}

.icon-btn{
  width: 42px; height: 42px;
  border-radius: 14px;
  border:1px solid rgba(90,96,140,.16);
  background: rgba(255,255,255,.8);
  display:grid; place-items:center;
  color: rgba(39,48,74,.72);
  box-shadow: 0 10px 26px rgba(34, 38, 70, .06);
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.icon-btn:hover{ transform: translateY(-1px); box-shadow: 0 16px 34px rgba(34,38,70,.10); }
.icon-btn:active{ transform: translateY(0); }
.badge-dot{
  position:absolute;
  right: 10px;
  top: 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ff466d;
  border:2px solid rgba(255,255,255,.9);
}

.profile-chip{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 16px;
  border:1px solid rgba(90,96,140,.16);
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 26px rgba(34, 38, 70, .06);
}
.profile-avatar{
  width: 34px; height: 34px;
  border-radius: 12px;
  overflow:hidden;
  background: rgba(107,107,230,.12);
}
.profile-avatar img{ width:100%; height:100%; object-fit:cover; }
.profile-name{ font-weight:600; font-size: 14px; line-height: 1.1; }
.profile-role{ color: var(--muted); font-size: 12px; }

.app-main{
  animation: fadeUp .7s ease .05s both;
}
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.domain-badge{
  width: 44px; height: 44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(107,107,230,.12);
  border:1px solid rgba(107,107,230,.18);
  color: rgba(39,48,74,.72);
}
.domain-title{
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .2px;
  color:#253050;
}

/* iOS-style switch */
.switch { position: relative; display: inline-block; width: 60px; height: 32px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(90, 96, 140, .20);
  transition: .2s;
  border-radius: 999px;
  border:1px solid rgba(90,96,140,.18);
}
.slider:before {
  position: absolute; content: "";
  height: 26px; width: 26px;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  background-color: white;
  transition: .2s;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(34,38,70,.18);
}
.switch input:checked + .slider { background-color: rgba(107,107,230,.55); }
.switch input:checked + .slider:before { transform: translate(28px, -50%); }

/* KPI cards */
.kpi-card{
  position: relative;
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(90,96,140,.14);
  box-shadow: var(--shadow-soft);
  overflow:hidden;
  min-height: 86px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi-icon{
  width: 44px; height: 44px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: linear-gradient(180deg, rgba(107,107,230,.18), rgba(139,124,255,.10));
  border: 1px solid rgba(107,107,230,.16);
  color: rgba(39,48,74,.70);
}
.kpi-value{ font-size: 30px; font-weight: 800; letter-spacing: .3px; }
.kpi-label{ color: var(--muted); font-weight: 600; margin-top: -2px; }

.hero-card{
  position: relative;
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(90,96,140,.14);
  box-shadow: var(--shadow-soft);
  overflow:hidden;
  min-height: 320px;
}
.hero-art{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.95;
}
.hero-glow{
  position:absolute;
  width: 520px; height: 520px;
  left:-180px; top: 40px;
  background: radial-gradient(circle at 40% 40%, rgba(107,107,230,.28), transparent 60%);
  filter: blur(2px);
}
.hero-stream{
  position:absolute;
  width: 120%;
  height: 16px;
  left: -10%;
  top: 60%;
  background: linear-gradient(90deg, rgba(107,107,230,0), rgba(107,107,230,.45), rgba(139,124,255,.25), rgba(107,107,230,0));
  border-radius: 999px;
  filter: blur(.2px);
  transform: rotate(-12deg);
  animation: stream 4s ease-in-out infinite;
}
.hero-stream-2{
  top: 70%;
  opacity:.75;
  animation-delay: -1.2s;
}
@keyframes stream{
  0%,100%{ transform: translateX(-6%) rotate(-12deg); opacity:.55; }
  50%{ transform: translateX(6%) rotate(-12deg); opacity:1; }
}
.hero-tile{
  position:absolute;
  width: 64px; height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(90,96,140,.14);
  box-shadow: 0 16px 30px rgba(34,38,70,.10);
  animation: floaty 5.2s ease-in-out infinite;
}
.hero-tile:before{
  content:"";
  position:absolute;
  inset: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(107,107,230,.18), rgba(139,124,255,.10));
}
.hero-tile-1{ left: 18%; top: 44%; animation-delay: -0.8s; }
.hero-tile-2{ left: 28%; top: 36%; width: 74px; }
.hero-tile-3{ left: 38%; top: 48%; width: 54px; animation-delay: -1.6s; }
.hero-tile-4{ left: 46%; top: 40%; width: 68px; animation-delay: -2.1s; }
@keyframes floaty{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-10px); }
}

.hero-copy{
  position: relative;
  padding: 22px;
  max-width: 520px;
}
.hero-title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #253050;
}
.hero-subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
}
kbd{
  background: rgba(39,48,74,.08);
  border:1px solid rgba(90,96,140,.18);
  border-bottom-width:2px;
  padding: 2px 6px;
  border-radius: 8px;
}

.pill{
  font-size: 12px;
  font-weight: 700;
  color: rgba(39,48,74,.70);
  border: 1px solid rgba(90,96,140,.16);
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  padding: 6px 10px;
}

/* Info cards */
.info-card{
  position: relative;
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(90,96,140,.14);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  overflow:hidden;
}
.info-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 800;
  color:#2a3351;
  margin-bottom: 10px;
}
.info-icon{
  width: 36px; height: 36px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(107,107,230,.12);
  border: 1px solid rgba(107,107,230,.16);
  color: rgba(39,48,74,.72);
}
.info-divider{
  height: 1px;
  background: rgba(90,96,140,.14);
  margin: 12px 0;
}
.info-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 14px;
  padding: 7px 0;
}
.info-label{ color: var(--muted); font-weight: 700; font-size: 13px; }
.info-value{
  font-size: 22px;
  font-weight: 900;
}
.info-value-sm{
  font-weight: 800;
  color:#2a3351;
  text-align:right;
  word-break: break-word;
}
.btn-pill{
  border-radius: 16px !important;
  padding: 12px 16px !important;
  box-shadow: 0 18px 35px rgba(107,107,230,.22);
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border: none !important;
}
.btn-pill:hover{ filter: brightness(1.03); }
.btn-pill:active{ filter: brightness(.98); }

/* Status bar */
.status-bar{
  border-radius: 16px;
  border: 1px solid rgba(90,96,140,.14);
  background: rgba(255,255,255,.66);
  padding: 10px 14px;
  display:flex;
  align-items:center;
  gap: 10px;
  color: rgba(39,48,74,.76);
  box-shadow: 0 10px 26px rgba(34, 38, 70, .06);
}
.status-dot{
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(39,48,74,.30);
}
.status-dot.ok{ background: rgba(42, 198, 143, .95); }
.status-dot.busy{ background: rgba(255, 179, 64, .95); animation: pulse 1.2s ease-in-out infinite; }
.status-dot.bad{ background: rgba(255, 70, 109, .95); }
@keyframes pulse{
  0%,100%{ transform: scale(1); opacity:.7; }
  50%{ transform: scale(1.25); opacity:1; }
}

/* Loading shimmer state */
body.is-loading .kpi-shimmer,
body.is-loading .info-shimmer{
  opacity: 1;
}
.kpi-shimmer, .info-shimmer{
  position:absolute;
  inset:0;
  opacity:0;
  pointer-events:none;
  background: linear-gradient(110deg, rgba(240,242,255,0) 0%, rgba(240,242,255,.7) 35%, rgba(240,242,255,0) 70%);
  transform: translateX(-40%);
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer{
  0%{ transform: translateX(-60%); }
  100%{ transform: translateX(60%); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
