/* css/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b1120;
  --surface:   #141e30;
  --surface2:  #1c2a40;
  --surface3:  #243450;
  --border:    #2a3f5f;
  --text:      #dde6f3;
  --muted:     #6b80a0;
  --accent:    #38bdf8;
  --accent2:   #818cf8;
  --green:     #4ade80;
  --red:       #f87171;
  --yellow:    #fbbf24;
  --radius:    12px;
  --radius-sm: 8px;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; }

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; padding: 0.7rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 16px; transition: border-color 0.15s; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group select option { background: var(--surface2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.65rem 1.2rem; border: none; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; line-height: 1; cursor: pointer; transition: opacity 0.15s, transform 0.1s; white-space: nowrap; }.btn:active { transform: scale(0.97); }
.btn-primary   { background: var(--accent);   color: #0b1120; height: 37px; }
.btn-secondary { background: var(--surface3); color: var(--text); }
.btn-danger    { background: var(--red);       color: #0b1120; height: 37px; }
.btn-success   { background: var(--green);     color: #0b1120; }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn:hover     { opacity: 0.85; }
.btn-full      { width: 100%; justify-content: center; padding: 0.85rem; font-size: 1rem; }
.btn-sm        { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn:disabled  { cursor: not-allowed; }

.main-content { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.tab-nav {
  display: flex;
  justify-content: center;      /* back to center by default */
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  overflow-x: auto;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tab-nav.is-scrollable {
  justify-content: flex-start;  /* only when tabs don't fit */
}

.tab-nav::-webkit-scrollbar { height: 4px; }
.tab-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.tab-nav::-webkit-scrollbar-track { background: transparent; }
.tab-btn { padding: 0.55rem 1rem; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 0.87rem; font-weight: 600; cursor: pointer; white-space: nowrap; text-align: center; transition: all 0.15s; }
.tab-btn.active { background: var(--accent); color: #0b1120; }
.tab-btn:hover:not(.active) { background: var(--surface2); color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.2rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; flex-wrap: wrap; gap: 0.75rem; }
.card-title    { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

.week-selector { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.week-selector select {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  background: var(--surface)
    url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b80a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 0.85rem center;
  background-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.summary-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.summary-stat .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.summary-stat .value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.summary-stat .value.red    { color: var(--red); }
.summary-stat .value.green  { color: var(--green); }
.summary-stat .value.yellow { color: var(--yellow); }
.summary-stat .value.accent { color: var(--accent); }

.person-block  { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.person-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.2rem; cursor: pointer; user-select: none; background: var(--surface3); }
.person-name   { font-weight: 700; font-size: 0.95rem; }
.person-total  { font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.person-body   { padding: 1rem 1.2rem; }
.hidden-body   { display: none; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; padding: 0.55rem 0.75rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #1c2a4070; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #ffffff08; }
.data-table .amount  { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn + .btn { margin-left: 0.4rem; }
.data-table tfoot td { border-top: 1px solid var(--border); border-bottom: none; padding-top: 0.7rem; }

.data-table-3col { table-layout: fixed; }
.data-table-3col th:nth-child(1),
.data-table-3col td:nth-child(1) { width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table-3col th:nth-child(2),
.data-table-3col td:nth-child(2) { width: 30%; }
.data-table-3col th:nth-child(3),
.data-table-3col td:nth-child(3) { width: 15%; }

.data-table.bills-table { table-layout: fixed; }
.data-table.bills-table th:nth-child(1),
.data-table.bills-table td:nth-child(1) { width: 42%; }
.data-table.bills-table th:nth-child(2),
.data-table.bills-table td:nth-child(2) { width: 15%; }
.data-table.bills-table th:nth-child(3),
.data-table.bills-table td:nth-child(3) { width: 13%; }
.data-table.bills-table th:nth-child(1),
.data-table.bills-table td:nth-child(1) { width: 38%; }
.data-table.bills-table th:nth-child(4),
.data-table.bills-table td:nth-child(4) { width: 34%; }

.status-badge    { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.7rem; border-radius: 99px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.status-paid     { background: #14532d; color: var(--green); }
.status-not_paid { background: #7f1d1d; color: var(--red); }
.status-pending  { background: #44403c; color: var(--yellow); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; overflow-y: auto; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; width: 100%; max-width: 480px; transform: translateY(10px); transition: transform 0.2s; margin: auto; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title  { font-size: 1.1rem; font-weight: 700; }
.modal-close  { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

#toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1.2rem; font-size: 0.9rem; z-index: 9999; opacity: 0; transform: translateY(8px); transition: all 0.25s; max-width: 300px; }
#toast.show    { opacity: 1; transform: translateY(0); }
#toast.success { border-left: 3px solid var(--green); }
#toast.error   { border-left: 3px solid var(--red); }

.empty-state      { text-align: center; padding: 2.5rem; color: var(--muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p    { font-size: 0.9rem; }

.alert         { padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1rem; }
.alert-error   { background: #7f1d1d40; border: 1px solid #7f1d1d; color: var(--red); }
.alert-success { background: #14532d40; border: 1px solid #14532d; color: var(--green); }

.history-item   { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.history-week   { font-weight: 700; }
.history-closed { color: var(--muted); font-size: 0.8rem; }
.history-total  { font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* ── Tab panels ── */
.tab-panel { display: none; }

/* ── Pending rows ── */
.pending-list   { 
  margin-top: 1rem; 
  border: 1px solid var(--border); 
  border-radius: var(--radius-sm); 
  overflow: hidden;
  max-height: 270px;
  overflow-y: auto;
  overscroll-behavior: contain;   /* ← add this */
}
.pending-row    { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--border); background: var(--surface2); font-size: 0.88rem; }
.pending-row:last-child { border-bottom: none; }
.pending-desc      { flex: 1; }
.pending-amount    { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending-subtotal  { padding: 0.55rem 0.85rem; font-size: 0.85rem; color: var(--muted); background: var(--surface3); text-align: right; }
.pending-subtotal strong { color: var(--green); }

/* ── Modal footer split ── */
.modal-footer-split          { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.modal-footer-split .btn-add-more { flex: 1; }
.modal-footer-split .right-btns  { display: flex; gap: 0.6rem; }

/* ── Debt row paid ── */
.debt-row-paid td { opacity: 0.55; }

/* ── Payment applied rows ── */
.payment-applied-row { font-size: 0.8rem; color: var(--muted); padding: 0.2rem 0; }

/* ════════════════════════════════════════════════════
   ENTRIES TAB — Week Filter
════════════════════════════════════════════════════ */
.entries-card-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

.entries-week-filter {
  min-width: 220px;
  padding: 0.5rem 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
  /* override .form-group select full-width rule */
  width: auto;
}

.entries-week-filter:focus {
  outline: none;
  border-color: var(--accent);
}

.entries-week-filter option {
  background: var(--surface2);
}

/* ════════════════════════════════════════════════════
   PAY MODAL — Click to Pay
════════════════════════════════════════════════════ */
.pay-modal    { max-width: 520px; }
.pay-step-hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }

.pay-member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
.pay-member-card { background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius); padding: 1rem 0.6rem 0.75rem; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.pay-member-card:hover:not(.pay-member-card-disabled) { border-color: var(--accent); background: var(--surface3); transform: translateY(-2px); }
.pay-member-card:active:not(.pay-member-card-disabled) { transform: scale(0.97); }
.pay-member-card.pay-member-card-disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }
.pay-member-avatar   { width: 42px; height: 42px; background: var(--surface3); border: 2px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; color: var(--accent); margin: 0 auto 0.5rem; }
.pay-member-name     { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.25rem; }
.pay-member-debt     { font-size: 0.74rem; color: var(--red); font-weight: 700; }
.pay-member-nodebt   { font-size: 0.72rem; color: var(--muted); }
.pay-member-channels { display: flex; justify-content: center; gap: 0.3rem; margin-top: 0.4rem; }

.qr-chip       { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.68rem; font-weight: 900; color: #fff; }
.gcash-chip    { background: #007aff; }
.bdo-chip      { background: #003087; }
.maribank-chip { background: #f97316; }
.maya-chip     { background: #00c56d; }
.cash-chip     { background: #16a34a; }

.pay-s2-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.pay-s2-avatar { width: 46px; height: 46px; background: var(--surface3); border: 2px solid var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.pay-s2-name   { font-size: 1.05rem; font-weight: 700; }
.pay-s2-owes   { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }

.pay-channel-tabs {
  display: flex;
  flex-wrap: wrap;          
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pay-channel-btn {
  flex: 1 1 calc(33.333% - 0.5rem);   
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;   
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.82rem;       
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.pay-channel-btn.active { border-color: var(--accent); color: var(--text); background: var(--surface3); }
.pay-channel-icon { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 900; color: #fff; }
.gcash-icon    { background: #007aff; }
.bdo-icon      { background: #003087; }
.maribank-icon { background: #f97316; }
.maya-icon     { background: #00c56d; }
.cash-icon     { background: #16a34a; }

.pay-qr-wrapper { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: var(--radius); padding: 1rem; border: 1px solid var(--border); }
.pay-qr-img     { width: 100%; max-width: 240px; height: auto; border-radius: 6px; display: block; }
.pay-qr-hint    { font-size: 0.75rem; color: #888; margin-top: 0.5rem; text-align: center; }

.pay-step2-footer { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.pay-step2-footer .right-btns { display: flex; gap: 0.6rem; }

/* ── Pay type picker ── */
.pay-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }
.pay-type-btn  { display: flex; align-items: center; gap: 0.85rem; padding: 1.1rem 1rem; background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.pay-type-btn:hover:not(:disabled)  { border-color: var(--accent); background: var(--surface3); transform: translateY(-2px); }
.pay-type-btn:active:not(:disabled) { transform: scale(0.97); }
.pay-type-btn:disabled { cursor: not-allowed; }
.pay-type-icon  { font-size: 1.6rem; flex-shrink: 0; }
.pay-type-label { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.pay-type-sub   { font-size: 0.75rem; color: var(--muted); }

/* ════════════════════════════════════════════════════
   BDO TAB — Upload & Receipt
════════════════════════════════════════════════════ */
.bdo-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface2); min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; position: relative; overflow: hidden; padding: 1rem; }
.bdo-upload-area:hover  { border-color: var(--accent); background: var(--surface3); }
.bdo-upload-area.drag-over { border-color: var(--accent); background: #38bdf815; }
.bdo-upload-placeholder { text-align: center; pointer-events: none; }
.bdo-upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.bdo-upload-text { font-weight: 700; color: var(--text); font-size: 0.92rem; margin-bottom: 0.25rem; }
.bdo-upload-sub  { font-size: 0.75rem; color: var(--muted); }
.bdo-preview-img { width: 100%; max-height: 220px; object-fit: contain; border-radius: var(--radius-sm); display: block; }
.bdo-remove-img  { position: absolute; top: 0.5rem; right: 0.5rem; }

/* BDO transaction card */
.bdo-item         { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 0.85rem; display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.bdo-item-receipt { width: 80px; height: 80px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; cursor: pointer; border: 1px solid var(--border); transition: opacity 0.15s; }
.bdo-item-receipt:hover { opacity: 0.8; }
.bdo-item-info      { flex: 1; min-width: 0; }
.bdo-item-amount    { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.bdo-item-recipient { font-size: 0.9rem; color: var(--text); margin: 0.25rem 0; }
.bdo-item-week      { font-size: 0.75rem; color: var(--muted); }
.bdo-item-actions   { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

/* BDO receipt lightbox */
.bdo-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.bdo-lightbox.open { opacity: 1; pointer-events: all; }
.bdo-lightbox img  { max-width: 100%; max-height: 90vh; border-radius: var(--radius); object-fit: contain; }

/* ════════════════════════════════════════════════════
   REMAINING BALANCE TAB
════════════════════════════════════════════════════ */
.remaining-banner        { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border: 1px solid var(--yellow); border-radius: var(--radius); padding: 1rem 1.3rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.85rem; }
.remaining-banner-icon   { font-size: 1.6rem; flex-shrink: 0; }
.remaining-banner-text   { font-size: 0.85rem; color: var(--muted); }
.remaining-banner-total  { font-size: 1.4rem; font-weight: 800; color: var(--yellow); }
.remaining-member-block  { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--yellow); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 0.85rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.remaining-member-name   { font-weight: 700; font-size: 0.95rem; }
.remaining-member-week   { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.remaining-member-amount { font-size: 1.15rem; font-weight: 800; color: var(--yellow); }

/* ════════════════════════════════════════════════════
   REMAINING BALANCE — Multi-week breakdown
════════════════════════════════════════════════════ */
.remaining-member-block-wrap { margin-bottom: 0.85rem; }
.remaining-member-block.has-breakdown { cursor: pointer; margin-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }

.remaining-right-group { display: flex; align-items: center; gap: 0.6rem; }

.remaining-caret {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--yellow);
  transition: transform 0.2s;
  transform: rotate(-90deg);   /* closed by default → points right */
}
.remaining-caret.rotated { transform: rotate(0deg); }  /* open → points down */

.remaining-week-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  max-height: 0;               /* closed by default */
  transition: max-height 0.25s ease;
}
.remaining-week-breakdown.open {
  max-height: 500px;
}

.remaining-week-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid #1c2a4070;
  font-size: 0.85rem;
}
.remaining-week-row:last-child { border-bottom: none; }
.remaining-week-label { color: var(--muted); }
.remaining-week-amount { font-weight: 700; color: var(--yellow); text-align: right; }
.remaining-week-amount.paid { color: var(--green); }
.remaining-week-paidtoday {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.15rem;
}

@media (max-width: 600px) {
  .remaining-week-row { padding: 0.6rem 0.9rem; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .remaining-week-amount { text-align: left; }
}

/* ════════════════════════════════════════════════════
   REALTIME PH CLOCK
════════════════════════════════════════════════════ */
.ph-clock      { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.55rem 1rem; margin-bottom: 1.2rem; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; text-align: center; }
.ph-clock-icon { font-size: 0.95rem; }
.ph-clock-dot  { opacity: 0.5; }
.ph-clock-time { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ════════════════════════════════════════════════════
   TOPBAR — logged-in header (Admin & Member pages)
════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.topbar-user { font-size: 0.88rem; color: var(--muted); }
.topbar-user strong { color: var(--text); }
.topbar-role-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #1e3a5f;
  color: var(--accent);
  vertical-align: middle;
}

/* ════════════════════════════════════════════════════
   TOPBAR ACTIONS (Member page — mirrors admin's notif-wrapper)
════════════════════════════════════════════════════ */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Let action groups wrap onto their own line instead of overflowing */
.notif-wrapper,
.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .topbar-actions,
  .notif-wrapper {
    width: 100%;
    justify-content: flex-start;
  }
  .topbar-actions .btn,
  .notif-wrapper .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .topbar-actions .btn,
  .notif-wrapper .btn {
    flex: 1 1 100%;
  }
}

/* ════════════════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 18%, #1c2a4070 0%, transparent 55%),
    radial-gradient(circle at 88% 82%, #38bdf81f 0%, transparent 50%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px -20px #000000a0;
}

.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin: 0 auto 0.9rem;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px #38bdf870;
}
.auth-logo .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-logo h1 { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.auth-logo p  { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

.role-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  margin-bottom: 1.5rem;
}
.role-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.role-btn.active { background: var(--accent); color: #0b1120; }
.role-btn:hover:not(.active) { color: var(--text); }

.auth-footnote {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1.3rem;
  line-height: 1.45;
}

/* ════════════════════════════════════════════════════
   USERS TAB (Admin)
════════════════════════════════════════════════════ */
.password-cell {
  font-family: 'Courier New', monospace;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════════
   THEMED CHECKBOX (e.g. bill-combine confirmation)
════════════════════════════════════════════════════ */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .ph-clock     { font-size: 0.78rem; padding: 0.5rem 0.85rem; }

  .entries-card-header { flex-direction: column; align-items: flex-start; }
  .entries-week-filter { width: 100%; min-width: unset; }

  .auth-card { padding: 2rem 1.5rem; }
}


/* ════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px)
════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .main-content { padding: 1.25rem; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .pay-member-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
}

/* ════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤600px)
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .main-content { padding: 0.85rem; }

  /* Summary + dashboard grids: 2 per row, smaller text */
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .summary-stat { padding: 0.9rem; }
  .summary-stat .value { font-size: 1.2rem; }

  /* Topbar stacks */
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .ph-clock { font-size: 0.74rem; padding: 0.5rem 0.7rem; flex-wrap: wrap; }

  /* Week selector stacks vertically */
  .week-selector { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .week-selector select { width: 100%; }
  .week-selector .btn { width: 100%; justify-content: center; }
  #weekActions { flex-direction: column; width: 100%; }
  #weekActions .btn { width: 100%; justify-content: center; }

  /* Tabs scroll horizontally instead of wrapping */
  .tab-nav { gap: 0.3rem; padding: 0.3rem; }
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

  /* Cards tighter padding */
  .card { padding: 1.1rem; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .card-header .btn { width: 100%; justify-content: center; }

  /* Tables: allow horizontal scroll instead of squishing */
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .data-table thead, .data-table tbody, .data-table tr { display: table; width: 100%; table-layout: fixed; }
  .data-table td, .data-table th { white-space: normal; }

  /* Action buttons in table rows: stack + full width instead of squeezing */
  .data-table .actions { text-align: left; }
  .data-table .actions .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin: 0.3rem 0 0;
  }
  .data-table .actions .btn + .btn { margin-left: 0; }

  .data-table-3col td:nth-child(1),
  .data-table-3col th:nth-child(1) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }

  /* Person block header wraps */
  .person-header { flex-wrap: wrap; gap: 0.4rem; }

  /* Modals: full-width, scrollable, safe top margin */
  .modal-overlay { padding: 0.6rem; align-items: flex-start; }
  .modal { padding: 1.4rem; max-width: 100%; margin: 1rem auto; max-height: 92vh; overflow-y: auto; }
  .modal-header { margin-bottom: 1rem; }

  /* Pay modal: 3-per-row member grid on small screens */
  .pay-member-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 0.5rem; }
  .pay-member-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
  .pay-member-name { font-size: 0.78rem; }

  .pay-type-grid { grid-template-columns: 1fr; }
  .pay-channel-tabs { flex-wrap: wrap; }
  .pay-channel-btn { flex: 1 1 calc(50% - 0.5rem); min-width: 0; }

  .pay-qr-img { max-width: 180px; }

  /* Footer button rows stack */
  .modal-footer-split { flex-direction: column; }
  .modal-footer-split .right-btns { flex-direction: column; width: 100%; }
  .modal-footer-split .right-btns .btn { width: 100%; justify-content: center; }
  .modal-footer-split .btn-add-more { width: 100%; }

  .pay-step2-footer { flex-direction: column; align-items: stretch; }
  .pay-step2-footer .right-btns { flex-direction: column; width: 100%; }
  .pay-step2-footer .right-btns .btn { width: 100%; justify-content: center; }

  /* BDO transaction card stacks */
  .bdo-item { flex-direction: column; align-items: stretch; }
  .bdo-item-receipt { width: 100%; height: 160px; }
  .bdo-item-actions { flex-wrap: wrap; }

  /* History items stack */
  .history-item { flex-direction: column; align-items: flex-start; }

  /* Remaining balance blocks stack */
  .remaining-member-block { flex-direction: column; align-items: flex-start; gap: 0.4rem; }

  /* Entries week filter full width */
  .entries-card-header { flex-direction: column; align-items: flex-start; }
  .entries-week-filter { width: 100%; min-width: unset; }

  /* Auth/login screen */
  .auth-card { padding: 1.75rem 1.25rem; }
  .role-toggle { flex-wrap: wrap; }
  .role-btn { min-width: 45%; }

  /* Users table password column wraps */
  .password-cell { word-break: break-all; }

  /* Toast doesn't overflow screen width */
  #toast { left: 0.75rem; right: 0.75rem; max-width: none; bottom: 0.85rem; }
}

/* ════════════════════════════════════════════════════
   BILLS TABLE — dedicated mobile card layout
   (overrides the generic .data-table mobile hack, which
   doesn't work for Bills' richer cells/buttons)
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .data-table.bills-table thead { display: none; }

  .data-table.bills-table,
  .data-table.bills-table tbody { display: block; width: 100%; }

  .data-table.bills-table tr {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
  }
  .data-table.bills-table tr:last-child { border-bottom: none; }

  .data-table.bills-table td {
    display: block;
    padding: 0;
    border-bottom: none;
    white-space: normal;
  }

  .data-table.bills-table td.amount {
    text-align: left;
    font-size: 1.05rem;
    font-weight: 700;
  }

  .data-table.bills-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .data-table.bills-table td.actions .btn {
    display: inline-flex;
    width: auto;
    flex: 1 1 auto;
    margin: 0;
  }
}

/* ════════════════════════════════════════════════════
   USERS TABLE — dedicated mobile card layout
════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .data-table.users-table thead { display: none; }

  .data-table.users-table,
  .data-table.users-table tbody { display: block; width: 100%; }

  .data-table.users-table tr {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
  }
  .data-table.users-table tr:last-child { border-bottom: none; }

  .data-table.users-table td {
    display: block;
    padding: 0;
    border-bottom: none;
    white-space: normal;
  }

  /* Username row — label + value inline */
  .data-table.users-table td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 92px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }

  .data-table.users-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
  }
  .data-table.users-table td.actions .btn {
    display: inline-flex;
    width: auto;
    flex: 1 1 auto;
    margin: 0;
  }
}

.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #0b1120;
  font-size: 0.65rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; max-height: 380px; overflow-y: auto;
  overscroll-behavior: contain;   /* ← add this */
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px -12px #000000a0; z-index: 500;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.notif-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.notif-item { display: flex; gap: 0.6rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.notif-item-text { font-size: 0.83rem; color: var(--text); line-height: 1.35; }
.notif-item-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.notif-unread { background: #38bdf812; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

.notif-toggle {
  text-align: center;
  padding: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.notif-toggle:hover {
  background: var(--surface3);
}

.online-device-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.online-device-row:last-child { border-bottom: none; }

.online-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.online-device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.online-device-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.online-device-meta {
  font-size: 12px;
  color: var(--muted);
}

.notif-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

@media (max-width: 600px) {
  .notif-wrapper { margin-left: auto; }

  .notif-dropdown {
    position: fixed;
    top: 4rem;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }
}

/* ════════════════════════════════════════════════════
   RESPONSIVE — VERY SMALL PHONES (≤380px)
════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .summary-grid { grid-template-columns: 1fr; }
  .pay-member-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
  .role-btn { min-width: 100%; }
  .pay-channel-btn { min-width: 100%; }
}

/* ════════════════════════════════════════════════════
   NETWORK TAB — responsive device/account cards
════════════════════════════════════════════════════ */
.network-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.network-item-info  { flex: 1; min-width: 180px; }
.network-item-name  { font-weight: 700; font-size: 0.95rem; }
.network-item-role  { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.network-item-meta  { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.5rem; font-size: 0.82rem; }
.network-item-meta span   { color: var(--muted); }
.network-item-meta strong { color: var(--text); font-family: 'Courier New', monospace; font-weight: 600; }
.network-item-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

@media (max-width: 600px) {
  .network-item { flex-direction: column; align-items: stretch; }
  .network-item-actions { width: 100%; }
  .network-item-actions .btn { flex: 1; justify-content: center; }
  .network-item-meta { flex-direction: column; gap: 0.25rem; }
}

.ping-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface3);
}
.ping-good { color: var(--green); }
.ping-ok   { color: var(--yellow); }
.ping-bad  { color: var(--red); }

.stat-bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.stat-bar-fill.good   { background: var(--green); }
.stat-bar-fill.ok     { background: var(--yellow); }
.stat-bar-fill.bad    { background: var(--red); }

/* ════════════════════════════════════════════════════
   CONFIRM DELETE MODAL (generic — devices, local accounts, users)
════════════════════════════════════════════════════ */
.confirm-modal { max-width: 420px; }
.confirm-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 0.25rem 0 1.4rem;
}
.confirm-modal-icon {
  font-size: 2.4rem;
  line-height: 1;
}
.confirm-modal-message {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
}
.confirm-modal-message strong { color: var(--yellow); }

.week-dropdown-wrap { position: relative; flex: 1; min-width: 200px; }
.week-select-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

.week-dropdown-btn {
  width: 100%; text-align: left; padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  background: var(--surface)
    url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b80a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 0.85rem center;
  background-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; cursor: pointer;
}
.week-dropdown-btn:focus { outline: none; border-color: var(--accent); }

.week-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;   /* ← add this */
  z-index: 60;
  display: none;
  box-shadow: 0 12px 28px -10px #000000a0;
}
.week-dropdown-menu.open { display: block; }
.week-dropdown-item { padding: 0.6rem 0.9rem; font-size: 0.88rem; cursor: pointer; }
.week-dropdown-item:hover { background: var(--surface3); }
.week-dropdown-item.active { background: var(--surface3); color: var(--accent); font-weight: 700; }

@media (max-width: 600px) {
  .confirm-modal { max-width: 100%; }
  .confirm-modal-body { padding: 0.15rem 0 1.1rem; }
  .confirm-modal-icon { font-size: 2.1rem; }
  .confirm-modal-message { font-size: 0.88rem; }
}

/* ════════════════════════════════════════════════════
   PAYMENTS TAB — Grouped by member, FILO breakdown
════════════════════════════════════════════════════ */
.payment-member-block-wrap { margin-bottom: 0.85rem; }

.payment-member-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.payment-member-name { font-weight: 700; font-size: 0.95rem; }
.payment-member-sub  { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.payment-member-total { font-weight: 700; color: var(--accent); font-size: 1.05rem; }

.payment-right-group { display: flex; align-items: center; gap: 0.6rem; }

.payment-caret {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.2s;
  transform: rotate(-90deg);
}
.payment-caret.rotated { transform: rotate(0deg); }

.payment-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.payment-breakdown.open { max-height: 2000px; }

.payment-breakdown-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid #1c2a4070;
  flex-wrap: wrap;
}
.payment-breakdown-row:last-child { border-bottom: none; }
.payment-breakdown-info { flex: 1; min-width: 200px; }
.payment-breakdown-badges { display: flex; gap: 0.4rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.payment-breakdown-right { text-align: right; white-space: nowrap; }
.payment-breakdown-amount { font-size: 1rem; font-weight: 700; color: var(--accent); }
.payment-breakdown-right .btn { margin-top: 0.4rem; }

@media (max-width: 600px) {
  .payment-member-block { padding: 0.8rem 1rem; }
  .payment-breakdown-row { flex-direction: column; align-items: stretch; }
  .payment-breakdown-right { text-align: left; }
}

.payment-breakdown-date {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

@media (max-width: 600px) {
  .remaining-member-block.has-breakdown {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
}

/* ════════════════════════════════════════════════════
   APP FOOTER
════════════════════════════════════════════════════ */
.app-footer {
  margin-top: 2rem;
  padding: 1.1rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}
.app-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.app-footer-dot { opacity: 0.45; }
.app-footer a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.app-footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .app-footer { padding: 0.9rem 1rem; font-size: 0.72rem; }
  .app-footer-inner { flex-direction: column; gap: 0.15rem; }
  .app-footer-dot { display: none; }
}

/* Login screen: footer pinned to the bottom of the viewport */
#auth-screen { position: relative; padding-bottom: 3.5rem; }
#auth-screen .app-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  margin-top: 0;
  border-top: none;
}