/* ═══════════════════════════════════════════════════════
   HenSync — Main Stylesheet
   Primary: #2E7D32  Accent: #D4A017  BG: #F8FAF5
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --green:       #000000;
  --green-light: #4CAF50;
  --green-pale:  #E8F5E9;
  --green-dark:  #1B5E20;
  --gold:        #faaf27;
  --gold-light:  #F5D76E;
  --gold-pale:   #FFF8E1;
  --bg:          #F8FAF5;
  --bg2:         #EFF4EC;
  --white:       #FFFFFF;
  --text:        #263238;
  --text-muted:  #607D8B;
  --text-light:  #90A4AE;
  --border:      #DDE7D5;
  --danger:      #C62828;
  --danger-pale: #FFEBEE;
  --warning:     #E65100;
  --warning-pale:#FFF3E0;
  --info:        #01579B;
  --info-pale:   #E3F2FD;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow:      0 2px 12px rgba(46,125,50,0.08);
  --shadow-md:   0 4px 24px rgba(46,125,50,0.12);
  --shadow-lg:   0 8px 40px rgba(46,125,50,0.18);
  --transition:  0.2s ease;
  --font:        'Plus Jakarta Sans', sans-serif;
  --font-serif:  'Lora', serif;
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

img { max-width: 100%; display: block; }

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-light); }

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.sidebar-logo .logo-text span { color: var(--gold); }
.sidebar-logo .logo-sub { font-size: 0.72rem; color: rgba(255,255,255,0.5); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

.logo-icon {
  width: 40px; height: 40px;
  background: var(--green);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.logo-text { 
  font-size: 1.25rem; 
  font-weight: 800; 
  color: var(--green-dark);
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--gold); }

.farm-switcher {
  padding: 12px 16px;
  margin: 12px;
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
}

.farm-switcher:hover { background: var(--bg2); }

.farm-switcher .farm-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--green-dark);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-switcher .farm-role {
  font-size: 0.7rem;
  background: var(--green);
  color: white;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  font-weight: 700;
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--green-pale); color: var(--green); }
.nav-item.active { background: var(--green); color: white; }
.nav-item.active .nav-icon { color: white; }

.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); color: white; }

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

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 0.8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .email { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Main Content ──────────────────────────────────── */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top Header ────────────────────────────────────── */
.top-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 50;
}

.header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

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

.header-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  color: var(--text-muted);
  font-size: 1rem;
}

.header-btn:hover { background: var(--green-pale); color: var(--green); border-color: var(--green-light); }

.notification-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}

/* ─── Page Content ──────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════════════ */

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 30px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(46,125,50,0.35); color: white; }

.btn-gold {
  background: var(--gold);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(212,160,23,0.3);
}
.btn-gold:hover { background: #c4900f; transform: translateY(-1px); color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-outline:hover { background: var(--green-pale); }

.btn-ghost {
  background: var(--bg2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #b71c1c; color: white; }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Stat Cards ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
}

.stat-card.gold::before { background: var(--gold); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.stat-card.gold .stat-icon { background: var(--gold-pale); }
.stat-card.danger .stat-icon { background: var(--danger-pale); }
.stat-card.info .stat-icon { background: var(--info-pale); }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-trend {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--green-light); }
.stat-trend.down { color: var(--danger); }

/* ─── Tables ─────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead { background: var(--bg); }

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--green-pale); }

tbody td { padding: 13px 16px; color: var(--text); vertical-align: middle; }

.empty-row td {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

/* ─── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

.form-control::placeholder { color: var(--text-light); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-green { background: var(--green-pale); color: var(--green-dark); }
.badge-gold { background: var(--gold-pale); color: #7B5800; }
.badge-red { background: var(--danger-pale); color: var(--danger); }
.badge-gray { background: var(--bg2); color: var(--text-muted); }
.badge-blue { background: var(--info-pale); color: var(--info); }
.badge-orange { background: var(--warning-pale); color: var(--warning); }

/* ─── Alerts/Flash ───────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: var(--green-pale); color: var(--green-dark); border-left: 3px solid var(--green); }
.alert-danger { background: var(--danger-pale); color: var(--danger); border-left: 3px solid var(--danger); }
.alert-warning { background: var(--warning-pale); color: var(--warning); border-left: 3px solid var(--warning); }
.alert-info { background: var(--info-pale); color: var(--info); border-left: 3px solid var(--info); }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-pale); color: var(--danger); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Tabs ───────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 7px 16px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active {
  background: var(--white);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Dropdown ───────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 150;
  padding: 6px;
  animation: dropIn 0.15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--green-pale); color: var(--green); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-pale); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 20px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Progress Bar ───────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ─── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-top: 16px;
}

.page-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.page-btn:hover, .page-btn.active { background: var(--green); color: white; border-color: var(--green); }

/* ─── Flock Card ─────────────────────────────────────── */
.flock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.flock-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.flock-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green-light); }

.flock-card-header {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  padding: 20px;
  color: white;
  position: relative;
}

.flock-card-header .flock-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.flock-card-header .flock-breed {
  font-size: 0.78rem;
  opacity: 0.85;
}

.flock-big-number {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 2.2rem;
  font-weight: 800;
  opacity: 0.2;
  letter-spacing: -2px;
}

.flock-card-body { padding: 16px; }

.flock-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 2px;
}

.flock-stat { text-align: center; }
.flock-stat .value { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.flock-stat .lbl { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }

.flock-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Partner Cards ──────────────────────────────────── */
.partner-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.partner-card:hover { border-color: var(--green-light); box-shadow: var(--shadow); }

.partner-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.partner-info { flex: 1; min-width: 0; }
.partner-name { font-size: 0.9rem; font-weight: 700; }
.partner-email { font-size: 0.75rem; color: var(--text-muted); }

.partner-share {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green);
}

/* ─── Charts Wrapper ─────────────────────────────────── */
.chart-wrapper {
  position: relative;
  height: 240px;
}

/* ─── Notification Item ──────────────────────────────── */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.notif-item:hover { background: var(--green-pale); }
.notif-item.unread { background: var(--gold-pale); }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-text { font-size: 0.82rem; color: var(--text); }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Auth Pages ─────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, #388E3C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '🐔';
  position: absolute;
  font-size: 300px;
  opacity: 0.04;
  bottom: -40px;
  right: -40px;
  transform: rotate(-15deg);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .icon {
  width: 64px; height: 64px;
  background: var(--green);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 12px;
}

.auth-logo h1 { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); letter-spacing: -1px; }
.auth-logo h1 span { color: var(--gold); }
.auth-logo p { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 0.9rem;
}

.input-wrapper { position: relative; }

/* ─── Utilities ──────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-danger { color: var(--danger); }
.text-gold { color: var(--gold); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-sm { font-size: 0.8rem; }
.fs-xs { font-size: 0.72rem; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .flock-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .page-content { padding: 16px; }
  .top-header { padding: 0 16px; }

  .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
}

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

.mobile-overlay.open { display: block; }

/* ─── Loading ─────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Print */
@media print {
  .sidebar, .top-header, .btn, .header-actions { display: none !important; }
  .main-content { margin-left: 0; }
}
