/* Ydev: S&F Shop layout, dark theme, red accent */
:root {
  color-scheme: dark;
  --bg: #000; --card: #0c0d10; --card-2: #131519; --input: #0a0b0d;
  --line: #24272e; --text: #eceef2; --text-2: #c9ccd4; --muted: #8a909c;
  --brand: #ef233c; --brand-hover: #ff4356; --on-brand: #fff;
  --brand-soft: rgba(239, 35, 60, .14); --brand-softer: rgba(239, 35, 60, .07);
  --side: #050506; --side-text: #a3a8b3;
  --green: #4ade80; --amber: #fbbf24; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font: 14.5px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.2px; }
h2 { font-size: 16px; font-weight: 650; }
svg.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(600px 420px at 50% 40%, rgba(239, 35, 60, .11), transparent 70%); }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px 26px 24px; }
.login-card img { display: block; width: 104px; height: 104px; margin: 0 auto 10px; }
.login-card .word { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 3px; margin-bottom: 20px; }
.login-card .word b { color: var(--brand); font-weight: 800; }
.field { display: block; width: 100%; height: 46px; background: var(--input); border: 1px solid var(--line); border-radius: 9px; padding: 0 13px; margin-bottom: 13px; outline: 0; }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn-main { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border: 0; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-weight: 700; cursor: pointer; }
.btn-main:hover { background: var(--brand-hover); }
.btn-main:disabled { opacity: .6; }
.err { color: #ff8391; font-size: 13px; min-height: 19px; margin: -5px 0 7px; }
.get-app { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; margin-top: 15px; }
.get-app svg.i { width: 16px; height: 16px; }
.get-app:hover { color: var(--text); }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 16px; }
.brand img { width: 40px; height: 40px; }
.brand .name { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: .4px; }
.brand .tag { font-size: 11.5px; }
.side nav { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; font-weight: 500; }
.side nav a:hover { background: #111216; color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; font-weight: 650; box-shadow: 0 4px 16px rgba(239, 35, 60, .32); }
.side-foot { margin-top: auto; border-top: 1px solid #16171b; padding: 13px 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 34px; height: 34px; }
.who .n { color: #fff; font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.who .r { font-size: 12px; }
.icon-btn { margin-left: auto; background: none; border: 0; color: var(--side-text); padding: 6px; cursor: pointer; display: flex; }
.icon-btn:hover { color: #fff; }
.online { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--green); margin-top: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.up { background: var(--green); box-shadow: 0 0 7px rgba(74, 222, 128, .7); }
.dot.down { background: var(--brand); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 62px; display: flex; align-items: center; gap: 18px; padding: 0 24px; border-bottom: 1px solid #16171b; background: rgba(5, 5, 6, .92); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.top .date { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.top .date span { color: var(--muted); font-weight: 400; margin-left: 9px; }
.search { margin-left: auto; width: 100%; max-width: 460px; position: relative; }
.search svg.i { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; height: 42px; background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 0 13px 0 39px; outline: 0; }
.search input:focus { border-color: var(--brand); }
.top-logo { display: none; }
.page { padding: 22px 24px 40px; max-width: 1500px; width: 100%; }
.page-head { margin-bottom: 18px; }

/* KPI row */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-ic.a { background: #ef233c; } .kpi-ic.b { background: #a4101f; } .kpi-ic.c { background: #16a34a; } .kpi-ic.d { background: #2a2c33; }
.kpi .l { color: var(--text-2); font-size: 13px; }
.kpi .v { font-size: 25px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 12.5px; }

/* panels */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin-bottom: 12px; }
.pills { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.pill { flex: none; height: 38px; padding: 0 17px; border-radius: 19px; background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-weight: 500; }
.pill.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }

/* project tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 13px; }
.tile { display: flex; flex-direction: column; background: rgba(239, 35, 60, .035); border: 1px solid #2c1a1d; border-radius: 12px; overflow: hidden; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.thumb { aspect-ratio: 16 / 10; background: var(--card-2); position: relative; overflow: hidden; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.thumb .mono { font-size: 34px; font-weight: 800; color: var(--brand); }
.badge { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: rgba(0, 0, 0, .78); border: 1px solid var(--line); color: var(--text-2); }
.tile-b { padding: 11px 13px 13px; }
.tile-b .n { font-weight: 650; display: flex; align-items: center; gap: 7px; }
.tile-b .t { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* actions */
.actions { display: flex; flex-direction: column; gap: 9px; }
.act { display: flex; align-items: center; gap: 11px; height: 50px; padding: 0 14px; border-radius: 9px; font-weight: 650; color: #fff; }
.act:hover { filter: brightness(1.15); }
.act.r1 { background: #ef233c; } .act.r2 { background: #b3162a; } .act.r3 { background: #7a1020; } .act.g { background: #2a2c33; }
.status-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid #191b20; font-size: 13.5px; }
.status-row:first-of-type { border-top: 0; }
.status-row .ms { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* project page */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 12px; font-size: 13.5px; }
.back:hover { color: var(--text); }
.detail-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.detail-head .sub { color: var(--text-2); margin-top: 3px; }
.state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.btns { display: flex; flex-wrap: wrap; gap: 9px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 17px; border-radius: 9px; font-weight: 650; background: var(--card-2); border: 1px solid var(--line); cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.red { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.red:hover { background: var(--brand-hover); }
.about { color: var(--text-2); }
.feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feats li { display: flex; gap: 9px; color: var(--text-2); font-size: 13.5px; }
.feats svg.i { width: 17px; height: 17px; color: var(--brand); margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .tag { font-size: 12px; padding: 3px 10px; border-radius: 12px; background: var(--brand-soft); color: #ff8e9b; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 13px; }
.shot { padding: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: zoom-in; text-align: left; }
.shot:hover { border-color: var(--brand); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shot span { display: block; padding: 8px 11px; font-size: 13px; font-weight: 550; }
.shot small { display: block; color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); padding: 28px 10px; text-align: center; }

/* lists */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card h3 { font-size: 15px; font-weight: 650; }
.card .about { font-size: 13.5px; margin: 7px 0 11px; }
.dl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dl img, .dl .mono-box { width: 58px; height: 58px; border-radius: 14px; }
.mono-box { display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.dl .info { flex: 1; min-width: 160px; }
.dl .info b { font-size: 15px; display: block; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .94); display: flex; flex-direction: column; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.lb-top b { font-weight: 650; }
.lb-top .muted { font-size: 13px; }
.lb-x { margin-left: auto; background: var(--card-2); border: 1px solid var(--line); border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; }
.lb-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px 16px; }
.lb-img img { max-width: 100%; max-height: 100%; border-radius: 8px; border: 1px solid var(--line); }
.lb-nav { position: absolute; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: rgba(12, 13, 16, .86); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; }
.lb-nav.p { left: 14px; } .lb-nav.n { right: 14px; }

.tabs { display: none; }

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .side, .top .date, .only-wide { display: none; }
  .top { height: 58px; padding: 0 14px; gap: 11px; }
  .top-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .4px; flex: none; }
  .top-logo img { width: 34px; height: 34px; }
  .search { max-width: none; }
  .search input { height: 40px; }
  .search svg.i { top: 11px; }
  .page { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
  .kpis { gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-ic { width: 38px; height: 38px; }
  .kpi-ic svg.i { width: 18px; height: 18px; }
  .kpi .v { font-size: 21px; }
  .kpi .s { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-b { padding: 9px 10px 11px; }
  .tile-b .n { font-size: 13.5px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .btn { flex: 1; justify-content: center; }
  .btns { width: 100%; }
  .lb-nav { display: none; }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #050506; border-top: 1px solid #1d1f24; padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--side-text); font-size: 11px; font-weight: 500; }
  .tabs a.on { color: var(--brand); font-weight: 650; }
}
