/* ========================================
   SHARED STYLES — Used across all pages
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #F7F5F2;
  --bg-surface: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-tertiary: #999999;
  --accent: #8B7355;
  --accent-hover: #72603F;
  --border: #E0DCD7;
  --border-light: #ECEAE6;
  --success: #4A7C59;
  --error: #9C4040;

  --font: 'Inter', -apple-system, sans-serif;
  --max-width: 1200px;
  --content-padding: 24px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-weight: 400;
}

::selection {
  background-color: var(--accent);
  color: var(--bg-surface);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

/* ========================================
   AUTH LAYOUT
   ======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--content-padding);
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.3s ease;
}

.auth-back:hover {
  color: var(--accent);
}

.auth-logo {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 48px;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 12px;
}

.auth-title strong {
  font-weight: 600;
}

.auth-subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input.error {
  border-color: var(--error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ========================================
   BUTTONS (AUTH)
   ======================================== */
.btn-auth {
  width: 100%;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 16px 32px;
  border: none;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  cursor: pointer;
  transition: all 0.35s ease;
  margin-top: 16px;
}

.btn-auth:hover {
  background-color: var(--accent);
}

.btn-auth:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-auth:disabled:hover {
  background-color: var(--text-primary);
}

/* ========================================
   AUTH FOOTER / LINKS
   ======================================== */
.auth-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.auth-footer-text {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.auth-footer-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.auth-footer-text a:hover {
  color: var(--text-primary);
}

/* ========================================
   ALERTS / MESSAGES
   ======================================== */
.alert {
  padding: 14px 20px;
  font-size: 0.82rem;
  font-weight: 400;
  margin-bottom: 24px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background-color: rgba(156, 64, 64, 0.08);
  border-left: 2px solid var(--error);
  color: var(--error);
}

.alert-success {
  background-color: rgba(74, 124, 89, 0.08);
  border-left: 2px solid var(--success);
  color: var(--success);
}

/* ========================================
   PASSWORD TOGGLE
   ======================================== */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--accent);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.dashboard {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0 28px;
  margin-bottom: 8px;
  display: block;
}

.sidebar-role {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 28px;
  margin-bottom: 40px;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

.sidebar-link.active {
  color: var(--text-primary);
  font-weight: 500;
  border-left-color: var(--accent);
  background-color: var(--bg-primary);
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border);
  margin: 16px 28px;
}

.sidebar-footer {
  padding: 0 28px;
}

.sidebar-user {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebar-email {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.sidebar-logout {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  padding: 0;
}

.sidebar-logout:hover {
  color: var(--error);
}

.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
  padding: 40px 48px;
}

.page-header {
  margin-bottom: 48px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 8px;
}

.page-title strong {
  font-weight: 600;
}

.page-subtitle {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-secondary);
}

/* ========================================
   CONTENT CARDS
   ======================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background-color: var(--border);
}

.content-card {
  background-color: var(--bg-primary);
  padding: 32px;
  transition: background-color 0.3s ease;
}

.content-card:hover {
  background-color: var(--bg-surface);
}

.content-card-tag {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.content-card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
}

.content-card-desc {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.content-card-link {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.content-card-link:hover {
  color: var(--text-primary);
}

/* ========================================
   RESPONSIVE DASHBOARD
   ======================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 200;
    width: 280px;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  margin-bottom: 24px;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 1px;
  background-color: var(--text-primary);
  margin: 5px 0;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
}

.overlay.show {
  display: block;
}
