@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Lora:ital,wght@0,500;0,600;1,500&display=swap');

/* ── Design tokens ─────────────────────────────── */
:root {
  --cream:   #faf8f5;
  --white:   #ffffff;
  --sand:    #f0ece4;
  --sand2:   #e8e2d9;
  --ink:     #1e1b17;
  --ink2:    #4a4540;
  --ink3:    #8c8480;
  --line:    #e4ddd4;

  --blue:    #3b7aea;
  --blue-lt: #eef3fd;
  --blue-md: #c6d8fb;

  --green:   #27a96c;
  --green-lt:#eaf7f1;
  --green-md:#a8e4c9;

  --amber:   #e08a1e;
  --amber-lt:#fff4e0;
  --amber-md:#ffd98c;

  --red:     #e04545;
  --red-lt:  #fdeaea;
  --red-md:  #f5b0b0;

  --purple:  #7c5cbf;
  --purple-lt:#f0ecfb;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sh-xs: 0 1px 4px rgba(0,0,0,.06);
  --sh-sm: 0 2px 10px rgba(0,0,0,.07);
  --sh-md: 0 6px 24px rgba(0,0,0,.09);
  --sh-lg: 0 16px 48px rgba(0,0,0,.12);

  --sidebar-w: 230px;
  --top-h: 62px;

  --ff: 'Nunito', sans-serif;
  --ff-serif: 'Lora', Georgia, serif;
  --t: .2s ease;
}

/* ── Reset & base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--ff);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
}
button, input, select, textarea {
  font-family: var(--ff);
  font-size: 14px;
}
::selection { background: var(--blue-md); color: var(--ink); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--sand2); border-radius: 99px; }

/* ── Shell ──────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t);
  z-index: 60;
}

.sidebar-head {
  padding: 22px 20px 16px;
  border-bottom: 1.5px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: 11px;
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--blue);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(59,122,234,.35);
  flex-shrink: 0;
}
.logo-mark i { color: #fff; font-size: 18px; }
.logo-name { font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.logo-sub  { font-size: 11px; color: var(--ink3); font-weight: 500; }

.sidebar-body { flex: 1; overflow-y: auto; padding: 14px 12px; }

.nav-group { margin-bottom: 22px; }
.nav-group-label {
  font-size: 10px; font-weight: 700;
  color: var(--ink3); text-transform: uppercase; letter-spacing: .1em;
  padding: 0 8px 7px;
}
.nav-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer;
  color: var(--ink2); font-size: 13.5px; font-weight: 600;
  text-align: left;
  transition: background var(--t), color var(--t);
  position: relative;
}
.nav-btn i { font-size: 17px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-btn:hover { background: var(--sand); color: var(--ink); }
.nav-btn.active { background: var(--blue-lt); color: var(--blue); }
.nav-btn .nbadge {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  background: var(--sand);
  color: var(--ink3);
}
.nav-btn.active .nbadge { background: var(--blue-md); color: var(--blue); }
.nbadge.g { background: var(--green-lt); color: var(--green); }
.nbadge.a { background: var(--amber-lt); color: var(--amber); }

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1.5px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.user-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-lt);
  border: 2px solid var(--blue-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--blue);
  flex-shrink: 0;
}
.user-nm { font-size: 13px; font-weight: 700; }
.user-rl { font-size: 11px; color: var(--ink3); font-weight: 500; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30,27,23,.45);
  z-index: 50;
}

/* ── Main area ──────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--top-h);
  background: var(--white);
  border-bottom: 1.5px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--ink2); padding: 4px;
}
.topbar-title {
  font-size: 17px; font-weight: 800; flex: 1;
  letter-spacing: -.3px;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: none;
  transition: all var(--t);
  white-space: nowrap;
}
.btn i { font-size: 15px; }
.btn-ghost {
  background: var(--sand); color: var(--ink2);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--sand2); color: var(--ink); }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 3px 10px rgba(59,122,234,.3);
}
.btn-primary:hover { background: #2d6de0; box-shadow: 0 4px 16px rgba(59,122,234,.4); }
.btn-success { background: var(--green-lt); color: var(--green); border: 1.5px solid var(--green-md); }
.btn-success:hover { background: var(--green-md); }
.btn-danger  { background: var(--red-lt);   color: var(--red);   border: 1.5px solid var(--red-md); }
.btn-danger:hover  { background: var(--red-md); }
.btn-amber   { background: var(--amber-lt); color: var(--amber); border: 1.5px solid var(--amber-md); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { padding: 8px 10px; }

/* ── Content ────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; }
.page { padding: 28px 28px 48px; max-width: 1100px; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ── Page header ────────────────────────────────── */
.ph { margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-left {}
.ph-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.ph-title em { font-family: var(--ff-serif); font-style: italic; color: var(--blue); font-weight: 500; }
.ph-sub { font-size: 13.5px; color: var(--ink3); margin-top: 3px; font-weight: 500; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Stats row ──────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-box {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t), transform var(--t);
}
.stat-box:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 12px;
}
.stat-icon.blue   { background: var(--blue-lt);   color: var(--blue); }
.stat-icon.green  { background: var(--green-lt);  color: var(--green); }
.stat-icon.amber  { background: var(--amber-lt);  color: var(--amber); }
.stat-icon.purple { background: var(--purple-lt); color: var(--purple); }
.stat-val { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.stat-val.blue   { color: var(--blue); }
.stat-val.green  { color: var(--green); }
.stat-val.amber  { color: var(--amber); }
.stat-val.purple { color: var(--purple); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink3); margin-top: 4px; }

/* ── Tab strip ──────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: var(--sand);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  width: fit-content;
  margin-bottom: 22px;
}
.tab {
  padding: 7px 18px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: none;
  background: none; color: var(--ink3);
  transition: all var(--t);
}
.tab:hover { color: var(--ink); }
.tab.on {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--sh-xs);
  border: 1.5px solid var(--line);
}

/* ── Version cards ──────────────────────────────── */
.v-list { display: flex; flex-direction: column; gap: 12px; }

.v-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  cursor: pointer;
  transition: all var(--t);
  box-shadow: var(--sh-xs);
  position: relative;
  overflow: hidden;
}
.v-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--line);
  transition: background var(--t);
}
.v-card:hover { box-shadow: var(--sh-sm); transform: translateX(2px); border-color: var(--sand2); }
.v-card:hover::after { background: var(--blue-md); }
.v-card.sel { border-color: var(--blue-md); box-shadow: 0 0 0 3px var(--blue-lt), var(--sh-sm); }
.v-card.sel::after { background: var(--blue); }

.v-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.v-tag { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }

.badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  letter-spacing: .02em;
}
.badge-prod { background: var(--green-lt); color: var(--green); border: 1.5px solid var(--green-md); }
.badge-dev  { background: var(--amber-lt); color: var(--amber); border: 1.5px solid var(--amber-md); }
.badge-arch { background: var(--sand);     color: var(--ink3);  border: 1.5px solid var(--line); }
.badge-snap { background: var(--blue-lt);  color: var(--blue);  border: 1.5px solid var(--blue-md); }

.v-branch {
  font-size: 11px; font-weight: 600;
  background: var(--sand); color: var(--ink3);
  padding: 2px 9px; border-radius: 99px;
  border: 1.5px solid var(--line);
}
.v-time { font-size: 12px; color: var(--ink3); font-weight: 600; margin-left: auto; }

.v-desc { font-size: 13.5px; color: var(--ink2); margin-bottom: 10px; line-height: 1.55; }

.v-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.chip {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  border: 1.5px solid transparent;
}
.chip-new { background: var(--green-lt); color: var(--green); border-color: var(--green-md); }
.chip-fix { background: var(--red-lt);   color: var(--red);   border-color: var(--red-md); }
.chip-upd { background: var(--amber-lt); color: var(--amber); border-color: var(--amber-md); }
.chip-def { background: var(--sand);     color: var(--ink3);  border-color: var(--line); }

.v-changes {
  font-size: 12px; font-weight: 600; color: var(--ink3);
  display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.v-changes .add { color: var(--green); }
.v-changes .mod { color: var(--amber); }
.v-changes .del { color: var(--red); }

.v-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.live-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--green);
  background: var(--green-lt);
  border: 1.5px solid var(--green-md);
  padding: 5px 12px; border-radius: 99px;
  margin-left: auto;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1}50%{opacity:.3} }

/* ── Compare ────────────────────────────────────── */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.cmp-col {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.cmp-head {
  background: var(--sand);
  border-bottom: 1.5px solid var(--line);
  padding: 13px 18px;
  display: flex; align-items: center; gap: 8px;
}
.cmp-head i { color: var(--ink3); font-size: 15px; }
.cmp-head select {
  flex: 1; border: none; background: none;
  font-size: 13px; font-weight: 700; color: var(--ink);
  outline: none; cursor: pointer;
}
.cmp-body { padding: 18px; }

.diff-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink3); margin: 14px 0 7px;
}
.diff-label:first-child { margin-top: 0; }

.diff-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 4px;
  line-height: 1.45;
}
.diff-item.add { background: var(--green-lt); color: var(--ink2); }
.diff-item.mod { background: var(--amber-lt); color: var(--ink2); }
.diff-item.del { background: var(--red-lt);   color: var(--ink2); }
.diff-sym { font-weight: 800; flex-shrink: 0; width: 16px; text-align: center; }
.diff-item.add .diff-sym { color: var(--green); }
.diff-item.mod .diff-sym { color: var(--amber); }
.diff-item.del .diff-sym { color: var(--red); }

.cmp-summary {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
  box-shadow: var(--sh-xs);
}
.cmp-stat { text-align: center; }
.cmp-stat-val { font-size: 22px; font-weight: 800; }
.cmp-stat-lbl { font-size: 11px; font-weight: 600; color: var(--ink3); }

/* ── Branches ───────────────────────────────────── */
.branch-graph-wrap {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px 18px;
  margin-bottom: 18px;
  box-shadow: var(--sh-xs);
  overflow-x: auto;
}
.branch-graph-title { font-size: 12px; font-weight: 700; color: var(--ink3); margin-bottom: 14px; }

.b-list { display: flex; flex-direction: column; gap: 10px; }
.b-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--t);
  box-shadow: var(--sh-xs);
}
.b-card:hover { box-shadow: var(--sh-sm); }
.b-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.b-info { flex: 1; min-width: 0; }
.b-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.b-meta { font-size: 12px; color: var(--ink3); font-weight: 500; margin-top: 2px; }
.b-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.status-pill {
  font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 99px;
}

/* ── Activity ───────────────────────────────────── */
.act-filters { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.act-list { display: flex; flex-direction: column; }
.act-item {
  display: flex; gap: 14px;
  padding: 15px 0;
  border-bottom: 1.5px solid var(--line);
  animation: fadeUp .15s ease;
}
.act-item:last-child { border-bottom: none; }
.act-av {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 2px;
}
.act-body { flex: 1; }
.act-text { font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
.act-text strong { color: var(--ink); font-weight: 700; }
.act-text code {
  background: var(--sand); border: 1.5px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
  font-size: 11.5px; font-weight: 700; color: var(--blue);
  font-family: 'Courier New', monospace;
}
.act-meta { font-size: 11.5px; color: var(--ink3); font-weight: 600; margin-top: 3px; }
.act-ic { font-size: 13px; margin-right: 4px; }

/* ── Release notes ──────────────────────────────── */
.rel-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: box-shadow var(--t);
}
.rel-card:hover { box-shadow: var(--sh-sm); }
.rel-head {
  padding: 17px 22px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  background: var(--white);
  border-bottom: 1.5px solid transparent;
  transition: background var(--t);
}
.rel-head:hover { background: var(--sand); }
.rel-head.open { background: var(--sand); border-bottom-color: var(--line); }
.rel-vtag { font-size: 16px; font-weight: 800; }
.rel-summary { font-size: 13px; color: var(--ink3); font-weight: 500; flex: 1; }
.rel-date { font-size: 12px; color: var(--ink3); font-weight: 600; }
.rel-toggle { font-size: 15px; color: var(--ink3); transition: transform var(--t); }
.rel-toggle.open { transform: rotate(90deg); }
.rel-body { padding: 20px 22px; display: none; }
.rel-body.open { display: block; }
.rel-section { margin-bottom: 14px; }
.rel-sec-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: 8px;
}
.rel-item {
  display: flex; gap: 8px; font-size: 13.5px;
  color: var(--ink2); padding: 3px 0; align-items: flex-start;
}
.rel-bullet { flex-shrink: 0; margin-top: 2px; font-size: 13px; }
.rel-foot { padding: 0 22px 18px; display: flex; gap: 8px; }

/* ── Modal ──────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(30,27,23,.5);
  z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-bg.open { display: flex; }
.modal-box {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 460px; max-width: calc(100vw - 32px);
  box-shadow: var(--sh-lg);
  animation: popIn .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none} }
.modal-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 5px; }
.modal-sub { font-size: 13px; color: var(--ink3); font-weight: 500; margin-bottom: 24px; }
.form-row { margin-bottom: 16px; }
.form-lbl {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--ink3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .07em;
}
.form-ctrl {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cream); color: var(--ink);
  font-size: 14px; font-family: var(--ff); font-weight: 500;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-ctrl:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-lt); }
.form-ctrl::placeholder { color: var(--ink3); }
textarea.form-ctrl { resize: vertical; min-height: 88px; }
select.form-ctrl { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238c8480' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-hint { font-size: 11.5px; color: var(--ink3); margin-top: 5px; font-weight: 500; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 24px; padding-top: 20px;
  border-top: 1.5px solid var(--line);
}

/* ── Share box ──────────────────────────────────── */
.share-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--sand);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px; margin: 12px 0;
}
.share-url {
  flex: 1; font-size: 12px; color: var(--blue);
  font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Courier New', monospace;
}
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--ink2);
}
.tog {
  width: 38px; height: 22px;
  background: var(--line); border-radius: 99px;
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background var(--t);
}
.tog.on { background: var(--green); }
.tog-k {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left var(--t);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.tog.on .tog-k { left: 19px; }

/* ── Toasts ─────────────────────────────────────── */
.toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 400; pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--sh-md);
  pointer-events: all;
  animation: slideIn .25s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
}
@keyframes slideIn { from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none} }
.toast i { font-size: 16px; flex-shrink: 0; }
.toast.ok  i { color: var(--green); }
.toast.err i { color: var(--red); }

/* ── Empty state ────────────────────────────────── */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink3);
}
.empty i { font-size: 40px; display: block; margin-bottom: 12px; }
.empty p { font-size: 14px; font-weight: 600; }

/* ── Import page ────────────────────────────────── */
.drop-zone {
  border: 2.5px dashed var(--line);
  border-radius: var(--r-xl);
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
  background: var(--white);
  position: relative;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-lt);
}
.drop-zone.drag-over { transform: scale(1.01); box-shadow: 0 0 0 4px var(--blue-md); }
.drop-icon {
  width: 64px; height: 64px;
  background: var(--blue-lt);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--blue);
  margin: 0 auto 20px;
  transition: transform var(--t);
}
.drop-zone:hover .drop-icon { transform: translateY(-4px); }
.drop-title { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.drop-sub   { font-size: 13.5px; color: var(--ink3); font-weight: 500; margin-bottom: 20px; }
.drop-formats {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.drop-fmt {
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 99px;
  background: var(--sand); color: var(--ink3);
  border: 1.5px solid var(--line);
}

.import-preview {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  margin-top: 24px;
}
.import-preview-head {
  background: var(--sand);
  border-bottom: 1.5px solid var(--line);
  padding: 16px 22px;
  display: flex; align-items: center; gap: 12px;
}
.import-preview-head .zip-icon {
  width: 40px; height: 40px;
  background: var(--amber-lt);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--amber); flex-shrink: 0;
}
.import-fname { font-size: 14px; font-weight: 800; color: var(--ink); }
.import-fmeta { font-size: 12px; color: var(--ink3); font-weight: 500; margin-top: 2px; }
.import-preview-body { padding: 20px 22px; }

.file-tree { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--cream);
  border: 1.5px solid var(--line);
  font-size: 13px;
}
.file-row i { font-size: 15px; flex-shrink: 0; }
.file-row .fname { flex: 1; font-weight: 600; color: var(--ink2); word-break: break-all; }
.file-row .fsize { font-size: 11px; color: var(--ink3); font-weight: 500; white-space: nowrap; }
.file-row.pdf-row    { border-color: var(--red-md);    background: var(--red-lt); }
.file-row.excel-row  { border-color: var(--green-md);  background: var(--green-lt); }
.file-row.word-row   { border-color: var(--blue-md);   background: var(--blue-lt); }
.file-row.img-row    { border-color: var(--purple-lt); background: var(--purple-lt); }
.file-row.other-row  { border-color: var(--line);      background: var(--cream); }

.import-form { border-top: 1.5px solid var(--line); padding: 20px 22px; }
.import-form-title { font-size: 14px; font-weight: 800; margin-bottom: 16px; color: var(--ink); }
.import-actions {
  display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap;
}

.progress-wrap {
  background: var(--sand);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  width: 0%;
  transition: width .3s ease;
}

.import-history {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.import-history-head {
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--line);
  font-size: 13px; font-weight: 800; color: var(--ink);
  background: var(--sand);
  display: flex; align-items: center; gap: 8px;
}
.imp-hist-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1.5px solid var(--line);
  transition: background var(--t);
}
.imp-hist-row:last-child { border-bottom: none; }
.imp-hist-row:hover { background: var(--cream); }
.imp-hist-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.imp-hist-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.imp-hist-meta { font-size: 11.5px; color: var(--ink3); font-weight: 500; }
.imp-hist-ver  { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--green-lt); color: var(--green); border: 1.5px solid var(--green-md); margin-left: auto; white-space: nowrap; }

@media (max-width: 860px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .cmp-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar {
    position: fixed; top:0; left:0; bottom:0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: none; box-shadow: var(--sh-lg); }
  .sidebar-overlay { display: block; }
  .hamburger { display: block; }
  .page { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; }
  .stats-row { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .v-actions .btn span { display: none; }
  .modal-box { padding: 22px 18px; }
  .ph { flex-direction: column; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; }
}
@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr; }
}
