/*
  base.css - Shared tokens, reset, typography, buttons,
  forms, badges, cards, layout utilities.
  Imported by ALL pages.
*/

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand palette */
  --brand:        #16a34a;
  --brand-hover:  #15803d;
  --brand-light:  #f0fdf4;
  --brand-mid:    #dcfce7;
  --brand-dark:   #14532d;

  /* Neutral palette */
  --dark:   #111827;
  --bg:     #f8f9fb;
  --surface:#ffffff;
  --border: #e5e7eb;
  --ink:    #0f172a;
  --muted:  #64748b;
  --subtle: #94a3b8;
  --faint:  #cbd5e1;

  /* Semantic colors */
  --warn-bg:#fffbeb; --warn-bd:#fde68a; --warn-tx:#92400e;
  --info-bg:#eff6ff; --info-bd:#bfdbfe; --info-tx:#1e40af;
  --ok-bg:  #f0fdf4; --ok-bd:  #bbf7d0; --ok-tx:  #166534;
  --err-bg: #fff1f2; --err-bd: #fecdd3; --err-tx: #9f1239;

  /* Border radius scale */
  --r4:  4px; --r6:  6px; --r8:  8px;
  --r10: 10px; --r12: 12px; --r14: 14px; --r16: 16px;

  /* Shadow scale */
  --sh1: 0 1px 2px rgba(0,0,0,.04), 0 2px 6px rgba(0,0,0,.04);
  --sh2: 0 4px 12px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --sh3: 0 8px 28px rgba(0,0,0,.10), 0 3px 8px rgba(0,0,0,.05);
  --sh-brand: 0 4px 14px rgba(22,163,74,.25);

  /* Animation tokens */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography scale */
  --font-xs:   0.65rem;
  --font-sm:   0.75rem;
  --font-base: 0.875rem;
  --font-md:   1rem;
  --font-lg:   1.15rem;
  --font-xl:   1.35rem;
  --font-2xl:  1.75rem;
  --font-3xl:  2.25rem;
  --font-4xl:  3rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; transition: color var(--duration-fast) ease; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--subtle); }

/* ── Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r4);
}

/* ── Selection ── */
::selection {
  background: rgba(22, 163, 74, 0.15);
  color: var(--ink);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  /* Fixed height via padding — guarantees consistent height regardless of label length */
  padding: 0 1.2rem;
  height: 36px;          /* Standard button height across all variants */
  min-width: 0;          /* Allow shrink; explicit widths set per context */
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1px;
  border-radius: var(--r8); border: 1px solid transparent;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap; line-height: 1; cursor: pointer;
  position: relative; overflow: hidden;
  flex-shrink: 0;        /* Prevent buttons from being squished in flex containers */
  box-sizing: border-box;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Ripple effect base */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: opacity 0s, transform 0s;
}

.btn-primary {
  background: var(--brand); color: #fff; border-color: var(--brand-hover);
  box-shadow: 0 1px 3px rgba(22,163,74,.25), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover { background: var(--brand-hover); box-shadow: var(--sh-brand); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface); color: var(--ink);
  border-color: var(--border); box-shadow: var(--sh1);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--subtle); transform: translateY(-1px); }

.btn-danger {
  background: #dc2626; color: #fff; border-color: #b91c1c;
  box-shadow: 0 1px 3px rgba(220,38,38,.25);
}
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,.3); transform: translateY(-1px); }

/* Smaller variant — used for inline actions, pagination, search */
.btn-sm   { height: 30px; padding: 0 0.75rem; font-size: 0.73rem; border-radius: var(--r6); }

/* Full-width variant — login/submit forms */
.btn-full { width: 100%; height: 42px; font-size: 0.85rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block; font-size: 0.68rem; font-weight: 700;
  color: var(--muted); margin-bottom: 0.45rem;
  text-transform: uppercase; letter-spacing: 0.6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--faint); border-radius: var(--r8);
  font-size: 0.855rem; font-family: inherit; color: var(--ink);
  background: var(--surface);
  transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease, background var(--duration-base) ease;
  appearance: none; -webkit-appearance: none; outline: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
  padding-right: 2.2rem; cursor: pointer;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #9ca3af; opacity: 0.7; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand); background: var(--brand-light);
  box-shadow: 0 0 0 3.5px rgba(22,163,74,.1);
}

.form-group input:disabled,
.form-group select:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; opacity: 0.7; }

.form-group textarea { resize: vertical; min-height: 110px; line-height: 1.65; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-section-label {
  font-size: 0.64rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.9px; color: var(--subtle);
  padding: 1.1rem 0 0.6rem; border-top: 1px solid var(--border); margin-top: 0.5rem;
}

.form-actions {
  display: flex; gap: 0.6rem; justify-content: flex-end;
  align-items: center;          /* vertically centre mixed-size buttons */
  flex-wrap: wrap;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}

.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.label-row label { margin-bottom: 0; }
.label-link { font-size: 0.72rem; color: var(--brand); font-weight: 600; }
.label-link:hover { text-decoration: underline; }

.field-hint { display: block; font-size: 0.7rem; color: var(--subtle); margin-top: 0.28rem; line-height: 1.5; }
.required { color: #ef4444; }

.file-upload-box {
  position: relative; border: 1.5px dashed var(--faint);
  border-radius: var(--r6); padding: 1.75rem 1.25rem;
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; background: var(--bg);
}
.file-upload-box:hover { border-color: var(--brand); background: var(--brand-light); }
.file-upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-upload-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.file-upload-hint  { font-size: 0.72rem; color: var(--subtle); margin-top: 0.3rem; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem; border-radius: var(--r4);
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; border: 1px solid transparent;
}
.badge-pending  { background: var(--warn-bg); color: var(--warn-tx); border-color: var(--warn-bd); }
.badge-progress { background: var(--info-bg); color: var(--info-tx); border-color: var(--info-bd); }
.badge-resolved { background: var(--ok-bg);   color: var(--ok-tx);   border-color: var(--ok-bd); }
.badge-role     { background: var(--brand-light); color: var(--ok-tx); border-color: var(--ok-bd); }

/* ── CARD ── */
.card {
  background: var(--surface); border-radius: var(--r12);
  border: 1px solid var(--border);
  box-shadow: var(--sh1);
  padding: 1.5rem;
  transition: box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.card:hover { box-shadow: var(--sh2); }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); line-height: 1.2; }
.page-header p  { font-size: 0.78rem; color: var(--subtle); margin-top: 0.2rem; }
.section-label  { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--subtle); margin-bottom: 0.75rem; }

/* ── LAYOUT HELPERS ── */
.two-col      { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; align-items: start; }
.two-col-wide { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
.two-col-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .two-col, .two-col-wide, .two-col-equal { grid-template-columns: 1fr; } }

/* ── 2FA / OTP MOBILE FIXES ── */
@media (max-width: 480px) {
  .otp-input {
    font-size: 1.2rem !important;
    letter-spacing: 0.2rem !important;
    padding: 0.6rem 0.5rem !important;
  }
  .qr-wrap {
    padding: 0.75rem !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center;
  }
  .qr-wrap img, .qr-wrap svg {
    max-width: 100% !important;
    height: auto !important;
  }
  .secret-box {
    font-size: 0.72rem !important;
    padding: 0.5rem !important;
    overflow-wrap: break-word;
    word-break: break-all;
  }
  .step-row {
    gap: 0.5rem !important;
  }
  .step-text {
    font-size: 0.78rem !important;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn {
    width: 100%;
  }
}

/* ── SECTION CARD ── */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r10); box-shadow: var(--sh1); overflow: hidden; }
.section-card-header { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
.section-card-header h3 { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.section-card-body { padding: 1.25rem; }

/* ── ACTIVITY LIST ── */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: flex-start; gap: 0.875rem; padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.dot-pending  { background: #d97706; }
.dot-progress { background: #2563eb; }
.dot-resolved { background: var(--brand); }
.activity-text { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }
.activity-text strong { color: var(--ink); font-weight: 600; }
.activity-time { font-size: 0.68rem; color: var(--subtle); margin-top: 0.15rem; }

/* ── INFO BOX ── */
.info-box { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--r10); padding: 1.1rem 1.25rem; box-shadow: var(--sh1); }
.info-box h3 { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--brand); margin-bottom: 0.65rem; }
.info-box ol, .info-box ul { padding-left: 1.1rem; }
.info-box li { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; line-height: 1.6; }
.info-box li strong { color: var(--ink); font-weight: 600; }

/* ── TIP CARD ── */
.tip-card { background: var(--dark); background-image: radial-gradient(ellipse at 0% 100%, rgba(22,163,74,.15) 0%, transparent 55%); border-radius: var(--r10); padding: 1.25rem 1.5rem; color: #fff; position: relative; overflow: hidden; max-width: 100%; }
.tip-card::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.tip-card-label { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #4ade80; margin-bottom: 0.4rem; position: relative; }
.tip-card h4,
.tip-card h3,
.tip-card h2 { font-size: 0.85rem; font-weight: 700; color: #fff !important; margin-bottom: 0.35rem; position: relative; }
.tip-card p  { font-size: 0.78rem; color: rgba(255,255,255,.85); line-height: 1.6; position: relative; }
.tip-card p strong { color: #fff; }

/* ── QUICK ACTIONS ── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.action-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r10); padding: 1.25rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 0.3rem; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; overflow: hidden; box-shadow: var(--sh1); }
.action-card::after { content: '→'; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 0.9rem; color: var(--faint); transition: color .15s, right .15s; font-weight: 600; }
.action-card:hover { border-color: #86efac; box-shadow: var(--sh2); transform: translateY(-2px); }
.action-card:hover::after { color: var(--brand); right: 0.9rem; }
.action-card.action-primary { border-color: #bbf7d0; background: linear-gradient(145deg, var(--brand-light) 0%, var(--surface) 100%); }
.action-card-label { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.action-card-desc  { font-size: 0.73rem; color: var(--subtle); line-height: 1.55; padding-right: 1.5rem; }

/* ── REPORT CARDS ── */
.report-list { display: flex; flex-direction: column; gap: 0.65rem; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r10); padding: 1.1rem 1.25rem; border-left: 3px solid var(--brand); transition: box-shadow .15s, transform .15s; box-shadow: var(--sh1); }
.report-card:hover { box-shadow: var(--sh2); transform: translateX(2px); }
.report-card.card-pending  { border-left-color: #d97706; }
.report-card.card-progress { border-left-color: #2563eb; }
.report-card.card-resolved { border-left-color: var(--brand); opacity: 0.75; }
.report-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.report-category { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.report-location { font-size: 0.73rem; color: var(--subtle); margin-bottom: 0.3rem; }
.report-desc     { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; line-height: 1.6; }
.report-footer   { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.report-date     { font-size: 0.68rem; color: var(--subtle); }

/* ── DETAIL ROWS ── */
.detail-row { display: grid; grid-template-columns: 110px 1fr; gap: 0.5rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--subtle); padding-top: 0.1rem; }
.detail-value { color: var(--muted); line-height: 1.65; }

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; }
.timeline-step { display: flex; align-items: flex-start; gap: 0.75rem; padding-bottom: 1.1rem; position: relative; }
.timeline-step:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.timeline-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); flex-shrink: 0; margin-top: 1px; }
.timeline-dot.done   { background: var(--brand); border-color: var(--brand); }
.timeline-dot.active { background: #2563eb; border-color: #2563eb; }
.timeline-text { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.timeline-text strong { color: var(--ink); font-weight: 600; display: block; }
.timeline-time { font-size: 0.68rem; color: var(--subtle); margin-top: 0.1rem; }

/* ── PROFILE AVATAR ── */
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; color: #fff; flex-shrink: 0; }

/* ── ADMIN STAT ROW ── */
.admin-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.admin-stat-row:last-child { border-bottom: none; }
.admin-stat-lbl { color: var(--muted); }
.admin-stat-val { font-weight: 800; font-size: 1rem; color: var(--ink); }

/* ── TABLE ── */
.table-wrapper { overflow-x: auto; border-radius: var(--r10); border: 1px solid var(--border); box-shadow: var(--sh1); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.8rem; }
.data-table thead tr { background: var(--bg); border-bottom: 1px solid var(--border); }
.data-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--subtle); white-space: nowrap; }
.data-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: middle; line-height: 1.5; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }
.data-table select { padding: 0.28rem 1.6rem 0.28rem 0.5rem; border-radius: var(--r4); border: 1px solid var(--faint); font-size: 0.73rem; font-family: inherit; background: var(--surface); cursor: pointer; color: var(--muted); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.4rem center; appearance: none; }

/* ── ROLE SELECTOR ── */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.5rem; }
.role-btn { display: flex; flex-direction: column; align-items: flex-start; padding: 0.85rem 1rem; border: 1.5px solid var(--faint); border-radius: var(--r8); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; text-align: left; font-family: inherit; }
.role-btn:hover { border-color: var(--brand); background: var(--brand-light); }
.role-btn.role-active { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.role-btn-title { font-size: 0.82rem; font-weight: 700; color: var(--ink); display: block; }
.role-btn-desc  { font-size: 0.7rem; color: var(--subtle); margin-top: 0.15rem; display: block; }

/* ── IMAGE CONTAINMENT — prevents portrait/large images from breaking layout ── */

/*
  Any image inside a constrained wrapper (.img-contain-wrap) will
  scale responsively without overflow or aspect-ratio distortion.
*/
.img-contain-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;        /* clip anything that would escape */
  border-radius: var(--r8);
  border: 1px solid var(--border);
  background: var(--bg);   /* letterbox bg for portrait images */
  line-height: 0;          /* remove phantom inline gap below img */
}

.img-contain-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;     /* show full image, no cropping */
  border-radius: inherit;
}

/* Photo preview in report form — capped height so portrait photos don't explode */
.photo-preview-wrap img,
#edit-preview-img {
  display: block;
  max-width: 100%;
  max-height: 280px;       /* generous but controlled height */
  width: auto;             /* keep natural width up to max-width */
  height: auto;
  object-fit: contain;
  border-radius: var(--r8);
  border: 1px solid var(--border);
  background: var(--bg);
  margin: 0 auto;          /* centre portrait images in their container */
}

/* Thumbnail images in report lists */
.report-thumb {
  display: block;
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--r6);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Detail view report/resolution photos */
.report-photo-detail {
  display: block;
  max-width: 100%;         /* never wider than the detail column */
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r8);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-top: 0.25rem;
}

.report-photo-resolution {
  display: block;
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r8);
  border: 2px solid #bbf7d0;
  background: var(--bg);
  margin-top: 0.25rem;
}

/* Camera video feed — always fills its container without overflow */
#camera-video {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--r8);
  border: 1px solid var(--border);
  background: #000;
}

/* ── CONFIRMATION MODAL ── */
.confirm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-modal-overlay.open {
  display: flex;
}
.confirm-modal {
  background: var(--surface);
  border-radius: var(--r16);
  padding: 2rem 1.75rem 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--sh3);
  animation: confirm-pop-in 0.28s var(--ease-spring) both;
  text-align: center;
}
@keyframes confirm-pop-in {
  from { opacity:0; transform: scale(0.88) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.confirm-modal-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fff1f2;
  border: 2px solid #fecdd3;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.confirm-modal-icon svg { display: block; }
.confirm-modal-title {
  font-size: 1rem; font-weight: 800; color: var(--ink);
  margin-bottom: 0.4rem; letter-spacing: -0.2px;
}
.confirm-modal-body {
  font-size: 0.82rem; color: var(--muted); line-height: 1.65;
  margin-bottom: 1.5rem;
}
.confirm-modal-item {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r6);
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.3rem 0 0;
  max-width: 100%;
  word-break: break-word;
}
.confirm-modal-actions {
  display: flex; gap: 0.65rem; justify-content: center;
  flex-wrap: wrap;
}
.confirm-modal-actions .btn {
  flex: 1; min-width: 100px; max-width: 160px;
}
@media (prefers-reduced-motion: reduce) {
  .confirm-modal { animation: none !important; }
}
@media (max-width: 480px) {
  .confirm-modal { padding: 1.5rem 1.25rem 1.25rem; border-radius: var(--r12); }
  .confirm-modal-actions .btn { max-width: none; }
}
.logo-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── OFFICE DIRECTORY ── */
.office-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.office-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r10);
  padding: 1.35rem;
  box-shadow: var(--sh1);
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
}
.office-card:hover { box-shadow: var(--sh2); transform: translateY(-2px); }

.office-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

.office-icon {
  width: 40px; height: 40px;
  border-radius: var(--r6);
  flex-shrink: 0;
  background: var(--brand-light);
  border: 1px solid var(--brand-mid);
}
.office-icon-maintenance { background: #fef3c7; border-color: #fde68a; }
.office-icon-ict         { background: #dbeafe; border-color: #bfdbfe; }
.office-icon-safety      { background: #fee2e2; border-color: #fecdd3; }
.office-icon-health      { background: #d1fae5; border-color: #a7f3d0; }
.office-icon-registrar   { background: #ede9fe; border-color: #ddd6fe; }
.office-icon-osa         { background: #fce7f3; border-color: #fbcfe8; }

.office-name  { font-size: 0.85rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.office-abbr  { font-size: 0.7rem; font-weight: 600; color: var(--subtle); margin-top: 0.15rem; }
.office-desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.875rem; flex: 1; }

.office-handles { margin-bottom: 0.75rem; }
.office-handles-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--subtle); margin-bottom: 0.4rem; }

.office-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.office-tag {
  font-size: 0.68rem; font-weight: 600;
  background: var(--brand-light); color: var(--ok-tx);
  border: 1px solid var(--brand-mid);
  padding: 0.15rem 0.5rem; border-radius: var(--r4);
}

.office-tag-sm {
  font-size: 0.65rem; font-weight: 600;
  background: var(--brand-light); color: var(--ok-tx);
  border: 1px solid var(--brand-mid);
  padding: 0.1rem 0.4rem; border-radius: var(--r4);
  display: inline-block; margin: 0.1rem 0.1rem 0 0;
}

.office-contact {
  display: flex; flex-direction: column; gap: 0.2rem;
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.office-contact-item { font-size: 0.73rem; color: var(--subtle); }

/* ── MOTION & ANIMATION SYSTEM ── */

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-in { opacity: 1 !important; transform: none !important; }
}

/* Scroll-triggered fade-in animations */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for child elements */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }

/* Slide-in from left */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide-in from right */
.animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale-in */
.animate-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Pulse glow for important elements */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.3); }
  50% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
}
.pulse-glow { animation: pulse-glow 2.5s ease-in-out infinite; }

/* Notification badge bounce */
@keyframes notif-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Subtle float for decorative elements */
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-gentle { animation: float-gentle 4s ease-in-out infinite; }

/* Activity dot pulse */
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}
.dot-pending, .dot-progress {
  animation: dot-pulse 2s ease-in-out infinite;
}

/* Stat number count-up feel */
@keyframes stat-pop {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── PASSWORD TOGGLE ── */
.pw-field-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--faint);
  border-radius: var(--r6);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
  overflow: hidden;
}
.pw-field-wrap:focus-within {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.pw-field-wrap input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0.55rem 0 0.55rem 0.8rem !important;
  width: 100%;
  min-width: 0;
}
.pw-field-wrap input:focus {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.pw-eye {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.65rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s;
}
.pw-eye:hover { color: #374151; }
.pw-eye svg { display: block; pointer-events: none; }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--r10);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh3);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 280px;
  max-width: 400px;
  animation: toast-slide-in 0.4s var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brand);
  animation: toast-progress 4s linear forwards;
}

.toast-success { border-left: 3px solid var(--brand); }
.toast-success::before { background: var(--brand); }
.toast-error { border-left: 3px solid #dc2626; }
.toast-error::before { background: #dc2626; }
.toast-warning { border-left: 3px solid #d97706; }
.toast-warning::before { background: #d97706; }
.toast-info { border-left: 3px solid #2563eb; }
.toast-info::before { background: #2563eb; }

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--subtle);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--duration-fast) ease;
}
.toast-dismiss:hover { color: var(--ink); }

.toast.toast-exit {
  animation: toast-slide-out 0.3s var(--ease-out) forwards;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-slide-out {
  to { opacity: 0; transform: translateX(100%) scale(0.9); }
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ── BACK TO TOP BUTTON ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: var(--sh2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 900;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              background var(--duration-fast) ease;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--brand-hover);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--sh-brand);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

/* ── ALERT MESSAGES (replacing inline styles) ── */
.alert {
  border-radius: var(--r8);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: alert-slide-in 0.3s var(--ease-smooth) both;
}

.alert-success {
  background: var(--ok-bg);
  color: var(--ok-tx);
  border: 1px solid var(--ok-bd);
}

.alert-error {
  background: var(--err-bg);
  color: var(--err-tx);
  border: 1px solid var(--err-bd);
}

.alert-warning {
  background: var(--warn-bg);
  color: var(--warn-tx);
  border: 1px solid var(--warn-bd);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-tx);
  border: 1px solid var(--info-bd);
}

@keyframes alert-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, #e8eaed 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r6);
}

.skeleton-text {
  height: 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: var(--r4);
}

.skeleton-text-sm {
  height: 0.65rem;
  width: 60%;
  border-radius: var(--r4);
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--r10);
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── SUBTLE NOISE TEXTURE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── RESPONSIVE UTILITIES ── */
@media (max-width: 480px) {
  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
  .toast { min-width: auto; width: 100%; }
  .back-to-top { bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px; }
}

/* ── CONFIRM MODAL ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.2s ease, backdrop-filter 0.2s ease, -webkit-backdrop-filter 0.2s ease;
}
.confirm-overlay.confirm-open {
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-box {
  background: #fff;
  border-radius: 14px;
  padding: 2rem 1.75rem 1.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  text-align: center;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.confirm-overlay.confirm-open .confirm-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.confirm-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.1rem;
}
.confirm-icon-danger {
  background: #fff1f2;
  color: #dc2626;
  border: 1px solid #fecdd3;
}
.confirm-icon-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.confirm-title {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.5rem;
  letter-spacing: -0.2px;
}

.confirm-message {
  font-size: 0.83rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.confirm-btn-cancel {
  flex: 1;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  transition: background .15s, color .15s;
}
.confirm-btn-cancel:hover { background: #e5e7eb; }

.confirm-btn-ok {
  flex: 1;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.confirm-btn-ok:hover { opacity: 0.88; }

.confirm-btn-danger {
  background: #dc2626;
  color: #fff;
}
.confirm-btn-info {
  background: #2563eb;
  color: #fff;
}

/* ── IMAGE LIGHTBOX ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
  cursor: zoom-out;
}
.lightbox-overlay.lb-open {
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox-img {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  object-fit: contain;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  cursor: default;
}
.lightbox-overlay.lb-open .lightbox-img {
  transform: scale(1);
  opacity: 1;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  z-index: 9999;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* Make lightbox-triggerable images show a zoom cursor */
[data-lightbox] { cursor: zoom-in; }
