/* ════════════════════════════════════════════════════════════════
   layout.css — MKT NVG Tool
   Nội dung: Sidebar + Main/Content/Topbar + Cards & Panels + Stat grid
   Patch M1 — tách từ index.html dòng 54–207
   ════════════════════════════════════════════════════════════════ */

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  color: var(--white);
  line-height: 1.2;
}
.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,.45);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* User selector */
.user-select-wrap {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.user-select-label {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.user-select {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--white);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.user-select option { background: var(--navy-dark); color: var(--white); }

.nav-section {
  padding: 10px 10px 0;
  flex: 1;
}
.nav-label {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: var(--navy-mid); color: var(--white); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: rgba(255,255,255,.3);
}

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 0; /* force flex to not expand beyond container */
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { padding: 20px 24px; flex: 1; overflow-x: hidden; }

/* ── CARDS & PANELS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--navy); }
.card-body { padding: 20px; }

/* ── STAT GRID ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; min-width: 0; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  min-width: 0; overflow: hidden;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-num { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
