:root{
  --primary:#9d79b6;
  --bg:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --radius:12px;
  --space:16px;
  --fs-sm: 0.875rem;  /* ~14px */
  --fs-md: 1rem;      /* ~16px */
  --fs-lg: 1.5rem;   /* ~20px */
  --btn-lg: 2rem;
}

@media (max-width: 768px){
  :root{
    --fs-lg: 1.125rem; /* ~18px */
  }
}

/* Base reset */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* --- EXISTING LAYOUT (kept for your login page) ---
   The .container centers content, which is perfect for compact pages like login. */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* Card (compact by default; used by login) */
.card{
  width:100%;
  max-width:420px;               /* good for compact forms */
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
}

/* Typography */
h1{margin:0 0 6px;font-size:var(--fs-lg);font-weight:700}
.sub{margin:0 0 18px;color:var(--muted);font-size:var(--fs-lg)}

/* Form */
.form-group{margin-top:12px}
label{display:block;font-size:var(--fs-lg);color:var(--muted);margin:0 0 6px}
.input{
  width:100%;
  padding:22px 24px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  outline:none;
}
.input:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Row utils (optional) */
.row{display:flex;align-items:center;justify-content:space-between;margin-top:10px}
.checkbox{display:flex;align-items:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}
.link{color:#2563eb;text-decoration:none;font-size:var(--fs-lg)}
.link:hover{text-decoration:underline}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  padding:12px 14px;
  border:0;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
}
.btn-primary{background:var(--primary); color:#fff; text-decoration: none;}
.btn-primary:hover{filter:brightness(0.95)}
.btn-primary:active{transform:translateY(1px)}

.hint{margin-top:12px;text-align:center;color:var(--muted);font-size:var(--fs-lg)}

.btn-ghost{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
  text-decoration: none;
}
/* ==============================
   LIST PAGE LAYOUT (NEW SECTION)
   This makes the list page wide and uses a responsive grid.
   ============================== */

/* Wide page wrapper for lists. Place it outside the centered .container flow. */
.page{
  max-width:1100px;         /* roomy width for listings */
  margin:0 auto;
  padding:24px;
}

/* Make the header card expand full width (not the compact 420px). */
.card--wide{
  max-width:none;
  margin-bottom:16px;
}

/* Responsive grid for volunteer cards. 
   "minmax(280px, 1fr)" gives a nice minimum card width and fills the row. */
.cards-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:16px;
}

/* Volunteer card */
.vcard{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.04);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

/* Name and small meta row */
.vcard__name{
  font-size:var(--fs-lg);
  font-weight:700;
}
.vcard__meta{
  margin-top:4px;
  color:var(--muted);
  font-size:var(--fs-lg);
}

/* Right-side action (button area) */
.vcard__action{
  min-width:140px;
}

/* On small screens, stack vertically and make the button full-width */
@media (max-width: 520px){
  .vcard{flex-direction:column;}
  .vcard__action{width:100%}
}

/* Optional: if your layout wraps @yield inside .container 
   and centers everything, this rule prevents the list page 
   from being centered vertically like a login page. */
.container .page{
  place-self: stretch;    /* expand instead of being centered */
}

/* ------------------------------
   PHONE RESPONSIVENESS ONLY
   (Desktop remains the default)
   ------------------------------ */

/* Up to tablets/large phones */
@media (max-width: 768px) {
  /* Page wrapper gets softer gutters on phones */
  .page {
    max-width: 100%;
    padding: 16px;
  }

  .card--lg .login-page-title{
    font-size: 1.5rem;
  }

  /* Header card spans full width nicely */
  .card--wide {
    padding: 18px;
    margin-bottom: 16px;
  }

  /* Volunteer grid: slightly smaller min-card to fit 2 cols on many phones */
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }

  /* Volunteer card spacing and stacking behavior */
  .vcard {
    padding: 14px;
    gap: 12px;
    flex-direction: column;       /* stack content on small screens */
    align-items: stretch;
  }

  .vcard__action {
    width: 100%;                  /* full-width button on phones */
    min-width: 0;
  }

  /* Comfortable touch targets */
  .btn,
  .input {
    min-height: 44px;
  }

  /* Slightly smaller headings on phones for better fit */
  h1 {
    font-size:var(--fs-lg);
  }
}

/* Very small phones (narrower than ~380px) → single column grid */
@media (max-width: 380px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* If your layout wraps content inside .container (centers vertically),
   this ensures list pages are not vertically centered on phones */
@media (max-width: 768px) {
  .container .page {
    place-self: stretch;
  }
}

/* Header (black background with logo centered vertically) */
.site-header {
  background: #000;
  padding: 16px 20px; /* more padding to look taller */
}

.site-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center; /* vertically center logo */
}

.site-header .logo img {
  height: 80px;       /* increase logo size */
  max-width: 100%;    /* avoid overflow on small screens */
  object-fit: contain;
}

/* Alert bar above header */
.site-alert {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 16px 48px; /* taller padding for visibility */
  font-size: var(--fs-lg);    /* slightly larger text */
  line-height: 1.4;
  position: relative;
}

.site-alert .alert-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #000;
  font-size: var(--fs-lg);    /* bigger close button */
  cursor: pointer;
}
/* Centraliza verticalmente apenas onde for usado */
.container--centered{
  min-height: calc(100vh - 140px); /* margem p/ header+alert; ajuste se quiser */
  display: grid;
  place-items: center;
  padding: 34px;
}

/* Card maior para o login */
.card--lg{
  max-width: 760px;          /* maior que 420px */
  padding: 62px;             /* mais respiro */
}

/* Título maior na card */
.card--lg h1{
  font-size: 50px;
  margin-bottom: 14px;
}

.form-group + .btn,
.form-group{ margin-top: 26px; }

.btn--lg{
  padding: 24px 26px;
  font-size: var(btn-lg);
}
/* Larger button for login */
.btn--lg {
  padding: 16px 20px;      /* bigger hit area */
  font-size: var(btn-lg);         /* bigger text */
  font-weight: 700;        /* bold */
  letter-spacing: 0.5px;   /* optional: more readability */
}

.vcard--checked{
  background:#ecfdf5;
  border-color:#10b981;
  box-shadow:0 10px 30px rgba(16,185,129,.12);
}

.badge-checked{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  font-size:var(--fs-lg);
  font-weight:700;
  color:#065f46;
  background:#a7f3d0;
  border:1px solid #6ee7b7;
  border-radius:999px;
}

.btn-success { background:#16a34a; color:#fff; }
.vcard--checked { border-color:#16a34a; box-shadow:0 0 0 3px color-mix(in srgb, #16a34a 25%, transparent); }
.badge-checked {
  margin-left:8px; padding:2px 8px; border-radius:999px;
  background:#16a34a; color:#fff; font-size:var(--fs-lg); font-weight:700;
}

/* ---- VOLUNTEER TABLE FIX & STYLES ---- */

/* Table shell */
.table-wrap { overflow-x: auto; }
.table.table--volunteers { width: 100%; border-collapse: separate; border-spacing: 0; }

/* Header: primary background + white text */
.table--volunteers thead th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
}

/* Cells */
.table--volunteers tbody td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

/* Column sizing/alignment */
.table--volunteers .col-name { width: auto; font-size: var(--fs-lg);}
.table--volunteers .col-action,
.table--volunteers .cell-action { width: 220px; text-align: right; font-size: var(--fs-lg); }

/* IMPORTANT: neutralize the old “card” styles when .vcard is used on <tr> */
.table--volunteers .vcard {
  display: table-row;        /* cancel display:flex from old .vcard */
  background: transparent;   /* no card background */
  border: 0;                 /* no card border */
  box-shadow: none;          /* no card shadow */
  padding: 0;                /* rows don’t have padding */
  gap: 0;
  align-items: initial;
  justify-content: initial;
}

/* Keep your checked-in highlight, but apply it to the row cells */
.table--volunteers .vcard--checked td {
  background: #ecfdf5;
  border-top-color: #10b981;
}

/* Name/meta inside the first column */
.name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.vcard__meta { margin-top: 4px; color: var(--muted); font-size: var(--fs-lg); }

/* Action button shouldn’t stretch full-width inside table */
.table--volunteers .vcard__action { display: inline-block; }
.table--volunteers .vcard__action .btn { width: auto; min-width: 140px; }

/* Badge + success styles you already use */
.badge-checked {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 700;
}
.btn-success { background:#16a34a; color:#fff; }

/* Bigger table headers */
.table--volunteers thead th {
  font-size: var(--fs-lg);          /* was default */
  padding: 14px 16px;       /* a touch taller */
}

/* Bigger volunteer name */
.table--volunteers .vcard__name {
  font-size: var(--fs-lg);          /* was 16px */
}

/* Make Action column narrower and left-aligned */
.table--volunteers .col-action,
.table--volunteers .cell-action {
  width: 160px;             /* was ~220px */
  text-align: left;         /* was right */
}

/* Reduce left padding on the Action cell to bring button closer to Name */
.table--volunteers tbody td.cell-action {
  padding-left: 8px;        /* was 12–14px */
}

/* Keep the button compact so the column can sit closer */
.table--volunteers .vcard__action .btn {
  width: auto;
  min-width: 120px;         /* was 140px */
}

.toast{
  position: fixed;
  inset: auto 20px 20px auto; /* bottom-right */
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  font-weight: 600;
  z-index: 2000;
  max-width: min(90vw, 420px);
}
.toast--success{ background: #e7f7ee; color:#065f46; border:1px solid #a7f3d0; }
.toast--error{   background: #fde8e8; color:#7f1d1d; border:1px solid #fecaca; }
.toast--show{ animation: toast-in .15s ease-out; }
@keyframes toast-in{
  from{ transform: translateY(6px); opacity:0; }
  to{   transform: translateY(0);  opacity:1; }
}

.site-header .header-inner{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.header-actions{ display:flex; align-items:center; gap:12px; }
.user-chip{ color: var(--muted); font-size:.95rem; }

.btn-danger.btn-logout{
  background:#dc2626; border:1px solid #dc2626; color:#fff;
  padding:8px 14px; border-radius:10px; font-weight:700; cursor:pointer;
}
.btn-danger.btn-logout:hover{ filter:brightness(.95); }
.btn-danger.btn-logout:disabled{ opacity:.6; cursor:not-allowed; }


  /* Modal overlay */
.modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.5);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.modal[hidden]{ display:none; }

/* Dialog: usa grid para permitir rolagem só no body */
.modal__dialog{
  width: 1500px;
  max-height: 92dvh;                 /* viewport dinâmica */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,.25);

  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;  /* head | body | foot */
}

/* Head/Foot fixos; Body rola */
.modal__head{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 0px 18px;
  margin-bottom: -30px;
  background: #fff;
  font-size: var(--fs-lg);
}
.modal__body .label-title{
  font-size: var(--fs-lg);
  font-weight: 800;
  color: black;
}

.modal__foot{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.modal__foot{
  border-top: 1px solid var(--border);
  border-bottom: 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal__body{
  overflow: auto;                     
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px;
  min-height: 0;
}

.modal__close{ background:transparent; border:0; font-size:var(--fs-lg); cursor:pointer }
body.modal-open{ overflow: hidden; }
.modal__close__x{
  --hit: 44px;
  inline-size: var(--hit);  /* width  */
  block-size: var(--hit);   /* height */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1; 
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
}

/* opcional: feedback no hover/focus */
.modal__close__x:hover,
.modal__close__x:focus-visible{
  background: rgba(0,0,0,.06);
  outline: none;
}

.form-grid{
  --cols: 12;
  --gap: 16px;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  align-items: start;
}
.form-group{ margin: 0; }
.col-4{ grid-column: span 4; }
.col-6{ grid-column: span 6; }
.col-8{ grid-column: span 8; }
.col-12{ grid-column: span 12; }

label{ display:block; margin-bottom:6px; color: var(--muted); font-size: var(--fs-lg);}
.input{ width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:#fff }
.input:focus{ outline:none; border-color: var(--primary) }

.toggle-list{ display:flex; gap:12px; align-items:center }
.chips{ display:flex; flex-wrap:wrap; gap:8px }
.chip{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; padding:6px 10px; background:#fff }

/* Mobile */
@media (max-width: 900px){
  .modal{ padding: 0; }
  .modal__dialog{
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .form-grid{ --cols: 1; }
  .col-4,.col-6,.col-8,.col-12{ grid-column: auto; }
}

.btn-donor{
  background:#fff;
  color: var(--primary);
  border:1px solid var(--primary);
  border-radius:10px;
  padding:10px 12px;
  font-weight:700;
  cursor:pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-donor:hover{
  background: var(--primary);
  color:#fff;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.btn-receipt{
  background:var(--primary);
  color: #fff;
  border:1px solid var(--primary);
  border-radius:10px;
  padding:10px 12px;
  font-weight:700;
  cursor:pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-receipt:hover{
  background: #fff;
  color:var(--primary);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* grade dos resultados: exatamente 2 colunas */
.cards-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* no mobile vira 1 coluna */
@media (max-width: 900px){
  .cards-grid{ grid-template-columns: 1fr; }
}

.person-card{
  display: grid; /* <- era flex */
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.04);
}
.person-card__left{ min-width: 0; }
.person-card__name{ font-weight: 700; }
.person-card__meta{ color: var(--muted); font-size: var(--fs-lg); margin-top:4px; }

.card-actions{
  display:flex;
  gap:12px;
  flex-wrap:nowrap;
  flex-shrink:0;
  white-space:nowrap;
}

/* responsivo: empilha no mobile */
@media (max-width:560px){
  .person-card{ grid-template-columns: 1fr; }
  .card-actions{ margin-top:10px; }
}

.login-page-container{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.widget-container{
  border-radius: 10px;
}

@media (max-width: 900px){
  .card--lg{
    width: 100%;
    padding: 20px;
  }
  .login-page-container{
    width: 100%; 
    padding: 0;
  }
}

.user-chip, .btn-logout{
  font-size: var(--fs-lg);
} 