/* ═══════════════════════════════════════════════════════
   OMYS Hide & Skin Collection System — Global Stylesheet
   Primary: #1a1aff  |  Pink: #d63384  |  Gradient ↘
   ═══════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --omys-primary:      #1a1aff;
  --omys-primary-dark: #1010cc;
  --omys-primary-light:#4444ff;
  --omys-pink:         #d63384;
  --omys-gradient:     linear-gradient(135deg, #d63384 0%, #1a1aff 100%);
  --omys-soft:         #eef0ff;
  --omys-border:       rgba(26, 26, 255, 0.16);

  /* Semantic */
  --omys-success:      #0f6e56;
  --omys-warning:      #854f0b;
  --omys-danger:       #a32d2d;

  /* Shape */
  --radius:            8px;
  --radius-lg:         12px;

  /* Layout */
  --sidebar-w:         240px;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 15px;
  overflow-x: hidden;
  scroll-behavior: auto !important; /* prevent smooth-scroll from fighting our preservation logic */
}

/* Prevent the browser from auto-scrolling when list/card content re-renders.
   Especially noticeable on mobile when we re-render the bookings/alerts/feedback grids. */
@media (max-width: 768px) {
  .mobile-card-container,
  #bookingsTbody,
  #overdueContainer,
  #donorConfirmContainer,
  #followupList,
  #feedbackContainer,
  .overdue-grid,
  .table-wrap,
  .table-outer {
    overflow-anchor: none;
  }
}
body {
  overflow-x: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f0f8;
  color: #1a1a2e;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Smooth fade-in on page load */
  animation: pageEnter 0.2s ease both;
}
/* Fade out just before navigating away */
body.page-leaving {
  opacity: 0;
  transition: opacity 0.15s ease;
}
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
a { color: var(--omys-primary); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ── Utilities ───────────────────────────────────────── */
.w-100  { width: 100%; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: #888; }
.text-sm    { font-size: 0.8125rem; }
.logo-white { filter: brightness(0) invert(1); }
.text-right { text-align: right; }
.fw-600  { font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover   { filter: brightness(1.08); }
.btn:active  { filter: brightness(0.92); }
.btn:disabled, .btn[disabled] { opacity: 0.52; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--omys-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,26,255,0.3);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(26,26,255,0.4);
  transform: translateY(-1px);
  filter: none;
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
  filter: none;
}
.btn-success { background: var(--omys-success); color: #fff; }
.btn-danger  { background: var(--omys-danger);  color: #fff; }
.btn-warning { background: var(--omys-warning); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--omys-primary);
  border: 1.5px solid var(--omys-border);
}
.btn-outline:hover { background: var(--omys-soft); filter: none; }
.btn-wa  { background: #25D366; color: #fff; }

.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: calc(var(--radius) - 2px);
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid rgba(26,26,255,0.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(26,26,255,0.05);
}
.card-header {
  padding: 0.75rem 1.25rem;
  background: var(--omys-soft);
  border-bottom: 1px solid #e2e0f0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: -1rem -1.25rem 1rem;
  font-weight: 600;
  color: var(--omys-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}
.form-card {
  background: #fff;
  border: 1px solid #e8e8f4;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0f0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: #1a1a2e;
}
.form-control:focus {
  border-color: var(--omys-primary);
  box-shadow: 0 0 0 4px rgba(26,26,255,0.08);
}
.form-control::placeholder { color: #bbb; }
select.form-control  { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alerts (inline) ─────────────────────────────────── */
.alert {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #e1f5ee; color: var(--omys-success); border-left: 3px solid var(--omys-success); }
.alert-danger  { background: #fcebeb; color: var(--omys-danger);  border-left: 3px solid var(--omys-danger);  }
.alert-warning { background: #faeeda; color: var(--omys-warning); border-left: 3px solid var(--omys-warning); }
.alert-info    { background: var(--omys-soft); color: var(--omys-primary); border-left: 3px solid var(--omys-primary); }

/* Operations alert rows */
.alert-overdue {
  border-left: 3px solid var(--omys-danger);
  background: #fcebeb;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}
.alert-followup {
  border-left: 3px solid var(--omys-warning);
  background: #faeeda;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

/* ── Status Badges ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-registered           { background: #eef0ff; color: #1a1aff; }
.badge-called               { background: #faeeda; color: #633806; }
.badge-ready                { background: #e1f5ee; color: #085041; }
.badge-dispatched           { background: #e6f1fb; color: #0c447c; }
.badge-collected            { background: #eaf3de; color: #27500a; }
.badge-feedback_done        { background: #d3d1c7; color: #2c2c2a; }
.badge-cancelled            { background: #fde8e8; color: #9b1c1c; }
.badge-chairman_unconfirmed { background: #fff3cd; color: #664d03; }

.badge-ready::before, .badge-dispatched::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: omys-pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes omys-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Table ───────────────────────────────────────────── */
.table-omys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,26,255,0.05);
}
.table-omys th {
  background: linear-gradient(135deg, #1010cc, #1a1aff);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.table-omys th:first-child { border-radius: 0; }
.table-omys th:last-child  { border-radius: 0; }
.table-omys td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 13px;
}
.table-omys tbody tr:nth-child(odd) { background: #fafafe; }
.table-omys tbody tr:hover { background: #f8f8ff; transition: background 0.1s; }
.table-omys tbody tr:last-child td { border-bottom: none; }

/* ── Toast notifications ─────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
  max-width: 320px;
  min-width: 220px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  opacity: 1;
  transition: opacity 0.32s;
  pointer-events: all;
  line-height: 1.45;
  animation: toastSlideIn 0.25s ease both;
}
.toast.toast-fade    { opacity: 0; }
.toast-success       { background: var(--omys-success); }
.toast-error,
.toast-danger        { background: var(--omys-danger); }
.toast-warning       { background: var(--omys-warning); }
.toast-info          { background: var(--omys-primary); }

/* ── Loading spinner ─────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: omys-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes omys-spin { to { transform: rotate(360deg); } }

/* ── Realtime row highlights (All Bookings silent updates) ── */
@keyframes highlightNew {
  0%   { background: #e1f5ee; }
  100% { background: transparent; }
}
@keyframes highlightUpdate {
  0%   { background: #faeeda; }
  100% { background: transparent; }
}

/* ── Custom multi-select dropdown ─────────────────────── */
.ms-wrapper { position: relative; min-width: 150px; flex: 1; }
.ms-trigger {
  display: flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1.5px solid #e0e0f0 !important;
  border-radius: 10px !important;
  padding: 9px 14px !important;
  font-size: 14px !important;
  cursor: pointer; user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s; min-height: 42px;
}
.ms-trigger:hover { border-color: #c0c0e8 !important; }
.ms-wrapper.open .ms-trigger {
  border-color: #1a1aff !important;
  box-shadow: 0 0 0 4px rgba(26,26,255,0.08);
}
.ms-label { flex: 1; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ms-badge { background: var(--omys-primary); color: #fff; border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.ms-chevron { font-size: 12px; color: #888; flex-shrink: 0; transition: transform 0.2s; }
.ms-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  min-width: 220px; background: #fff;
  border: 1px solid #e0e0f0; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(26,26,255,0.12);
  z-index: 500; overflow: hidden;
}
.ms-search { padding: 8px 10px; border-bottom: 1px solid #f0f0f8; }
.ms-search input { width: 100%; border: 1px solid #e0e0f0; border-radius: 6px; padding: 6px 10px; font-size: 12px; outline: none; }
.ms-search input:focus { border-color: var(--omys-primary); }
.ms-options { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.ms-option { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; color: #333; transition: background 0.1s; }
.ms-option:hover { background: #f8f8ff; }
.ms-option input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--omys-primary); flex-shrink: 0; }
.ms-option.ms-all { font-weight: 600; color: var(--omys-primary); }
.ms-divider { height: 1px; background: #f0f0f8; margin: 2px 0; }
.ms-footer { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid #f0f0f8; background: #fafafa; }
.ms-clear-btn { flex: 1; padding: 6px; background: #f0f0f8; color: #666; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; }
.ms-apply-btn { flex: 1; padding: 6px; background: var(--omys-gradient); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* ── Premium filter fields (match public registration form) ── */
.filter-select,
.filter-input,
select.form-filter,
input.form-filter {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1.5px solid #e0e0f0;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}
.filter-input { cursor: text; }
.filter-select:focus,
.filter-input:focus {
  border-color: #1a1aff;
  box-shadow: 0 0 0 4px rgba(26,26,255,0.08);
}
.filter-select:hover,
.filter-input:hover {
  border-color: #c0c0e8;
}

/* Custom dropdown arrow */
.filter-select-wrapper { position: relative; }
.filter-select-wrapper::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #888;
  pointer-events: none;
}
.filter-select-wrapper .filter-select { padding-right: 32px; }

/* Search input with icon */
.filter-search-wrapper { position: relative; }
.filter-search-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.filter-search-wrapper .filter-input { padding-left: 36px; }

@media (max-width: 768px) {
  .filter-select,
  .filter-input {
    font-size: 16px; /* prevents iOS zoom */
    padding: 10px 14px;
  }
  .filter-select-wrapper::after { right: 14px; }
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 240px;
  background: #0d0d6b;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.sidebar-brand img { height: 32px; flex-shrink: 0; }
.sidebar-brand-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.sidebar-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(214,51,132,0.3), rgba(26,26,255,0.4));
  color: #fff;
  font-weight: 500;
  border-left-color: #d63384;
  padding-left: 9px;
}
.sidebar .nav-item svg {
  stroke: rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.sidebar .nav-item:hover svg {
  stroke: white;
}
.sidebar .nav-item.active svg {
  stroke: white;
}
/* Reset button element defaults so nav-item buttons match nav links */
button.nav-item {
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.sidebar .nav-item {
  background: transparent !important;
}
.sidebar .nav-item:hover {
  background: rgba(255,255,255,0.1) !important;
}
.sidebar .nav-item.active {
  background: linear-gradient(135deg,
    rgba(214,51,132,0.25),
    rgba(26,26,255,0.35)) !important;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d63384, #1a1aff);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 1px;
}
.sidebar-logout {
  width: 100%;
  margin-top: 10px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* keep old classes as aliases so any pages using them still work */
.sidebar-logo { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.12); flex-shrink: 0; }
.sidebar-logo img { height: 32px; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; padding: 0.875rem 1rem; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.8rem; color: rgba(255,255,255,0.5); flex-shrink: 0; }

/* ── Main content ────────────────────────────────────── */
.main-content {
  margin-left: 240px;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-topbar {
  position: sticky;
  top: 0;
  left: 240px;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8e8f4;
  box-shadow: 0 1px 4px rgba(26,26,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 100;
  margin: -1.5rem -1.5rem 1.5rem;
}
.page-topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--omys-primary);
  margin-bottom: 1.25rem;
}
.page-title small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #888;
  margin-left: 0.5rem;
}

/* ── Stats / summary cards ───────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e0f0;
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--omys-gradient);
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--omys-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: transparent;
  background: var(--omys-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.metric-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(26,26,255,0.08);
  box-shadow: 0 2px 8px rgba(26,26,255,0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,26,255,0.1);
}
.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.metric-card-primary .metric-icon { background: var(--omys-gradient); color: #fff; }
.metric-card-success .metric-icon { background: #e1f5ee; color: #0f6e56; }
.metric-card-warning .metric-icon { background: #faeeda; color: #854f0b; }
.metric-card-danger  .metric-icon { background: #fcebeb; color: #a32d2d; }

/* ── Page footer ─────────────────────────────────────── */
.page-footer {
  background: #fff;
  border-top: 1px solid #e8e8f4;
  padding: 14px 1.5rem;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #888;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  left: 0;
  right: 0;
}
.page-footer a { color: inherit; text-decoration: none; }
.page-footer a:hover { opacity: 0.75; }
.footer-copy { font-size: 12px; color: #aaa; line-height: 1.5; }
.footer-dev {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.footer-dev-label {
  font-size: 10px;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-dev a { display: block; text-decoration: none; }
.footer-dev-logo { display: block; opacity: 0.85; height: 22px; }
.page-footer-centered {
  justify-content: center !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}
.page-footer-centered .footer-dev { align-items: center !important; }

/* ── Login page ──────────────────────────────────────── */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--omys-soft);
}
.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(26, 26, 255, 0.12);
  overflow: hidden;
}
.login-card-header {
  background: var(--omys-gradient);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
}
.login-card-header .logo-wrap img { height: 44px; }
.login-card-header .title-wrap h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.login-card-header .title-wrap p {
  font-size: 0.785rem;
  opacity: 0.68;
  margin-top: 0.25rem;
}
.login-card-body { padding: 1.75rem 1.75rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar: use overlay mode — handled by FIX 3 block below */
  .main-content { margin-left: 0 !important; margin-top: 0; padding: 1rem; }
  .page-topbar { left: 0; margin: -1rem -1rem 1rem; }
  .metric-card { min-width: 140px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card-header { padding: 1.25rem 1.5rem; }
  .login-card-body   { padding: 1.5rem; }
}

/* ── Two-column form grid ────────────────────────────── */
.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .form-two-col { grid-template-columns: 1fr; }
}

/* ── Bilingual label helpers ─────────────────────────── */
.urdu-label { color: #888; font-size: 12px; font-weight: 400; }
.required   { color: #a32d2d; margin-left: 2px; }
.optional   { color: #aaa; font-size: 11px; font-weight: 400; margin-left: 4px; }

/* ── intl-tel-input overrides ─────────────────────────── */
.iti { width: 100%; }
.iti input, .iti input[type=tel] { width: 100% !important; }
.iti__flag-container { z-index: 10; }

/* ── flatpickr theme overrides ────────────────────────── */
.flatpickr-calendar {
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(26,26,255,0.15) !important;
  border: 1px solid rgba(26,26,255,0.1) !important;
  font-family: inherit !important;
}
.flatpickr-time input:hover, .flatpickr-time input:focus { background: #f0f0ff !important; }
.flatpickr-time .flatpickr-am-pm {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1a1aff !important;
}
.numInputWrapper:hover { background: #f0f0ff !important; }
.flatpickr-time input.flatpickr-hour,
.flatpickr-time input.flatpickr-minute {
  font-size: 22px !important;
  font-weight: 600 !important;
  color: #1a1aff !important;
}
.flatpickr-time .flatpickr-time-separator {
  font-size: 22px !important;
  font-weight: 600 !important;
  color: #1a1aff !important;
}

/* ── Spinner keyframe (shared) ────────────────────────── */
@keyframes spin-global {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Toggle switch (PWA notification panel) ──────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ddd;
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--omys-gradient); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — FIX 2: Tables → Cards
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Remove horizontal scroll wrappers on mobile */
  .table-outer, .table-wrap, .table-responsive {
    overflow-x: visible !important;
    overflow: visible !important;
  }
}
@media (max-width: 640px) {
  .table-omys { display: block; width: 100%; }
  .table-omys thead { display: none !important; }
  .table-omys tbody { display: block; width: 100%; }
  .table-omys tbody tr {
    display: block !important;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8f4;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(26,26,255,0.05);
    width: 100%;
  }
  .table-omys td {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid #f4f4fb;
    font-size: 13px;
    width: 100%;
  }
  .table-omys td:last-child {
    border-bottom: none;
    padding-top: 10px;
    flex-direction: column;
    gap: 6px;
  }
  .table-omys td:last-child .btn { width: 100%; text-align: center; min-height: 40px; }
  .table-omys td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 90px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .table-omys td > * { max-width: calc(100% - 100px); word-break: break-word; }
  .table-omys tbody td:empty { display: none; }
}

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — FIX 3: Hamburger / Sidebar
   ══════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: #1a1a2e;
  line-height: 1;
  touch-action: manipulation;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.hamburger-btn svg { display: block; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 299;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex !important; }

  /* Full overlay sidebar — slides in from left */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100dvh !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 300 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1) !important;
    box-shadow: none !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3) !important;
  }
  /* Sidebar footer always visible inside the overlay */
  .sidebar-footer { display: flex !important; flex-direction: column !important; }

  /* Overlay visible when sidebar open */
  .sidebar-overlay.open { display: block; opacity: 1; }
}
@media (min-width: 769px) {
  .hamburger-btn { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — FIX 6: Full UX Audit
   ══════════════════════════════════════════════════════ */

/* A) Touch targets — 44px minimum */
@media (max-width: 768px) {
  .btn, button, .nav-item, select, input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
  }
  .nav-item { display: flex; align-items: center; }
  .badge, .status-badge { min-height: unset; }
}

/* B) Font sizes — prevent iOS auto-zoom on inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* C) Modals — slide up from bottom on mobile */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-box, .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* D) Metric cards — 2-column on mobile */
@media (max-width: 640px) {
  .metric-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }
  .metric-card {
    padding: 0.85rem 0.75rem !important;
    min-width: unset !important;
  }
  .metric-card .metric-value { font-size: 1.6rem !important; }
  .metric-card .metric-label { font-size: 11px !important; }
}

/* E) Alert card buttons — column on mobile (dept2) */
@media (max-width: 480px) {
  .alert-card-actions {
    flex-direction: column;
    gap: 0.4rem;
  }
  .alert-card-actions .btn { width: 100%; justify-content: center; }
}

/* F) Dispatch card buttons — column on mobile (dept3) */
@media (max-width: 480px) {
  .dispatch-card-actions {
    flex-direction: column;
    gap: 0.4rem;
  }
  .dispatch-card-actions .btn { width: 100%; justify-content: center; }
}

/* G) Chairman — 2-col stats, big mark-collected button */
@media (max-width: 640px) {
  .chairman-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .btn-mark-collected {
    width: 100%;
    font-size: 16px;
    padding: 14px;
    min-height: 52px;
  }
}

/* H) Flatpickr — fixed bottom on mobile */
@media (max-width: 640px) {
  .flatpickr-calendar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18) !important;
    z-index: 9999 !important;
  }
}

/* I) intl-tel-input country list — fixed bottom on mobile */
@media (max-width: 640px) {
  .iti__country-list {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 50dvh !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18) !important;
    z-index: 9999 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* K) Active state visual feedback */
.btn:active, button:active { opacity: 0.82; transform: scale(0.97); }
@media (hover: none) {
  .btn:hover, button:hover { background: unset; }
}

/* L) Prevent double-tap zoom on interactive elements */
button, .btn, a, input, select, textarea, label {
  touch-action: manipulation;
}

/* ── Register page nav — FIX 5 ──────────────────────── */
@media (max-width: 480px) {
  .nav-btn-login .btn-label { display: none; }
  .nav-btn-login {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-omys-link { display: none; }
}

/* ── Footer responsive ───────────────────────────────── */
@media (min-width: 769px) {
  .page-footer {
    margin-left: 0;
    width: 100%;
  }
}
@media (max-width: 768px) {
  .page-footer {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1.25rem 1rem !important;
    gap: 10px !important;
    width: 100%;
    margin: 0;
  }
  .footer-copy { text-align: center; font-size: 11px; }
  .footer-dev { align-items: center !important; }
}
/* Legacy alias */
.footer-dev-credit {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.footer-dev-credit .dev-label { font-size: 11px; color: #bbb; }
.footer-dev-credit a { display: flex; align-items: center; text-decoration: none; }

/* ── Mobile card containers ──────────────────────────── */
.mobile-card-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}
.mobile-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(26,26,255,0.08);
  padding: 14px 16px;
  border: 1px solid var(--omys-border);
}
.mobile-card-header {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef0ff;
  color: var(--omys-primary-dark);
}
.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid #f5f5fb;
}
.mobile-card-row:last-of-type { border-bottom: none; }
.mobile-card-label {
  color: #888;
  font-size: 0.8rem;
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
}
.mobile-card-value { text-align: right; flex: 1; }
.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef0ff;
}
.mobile-card-actions .btn {
  flex: 1;
  min-height: 42px;
  font-size: 13px;
  border-radius: 8px;
  justify-content: center;
  text-align: center;
}
.mobile-card-empty {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.9rem;
}
@media (max-width: 768px) {
  .table-omys { display: none !important; }
  .mobile-card-container { width: 100%; max-width: 100%; overflow: hidden; }
  .mobile-card .btn { min-height: 42px; font-size: 13px; border-radius: 8px; }
}

/* ── PWA modal animations ── */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ══════════════════════════════════════════════════════
   Dashboard motion — smooth entrance + feedback animations
   ══════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* Metric cards — staggered fade-in + hover lift */
.metric-card { animation: fadeInUp 0.4s ease both; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.10s; }
.metric-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4) { animation-delay: 0.20s; }
.metric-card:nth-child(5) { animation-delay: 0.25s; }
.metric-card:nth-child(6) { animation-delay: 0.30s; }
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,26,255,0.12); }

/* Section cards fade in */
.card { animation: fadeIn 0.3s ease both; }

/* Table rows fade in (staggered) */
.table-omys tbody tr { animation: fadeInUp 0.3s ease both; }
.table-omys tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.table-omys tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.table-omys tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.table-omys tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.table-omys tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.table-omys tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.table-omys tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.table-omys tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.table-omys tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.table-omys tbody tr:nth-child(n+10) { animation-delay: 0.20s; }

/* Smooth status-badge color transitions */
.badge { transition: background 0.3s ease, color 0.3s ease; }

/* Button press feedback (extends existing filter/opacity transition) */
.btn { transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.15s, opacity 0.15s; }
.btn:active { transform: scale(0.97); }

/* Area progress bar fill animation */
.area-progress-bar { transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }

/* Sidebar nav item hover animation */
.nav-item { transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease; }

/* Mobile card slide-in */
.mobile-card { animation: fadeInUp 0.3s ease both; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
