/* layout.css — sidebar, main area, page shell, toolbar, empty state */

/* ---- app shell ---- */
body {
  display: flex;
  min-height: 100vh;
}

/* ---- sidebar ---- */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  margin: 1px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text3);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Theme toggle button */
.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-align: left;
}
.theme-btn:hover {
  background: var(--border);
  color: var(--text);
}
.theme-btn-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.theme-btn-label {
  flex: 1;
}
.theme-btn::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--amber);
  background: var(--amber-dim);
}

.sidebar-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

/* ---- main area ---- */
.main {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

/* ---- page shell ---- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}

/* ---- page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  font-family: var(--mono);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.toolbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.toolbar-search input {
  width: 100%;
  padding-left: 34px;
  height: 34px;
  font-size: 13px;
  background: var(--bg);
  border-color: var(--border);
}
.toolbar-search input::placeholder { color: var(--text3); }

.toolbar-filter select {
  height: 34px;
  font-size: 12px;
  background: var(--bg);
  padding: 0 30px 0 10px;
}

/* ---- empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 1.2;
  margin-bottom: 16px;
  opacity: .5;
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.6;
}
