/* ══════════════════════════════════════════════
   Navigation Header
   ══════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  padding: 0 var(--space-xl);
  height: var(--header-height);
  display: flex;
  align-items: center;
  backdrop-filter: blur(8px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 var(--space-xs);
  color: var(--text-muted);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ── User Menu ── */

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 36px;
  color: var(--text-primary);
}

.user-menu-trigger:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 1000;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--bg-tertiary);
  text-decoration: none;
}

/* ── Theme toggle ── */

.theme-toggle {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  min-height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

/* Show/hide sun/moon based on theme */
.theme-icon-dark { display: none; }
.theme-icon-light { display: inline; }

[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
}


/* ══════════════════════════════════════════════
   Main Layout
   ══════════════════════════════════════════════ */

main {
  max-width: var(--max-width);
  margin: var(--space-xl) auto;
  padding: 0 var(--space-md);
  flex: 1;
}

/* ── Hero ── */

/* ── Dashboard Welcome ── */

.dashboard-welcome {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.dashboard-welcome h1 {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  font-weight: 700;
}

.dashboard-welcome p {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════
   Forms & Inputs
   ══════════════════════════════════════════════ */

form {
  gap: var(--space-sm);
  flex-wrap: wrap;
}

input[type="text"] {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-sans);
  min-height: 44px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  flex: 1;
  min-width: 0;
}

input[type="text"]:hover {
  border-color: var(--border-hover);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

input[type="file"] {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  min-height: 44px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
}


/* ══════════════════════════════════════════════
   Footer
   ══════════════════════════════════════════════ */

.site-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  margin-top: auto;
}

.site-footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   Utility Classes
   ══════════════════════════════════════════════ */

.empty {
  color: var(--text-muted);
  font-style: italic;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ══════════════════════════════════════════════
   Responsive: Prevent horizontal overflow
   ══════════════════════════════════════════════ */

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  width: 100%;
}
