:root {
  --navy: #0d1b3e;
  --navy-light: #16265a;
  --sidebar-active: #1e6df2;
  --bg: #eef1f7;
  --panel-bg: #ffffff;
  --border: #dfe5ef;
  --text: #1b2a41;
  --text-muted: #68748a;
  --green: #16a34a;
  --green-bg: #e8f7ee;
  --red: #d92d20;
  --red-bg: #fdecea;
  --blue: #1e6df2;
  --blue-bg: #e8f0fe;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app { display: flex; min-height: 100vh; width: 100%; max-width: 100%; min-width: 0; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0d1b3e 0%, #0a1734 100%);
  color: #cdd7ec;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text { font-weight: 700; font-size: 15px; letter-spacing: 1px; color: #fff; line-height: 1.1; }
.logo-sub { font-size: 10.5px; letter-spacing: 3px; color: #8fa1c7; font-weight: 600; }
.logo-stack { display: flex; flex-direction: column; gap: 1px; }

.sidebar-nav { padding: 10px 10px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cdd7ec;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.nav-item.active { background: var(--sidebar-active); color: #fff; }

.nav-icon { width: 18px; text-align: center; font-size: 15px; }

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-bottom-title { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.5px; }
.sidebar-bottom-sub { color: #8fa1c7; font-size: 12px; margin-top: 2px; }
.sidebar-bottom-domain { color: #6d81ab; font-size: 10.5px; margin-top: 8px; letter-spacing: 0.3px; }

/* ============ MAIN ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 { font-size: 19px; font-weight: 700; color: #101c33; letter-spacing: 0.3px; }
.subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.topbar-clock { text-align: right; }
.clock-date { color: var(--text-muted); font-size: 12px; }
.clock-time { font-size: 17px; font-weight: 600; color: #101c33; }

.content { padding: 20px 24px 40px; }

.hidden { display: none !important; }

/* ============ DASHBOARD GRID ============ */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.dash-center { min-width: 0; }
.dash-right { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 96px; }

/* ============ STAT CARDS ============ */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 3px solid transparent;
}

.stat-card.green { border-top-color: var(--green); }
.stat-card.red { border-top-color: var(--red); }
.stat-card.blue { border-top-color: var(--blue); }

.stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.8px; color: var(--text-muted); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.blue .stat-value { color: var(--blue); }

/* ============ PANELS ============ */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.panel-title { font-size: 15px; font-weight: 700; color: #101c33; margin-bottom: 12px; letter-spacing: 0.4px; }
.green-title { color: var(--green); }
.red-title { color: var(--red); }

.panel-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-title-row .panel-title { margin-bottom: 0; }
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* ============ CONTRIBUTION / EXPENDITURE ENTRY ============ */
.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.contrib-head-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.3fr) 74px;
  gap: 8px;
  margin-bottom: 6px;
}

.contrib-h { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.4px; }

.contributor-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.3fr) 74px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.contributor-name {
  font-weight: 700;
  font-size: 13px;
  color: #101c33;
  background: var(--green-bg);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
  letter-spacing: 0.5px;
}

input[type="text"], input[type="date"], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 109, 242, 0.12);
}

textarea { resize: vertical; }

.form-field { margin-bottom: 10px; }
.form-field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.4px; }

/* ============ BUTTONS ============ */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: filter 0.15s, transform 0.05s;
}

.btn:active { transform: translateY(1px); }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.08); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { filter: brightness(1.08); }
.btn-link { background: transparent; color: var(--blue); padding: 4px 6px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

.btn-wide { width: 100%; padding: 11px; font-size: 14px; }

.btn-send {
  background: var(--blue);
  color: #fff;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.btn-send:hover { filter: brightness(1.1); }

.field-error {
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  margin: 6px 0;
  min-height: 0;
}
.field-error:empty { display: none; }

/* ============ HISTORY ============ */
.hist-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-head .panel-title { margin-bottom: 0; }

.record-count { color: var(--text-muted); font-size: 12px; font-weight: 600; }

.history-table { width: 100%; border-collapse: collapse; }

.history-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: top;
}

.history-table tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: #f6f8fc; }

.cell-amount { font-weight: 600; white-space: nowrap; }
.cell-amount.green-text { color: var(--green); }
.cell-amount.red-text { color: var(--red); }
.cell-note { color: #3c4a63; word-break: break-word; }
.cell-dt { color: var(--text-muted); white-space: nowrap; font-size: 12.5px; }
.cell-contributor { font-weight: 600; white-space: nowrap; }

.empty-note { color: var(--text-muted); font-size: 13px; padding: 12px 4px 4px; font-style: italic; }

/* ============ CHAT ============ */
.chat-panel { display: flex; flex-direction: column; }
.chat-messages {
  height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px;
  margin-bottom: 10px;
}

.chat-msg { max-width: 85%; align-self: flex-start; background: #f1f4fa; border-radius: 12px 12px 12px 3px; padding: 8px 11px; }
.chat-msg.own { align-self: flex-end; background: var(--blue-bg); border-radius: 12px 12px 3px 12px; }
.chat-sender { font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 2px; }
.chat-text { font-size: 13px; word-break: break-word; color: #1b2a41; }
.chat-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; text-align: right; }

.chat-input-row { display: flex; gap: 8px; }

/* ============ QUICK SUMMARY ============ */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row > span:first-child { color: var(--text-muted); font-weight: 600; }
.sum-val { font-weight: 700; color: var(--green); }
.red-text { color: var(--red); }
.blue-text { color: var(--blue); }

/* ============ MEMBERS ============ */
.members-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.member-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  background: #fbfcfe;
}
.member-avatar {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
}
.member-name { font-weight: 700; font-size: 14px; }
.member-total-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.member-total { font-size: 15px; font-weight: 700; color: var(--green); }

/* ============ CATEGORIES ============ */
.category-add-row { display: flex; gap: 10px; margin-bottom: 12px; }
.category-add-row input { flex: 1; }

/* ============ REPORTS ============ */
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.report-stat-item { background: #f6f8fc; border-radius: 8px; padding: 12px 14px; }
.report-stat-item .k { font-size: 11.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.4px; }
.report-stat-item .v { font-size: 16px; font-weight: 700; margin-top: 3px; }

.page-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }

.settings-saved { color: var(--green); font-weight: 600; font-size: 13px; margin-top: 10px; }
.settings-saved:empty { display: none; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #101c33;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s;
}
.toast.hidden { opacity: 0; pointer-events: none; }

/* ============ RESPONSIVE ============ */
/* Desktop >= 1200px: approved layout, untouched below this point. */

/* Tablet 768px - 1199px */
@media (max-width: 1199px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-right { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .sidebar { width: 190px; }
  .cards-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .entry-row, .hist-row { grid-template-columns: 1fr; }
}

/* Mobile < 768px */
@media (max-width: 767px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .app { flex-direction: column; width: 100%; max-width: 100%; min-width: 0; }
  .main { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; }
  .content { width: 100%; max-width: 100%; min-width: 0; padding: 12px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    height: 100vh;
    z-index: 400;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-topbar { display: flex !important; }
  .topbar { display: none; }
  .mobile-only { display: flex !important; }

  .dash-grid { display: flex; flex-direction: column; gap: 14px; width: 100%; min-width: 0; }
  .dash-center { display: flex; flex-direction: column; gap: 14px; width: 100%; min-width: 0; }
  .dash-right { display: flex; flex-direction: column; gap: 14px; width: 100%; min-width: 0; }
  .cards-row { grid-template-columns: 1fr !important; gap: 12px; margin-bottom: 0; width: 100%; min-width: 0; }
  .stat-card { width: 100%; min-width: 0; }
  .entry-row, .hist-row { grid-template-columns: 1fr; gap: 14px; margin-bottom: 0; width: 100%; min-width: 0; }
  .panel { padding: 14px; margin-bottom: 0; width: 100%; min-width: 0; }

  /* Mobile: MY CONTRIBUTION replaces the six-row form */
  .contrib-head-row, .contributor-row { display: none; }
  .my-contribution { display: block !important; width: 100%; }
  .my-contribution input, .my-contribution .btn { width: 100%; }

  /* Expenditure + chat full width */
  .expenditure-panel input, .expenditure-panel textarea, .expenditure-panel .btn { width: 100%; }
  .chat-panel { width: 100%; min-width: 0; }
  .chat-input-row { width: 100%; }
  .chat-input-row input { flex: 1; min-width: 0; width: auto; }
  .chat-input-row .btn-send { flex-shrink: 0; }

  /* Touch sizing */
  .btn { min-height: 44px; font-size: 15px; }
  .btn-link, .btn-send { min-height: 44px; }
  input[type="text"], input[type="date"], textarea, select { font-size: 16px; padding: 12px; min-width: 0; }
  .members-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .chat-messages { height: 260px; }
  .login-card { padding: 26px 20px; }

  /* History tables -> responsive transaction cards */
  .mobile-cards { display: block; width: 100%; min-width: 0; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { display: block; width: 100%; }
  .mobile-cards tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fbfcfe;
    width: 100%;
    min-width: 0;
  }
  .mobile-cards td {
    display: block;
    width: 100%;
    min-width: 0;
    border: none;
    padding: 3px 0;
    font-size: 13.5px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .mobile-cards td::before {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 6px;
  }
  .mobile-cards td:first-child::before { margin-top: 0; }
  .mobile-cards td.cell-dt::before { content: 'Date & Time'; }
  .mobile-cards td.cell-contributor::before { content: 'Contributor'; }
  .mobile-cards td.cell-amount::before { content: 'Amount'; }
  .mobile-cards td.cell-note::before { content: 'Note / Reason'; }
}

@media (max-width: 767px) and (min-width: 400px) {
  .members-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ LOGOUT ============ */
.topbar-right { display: flex; align-items: center; gap: 16px; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f5c6c0;
  padding: 8px 12px;
}
.btn-logout:hover { background: #fbd9d5; }

/* ============ LOGIN SCREEN ============ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #0d1b3e 0%, #0a1734 55%, #081227 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 34px 32px 30px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-brand { margin-bottom: 22px; }
.login-brand .logo-badge { margin: 0 auto 10px; width: 46px; height: 46px; border-radius: 12px; }
.login-title { font-size: 21px; font-weight: 800; color: #101c33; letter-spacing: 0.5px; }
.login-domain { font-size: 12.5px; color: var(--blue); font-weight: 600; margin-top: 3px; }
.login-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

.login-field { text-align: left; margin-bottom: 6px; }
.login-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; letter-spacing: 0.4px; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.eye-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #7a8699;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}
.eye-btn:hover { color: var(--blue); background: #eef3fd; }

.login-config-note {
  margin-top: 14px;
  background: #fff7e6;
  border: 1px solid #f2dfae;
  color: #8a6100;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

/* ============ IDENTITY CHIP ============ */
.identity-chip {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid #c9d9f8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.identity-chip:empty { display: none; }

/* ============ MOBILE TOPBAR ============ */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 300;
  background: #0d1b3e;
  color: #fff;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.mobile-topbar-title { font-weight: 800; font-size: 15px; letter-spacing: 0.5px; }
.mobile-topbar-brand { flex: 1; }
.mobile-topbar-member { font-size: 12.5px; font-weight: 700; color: #9fc2ff; }
.burger-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.burger-btn:hover { background: rgba(255, 255, 255, 0.18); }

.mobile-only { display: none; width: 100%; justify-content: center; margin-top: 10px; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 39, 0.55);
  z-index: 350;
}
.drawer-backdrop.hidden { display: none; }

/* ============ MY CONTRIBUTION (mobile) ============ */
.my-contribution { display: none; margin-top: 4px; }
.my-contribution-title { font-size: 14px; font-weight: 800; color: var(--green); margin-bottom: 8px; letter-spacing: 0.5px; }
.my-contribution-who { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.my-contribution .form-field { margin-bottom: 10px; }
.my-contribution .field-error { margin-top: 8px; }

/* ============ MEMBER SELECTION ============ */
.member-card-wide { max-width: 460px; }

.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.btn-member {
  min-height: 54px;
  border: 1px solid var(--border);
  background: #fbfcfe;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #101c33;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-member:hover { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }

.member-confirm-selected {
  border: 1px dashed #c9d9f8;
  background: var(--blue-bg);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.member-confirm-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.8px; }
.member-confirm-name { font-size: 26px; font-weight: 800; color: var(--blue); letter-spacing: 2px; margin: 4px 0; }
.member-confirm-note { font-size: 12.5px; color: var(--text-muted); }
.member-confirm-btns { display: flex; flex-direction: column; gap: 8px; }
.btn-plain {
  background: #f1f4fa;
  color: #33415c;
  border: 1px solid var(--border);
}
.btn-plain:hover { background: #e6ebf5; }

/* ============ LOCKED CONTRIBUTOR ROWS (desktop) ============ */
.contributor-row.locked-row { opacity: 0.55; }
.contributor-row.locked-row .contrib-save { pointer-events: none; }
.contributor-row.my-row .contributor-name { background: var(--blue); color: #fff; }
.contributor-row.my-row { outline: 2px solid var(--blue-bg); border-radius: 8px; }

.my-contribution.hidden { display: none !important; }

/* ============ ATTACHMENTS ============ */
.attach-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.attach-input { display: none; }
.btn-attach {
  background: #eef3fd;
  color: var(--blue);
  border: 1px dashed #9db8ec;
  min-height: 40px;
  font-weight: 600;
}
.btn-attach:hover { background: #dfe9fb; }
.attach-status {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.attach-remove { color: var(--red); }
.attach-remove.hidden { display: none; }
.attach-thumb.hidden { display: none; }

.contributor-row .contrib-attach {
  display: flex;
  align-items: center;
  gap: 4px;
}
.contributor-row .contrib-attach .btn-attach {
  padding: 7px 8px;
  font-size: 12px;
  min-height: 0;
  white-space: nowrap;
}
.contributor-row .attach-status {
  display: block;
  grid-column: 1 / -1;
  font-size: 11.5px;
}
.cell-receipt { white-space: nowrap; }
.btn-view-receipt {
  background: #eef3fd;
  color: var(--blue);
  border: 1px solid #c9d9f8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-view-receipt:hover { background: #dfe9fb; }

/* viewer */
.attach-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 18, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.attach-viewer.hidden { display: none; }
.attach-viewer-card {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.attach-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.attach-viewer-title { font-weight: 700; font-size: 14px; color: #101c33; }
.attach-viewer-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fa;
}
.attach-viewer-body img { max-width: 100%; max-height: 68vh; border-radius: 6px; }
.attach-viewer-body iframe { width: 100%; height: 68vh; border: none; border-radius: 6px; background: #fff; }
.attach-viewer-actions { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
