/* DE_PC2 v2.0 — layout.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ─── Header ─────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: var(--z-header);
  box-shadow: var(--shadow-sm);
}

#header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
#header .logo img {
  height: 38px;
  width: auto;
  min-width: 120px;
}
#header .logo-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
#header .logo-text span { color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 6px 12px 6px 36px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--tr);
}
.header-search input:focus { border-color: var(--accent); }
.header-search .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* ─── App shell ───────────────────────────── */
#app {
  display: flex;
  padding-top: 52px;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: var(--z-sidebar);
  padding: 8px 0 80px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--tr);
  user-select: none;
}
.nav-item:hover {
  background: var(--row-hover);
  color: var(--text);
}
.nav-item.active {
  border-left-color: var(--accent);
  background: var(--row-hover);
  color: var(--accent);
  font-weight: 500;
}
.nav-item [data-lucide] { flex-shrink: 0; }
.nav-item .nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item .nav-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-3);
  border-radius: 10px;
  padding: 1px 6px;
}

/* ─── Rates/discount bars wrapper ─────────── */
#bars-wrap {
  position: fixed;
  top: 52px;
  left: var(--sidebar-w);
  right: 0;
  z-index: 90;   /* below header(200) and dropdowns — won't cover lang menu */
  transition: left var(--tr);
}

/* ─── Main content ────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 16px;
  /* Extra top padding for rates + discount bars (fixed overlay) */
  padding-top: calc(var(--bars-h, 30px) + 16px);
}

/* ─── Footer ──────────────────────────────── */
#footer {
  margin-left: var(--sidebar-w);
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
#footer a { color: var(--accent); text-decoration: none; }
#footer a:hover { text-decoration: underline; }

/* ─── Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-280px); transition: transform var(--tr); width: 280px; }
  #sidebar.open { transform: translateX(0); --sidebar-w: 240px; }
  #main { margin-left: 0; padding: 8px; }
  #footer { margin-left: 0; }
  #bars-wrap { left: 0; }
  .header-search { max-width: 200px; }
  #menu-toggle { display: flex !important; }
}

#menu-toggle { display: none; }

/* ─── Section header ──────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.section-header .sec-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* deploy: 2026-04-16 */
/* @v1776352182 */