/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
}

/* Page shell */
.page {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: 256px;
  min-width: 256px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px 16px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  height: 24px;
  opacity: 0.95;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--sidebar-fg);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  display: flex;
  align-items: center;
}

.sidebar-collapse-btn:hover {
  opacity: 1;
  background: var(--sidebar-accent);
}

.sidebar-collapse-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-separator {
  height: 1px;
  background: var(--sidebar-border);
  margin: 4px 16px;
}

.sidebar-section {
  padding: 4px 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--sidebar-fg);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-nav-item:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-bright);
}

.sidebar-nav-item.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-bright);
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sidebar groups */

.sidebar-group {
  padding: 4px 8px;
}

.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 4px;
}

.sidebar-group-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(168, 154, 140, 0.7);
}

/* Bundle items */

.bundle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--sidebar-fg);
  cursor: pointer;
  transition: background 0.15s;
}

.bundle-item:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-bright);
}

.bundle-item.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-bright);
  font-weight: 500;
}

.bundle-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bundle-item-left svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.bundle-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 9999px;
}

.bundle-badge.attention {
  background: var(--bundle-attention-bg);
  color: var(--bundle-attention-text);
}

.bundle-badge.standard {
  background: var(--bundle-standard-bg);
  color: var(--bundle-standard-text);
}

.bundle-badge.bulk {
  background: var(--bundle-bulk-bg);
  color: var(--bundle-bulk-text);
}

.bundle-item.disabled {
  opacity: 0.5;
}

/* Sidebar footer */

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-fg-bright);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-fg-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-actions {
  display: flex;
  gap: 4px;
}

.sidebar-footer-btn {
  background: none;
  border: none;
  color: rgba(168, 154, 140, 0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
}

.sidebar-footer-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-footer-btn:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-bright);
}

/* ── Main content area ───────────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

/* ── Header ──────────────────────────────────────────────── */

.header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.search-bar {
  position: relative;
  width: 500px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F0EBE3;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
  color: var(--tertiary);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(194, 87, 42, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tertiary);
}

.search-icon svg {
  width: 16px;
  height: 16px;
}

.compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.compose-btn:hover {
  background: var(--primary-hover);
}

/* ── Content area ────────────────────────────────────────── */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  justify-content: center;
}

.content-inner {
  width: 66.666%;
  max-width: 800px;
}

.page-title {
  font-size: 20px;
  margin-bottom: 20px;
}

/* ── Scrollbar styling ───────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
}
