:root{
  --bg:#f6f8fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;

  --accent:#2563eb;
  --accent2:#06b6d4;

  --danger:#ef4444;

  --radius:18px;
  --shadow:0 14px 40px rgba(15,23,42,.08);
  --shadow2:0 10px 24px rgba(15,23,42,.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(37,99,235,.10), transparent 58%),
    radial-gradient(760px 520px at 85% 10%, rgba(6,182,212,.10), transparent 58%),
    var(--bg);
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
.small{ font-size:12px; }
.strong{ font-weight:900; }
.muted{ color:var(--muted); }

.container{ width:min(1200px, calc(100% - 40px)); margin-inline:auto; }

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(246,248,252,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand__logo{
  width:184px;
 
  padding:6px;

}
.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight:900;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow2);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  cursor:pointer;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn--primary{
  color:#fff;
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 16px 32px rgba(37,99,235,.22);
}
.btn--ghost{ background:#fff; }
.btn--full{ width:100%; margin-top: 10px; }

.btn--danger{
  color:#fff;
  border-color: transparent;
  background: linear-gradient(90deg, #ff4d4d, #ff1f6d);
  box-shadow: 0 16px 32px rgba(239,68,68,.20);
}

/* Language dropdown (optional) */
.lang-dropdown{ position:relative; }
.lang-toggle{
  display:flex; align-items:center; gap:6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow2);
  font-weight:900;
  cursor:pointer;
}
.lang-dropdown .chev{ font-size:12px; opacity:.7; }
.lang-menu{

 
  margin:0;
  padding:6px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow: var(--shadow);
  min-width: 90px;
   z-index:100;
}
.lang-menu li{
  padding:8px 12px;
  border-radius:10px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
}
.lang-menu li:hover{ background: rgba(37,99,235,.08); color: var(--accent); }
.lang-menu li.active{ color: var(--accent); }
.lang-dropdown.open .lang-menu{ display:block; }

/* Main */
.main{ padding: 22px 0 40px; }

/* Head card */
.headcard{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
}
.headcard h1{
  margin:0 0 6px;
  font-size: 30px;
  letter-spacing:-0.03em;
}
.headcard p{ margin:0; }

.tools{
  display:flex;
  gap:10px;
  align-items:center;
}
.search{
  position:relative;
  min-width: 320px;
}
.search__icon{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 900;
}
.search input{
  width:100%;
  padding: 12px 12px 12px 34px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:#fff;
  outline:none;
  font-weight:700;
}
.search input:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.select{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:#fff;
  font-weight:800;
  outline:none;
}
.select:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

/* Layout */
.layout{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  align-items:start;
}

.panel{
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow2);
  padding: 16px;
}

.panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.panel__head h2{
  margin:0;
  font-size: 15px;
  font-weight: 950;
}
.panel__meta{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-weight:800;
  font-size: 13px;
}
.dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* Grid */
.grid{
  max-height: calc(100vh - 280px);
  overflow:auto;
  padding-right: 6px;

  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

/* Custom scrollbar */
.grid::-webkit-scrollbar{ width: 10px; }
.grid::-webkit-scrollbar-track{
  background: #eef2ff;
  border-radius: 999px;
}
.grid::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 999px;
}

.model{
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
  overflow:hidden;
  cursor:pointer;
  padding:0;
  text-align:left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.model:hover{
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(15,23,42,.10);
  border-color: rgba(37,99,235,.25);
}
.model.is-selected{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12), 0 18px 34px rgba(15,23,42,.10);
}

.model__img{
  aspect-ratio: 3/4;
  display:grid;
  place-items:center;
  padding: 12px;
  background:
    radial-gradient(380px 220px at 50% 20%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(380px 220px at 70% 95%, rgba(6,182,212,.10), transparent 60%),
    #f8fafc;
  border-bottom: 1px solid var(--line);
}
.model__img img{
  max-height: 170px;
  filter: drop-shadow(0 10px 18px rgba(15,23,42,.18));
}
.model__cap{
  padding: 10px 10px 12px;
  font-weight: 950;
  font-size: 12.5px;
  color: #0f172a;
  text-align:center;
}

/* Side panel */
.side{ position:sticky; top: 86px; }

.pill{
  font-size: 12px;
  font-weight: 950;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
#selPill{ border-color: rgba(16,185,129,.25); background: rgba(16,185,129,.08); color:#065f46; }

.selected{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.selected__img{
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 260px at 50% 15%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(520px 260px at 70% 95%, rgba(6,182,212,.10), transparent 60%),
    #f8fafc;
  display:grid;
  place-items:center;
  padding: 14px;
}
.selected__img img{
  max-height: 260px;
  filter: drop-shadow(0 14px 22px rgba(15,23,42,.18));
}

.selected__name{
  font-weight: 950;
  font-size: 18px;
  letter-spacing:-0.02em;
  margin-top: 4px;
}

.miniGrid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini{
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background:#fff;
}

.actions2{ margin-top: 10px; }

.note{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(37,99,235,.35);
  background: rgba(37,99,235,.06);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 1100px){
  .grid{ grid-template-columns: repeat(4, 1fr); }
  .layout{ grid-template-columns: 1fr; }
  .side{ position:static; }
  .search{ min-width: 220px; }
}
@media (max-width: 640px){
  .container{ width:min(1200px, calc(100% - 24px)); }
  .headcard{ flex-direction:column; align-items:flex-start; }
  .tools{ width:100%; flex-direction:column; align-items:stretch; }
  .search{ min-width: unset; }
  .grid{ grid-template-columns: repeat(2, 1fr); max-height: unset; }
}
