/* ============================================================
   app.css — Cooperative Management PWA
   Mobile-first, customizable via CSS variables
   ============================================================ */

/* ── Dynamic theme variables (overridden by JS from DB) ─────── */
:root {
  --banner-color:      #1B5E20;
  --banner-text:       #FFFFFF;
  --bg-color:          #F1F8E9;
  --box-bg:            #FFFFFF;
  --accent:            #388E3C;
  --accent-light:      #C8E6C9;
  --danger:            #D32F2F;
  --warning:           #F57C00;
  --text-primary:      #1A1A1A;
  --text-secondary:    #555555;
  --text-muted:        #999999;
  --border:            #E0E0E0;
  --shadow:            0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg:         0 6px 24px rgba(0,0,0,0.15);
  --radius:            14px;
  --radius-sm:         8px;
  --font:              'Nunito', 'Segoe UI', sans-serif;
  --banner-h:          60px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 1.4rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem;   font-weight: 600; }

/* ── Banner ───────────────────────────────────────────────── */
.banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--banner-h);
  background: var(--banner-color);
  color: var(--banner-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.banner-title {
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--banner-text);
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  transition: background 0.2s;
  flex-shrink: 0;
}
.banner-btn:hover, .banner-btn:active { background: rgba(255,255,255,0.15); }
.banner-btn.hidden { opacity: 0; pointer-events: none; }

/* Sync button */
.btn-sync-wrap {
  position: relative;
  display: flex; align-items: center;
}
#btn-sync {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--banner-text);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  transition: background 0.2s, transform 0.3s;
}
#btn-sync:hover { background: rgba(255,255,255,0.15); }
#btn-sync.syncing svg, #btn-sync.syncing .icon { animation: spin 1s linear infinite; }
#sync-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: #FF5252;
  color: #fff;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center; justify-content: center;
  padding: 0 3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main content area (below banner) ────────────────────── */
.page {
  padding-top: calc(var(--banner-h) + 12px);
  padding-bottom: 24px;
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ── Login screen ─────────────────────────────────────────── */
#screen-login .page-inner {
  padding: 12px 10px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* Member grid — 3 per row */
.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 2px;
}

.member-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: 2px solid transparent;
}
.member-card:active { transform: scale(0.96); box-shadow: none; }
.member-card.selected { border-color: var(--accent); }

.member-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.member-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

.member-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: var(--text-primary);
  word-break: break-word;
}
.member-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}
.member-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 3px;
}
.badge-admin    { background: #3F51B5; color: #fff; }
.badge-manager  { background: #FF9800; color: #fff; }
.badge-worker   { background: var(--accent); color: #fff; }
.badge-temp     { background: #9E9E9E; color: #fff; }

/* ── Password modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--box-bg);
  border-radius: var(--radius) var(--radius) var(--radius-sm) var(--radius-sm);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 380px;
  transform: translateY(30px);
  transition: transform 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.modal-overlay.active .modal-box { transform: translateY(0); }

.modal-user-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--accent);
  overflow: hidden;
}
.modal-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.modal-user-name { font-size: 1.1rem; font-weight: 800; text-align: center; }
.modal-label { font-size: 0.85rem; color: var(--text-secondary); }

.input-field {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
  background: var(--bg-color);
  transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--accent); }
.input-field.error { border-color: var(--danger); }

.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  text-align: center;
  min-height: 18px;
}

.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 100%; padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 2px solid var(--border); }

/* ── Profile screen ───────────────────────────────────────── */
.profile-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px;
}
.profile-photo-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800; color: var(--accent);
  margin-bottom: 10px;
  position: relative;
  cursor: pointer;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--accent); color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-color);
  outline: none;
}
.form-select:focus { border-color: var(--accent); }

.section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 10px;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 4px;
}

/* ── Admin user management ─────────────────────────────────── */
.admin-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 12px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.btn-add {
  background: var(--accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; gap: 5px;
}

.user-list-item {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.user-list-item:hover { box-shadow: var(--shadow-lg); }
.user-list-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}
.user-list-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-list-info { flex: 1; }
.user-list-name { font-weight: 700; font-size: 0.95rem; }
.user-list-sub  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.user-list-inactive { opacity: 0.45; }

/* Domain checkbox grid */
.domain-check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.domain-check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.domain-check-item input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
}
.domain-check-label { font-size: 0.85rem; font-weight: 600; }

/* ── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90vw;
}
.toast {
  background: #323232;
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}
.toast.show     { opacity: 1; transform: translateY(0); }
.toast-success  { background: #2E7D32; }
.toast-error    { background: #C62828; }
.toast-warning  { background: #E65100; }

/* ── Offline indicator ─────────────────────────────────────── */
#offline-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #E65100;
  color: #fff;
  text-align: center;
  padding: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 150;
  transform: translateY(100%);
  transition: transform 0.3s;
}
#offline-bar.visible { transform: translateY(0); }

/* ── Loader spinner ────────────────────────────────────────── */
.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Color picker row ──────────────────────────────────────── */
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.color-row label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
}
.color-row input[type=color] {
  width: 44px; height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
}

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (min-width: 480px) {
  .member-grid { grid-template-columns: repeat(4, 1fr); }
  .member-avatar { width: 80px; height: 80px; }
}
@media (min-width: 768px) {
  .member-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .admin-wrap, .profile-wrap { padding: 0 24px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2: DOMAIN SCREEN
═══════════════════════════════════════════════════════════ */

/* User greeting bar on domain screen */
.user-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--box-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.greeting-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.greeting-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
.greeting-info { flex: 1; }
.greeting-name { font-weight: 800; font-size: 0.95rem; }
.greeting-role { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.greeting-profile-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-color);
  border: 1.5px solid var(--border);
  transition: background 0.2s;
}
.greeting-profile-btn:hover { background: var(--accent-light); }

/* Domain subtitle */
.domains-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Domain grid — 3 per row on mobile */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Domain box/card */
.domain-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border: 2.5px solid transparent;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 110px;
}
.domain-card:active { transform: scale(0.95); box-shadow: none; }

/* Color band at top of each domain card */
.domain-card-band {
  width: 100%;
  height: 6px;
  flex-shrink: 0;
}

/* Domain image */
.domain-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  max-height: 80px;
}
.domain-card-img-placeholder {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--bg-color);
  min-height: 70px;
}

/* Domain name */
.domain-card-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  padding: 6px 4px 8px;
  line-height: 1.2;
  word-break: break-word;
  color: var(--text-primary);
}

/* Inactive overlay */
.domain-card.inactive { opacity: 0.45; }
.domain-card.inactive::after {
  content: '✕';
  position: absolute;
  top: 6px; right: 6px;
  background: var(--danger);
  color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
}

/* Empty state */
.domain-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.domain-empty-icon { font-size: 3rem; margin-bottom: 10px; }
.domain-empty-text { font-size: 0.9rem; }

/* Admin domain list item */
.domain-list-item {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  border-left: 5px solid var(--accent);
}
.domain-list-item:hover { box-shadow: var(--shadow-lg); }
.domain-list-thumb {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}
.domain-list-thumb img { width:100%;height:100%;object-fit:cover;border-radius:var(--radius-sm); }
.domain-list-info { flex: 1; }
.domain-list-name { font-weight: 800; font-size: 0.95rem; }
.domain-list-sub  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Domain image preview in modal */
.domain-img-preview {
  width: 100px; height: 100px;
  border-radius: var(--radius);
  background: var(--bg-color);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}
.domain-img-preview:hover { border-color: var(--accent); }
.domain-img-placeholder { font-size: 2.5rem; }
.domain-img-preview img { width:100%;height:100%;object-fit:cover;border-radius:var(--radius); }
.domain-img-edit-btn {
  position: absolute;
  bottom: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
}

@media (min-width: 480px) {
  .domain-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 768px) {
  .domain-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3: TASK & RECORD SCREEN
═══════════════════════════════════════════════════════════ */

/* ── Domain header strip on task screen ─────────────────── */
.domain-header-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.domain-header-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
  flex-shrink: 0;
}
.domain-header-thumb img { width:100%;height:100%;object-fit:cover; }
.domain-header-name { font-weight: 800; font-size: 1rem; }
.domain-header-band { height: 4px; border-radius: 2px; margin-top: 3px; }

/* ── Section titles ─────────────────────────────────────── */
.screen-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

/* ── Task boxes grid ────────────────────────────────────── */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.task-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  border-left: 4px solid var(--border);
  transition: box-shadow 0.15s, transform 0.12s;
  position: relative;
}
.task-card:active { transform: scale(0.97); }
.task-card.status-pending     { border-left-color: #FFC107; }
.task-card.status-in_progress { border-left-color: #2196F3; }
.task-card.status-done        { border-left-color: #4CAF50; opacity: 0.7; }
.task-card.status-impossible  { border-left-color: #F44336; opacity: 0.6; }

.task-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}
.task-card-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.task-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  align-self: flex-start;
}
.pill-pending     { background: #FFF8E1; color: #F57F17; }
.pill-in_progress { background: #E3F2FD; color: #1565C0; }
.pill-done        { background: #E8F5E9; color: #2E7D32; }
.pill-impossible  { background: #FFEBEE; color: #B71C1C; }

.task-due {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ── Task status modal ──────────────────────────────────── */
.task-status-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.task-status-btn {
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid transparent;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.task-status-btn .tsb-icon { font-size: 1.4rem; }
.tsb-progress { background: #E3F2FD; color: #1565C0; border-color: #1565C0; }
.tsb-done     { background: #E8F5E9; color: #2E7D32; border-color: #4CAF50; }
.tsb-impossible { background: #FFEBEE; color: #B71C1C; border-color: #F44336; }
.task-status-btn:hover { opacity: 0.85; transform: scale(0.97); }

/* ── Action boxes (5 record types) ─────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.action-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
  border-bottom: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.action-card:active { transform: scale(0.94); box-shadow: none; }
.action-icon {
  font-size: 2rem;
  line-height: 1;
}
.action-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Action card colors */
.action-activity    { border-bottom-color: #3F51B5; }
.action-activity .action-icon { filter: hue-rotate(200deg); }
.action-harvest     { border-bottom-color: #4CAF50; }
.action-sale        { border-bottom-color: #FF9800; }
.action-income      { border-bottom-color: #009688; }
.action-expenditure { border-bottom-color: #F44336; }

/* ── Recent records strip ───────────────────────────────── */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.recent-item {
  background: var(--box-bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.recent-type-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-activity    { background: #3F51B5; }
.dot-harvest     { background: #4CAF50; }
.dot-sale        { background: #FF9800; }
.dot-income      { background: #009688; }
.dot-expenditure { background: #F44336; }

.recent-info { flex: 1; min-width: 0; }
.recent-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.recent-amount {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Record input modals ────────────────────────────────── */
.record-modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-color);
}
.record-modal-icon { font-size: 1.8rem; }
.record-modal-title { font-size: 1.05rem; font-weight: 800; }

/* Datetime quick-input row */
.datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

/* Quantity + unit row */
.qty-unit-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  width: 100%;
}

/* Price row */
.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

/* Total display */
.total-display {
  width: 100%;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.total-label { font-size: 0.82rem; font-weight: 700; color: var(--accent); }
.total-value { font-size: 1.1rem; font-weight: 900; color: var(--accent); }

/* Photo row */
.photo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.photo-thumb {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border);
}
.btn-add-photo {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  background: var(--bg-color);
  transition: border-color 0.2s;
}
.btn-add-photo:hover { border-color: var(--accent); }

/* Autocomplete-style select+input combo */
.combo-wrap { position: relative; width: 100%; }
.combo-list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--box-bg);
  border: 2px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
  z-index: 300;
  box-shadow: var(--shadow-lg);
}
.combo-option {
  padding: 9px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.combo-option:last-child { border-bottom: none; }
.combo-option:hover { background: var(--accent-light); }

/* No tasks empty state */
.tasks-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .action-grid { grid-template-columns: repeat(5, 1fr); }
  .task-grid   { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 4: MANAGER BACKEND
═══════════════════════════════════════════════════════════ */

/* ── Tab bar ────────────────────────────────────────────── */
.mgr-tabs {
  display: flex;
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--banner-h) + 8px);
  z-index: 50;
}
.mgr-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  position: relative;
  user-select: none;
}
.mgr-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.mgr-tab-icon { font-size: 1.2rem; }
.mgr-tab-badge {
  position: absolute;
  top: 5px; right: 6px;
  min-width: 16px; height: 16px;
  background: #F44336;
  color: #fff;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.mgr-panel { display: none; }
.mgr-panel.active { display: block; }

/* ── Pending validation cards ────────────────────────────── */
.validate-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 14px 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.validate-section-title .vsec-badge {
  background: var(--accent);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
}

.pending-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 12px;
  margin-bottom: 8px;
  border-left: 4px solid var(--border);
}
.pending-card.type-harvest     { border-left-color: #4CAF50; }
.pending-card.type-sale        { border-left-color: #FF9800; }
.pending-card.type-income      { border-left-color: #009688; }
.pending-card.type-expenditure { border-left-color: #F44336; }

.pending-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.pending-card-title {
  font-weight: 800;
  font-size: 0.88rem;
  flex: 1;
}
.pending-card-amount {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--accent);
  margin-left: 8px;
}
.pending-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.pending-card-actions {
  display: flex;
  gap: 8px;
}
.btn-approve {
  flex: 1;
  background: #E8F5E9;
  color: #2E7D32;
  border: 1.5px solid #4CAF50;
  border-radius: var(--radius-sm);
  padding: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-approve:hover { background: #C8E6C9; }
.btn-reject-sm {
  padding: 7px 12px;
  background: #FFEBEE;
  color: #B71C1C;
  border: 1.5px solid #F44336;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

/* ── Stock overview ─────────────────────────────────────── */
.stock-table {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}
.stock-table-header {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stock-row {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  align-items: center;
}
.stock-row:last-child { border-bottom: none; }
.stock-row:hover { background: var(--bg-color); }
.stock-row-name { font-weight: 700; }
.stock-qty { font-weight: 900; text-align: right; }
.stock-qty.low  { color: #F44336; }
.stock-qty.zero { color: #9E9E9E; }
.stock-unit { text-align: right; color: var(--text-muted); font-size: 0.72rem; }

/* ── Finance summary cards ───────────────────────────────── */
.finance-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.finance-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.finance-card.full-width { grid-column: 1 / -1; }
.finance-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.finance-card-value {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
}
.finance-card-value.positive { color: #2E7D32; }
.finance-card-value.negative { color: #C62828; }
.finance-card-value.neutral  { color: var(--text-primary); }

/* Cash account chip */
.cash-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cash-chip {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  min-width: 110px;
  border-top: 3px solid var(--accent);
}
.cash-chip-name  { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.cash-chip-value { font-size: 1.1rem; font-weight: 900; color: var(--accent); margin-top: 2px; }

/* Ledger table */
.ledger-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--box-bg);
  font-size: 0.82rem;
}
.ledger-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.ledger-row:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
.ledger-type-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.dot-income  { background: #009688; }
.dot-sale    { background: #FF9800; }
.dot-expenditure { background: #F44336; }
.dot-transfer    { background: #9C27B0; }
.ledger-info { flex: 1; min-width: 0; }
.ledger-desc { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-meta { font-size: 0.65rem; color: var(--text-muted); margin-top: 1px; }
.ledger-amount {
  font-weight: 900; font-size: 0.88rem;
  flex-shrink: 0;
}
.ledger-amount.income      { color: #2E7D32; }
.ledger-amount.expenditure { color: #C62828; }
.ledger-amount.transfer    { color: #9C27B0; }

/* ── Member payment cards ────────────────────────────────── */
.member-pay-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.member-pay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.member-pay-header:hover { background: var(--bg-color); }
.member-pay-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.member-pay-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
.member-pay-info { flex: 1; }
.member-pay-name { font-weight: 800; font-size: 0.9rem; }
.member-pay-sub  { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.member-pay-total { font-weight: 900; font-size: 0.95rem; }
.member-pay-total.paid    { color: #2E7D32; }
.member-pay-total.pending { color: #F57C00; }

.member-pay-body {
  padding: 10px 12px;
  display: none;
}
.member-pay-body.open { display: block; }

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.pay-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
}
.pay-field input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--bg-color);
}
.pay-field input:focus { border-color: var(--accent); outline: none; }

.pay-total-bar {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.pay-total-label { font-size: 0.78rem; font-weight: 700; color: var(--accent); }
.pay-total-value { font-size: 1.05rem; font-weight: 900; color: var(--accent); }

.pay-actions { display: flex; gap: 8px; }
.btn-pay-save {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-pay-paid {
  padding: 9px 14px;
  background: #E8F5E9;
  color: #2E7D32;
  border: 1.5px solid #4CAF50;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-pay-paid.already-paid {
  background: #C8E6C9;
  cursor: default;
}

/* ── Quick action row (add income/expense/transfer) ──────── */
.mgr-quick-actions {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.mgr-quick-btn {
  background: var(--box-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 6px;
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 3px solid transparent;
  transition: box-shadow 0.15s, transform 0.12s;
  user-select: none;
}
.mgr-quick-btn:active { transform: scale(0.96); box-shadow: none; }
.mgr-quick-btn .qb-icon { font-size: 1.4rem; }
.qb-income   { border-bottom-color: #009688; color: #009688; }
.qb-expense  { border-bottom-color: #F44336; color: #F44336; }
.qb-transfer { border-bottom-color: #9C27B0; color: #9C27B0; }

/* ═══════════════════════════════════════════════════════════
   PHASE 5: ADMIN DASHBOARD
═══════════════════════════════════════════════════════════ */

/* ── Dashboard stat cards grid ───────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}
.dash-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.dash-card.wide  { grid-column: 1 / -1; }
.dash-card.green::before  { background: #4CAF50; }
.dash-card.red::before    { background: #F44336; }
.dash-card.blue::before   { background: #2196F3; }
.dash-card.orange::before { background: #FF9800; }
.dash-card.purple::before { background: #9C27B0; }
.dash-card.teal::before   { background: #009688; }

.dash-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 2px;
}
.dash-card-value {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
}
.dash-card-value.green  { color: #2E7D32; }
.dash-card-value.red    { color: #C62828; }
.dash-card-value.orange { color: #E65100; }
.dash-card-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.dash-card-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Reminder banner ─────────────────────────────────────── */
.reminder-banner {
  background: linear-gradient(135deg, #E65100, #FF8F00);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.reminder-banner .reminder-icon { font-size: 1.3rem; flex-shrink: 0; }
.reminder-banner .reminder-text { flex: 1; }
.reminder-banner .reminder-btn {
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

/* ── Dashboard section headers ───────────────────────────── */
.dash-section {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-section-link {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

/* ── Quick action shortcuts ──────────────────────────────── */
.dash-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.dash-shortcut {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.12s;
  border-left: 3px solid var(--accent);
  user-select: none;
}
.dash-shortcut:active { transform: scale(0.97); box-shadow: none; }
.dash-shortcut-icon { font-size: 1.4rem; }
.dash-shortcut-label {
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

/* ── Member activity table ───────────────────────────────── */
.member-activity-table {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mat-header {
  display: grid;
  grid-template-columns: 1fr 48px 48px 60px;
  background: var(--accent);
  color: #fff;
  padding: 7px 10px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mat-row {
  display: grid;
  grid-template-columns: 1fr 48px 48px 60px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.mat-row:last-child { border-bottom: none; }
.mat-row:hover { background: var(--bg-color); }
.mat-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
}
.mat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.mat-avatar img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
.mat-cell {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
}
.mat-cell.muted { color: var(--text-muted); font-size: 0.72rem; font-weight: 600; }

/* ── Activity bar chart (CSS only) ──────────────────────── */
.trend-chart {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 12px 10px;
  margin-bottom: 4px;
}
.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
  margin-bottom: 6px;
}
.trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}
.trend-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  transition: height 0.4s ease;
  min-height: 2px;
}
.trend-bar-cnt {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.trend-labels {
  display: flex;
  gap: 6px;
}
.trend-label {
  flex: 1;
  text-align: center;
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Harvest summary table ───────────────────────────────── */
.harvest-table {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ht-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.ht-row:last-child { border-bottom: none; }
.ht-name { flex: 1; font-size: 0.85rem; font-weight: 700; }
.ht-qty  { font-size: 0.8rem; font-weight: 800; color: var(--accent); text-align: right; }
.ht-unit { font-size: 0.68rem; color: var(--text-muted); min-width: 28px; text-align: right; }

/* ── Stock alert list ────────────────────────────────────── */
.stock-alert-list {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stock-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.stock-alert-row:last-child { border-bottom: none; }
.stock-alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #F44336;
  flex-shrink: 0;
}
.stock-alert-name { flex: 1; font-size: 0.84rem; font-weight: 700; }
.stock-alert-qty  { font-size: 0.8rem; font-weight: 800; color: #F44336; }

/* ── Member detail overlay ───────────────────────────────── */
.member-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  z-index: 180;
  overflow-y: auto;
  padding: calc(var(--banner-h) + 8px) 10px 60px;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.member-detail-overlay.open { transform: translateX(0); }

.member-detail-hero {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  text-align: center;
}
.member-detail-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.member-detail-avatar img { width:100%;height:100%;object-fit:cover; }
.member-detail-name { font-size: 1.1rem; font-weight: 900; }
.member-detail-sub  { font-size: 0.78rem; color: var(--text-muted); }

/* ── Report screen ───────────────────────────────────────── */
.report-section {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.report-section-title {
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.report-row:last-child { border-bottom: none; }
.report-row-label { flex: 1; font-weight: 600; }
.report-row-value { font-weight: 800; text-align: right; }
.report-row-meta  { font-size: 0.66rem; color: var(--text-muted); }
.report-total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--accent-light);
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--accent);
}

@media (min-width: 480px) {
  .dash-grid      { grid-template-columns: repeat(3, 1fr); }
  .dash-shortcuts { grid-template-columns: repeat(4, 1fr); }
  .mat-header,
  .mat-row        { grid-template-columns: 1fr 60px 60px 80px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 6: ANNOUNCEMENT BANNER + PDF EXPORT BUTTONS
═══════════════════════════════════════════════════════════ */

/* Announcement bar shifts everything down */
body.has-announcement .banner        { top: var(--ann-h, 38px); }
body.has-announcement .page          { padding-top: calc(var(--banner-h) + var(--ann-h, 38px) + 12px); }
body.has-announcement .mgr-tabs      { top: calc(var(--banner-h) + var(--ann-h, 38px) + 8px); }
body.has-announcement .member-detail-overlay { padding-top: calc(var(--banner-h) + var(--ann-h, 38px) + 8px); }

/* PDF export button — inline subtle button */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1.5px solid #E53935;
  color: #E53935;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-pdf:hover { background: #E53935; color: #fff; }
.btn-pdf .pdf-icon { font-size: 0.9rem; }

/* PDF toolbar — row of export buttons */
.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px;
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  align-items: center;
}
.pdf-toolbar-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 4px;
  flex-shrink: 0;
}

/* Worker screen export bar */
.worker-export-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Announcement preview in settings */
.announcement-preview {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.announcement-preview .ap-text { flex: 1; }

/* ═══════════════════════════════════════════════════════════
   TASK MANAGEMENT + ACCOUNT CRUD
═══════════════════════════════════════════════════════════ */

.task-mgmt-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 12px;
  margin-bottom: 8px;
  border-left: 4px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-mgmt-card.status-pending     { border-left-color: #FFC107; }
.task-mgmt-card.status-in_progress { border-left-color: #2196F3; }
.task-mgmt-card.status-done        { border-left-color: #4CAF50; opacity: 0.75; }
.task-mgmt-card.status-impossible  { border-left-color: #F44336; opacity: 0.65; }

.task-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.task-mgmt-title {
  font-weight: 800;
  font-size: 0.9rem;
  flex: 1;
}
.task-mgmt-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.task-mgmt-btn {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.task-mgmt-btn.edit   { background: #E3F2FD; color: #1565C0; }
.task-mgmt-btn.delete { background: #FFEBEE; color: #B71C1C; }

.task-mgmt-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.task-mgmt-worker {
  font-weight: 700;
  color: var(--accent);
}
.task-mgmt-domain {
  background: var(--accent-light);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Account list items */
.account-list {
  background: var(--box-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 10px;
}
.account-row {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.account-row:last-child { border-bottom: none; }
.account-row-name { flex: 1; font-size: 0.88rem; font-weight: 700; }
.account-row-sub  { font-size: 0.72rem; color: var(--text-muted); }
.account-row-actions { display: flex; gap: 5px; }
