/* ═══════════════════════════════════════════════════════════
   FarNimals v2 — Farm Theme (Brown & Gold)
   ═══════════════════════════════════════════════════════════ */
:root {
  /* ── Brand — warm caramel brown (professional, clearly brown not red) ── */
  --brand:       #7A5C3A;   /* warm caramel-brown — nav, buttons          */
  --brand-dark:  #5C4426;   /* deep warm brown — hover states             */
  --brand-mid:   #9B7A50;   /* lighter warm-tan — gradients               */
  --gold:        #C49A3A;   /* golden amber accent                         */
  --gold-light:  #FDF0E0;   /* very pale warm cream                       */
  --gold-mid:    #B09040;

  /* ── Neutral palette — light airy beige ── */
  --black:       #1c1c1c;   /* soft true-black for headings               */
  --white:       #ffffff;
  --cream:       #faf7f2;   /* lightest beige — main page background      */
  --gray-100:    #f3ede4;   /* cards, subtle section fills                */
  --gray-200:    #e6ddd0;   /* borders, dividers                          */
  --gray-300:    #d4c9ba;   /* muted borders                              */
  --gray-400:    #a89880;   /* icons, disabled elements                   */
  --gray-500:    #3d3530;   /* ALL small text — dark for legibility       */
  --gray-600:    #2e2820;   /* body / secondary text                      */
  --gray-700:    #1f1a14;   /* strong text                                */
  --gray-800:    #111111;
  --accent:      #9C7A25;
  --accent-soft: #faf3e0;

  /* ── Status colours — saturated so they pop on beige ── */
  --green:       #1e7a40;
  --green-bg:    #e4f5ec;
  --red:         #b52b1e;
  --red-bg:      #fce8e6;
  --yellow:      #8a6400;
  --yellow-bg:   #fdf6d8;
  --blue:        #1a56db;
  --blue-bg:     #dce8fb;
  --orange:      #8B6914;
  --orange-bg:   #f5ecd4;

  /* ── Shadows (warm-neutral, not too orange) ── */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 8px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 28px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06);
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --nav-h:       62px;
  --sidebar-w:   240px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--cream);
  color: var(--black);   /* #111 — crisp black on beige */
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: 0.875rem;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   TOP NAVIGATION
   ═══════════════════════════════════════════════════════ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #7A5C3A;                /* rich chocolate brown — matches reference */
  display: flex; align-items: center;
  padding: 0 24px;
  z-index: 1000;
  gap: 20px;
  border-bottom: 1px solid #5C4426;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem;
  color: #ffffff; letter-spacing: -.3px;
  white-space: nowrap;
}
.topnav-brand span { color: rgba(255,255,255,.65); font-weight: 400; font-size:.75rem; }
.topnav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.topnav-links a {
  color: rgba(255,255,255,.88); font-size: .83rem; font-weight: 500;
  padding: 6px 14px; border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.topnav-links a:hover, .topnav-links a.active {
  background: rgba(255,255,255,.15); color: #ffffff;
}
.topnav-links a.active { background: rgba(255,255,255,.18); color: #ffffff; font-weight: 700; }
.topnav-right {
  display: flex; align-items: center; gap: 12px; margin-left: auto;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  border-radius: 20px; padding: 5px 14px 5px 8px;
  color: #ffffff; font-size: .8rem; font-weight: 600;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #ffffff; color: #7A5C3A;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
}
.role-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 8px; border-radius: 20px;
  background: rgba(255,255,255,.15); color: #ffffff;
  border: 1px solid rgba(255,255,255,.3);
}
.topnav-btn {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  color: #ffffff; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; font-size: .8rem; transition: background .15s; text-decoration: none;
  display: inline-flex; align-items: center;
}
.topnav-btn:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); }

.topnav-hamburger {
  display: none; /* shown only on mobile via media query below */
  flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: transparent; border: none;
  cursor: pointer; margin-left: 8px; flex-shrink: 0;
}
.topnav-hamburger span {
  display: block; width: 100%; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.topnav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topnav-hamburger.open span:nth-child(2) { opacity: 0; }
.topnav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════════════════ */
.page-body {
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
}

/* ── Site Footer ──────────────────────────────────────────── */
.site-footer {
  background: #7A5C3A;          /* rich chocolate brown — matches nav */
  color: #ffffff;
  margin-top: 0;
  padding: 28px 24px;
  border-top: 1px solid #5C4426;
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-brand .fb-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}
.footer-brand p {
  font-size: .78rem;
  line-height: 1.7;
  color: rgba(255,255,255,.75);
  max-width: 260px;
}
.footer-col h4 {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.6);
  margin-bottom: 12px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  font-size: .82rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.footer-col ul li .fi {
  font-size: .95rem;
  flex-shrink: 0;
  opacity: .75;
}
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
}
.footer-bottom a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
}
.footer-bottom a:hover { color: var(--brand); }

@media (max-width: 700px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-bottom { flex-direction: column; text-align: center; }
}
.page-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 28px 24px;
}
.page-wrap.wide { max-width: 1440px; }
.page-wrap.narrow { max-width: 900px; }

/* ── Page Header ────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #7A5C3A, #9B7A50);
  padding: 28px 32px;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  color: var(--white);
}
.page-header-text h1 {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 4px;
}
.page-header-text p { font-size: .85rem; color: rgba(255,255,255,.85); }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-padded { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  background: #f0ece6;
}
.card-header h2 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 24px; }

/* ── Stat Cards ─────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7A5C3A, #C49A3A);
}
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fdf8f0;
  border: 1px solid #e6ddd0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-card .stat-value {
  font-size: 2rem; font-weight: 800; line-height: 1;
}
.stat-card .stat-label {
  font-size: .75rem; color: #1c1c1c; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.stat-card .stat-sub {
  font-size: .75rem; color: #1c1c1c;
}

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: .85rem;
}
thead th {
  background: #7A5C3A; color: #ffffff;
  padding: 12px 16px; text-align: left;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  white-space: nowrap;
}
thead th:first-child { border-radius: 0; }
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .1s; }
tbody tr:hover { background: #eee8dc; }
tbody td { padding: 12px 16px; vertical-align: middle; color: #1c1c1c; }
tbody tr:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: none;
  font-weight: 600; font-size: .85rem; cursor: pointer;
  transition: all .15s; white-space: nowrap; text-decoration: none;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline {
  background: transparent; color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-outline:hover { background: var(--brand); color: var(--white); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--gray-100); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: #15803d; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: #b91c1c; }
.btn-gray { background: var(--gray-200); color: #111111; }
.btn-gray:hover { background: var(--gray-300); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-lg { padding: 12px 28px; font-size: .95rem; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--gray-600); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--gray-200); border-radius: 8px;
  background: var(--white); color: var(--black);
  transition: border-color .15s, box-shadow .15s;
  font-size: .9rem;
}
.form-control:focus {
  outline: none; border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
.form-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px;
}
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* ── Search Bar ──────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 0;
  border: 2px solid var(--gray-200); border-radius: 8px; overflow: hidden;
  background: var(--white);
}
.search-bar input {
  flex: 1; padding: 10px 14px; border: none; outline: none;
  font-size: .9rem; background: transparent;
}
.search-bar button {
  padding: 10px 16px; background: var(--black); color: var(--white);
  border: none; cursor: pointer; font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════
   PILLS / BADGES
   ═══════════════════════════════════════════════════════ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700;
}
.pill-black    { background: var(--black);      color: var(--white); }
.pill-white    { background: var(--gray-200);   color: #111111; }
.pill-green    { background: var(--green-bg);   color: #15803d; }
.pill-red      { background: var(--red-bg);     color: #b91c1c; }
.pill-yellow   { background: var(--yellow-bg);  color: #a16207; }
.pill-blue     { background: var(--blue-bg);    color: #1d4ed8; }
.pill-orange   { background: var(--orange-bg);  color: #c2410c; }
.pill-gray     { background: var(--gray-200);   color: #2e2820; }

/* ═══════════════════════════════════════════════════════
   ALERTS / MESSAGES
   ═══════════════════════════════════════════════════════ */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  font-size: .87rem; font-weight: 500; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-bg); color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: var(--red-bg);   color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warn    { background: var(--yellow-bg);color: #a16207; border: 1px solid #fde047; }
.alert-info    { background: #FDF0E0; color: #7A5C3A; border: 1px solid #C49A3A; }

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
  transform: translateY(20px) scale(.97);
  transition: transform .2s;
}
.modal-overlay.active .modal { transform: none; }
.modal-header {
  padding: 22px 28px; border-bottom: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(135deg, #7A5C3A, #9B7A50);
  color: #fff;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; color: #fff; }
.modal-close { background: rgba(255,255,255,.2) !important; color: #fff !important; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-100); border: none; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--gray-100);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1100px; }

/* ── Confirm modal ───────────────────────────── */
.confirm-modal { max-width: 420px; }
.confirm-icon { font-size: 2.5rem; text-align: center; margin-bottom: 12px; }
.confirm-text { text-align: center; color: var(--gray-600); }

/* ═══════════════════════════════════════════════════════
   REMINDER POPUP
   ═══════════════════════════════════════════════════════ */
.reminder-popup {
  position: fixed; top: 80px; right: 20px;
  background: var(--white); border: 2px solid var(--black);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 340px; z-index: 1500;
  animation: slideInRight .3s ease;
  overflow: hidden;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.reminder-head {
  background: var(--black); color: var(--white);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.reminder-head span { font-weight: 700; font-size: .9rem; }
.reminder-close {
  background: none; border: none; color: var(--white);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.reminder-items { max-height: 300px; overflow-y: auto; }
.reminder-item {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  display: flex; gap: 12px; align-items: flex-start;
}
.reminder-item:last-child { border-bottom: none; }
.reminder-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.reminder-dot.red    { background: var(--red); }
.reminder-dot.yellow { background: var(--yellow); }
.reminder-dot.blue   { background: var(--blue); }
.reminder-dot.green  { background: var(--green); }
.reminder-item-text { font-size: .82rem; }
.reminder-item-text strong { display: block; font-weight: 700; }
.reminder-item-text span   { color: #1c1c1c; font-size: .76rem; }
.reminder-empty { padding: 20px; text-align: center; color: var(--gray-400); font-size: .85rem; }

/* ═══════════════════════════════════════════════════════
   LOGIN PAGES
   ═══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-container {
  display: grid; grid-template-columns: 1fr 1fr;
  max-width: 960px; width: 100%;
  background: var(--white); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}
.login-left-panel {
  background: var(--black);
  padding: 52px 48px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-left-panel::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}
.login-left-panel > * { position: relative; z-index: 1; }
.login-logo { font-size: 2.5rem; font-weight: 900; color: var(--white); margin-bottom: 8px; }
.login-logo span { color: var(--gray-400); }
.login-tagline { font-size: 1rem; color: var(--gray-300); line-height: 1.7; margin-bottom: 32px; }
.login-role-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); color: var(--gray-200);
  padding: 8px 16px; border-radius: 20px; font-size: .82rem;
  font-weight: 600; border: 1px solid rgba(255,255,255,.15);
}
.login-right-panel { padding: 52px 48px; }
.login-right-panel h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.login-right-panel p { font-size: .87rem; color: var(--gray-500); margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form .btn-primary {
  width: 100%; padding: 13px; font-size: .95rem;
  margin-top: 8px;
}
.login-links { text-align: center; margin-top: 20px; font-size: .82rem; color: var(--gray-500); }
.login-links a { color: var(--black); font-weight: 700; }
.login-portal {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-portal-inner { max-width: 700px; width: 100%; text-align: center; }
.portal-brand { font-size: 3rem; font-weight: 900; margin-bottom: 8px; }
.portal-tagline { color: var(--gray-500); margin-bottom: 48px; }
.portal-cards {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px;
}
.portal-card {
  background: var(--white); border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 32px 20px;
  cursor: pointer; transition: all .2s; text-decoration: none; color: inherit;
  display: block;
}
.portal-card:hover { border-color: var(--black); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.portal-card-icon { font-size: 2.2rem; margin-bottom: 12px; }
.portal-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.portal-card p { font-size: .8rem; color: var(--gray-500); }
.portal-card.featured { background: var(--black); color: var(--white); border-color: var(--black); }
.portal-card.featured p { color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════
   CONTACT INFO CARD (DASHBOARD)
   ═══════════════════════════════════════════════════════ */
.contact-card {
  background: var(--black); color: var(--white);
  border-radius: var(--radius-lg); padding: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.contact-item { display: flex; align-items: flex-start; gap: 10px; }
.contact-item .ci-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.contact-item .ci-label { font-size: .7rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; }
.contact-item .ci-value { font-size: .87rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   SHOPEE-LIKE SHOP / CATTLE CARDS
   ═══════════════════════════════════════════════════════ */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.shop-sidebar {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 20px;
  height: fit-content; position: sticky; top: calc(var(--nav-h) + 16px);
}
.sidebar-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--gray-600); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--gray-200);
}
.filter-group { margin-bottom: 20px; }
.filter-group label { font-size: .8rem; color: var(--gray-600); margin-bottom: 8px; display: block; font-weight: 600; }
.filter-group select, .filter-group input { width: 100%; }
.filter-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; }
.filter-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.cattle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px;
}
.cattle-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .2s; cursor: pointer;
}
.cattle-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--gray-300); }
.cattle-card-img {
  height: 140px; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; position: relative;
}
.cattle-card-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--black); color: var(--white);
  font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 4px;
}
.cattle-card-body { padding: 12px; }
.cattle-card-name { font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.cattle-card-rfid { font-size: .72rem; color: var(--gray-400); margin-bottom: 8px; }
.cattle-card-price { font-size: 1.15rem; font-weight: 800; color: var(--black); }
.cattle-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cattle-card-actions { padding: 10px 12px; border-top: 1px solid var(--gray-100); display: flex; gap: 8px; }
.cattle-card-actions .btn { flex: 1; justify-content: center; }

/* ── Cart ────────────────────────────────────── */
.cart-panel {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 20px;
  position: sticky; top: calc(var(--nav-h) + 16px);
}
.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gray-100);
}
.cart-item:last-child { border-bottom: none; }
.cart-icon { width: 40px; height: 40px; background: var(--gray-100); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.cart-info { flex: 1; min-width: 0; }
.cart-info .name { font-weight: 700; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-info .price { font-size: .85rem; color: var(--gray-500); }
.cart-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1rem; }
.cart-total { padding-top: 16px; border-top: 2px solid var(--black); margin-top: 8px; }
.cart-total .label { font-size: .82rem; color: var(--gray-600); }
.cart-total .amount { font-size: 1.4rem; font-weight: 800; }

/* ── Order Status Steps ──────────────────────── */
.order-steps {
  display: flex; align-items: center; gap: 0; margin-bottom: 24px;
}
.order-step {
  flex: 1; text-align: center; position: relative; padding: 10px 4px;
}
.order-step::after {
  content: ''; position: absolute; top: 18px; left: 50%; right: -50%;
  height: 2px; background: var(--gray-200); z-index: 0;
}
.order-step:last-child::after { display: none; }
.order-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; margin: 0 auto 6px;
  position: relative; z-index: 1; border: 2px solid var(--gray-200);
}
.order-step.done .order-step-dot {
  background: var(--black); color: var(--white); border-color: var(--black);
}
.order-step.active .order-step-dot {
  background: var(--white); border-color: var(--black); color: var(--black);
}
.order-step-label { font-size: .7rem; font-weight: 600; color: var(--gray-400); }
.order-step.done .order-step-label,
.order-step.active .order-step-label { color: var(--black); }

@media (max-width: 640px) {
  .order-steps {
    overflow-x: auto; justify-content: flex-start;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  }
  .order-step { flex: 0 0 auto; min-width: 92px; }
  .order-step::after { left: 50%; right: -100%; width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab-btn {
  padding: 11px 22px; border: none; background: none; cursor: pointer;
  font-size: .87rem; font-weight: 600; color: var(--gray-500);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active { color: var(--black); border-bottom-color: var(--black); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════
   RFID AUTO TAG
   ═══════════════════════════════════════════════════════ */
.rfid-display {
  background: var(--black); color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 1.2rem; font-weight: 700;
  padding: 12px 20px; border-radius: 8px; letter-spacing: 3px;
  display: flex; align-items: center; gap: 12px;
}
.rfid-display .rfid-label { font-size: .65rem; color: #00cc33; letter-spacing: 1px; }

/* ═══════════════════════════════════════════════════════
   BREED TREE / BLOODLINE
   ═══════════════════════════════════════════════════════ */
.bloodline-tree {
  display: flex; flex-direction: column; gap: 6px;
}
.bloodline-item {
  display: flex; align-items: center; gap: 8px; font-size: .83rem;
}
.bloodline-item .b-icon { font-size: .9rem; }
.bloodline-item .b-arrow { color: var(--gray-400); }

/* ═══════════════════════════════════════════════════════
   PERMISSION GRID (SUPER ADMIN)
   ═══════════════════════════════════════════════════════ */
.perm-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
}
.perm-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--gray-100); border-radius: 8px; padding: 12px;
  cursor: pointer; border: 2px solid transparent; transition: all .15s;
}
.perm-item:hover { border-color: var(--gray-300); }
.perm-item.active { background: var(--green); color: var(--white); border-color: var(--green); }
.perm-item .pi-icon { font-size: 1.1rem; }
.perm-item .pi-label { font-size: .82rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .login-container { grid-template-columns: 1fr; }
  .login-left-panel { display: none; }
  .portal-cards { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .contact-card { grid-template-columns: 1fr; }
  .charts-2col { grid-template-columns: 1fr; }
  .comparison-bar { grid-template-columns: 1fr; }

  /* ── Nav: swap the inline link bar for a hamburger dropdown ── */
  .topnav-links {
    display: none;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #7A5C3A; border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    z-index: 999; padding: 6px 0;
  }
  .topnav-links.mobile-open { display: flex; }
  .topnav-links a {
    padding: 14px 22px; border-radius: 0; font-size: .92rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .topnav-hamburger { display: flex; }

  /* Trim the right-hand cluster so it doesn't crowd/overflow next to the hamburger */
  .user-chip span, .profile-link span { display: none; }
  .topnav-right { gap: 8px; }
  .topnav-btn { padding: 6px 10px; font-size: .75rem; }
  .role-badge { display: none; }
}

@media (max-width: 700px) {
  .page-header {
    flex-direction: column; align-items: flex-start; padding: 20px;
  }
  .page-header-actions { width: 100%; flex-wrap: wrap; }
  .page-header-actions .btn, .page-header-actions button, .page-header-actions a {
    flex: 1; min-width: 0;
  }
  .page-wrap { padding: 18px 14px; }
  .modal-overlay { padding: 10px; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding: 12px 18px; flex-wrap: wrap; }
  .modal-footer .btn, .modal-footer button { flex: 1; min-width: 0; }
  table { font-size: .8rem; }
  .table-wrap table { min-width: 640px; } /* keep columns legible; wrapper already scrolls */
}

@media (max-width: 600px) {
  .form-row, .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .charts-2col .chart-wrap, .chart-card .chart-wrap { height: 220px !important; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topnav-brand { font-size: 1rem; }
  .topnav-brand span { display: none; }
  .page-header-text h1 { font-size: 1.15rem; }
  .modal.modal-lg, .modal.modal-xl { max-width: 100%; }
  .btn, button { font-size: .85rem; }
}

/* ═══════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════ */
@media print {
  .topnav, .btn, .modal-overlay, .reminder-popup, .site-footer { display: none !important; }
  body { background: white !important; }
  .page-body { margin-top: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ═══════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════ */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }
.text-muted { color: #1c1c1c; }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { align-items: center; } .flex-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state .es-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ═══════════════════════════════════════════════════════
   NOTIFICATION BELL & PROFILE LINK (NAV)
   ═══════════════════════════════════════════════════════ */
.notif-btn {
  position: relative; background: #e4dace;
  border: 1px solid #d0c4b0; color: #1c1c1c;
  padding: 6px 12px; border-radius: 6px; font-size: .95rem;
  cursor: pointer; text-decoration: none; transition: background .2s;
  display: flex; align-items: center; gap: 4px;
}
.notif-btn:hover { background: rgba(255,255,255,.25); }
.notif-count {
  position: absolute; top: -7px; right: -7px;
  background: var(--red); color: #fff;
  font-size: .6rem; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.profile-link {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  border-radius: 20px; padding: 5px 14px 5px 8px;
  color: #ffffff; font-size: .8rem; font-weight: 600;
  text-decoration: none; transition: background .2s; cursor: pointer;
}
.profile-link:hover { background: rgba(255,255,255,.25); }
.profile-link .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #ffffff; color: #7A5C3A;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
}

/* ═══════════════════════════════════════════════════════
   LOGIN ALERT BANNER (staff)
   ═══════════════════════════════════════════════════════ */
.login-alert-bar {
  background: linear-gradient(135deg, #7A5C3A, #9B7A50);
  color: #fff; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .85rem; gap: 12px; flex-wrap: wrap;
}
.login-alert-bar a { color: var(--gold); font-weight: 700; }
.login-alert-bar .dismiss-btn {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: .78rem;
}

/* ═══════════════════════════════════════════════════════
   PROFILE PAGE TABS
   ═══════════════════════════════════════════════════════ */
.profile-tabs {
  display: flex; gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 0;
  /* no border-bottom here — the parent wrapper handles it */
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab-btn {
  padding: 12px 18px; border: none; background: none;
  font-size: .82rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .15s; display: flex; align-items: center; gap: 5px;
}
.profile-tab-btn:hover { color: #7A5C3A; }
.profile-tab-btn.active { color: #7A5C3A; border-bottom-color: #7A5C3A; }
.profile-tab-count {
  background: var(--gray-200); color: var(--gray-600);
  font-size: .68rem; font-weight: 800;
  padding: 1px 6px; border-radius: 10px;
}
.profile-tab-count.has-items { background: var(--gold-light); color: var(--brand); }

/* ═══════════════════════════════════════════════════════
   FAVORITES HEART
   ═══════════════════════════════════════════════════════ */
.fav-btn {
  position: absolute; top: 8px; right: 38px;
  background: rgba(255,255,255,.85); border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: .9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s; z-index: 2;
}
.fav-btn:hover { transform: scale(1.15); background: #fff; }
.fav-btn.faved { color: var(--red); }

/* ── Cart button in topnav ──────────────────────────────────── */
.sph-cart-nav {
  position: relative;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  color: var(--white);
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sph-cart-nav:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); }
.sph-cart-nav .sph-badge {
  background: var(--red);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.sph-cart-nav .sph-badge.visible { display: inline-flex; }
