@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root {
  --bg: #0b0e14;
  --bg-card: rgba(12,18,30,0.75);
  --bg-card-solid: #0f172a;
  --bg-input: rgba(12,18,30,0.6);
  --bg-hover: rgba(0,229,160,0.04);
  --border: rgba(148,163,184,0.08);
  --border-focus: rgba(0,229,160,0.4);
  --accent: #00e5a0;
  --accent-dim: rgba(0,229,160,0.08);
  --accent-mid: rgba(0,229,160,0.2);
  --accent-glow: rgba(0,229,160,0.15);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #475569;
  --danger: #ff4d4d;
  --danger-dim: rgba(255,77,77,0.1);
  --warn: #ffb020;
  --warn-dim: rgba(255,176,32,0.08);
  --warn: #fbbf24;
  --warn-dim: rgba(251,191,36,0.1);
  --cyan: #38bdf8;
  --blue: #3b82f6;
  --green: #00e5a0;
  --yellow: #fde68a;
  --orange: #fdba74;
  --purple: #c4b5fd;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  min-height: 100vh;
  padding: 24px;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.02) 0%, transparent 50%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; color: #33ffbb; }

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--accent-glow);
}

.back {
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  transition: all 0.25s;
  background: transparent;
}
.back:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-dim);
  text-decoration: none;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(16px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 0 20px var(--accent-glow);
}

.card h2 {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
}

.box {
  max-width: 720px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 20px;
  backdrop-filter: blur(16px);
}

.sidebar-title {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.main {
  flex-grow: 1;
  min-width: 0;
}

/* ===== FORMS ===== */
label {
  display: block;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--accent-glow);
}

select option {
  background: var(--bg-card-solid);
  color: var(--text);
}

textarea {
  min-height: 64px;
  resize: vertical;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.price-row {
  display: flex;
  gap: 10px;
}
.price-row .filter-group { flex: 1; }

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}
.chk input { width: auto; margin: 0; }

/* ===== BUTTONS ===== */
button, .btn {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.25s;
}

button:hover, .btn:hover {
  border-color: var(--accent-mid);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn {
  background: var(--accent-dim);
  border-color: var(--accent-mid);
  color: var(--accent);
  padding: 10px 14px;
  font-weight: 700;
}

.btn:hover {
  background: rgba(0,229,160,0.15);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: all 0.25s;
}

a.link-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  color: var(--accent);
  padding: 12px 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: all 0.25s;
}

a.link-btn:hover {
  background: rgba(0,229,160,0.15);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-dim);
}

.btn-reset {
  width: 100%;
  background: transparent;
  border: 1px solid var(--danger-dim);
  color: var(--danger);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.25s;
}
.btn-reset:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(255,77,77,0.15);
}

.btn-add {
  width: 100%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.25s;
}
.btn-add:hover {
  background: rgba(0,229,160,0.15);
  box-shadow: 0 0 16px var(--accent-glow);
}

.act {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  margin-right: 4px;
  transition: all 0.2s;
}
.act:hover {
  border-color: var(--accent-mid);
  background: var(--accent-dim);
}
.act.del, .del {
  border-color: var(--danger-dim);
  color: var(--danger);
  background: transparent;
}
.act.del:hover, .del:hover {
  background: var(--danger-dim);
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

th {
  background: rgba(12,18,30,0.95);
  color: var(--accent);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
th:hover {
  background: rgba(30,41,59,0.95);
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(148,163,184,0.04);
  font-size: 14px;
  transition: background 0.15s;
}

tr:hover td {
  background: var(--bg-hover);
}

.price {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
  text-shadow: 0 0 8px var(--accent-glow);
}
.price-cyan { color: var(--cyan); }
.price-green { color: var(--green); }
.price-yellow { color: var(--yellow); }
.price-orange { color: var(--orange); }
.price-purple { color: var(--purple); }

.suspect-flag {
  color: var(--orange);
  cursor: help;
  font-weight: 700;
  animation: suspect-pulse 2s ease-in-out infinite;
}
@keyframes suspect-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.per {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.qty, .qty-cell {
  color: var(--text-dim);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

.name a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  transition: all 0.2s;
}
.name a:hover {
  color: var(--accent);
  text-decoration: none;
  text-shadow: 0 0 8px var(--accent-glow);
}

.time-cell {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.contents {
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller {
  color: var(--cyan);
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.stockman {
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.sum {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
}

.miss {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 11px;
}

.ok {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ===== TIMER CELLS ===== */
.timer-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.timer-ok { color: var(--green); }
.timer-warn { color: var(--warn); }
.timer-danger, .timer-expired { color: var(--danger); }
tr.expired { opacity: 0.3; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
}
.page-btn:hover, .page-btn.active {
  border-color: var(--accent-mid);
  color: var(--accent);
  text-decoration: none;
  box-shadow: 0 0 8px var(--accent-glow);
}
.page-btn.active {
  background: var(--accent-dim);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tabs.col { flex-direction: column; }

.tab {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  transition: all 0.25s;
  background: transparent;
}
.tabs.col .tab { flex: none; width: 100%; }

.tab.on {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-dim);
  box-shadow: 0 0 10px var(--accent-glow);
}
.tab:hover:not(.on) {
  border-color: rgba(148,163,184,0.2);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

/* ===== MODAL ===== */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.show { display: flex; }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.modal h2 {
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 16px;
  text-shadow: 0 0 12px var(--accent-glow);
}

.modal label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  display: block;
  margin: 10px 0 5px;
}

.modal input, .modal textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.modal textarea { min-height: 64px; resize: vertical; }

.modal-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-row button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

/* ===== SUGGEST ===== */
.sug-box, .sug {
  position: relative;
}

.sug-box .sug, .sug-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 50;
  max-height: 220px;
  overflow: auto;
  display: none;
}

.sug-box .sug div, .sug-list div {
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: all 0.15s;
}

.sug-box .sug div:hover, .sug-list div:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.sug-list div.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ===== STATS LINE ===== */
.stats-line {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
}

.stats-line .count {
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  display: block;
  margin-top: 4px;
  text-shadow: 0 0 16px var(--accent-glow);
}

/* ===== LIVE STATS ===== */
.live-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.live-stat {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
  backdrop-filter: blur(16px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.live-stat:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 0 16px var(--accent-glow);
}

.live-stat .live-stat-val {
  display: block;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  font-family: var(--font-mono);
  text-shadow: 0 0 16px var(--accent-glow);
  letter-spacing: 0;
}

/* ===== STAT CARDS ===== */
.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  backdrop-filter: blur(16px);
}

.stat-card label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 6px;
}

.stat-card .val {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 0 12px var(--accent-glow);
}

/* ===== CHART BOX ===== */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
}

.chart-box h2 {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 14px;
  text-shadow: 0 0 12px var(--accent-glow);
}

.no-data {
  text-align: center;
  padding: 48px;
  color: var(--text-faint);
  font-size: 16px;
}

.no-results {
  text-align: center;
  padding: 48px;
  color: var(--text-faint);
}

/* ===== TOTALS / SUMMARY CARDS ===== */
.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.tot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(16px);
}

.tot span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.tot b {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.tot.bad b { color: var(--danger); }
.tot.good b { color: var(--accent); }

/* ===== WELCOME / PDA HOME ===== */
.pda {
  width: 100%;
  max-width: 920px;
  min-height: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 40px rgba(0,0,0,0.4), 0 0 80px var(--accent-glow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  margin: 0 auto;
}

.header {
  background: rgba(12,18,30,0.95);
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
}

.header-title {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  text-shadow: 0 0 20px var(--accent-glow);
}

.header-status {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-glow); }
  50% { opacity: 0.4; box-shadow: 0 0 4px var(--accent), 0 0 8px var(--accent-glow); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.content {
  padding: 36px 40px;
  height: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

.welcome {
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 36px;
  line-height: 1.7;
  border-left: 2px solid var(--accent-mid);
  padding-left: 18px;
  animation: fadeIn 0.5s ease;
}

.welcome strong {
  color: var(--accent);
  font-weight: 600;
}

.menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  animation: fadeIn 0.6s ease;
}

.btn-square {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: var(--text-dim);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-square::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-square:hover {
  border-color: var(--accent-mid);
  color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
  transform: translateY(-3px);
  text-decoration: none;
}
.btn-square:hover::before {
  opacity: 1;
}

.btn-icon {
  font-size: 36px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.btn-label {
  position: relative;
  z-index: 1;
}

.btn-label .title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  display: block;
}

.btn-label .sub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
  display: block;
}

.footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-online {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-online:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===== AUTH PAGES (LOGIN / REGISTER) ===== */
body.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.pda.auth-card {
  max-width: 440px;
  min-height: auto;
  padding: 28px 32px 24px;
}

.title {
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 4px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 16px var(--accent-glow);
}

.sub {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 28px;
}

.err {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  margin-bottom: 14px;
  min-height: 16px;
}

.auth-ok {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  margin-bottom: 14px;
  word-break: break-all;
}

.foot {
  text-align: center;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}
.foot a {
  color: var(--accent);
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
}

/* ===== DICT PAGE ===== */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.result {
  margin-top: 14px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-left: 3px solid var(--border);
  color: var(--text-dim);
  min-height: 42px;
  white-space: pre-wrap;
}
.result.ok { border-color: var(--accent); color: var(--accent); }
.result.bad { border-color: var(--orange); color: var(--orange); }

.list {
  max-height: 420px;
  overflow-y: auto;
}

.item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}

.item .name { color: var(--accent); cursor: pointer; }
.item .sub { color: var(--text-dim); margin-top: 3px; }

.item button.x {
  float: right;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--danger);
  border-color: var(--danger-dim);
  background: transparent;
}

.hint {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.btns {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ===== TOOLTIP / ARTIFACT TAGS ===== */
.tooltip-gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.artifact-tag {
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.artifact-tag:hover {
  background: rgba(0,229,160,0.15);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

/* ===== ROW ADD (CALC) ===== */
.row-add {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}
.row-add input { margin: 0; }

/* ===== CELL INPUTS (CALC) ===== */
input.cell {
  width: 110px;
  margin: 0;
  padding: 6px 8px;
}

input.cell-name {
  width: 100%;
  margin: 0;
}

/* ===== SECTION LABELS ===== */
.section {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  margin: 18px 0 8px;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* ===== TP COLUMNS ===== */
.tp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== TABLE PICK ROWS (CALC) ===== */
tr.pick { cursor: pointer; }
tr.pick:hover td { background: var(--bg-hover); }
tr.pick.on td { background: rgba(0,229,160,0.06); }

/* ===== CHART CANVAS ===== */
canvas { max-height: 340px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .tp-cols { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; position: static; }
  .totals { grid-template-columns: 1fr; }
  #tpMain .totals { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; position: static; }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { padding: 12px; }
  .content { padding: 24px; }
  .header { flex-direction: column; gap: 10px; text-align: center; }
  .menu { grid-template-columns: 1fr; }
  .btn-square { padding: 20px; }
  .live-stats { flex-direction: column; }
  .top-bar { flex-direction: column; gap: 10px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-mid); }

/* ===== PROFILE ===== */
.profile-field {
  margin-bottom: 12px;
}
.profile-field label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 3px;
}
.profile-field .val {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.act-label {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  margin-right: 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.act-detail {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.act-time {
  float: right;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}
.sub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ===== NOTIFICATIONS ===== */
.notif-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover {
  background: var(--bg-hover);
}
.notif-item.unread {
  background: rgba(0,229,160,0.03);
}
.notif-item.unread .notif-title {
  color: var(--accent);
  font-weight: 600;
}
.notif-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
}
.notif-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.notif-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ===== BURGER MENU ===== */
.burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
}
.burger:hover {
  border-color: var(--accent-mid);
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .burger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 100;
    min-width: 160px;
    backdrop-filter: blur(16px);
  }
  .nav-links.open { display: flex; }
  .nav-links .back { width: 100%; }
}

/* ===== SKELETON LOADING ===== */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(148,163,184,0.06) 50%, var(--bg-card) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}
.skeleton-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px 100px 100px 100px;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.skeleton-cell {
  height: 16px;
  border-radius: 4px;
}
.skeleton-cell.wide { grid-column: span 2; }
.skeleton-cell.short { height: 12px; width: 60%; }

/* ===== TABLE ROW HOVER ===== */
.table-wrap tbody tr {
  transition: background 0.15s;
}
.table-wrap tbody tr:hover {
  background: var(--bg-hover);
}

/* ===== PRICE TOOLTIP ===== */
.price-cell {
  position: relative;
  cursor: help;
}
.price-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.price-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}
.price-cell:hover .price-tip {
  display: block;
}
.price-tip .tip-min { color: var(--accent); }
.price-tip .tip-max { color: var(--danger); }
.price-tip .tip-avg { color: var(--warn); }

/* ===== QUICK SEARCH (Ctrl+K) ===== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  backdrop-filter: blur(4px);
}
.search-overlay.open { display: flex; }
.search-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.search-box input {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  outline: none;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 0;
}
.search-results .sr-item {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background 0.1s;
}
.search-results .sr-item:hover,
.search-results .sr-item.active {
  background: var(--bg-hover);
  color: var(--accent);
}
.search-results .sr-sub {
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 8px;
}
.search-hint {
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
}
.search-hint kbd {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
}

/* ===== PRICE ALERT BUTTON ===== */
.alert-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.alert-btn:hover {
  border-color: var(--warn);
  color: var(--warn);
}
.alert-btn.active {
  border-color: var(--warn);
  color: var(--warn);
  background: var(--warn-dim);
}

/* ===== EXPORT / ACTION BUTTONS ===== */
.export-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.export-btn:hover {
  border-color: var(--accent-mid);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== LEADERBOARD ===== */
.lb-row {
  display: grid;
  grid-template-columns: 40px 1fr 80px 80px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background 0.15s;
}
.lb-row:hover { background: var(--bg-hover); }
.lb-rank {
  font-weight: 700;
  color: var(--text-faint);
  text-align: center;
}
.lb-rank.top1 { color: #ffd700; }
.lb-rank.top2 { color: #c0c0c0; }
.lb-rank.top3 { color: #cd7f32; }
.lb-name { color: var(--text); }
.lb-count { color: var(--accent); text-align: right; }
.lb-latest { color: var(--text-dim); font-size: 11px; text-align: right; }

.per-btn {
    padding: 4px 12px !important;
    font-size: 11px !important;
    background: var(--bg-card) !important;
    color: var(--text-dim) !important;
    border: 1px solid rgba(148,163,184,0.1) !important;
    cursor: pointer;
    transition: all 0.2s;
}
.per-btn:hover { background: rgba(0,229,160,0.1) !important; color: var(--accent) !important; }
.per-btn[style*="accent"] { background: var(--accent) !important; color: #000 !important; }

.search-tab {
    flex: 1;
    padding: 6px 0;
    font-size: 11px;
    font-family: var(--font-body);
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid rgba(148,163,184,0.1);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.search-tab:first-child { border-radius: 6px 0 0 6px; }
.search-tab:last-child { border-radius: 0 6px 6px 0; }
.search-tab:not(:first-child) { border-left: none; }
.search-tab:hover { color: var(--accent); background: rgba(0,229,160,0.05); }
.search-tab.active { background: var(--accent); color: #000; font-weight: 600; }
