/* ── APP SHELL ── */
#app { display: none; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .2s, border-color .2s;
}
.topbar-left  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-center{ flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.app-title { font-size: 13px; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
.app-sub   { font-size: 12px; color: var(--text-muted); }

/* ── CLOCK ── */
.clock-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 5px 14px; }
.clock { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .03em; }

/* ── LANG SWITCHER ── */
.lang-group { display: flex; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.lang-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-btn.active { background: var(--text); color: var(--bg); }

/* ── THEME BUTTON ── */
.theme-btn {
  width: 32px; height: 32px;
  font-size: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--r);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.theme-btn:hover { background: var(--border); color: var(--text); }

/* ── USER PILL ── */
.user-pill {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ── BUTTONS ── */
.btn-primary {
  cursor: pointer; font-family: inherit; font-size: 13px;
  border-radius: var(--r); border: none;
  padding: 7px 14px; font-weight: 600;
  background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, box-shadow .15s; white-space: nowrap;
}
.btn-primary:hover { background: #1a4f8a; box-shadow: var(--shadow-sm); }

.btn-green {
  cursor: pointer; font-family: inherit; font-size: 13px;
  border-radius: var(--r); border: 1px solid var(--green);
  padding: 6px 13px; font-weight: 500;
  background: transparent; color: var(--green);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s; white-space: nowrap;
}
.btn-green:hover { background: var(--green-light); }

.btn-logout {
  cursor: pointer; font-family: inherit; font-size: 12px;
  border-radius: var(--r); border: 1px solid var(--border);
  padding: 6px 10px; font-weight: 400;
  background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .15s;
}
.btn-logout:hover { background: var(--surface-2); color: var(--text); }

.btn-json-export, .btn-json-import {
  cursor: pointer; font-family: inherit; font-size: 12px;
  border-radius: var(--r); padding: 6px 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s; white-space: nowrap;
}
.btn-json-export {
  border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-muted);
}
.btn-json-export:hover { background: var(--surface-2); color: var(--text); }
.btn-json-import {
  border: 1px solid var(--blue);
  background: var(--blue-light); color: var(--blue);
}
.btn-json-import:hover { background: var(--blue); color: #fff; }
  cursor: pointer; font-family: inherit;
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  min-width: unset; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.del:hover { background: var(--red-light); color: var(--red); border-color: var(--red-mid); }

/* ── TABS ── */
.tabs-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  transition: background .2s;
}
.tab-btn {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: none; }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── MAIN ── */
main { max-width: 1120px; margin: 0 auto; padding: 24px 20px; width: 100%; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── STAT ROW ── */
.stat-row { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 24px; }
.sc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s;
}
.sc .n { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 3px; }
.sc .l { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.sc.red   .n { color: var(--red);   }
.sc.amber .n { color: var(--amber); }
.sc.green .n { color: var(--green); }
.sc.blue  .n { color: var(--blue);  }

/* ── LIST TOOLBAR ── */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.list-toolbar select { width: auto; padding: 6px 10px; font-size: 12px; }

/* ── ITEMS LIST ── */
.items-list { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(3,1fr); }
  main { padding: 14px 12px; }
  .topbar { padding: 0 12px; height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .topbar-center { order: 3; width: 100%; }
  .tabs-bar { padding: 0 12px; overflow-x: auto; }
  .tab-btn { padding: 10px 10px; font-size: 12px; }
  .app-sub { display: none; }
}
