/* ============================================================
   Ligao Petcare & Veterinary Clinic — Global Stylesheet
   Matches the teal/cyan to yellow-green gradient prototype
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --teal:          #00bcd4;
  --teal-dark:     #0097a7;
  --teal-light:    #b2ebf2;
  --yellow:        #cddc39;
  --yellow-dark:   #afb42b;
  --blue-header:   #1565c0;
  --blue-mid:      #1976d2;
  --sidebar-bg:    #f5f0e8;
  --sidebar-text:  #333;
  --white:         #ffffff;
  --light-bg:      #f0fffe;
  --card-bg:       #ffffffcc;
  --text-dark:     #1a1a2e;
  --text-mid:      #444;
  --text-light:    #888;
  --border:        #e0e0e0;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.12);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --gradient:      linear-gradient(160deg, #cddc39 0%, #00bcd4 60%, #00acc1 100%);
  --gradient-h:    linear-gradient(90deg, #1565c0 0%, #1976d2 100%);
  --font-main:     'Nunito', sans-serif;
  --font-head:     'Poppins', sans-serif;
  --transition:    all 0.25s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background: var(--gradient);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: var(--font-main); }

/* ── Auth Pages (Login / Signup) ────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-logo h1 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.2;
}

.auth-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-header);
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--teal-dark);
  text-align: center;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ── Form Elements ──────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #eaf9fb;
  color: var(--text-dark);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,188,212,0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--blue-header);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.btn-primary:hover { background: var(--blue-mid); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }

.btn-green { background: #4caf50; color: #fff; }
.btn-green:hover { background: #388e3c; }

.btn-yellow { background: var(--yellow); color: #333; }
.btn-yellow:hover { background: var(--yellow-dark); color: #fff; }

.btn-red { background: #ef4444; color: #fff; }
.btn-red:hover { background: #dc2626; }

.btn-gray { background: #e0e0e0; color: #555; }
.btn-gray:hover { background: #bdbdbd; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--teal);
  color: var(--teal);
}
.btn-outline:hover { background: var(--teal); color: #fff; }

/* ── App Layout (Sidebar + Main) ────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 200px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.sidebar-logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-logo .username {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.2;
}

.sidebar-logo .role {
  font-size: 11px;
  color: var(--teal-dark);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(0,188,212,0.12);
  color: var(--teal-dark);
  border-left-color: var(--teal);
}

.sidebar-nav a .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-logout a {
  color: #ef4444;
}
.sidebar-nav .nav-logout a:hover {
  background: rgba(239,68,68,0.1);
  border-left-color: #ef4444;
  color: #dc2626;
}

/* Main Content */
.main-content {
  margin-left: 200px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--gradient-h);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover { background: rgba(255,255,255,0.35); }

.badge-count {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.page-body {
  flex: 1;
  padding: 24px 28px;
  background: var(--gradient);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dark);
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: rgba(0,188,212,0.12);
}

thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,188,212,0.05); }

tbody td {
  padding: 11px 14px;
  color: var(--text-mid);
  vertical-align: middle;
}

/* ── Search / Filter Bar ────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  width: 100%;
  color: var(--text-dark);
}

.search-box span { color: var(--text-light); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  transform: translateY(20px);
  transition: transform 0.25s;
  position: relative;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}
.modal-close:hover { color: #ef4444; }

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Dashboard Grid ─────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-grid.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Pet Cards ──────────────────────────────────────────── */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.pet-card {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}

.pet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pet-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.pet-card-body {
  padding: 14px;
}

.pet-card-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.pet-card-meta {
  font-size: 12px;
  color: var(--text-light);
  margin: 2px 0;
}

.pet-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 2px dashed var(--border);
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  min-height: 180px;
}

.pet-card-add:hover {
  border-color: var(--teal);
  background: rgba(0,188,212,0.05);
}

.pet-card-add .add-icon {
  font-size: 36px;
  color: var(--teal);
  margin-bottom: 10px;
}

.pet-card-add .add-label {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-dark);
}

.pet-card-add .add-sub {
  font-size: 12px;
  color: var(--text-light);
}

/* ── Appointment Card ───────────────────────────────────── */
.appt-card {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.appt-card .appt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.appt-card .appt-title {
  font-weight: 800;
  font-size: 15px;
}

/* ── Medical Record Cards ───────────────────────────────── */
.medical-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.medical-card {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.medical-card .med-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--blue-header);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.medical-card .med-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.medical-card .med-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.medical-card .med-name { font-weight: 700; font-size: 13px; }
.medical-card .med-detail { font-size: 12px; color: var(--text-light); }

/* ── Service Cards ──────────────────────────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.service-card {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--teal);
}

.service-card .svc-icon { font-size: 32px; margin-bottom: 10px; }
.service-card .svc-name { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.service-card .svc-desc { font-size: 11px; color: var(--text-light); line-height: 1.5; }
.service-card .svc-price { font-weight: 700; color: var(--teal-dark); margin-top: 8px; font-size: 13px; }

/* ── Product Grid ───────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.product-card {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  padding: 12px;
  background: #f9f9f9;
}

.product-card-body { padding: 12px; }
.product-card-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.product-card-price { font-weight: 800; color: var(--teal-dark); font-size: 14px; }

/* ── Messages ───────────────────────────────────────────── */
.messages-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  height: calc(100vh - 130px);
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.contacts-panel {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: #f8fffe;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.contact-item:hover,
.contact-item.active {
  background: rgba(0,188,212,0.1);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contact-name { font-weight: 700; font-size: 14px; }
.contact-preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-panel {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  background: #fff;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.msg-bubble.received {
  background: var(--teal-light);
  color: #1a1a2e;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-bubble.sent {
  background: var(--blue-header);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-meta {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 3px;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: #fff;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  font-size: 13px;
  transition: var(--transition);
}

.chat-input-area input:focus { border-color: var(--teal); }

/* ── Calendar ───────────────────────────────────────────── */
.calendar-wrapper {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ── Announcement ───────────────────────────────────────── */
.announcement-box {
  background: rgba(255,255,255,0.88);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.announcement-box .ann-title {
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-box .ann-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--teal-dark);
  margin-bottom: 6px;
}

.announcement-box .ann-content {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text-dark);
}

/* ── Utility ────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.bold { font-weight: 700; }
.text-teal { color: var(--teal-dark); }
.text-red { color: #ef4444; }
.text-green { color: #10b981; }
.text-light { color: var(--text-light); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.8);
  color: var(--text-dark);
  transition: var(--transition);
}

.pagination a:hover { background: var(--teal-light); }
.pagination .current { background: var(--teal); color: #fff; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,188,212,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ── Responsive ─────────────────────────────────────────── */

/* ── Hamburger menu button (hidden on desktop) ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-header);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--teal-dark); }

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ════════════════════════════════════════════════
   TABLET  (≤ 900px)
════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Sidebar becomes icon-only strip */
  .sidebar {
    width: 64px;
    overflow: hidden;
  }
  .sidebar-logo {
    padding: 14px 8px 10px;
  }
  .sidebar-logo .username,
  .sidebar-logo .role,
  .sidebar-logo img:last-child { display: none; }
  .sidebar-logo > div:nth-child(2) { display: none; }

  .sidebar-nav a {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }
  .sidebar-nav a span:not(.nav-icon):not(.badge-count) { display: none; }
  .sidebar-nav a .nav-icon { width: 100%; text-align: center; font-size: 18px; }

  .main-content { margin-left: 64px; }

  /* Grids collapse */
  .medical-grid    { grid-template-columns: 1fr; }
  .dashboard-grid  { grid-template-columns: 1fr; }
  .sl              { grid-template-columns: 1fr !important; }
  .profile-layout  { grid-template-columns: 1fr !important; }
  .appt-section-grid { grid-template-columns: 1fr !important; }
  .txn-charts      { grid-template-columns: 1fr !important; }
  .pets-grid       { grid-template-columns: 1fr 1fr; }
  .alert-summary   { grid-template-columns: 1fr 1fr; }

  /* Messages layout */
  .msg-layout, .messages-layout {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
  .contacts-panel { max-height: 220px; }

  /* Table scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ════════════════════════════════════════════════
   MOBILE  (≤ 600px)
════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Show hamburger, hide fixed sidebar */
  .sidebar-toggle { display: flex; }

  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    /* Restore labels on mobile drawer */
  }
  .sidebar.open .sidebar-logo .username,
  .sidebar.open .sidebar-logo .role,
  .sidebar.open .sidebar-logo > div:nth-child(2) { display: block; }
  .sidebar.open .sidebar-nav a {
    justify-content: flex-start;
    padding: 10px 18px;
    gap: 10px;
  }
  .sidebar.open .sidebar-nav a span:not(.nav-icon):not(.badge-count) { display: inline; }
  .sidebar.open .sidebar-nav a .nav-icon { width: 20px; font-size: 16px; }

  .main-content { margin-left: 0; }

  /* Topbar */
  .topbar { padding: 12px 14px 12px 60px; }
  .topbar-title { font-size: 15px; }

  /* Page body */
  .page-body { padding: 12px 10px; }

  /* Stat cards */
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card  { padding: 14px 12px; }
  .stat-value { font-size: 26px !important; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .form-group label { font-size: 12px; }
  input, select, textarea { font-size: 13px !important; }

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 12px; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }

  /* Tables */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }
  th, td { padding: 8px 10px; font-size: 12px; }

  /* Calendar */
  .cal-cell { min-height: 52px !important; }
  .cal-day-header { font-size: 9px; padding: 4px 0; }
  .cal-event { font-size: 9px; padding: 1px 3px; }

  /* Cards / grids */
  .medical-grid     { grid-template-columns: 1fr; gap: 12px; }
  .pets-grid        { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-grid-full{ grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .alert-summary    { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-links      { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pet-detail-layout{ grid-template-columns: 1fr !important; }
  .inv-header       { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .inv-header > div { flex-wrap: wrap; gap: 8px; }

  /* Modals */
  .modal {
    margin: 10px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 16px !important;
  }
  .modal-title { font-size: 15px; }

  /* Auth box */
  .auth-box { padding: 28px 18px; }
  .auth-title { font-size: 22px; }

  /* Sidebar profile in drawer */
  .sidebar-logo { padding: 16px 12px 12px; }
}

/* ════════════════════════════════════════════════
   SMALL MOBILE  (≤ 380px)
════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .stat-cards       { grid-template-columns: 1fr; }
  .pets-grid        { grid-template-columns: 1fr; }
  .product-grid-full{ grid-template-columns: 1fr !important; }
  .topbar-title     { font-size: 13px; }
  .topbar-btn       { width: 30px; height: 30px; font-size: 14px; }
  .auth-box         { padding: 20px 14px; }
  .modal            { margin: 6px; }
}