*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-brand .brand-text {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gl);
  margin-top: 2px;
}
.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.78);
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: var(--w); }
.sidebar-nav a.active {
  background: rgba(201, 168, 76, 0.18);
  color: var(--gl);
  border-left: 2px solid var(--gl);
  padding-left: 10px;
}
.sidebar-nav a .ico { width: 18px; display: inline-flex; justify-content: center; opacity: .85; }
.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-foot .out {
  color: rgba(255,255,255,0.6);
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
}
.sidebar-foot .out:hover { color: var(--gl); border-color: var(--gl); }

/* ── Main ─────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}
.header h1 small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 12px; }

.period-picker {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.period-picker button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  letter-spacing: .03em;
  transition: all .15s;
}
.period-picker button:hover { color: var(--text-primary); }
.period-picker button.active {
  background: var(--g);
  color: var(--c);
}

.content { padding: 28px; max-width: 1400px; }

/* Mobile (phonesim) */
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: -260px;
    width: 240px; height: 100vh; z-index: 100;
    transition: left .25s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
  }
  .sidebar.open { left: 0; }
  .header { padding: 0 16px; }
  .content { padding: 16px; }
  .menu-btn { display: inline-flex !important; }
  .header h1 { font-size: 18px; }
}
.menu-btn {
  display: none;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 36px; height: 36px;
  align-items: center; justify-content: center; color: var(--g);
}

/* Scrollbar discrète */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(34,57,44,.18); border-radius: 4px; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }
