:root {
  --bg: #f3f6fb;
  --bg-soft: #e9eef8;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #5b6475;
  --line: #d8e0ec;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --accent-soft: #e0f2fe;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI Variable", "Nunito Sans", "Trebuchet MS", sans-serif;
  color: var(--ink);
  line-height: 1.45;
  background: #dbeafe;
}

.container {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 20px 14px 28px;
  display: grid;
  gap: 14px;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

h2 {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

small,
.muted {
  color: var(--muted);
}

a {
  color: #0369a1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.stack {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

input,
select,
textarea,
button,
.btn {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd9e8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

textarea[readonly] {
  background: #f8fbff;
}

button,
.btn {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover,
.btn:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.28);
  text-decoration: none;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

.warning {
  border-color: #f5d57a;
  background: linear-gradient(180deg, #fffdf6 0%, #fffbef 100%);
}

.danger {
  border-color: #f2b8b5;
  background: linear-gradient(180deg, #fff8f7 0%, #fff5f4 100%);
}

.error {
  color: var(--danger);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe5f4;
  background: var(--accent-soft);
  color: #0c4a6e;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
  width: auto;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

th,
td {
  border-bottom: 1px solid #e6edf7;
  padding: 8px 6px;
  text-align: left;
  white-space: nowrap;
}

thead th {
  color: #334155;
  font-weight: 700;
}

.auth {
  max-width: 430px;
  margin: 8vh auto;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.is-hidden {
  display: none !important;
}

@media (min-width: 860px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .card {
    padding: 16px;
  }
}
  .summary-table th,
  .summary-table td,
  .data-table th,
  .data-table td {
    padding: 8px;
    font-size: 0.9rem;
  }

  .net-badge {
    min-width: 72px;
  }

.summary-table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  background: #fff;
}

.summary-table th,
.summary-table td,
.data-table th,
.data-table td {
  white-space: normal;
  padding: 10px 12px;
}

.summary-table thead th,
.data-table thead th {
  background: #f8fbff;
  font-weight: 700;
  color: #334155;
}

.summary-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

.summary-table .name,
.data-table .name {
  font-weight: 600;
}

.summary-table .num,
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.net-badge {
  display: inline-block;
  min-width: 88px;
  text-align: right;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.net-badge.positive {
  color: #1e3a8a;
  background: #dbeafe;
}

.net-badge.negative {
  color: #991b1b;
  background: #fee2e2;
}

.net-badge.neutral {
  color: #374151;
  background: #f3f4f6;
}

.iban-cell {
  max-width: 220px;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.settlement-lines {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.settlement-lines li {
  line-height: 1.5;
}

.active-activities {
  border-color: #86efac;
  background: linear-gradient(180deg, #f6fff8 0%, #effcf3 100%);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.12);
}

.active-title-icon {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  background: radial-gradient(circle at 30% 30%, #86efac 0%, #22c55e 60%, #15803d 100%);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}

.desktop-only { display: inline; }
.mobile-only { display: none; }

.data-table .btn,
.summary-table .btn {
  width: auto;
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}
  body { font-size: 14px; }

  h1 { font-size: 1.15rem; }
  h2 { font-size: 1rem; }
  h3 { font-size: 0.95rem; }

  label { font-size: 0.84rem; }

  button,
  .btn {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .data-table,
  .summary-table {
    font-size: 0.86rem;
  }

  .desktop-only { display: none; }
  .mobile-only { display: inline; }

.chip input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  min-height: 14px;
  flex: 0 0 auto;
}

.chip {
  font-size: 0.88rem;
}


#copy-preview-btn {
  margin-bottom: 12px;
}


#preview-settlement-panel .inline-actions {
  margin-bottom: 12px;
}



.preview-copy-actions {
  margin-top: 14px;
  justify-content: center;
}

.preview-copy-actions #copy-preview-btn {
  margin: 0 auto;
}


.accordion-item {
  overflow: hidden;
}

.accordion-item > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  padding: 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accordion-item > summary::-webkit-details-marker {
  display: none;
}

.accordion-item > summary::after {
  content: "+";
  font-weight: 700;
  color: #475569;
}

.accordion-item[open] > summary::after {
  content: "-";
}

.accordion-item > :not(summary) {
  margin-top: 12px;
}

.invite-copy-actions {
  justify-content: center;
  margin-top: 8px;
}

.invite-copy-actions #copy-invite-btn {
  margin: 0 auto;
}


.debt-copy-actions {
  justify-content: center;
  margin-top: 12px;
}

.iban-click {
  cursor: pointer;
}

.iban-click:hover {
  text-decoration: underline;
}


/* table-fill-fix */
table {
  display: table;
  overflow-x: visible;
}

.data-table,
.summary-table {
  width: 100%;
  table-layout: auto;
}

.data-table th,
.data-table td,
.summary-table th,
.summary-table td {
  width: auto;
}


.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 168px;
  height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  flex: 0 0 auto;
}






.app-toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.92rem;
  z-index: 2000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast.success {
  background: #065f46;
}

.app-toast.error {
  background: #991b1b;
}

.app-toast.info {
  background: #0f172a;
}


.iban-copy-btn {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #7dd3fc;
  background: #e0f2fe;
  color: #075985;
  font-weight: 700;
  box-shadow: none;
}

.iban-copy-btn:hover {
  background: #bae6fd;
  box-shadow: none;
}


.iban-copy-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
  .iban-copy-btn {
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #7dd3fc;
    background: #e0f2fe;
    color: #075985;
    border-radius: 999px;
  }


.expense-edit-btn,
.expense-view-btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: inherit;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}

.expense-edit-btn {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}
.expense-edit-btn:hover {
  background: #dbeafe;
  box-shadow: none;
}

.expense-view-btn {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #14532d;
}
.expense-view-btn:hover {
  background: #dcfce7;
  box-shadow: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  z-index: 2100;
  overflow-y: auto;
}

.modal-backdrop.is-hidden {
  display: none !important;
}

.modal-card {
  width: min(100%, 560px);
  margin: auto;
  background: #ffffff;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  padding: 14px;
  flex-shrink: 0;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-close {
  min-height: 34px;
  min-width: 34px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  box-shadow: none;
}

.modal-actions {
  justify-content: flex-end;
}

.danger-zone {
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.danger-btn {
  width: 100%;
  background: #b91c1c;
}

.danger-btn:hover {
  background: #991b1b;
}
  .modal-card {
    width: 100%;
    border-radius: 12px;
    padding: 12px;
  }
  .expenses-table th,
  .expenses-table td {
    padding: 6px 6px;
    font-size: 0.82rem;
    word-break: break-word;
  }

  .expenses-table th:nth-child(2),
  .expenses-table td:nth-child(2) {
    display: none;
  }

  .expenses-table .expense-edit-btn,
  .expenses-table .expense-view-btn {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.78rem;
  }





/* UI compact optimization (2026-03-04) */
body {
  font-size: 15px;
  line-height: 1.4;
}

.container {
  padding: 16px 12px 22px;
  gap: 12px;
}

h1 { font-size: clamp(1.2rem, 1.8vw, 1.55rem); }
h2 { font-size: clamp(1rem, 1.2vw, 1.12rem); }
h3 { font-size: 0.98rem; }

.card {
  padding: 12px;
  border-radius: 14px;
}

label {
  font-size: 0.86rem;
}

input,
select,
textarea {
  min-height: 38px;
  padding: 8px 10px;
}

button,
.btn {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.84rem;
  border-radius: 10px;
}

.data-table,
.summary-table {
  font-size: 0.86rem;
}

.data-table th,
.data-table td,
.summary-table th,
.summary-table td {
  padding: 8px 9px;
}

.expenses-table {
  table-layout: fixed;
}

.expenses-table th,
.expenses-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-table .expense-edit-btn,
.expenses-table .expense-view-btn {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.74rem;
}
  body {
    font-size: 13px;
    line-height: 1.35;
  }

  .container {
    padding: 10px 8px 16px;
    gap: 10px;
  }

  h1 { font-size: 1rem; }
  h2 { font-size: 0.9rem; }
  h3 { font-size: 0.86rem; }

  .card {
    padding: 10px;
    border-radius: 12px;
  }

  label {
    font-size: 0.78rem;
  }

  input,
  select,
  textarea {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  button,
  .btn {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .data-table,
  .summary-table {
    font-size: 0.78rem;
  }

  .data-table th,
  .data-table td,
  .summary-table th,
  .summary-table td {
    padding: 5px 6px;
  }

  .expenses-table th:nth-child(4),
  .expenses-table td:nth-child(4) {
    max-width: 86px;
  }

  .modal-card {
    padding: 10px;
    border-radius: 10px;
  }

/* Ultra-compact profile (2026-03-04) */
  body {
    font-size: 12.5px;
    line-height: 1.3;
  }

  .container {
    padding: 8px 6px 12px;
    gap: 8px;
  }

  .card {
    padding: 8px;
    border-radius: 10px;
  }

  .accordion-item > summary {
    font-size: 0.86rem;
    padding: 1px 0;
  }

  h1 { font-size: 0.94rem; }
  h2 { font-size: 0.85rem; }
  h3 { font-size: 0.8rem; }

  label { font-size: 0.74rem; }

  input,
  select,
  textarea {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 0.75rem;
    border-radius: 9px;
  }

  button,
  .btn {
    min-height: 29px;
    padding: 4px 7px;
    font-size: 0.72rem;
    border-radius: 9px;
  }

  .chip {
    font-size: 0.76rem;
    padding: 4px 8px;
  }

  .topbar .inline-actions {
    gap: 6px;
  }

  .summary-table,
  .data-table {
    font-size: 0.74rem;
  }

  .summary-table th,
  .summary-table td,
  .data-table th,
  .data-table td {
    padding: 4px 5px;
  }

  .net-badge {
    min-width: 56px;
    padding: 2px 6px;
    font-size: 0.72rem;
  }

  .expense-edit-btn,
  .expense-view-btn,
  .iban-copy-btn {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 0.7rem;
  }

  /* Debt screen: stack each row to avoid horizontal squeeze */
  .debt-table {
    border: 0;
    background: transparent;
  }

  .debt-table thead {
    display: none;
  }

  .debt-table,
  .debt-table tbody,
  .debt-table tr,
  .debt-table td {
    display: block;
    width: 100%;
  }

  .debt-table tr {
    background: #fff;
    border: 1px solid #e6edf7;
    border-radius: 10px;
    padding: 6px;
    margin-bottom: 6px;
  }

  .debt-table td {
    border-bottom: 0;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    white-space: normal;
    text-align: right;
  }

  .debt-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #334155;
    text-align: left;
  }

  .debt-table .iban-cell {
    max-width: none;
    word-break: break-word;
  }

@media (max-width: 420px) {
  body { font-size: 12px; }

  .summary-table,
  .data-table { font-size: 0.72rem; }

  .summary-table th,
  .summary-table td,
  .data-table th,
  .data-table td { padding: 3px 4px; }
}

/* Keep participants and debt tables single-row on mobile */
  .participants-table,
  .debt-table {
    display: table !important;
    width: 100%;
    table-layout: fixed;
  }

  .participants-table thead,
  .debt-table thead {
    display: table-header-group !important;
  }

  .participants-table tbody,
  .debt-table tbody {
    display: table-row-group !important;
  }

  .participants-table tr,
  .debt-table tr {
    display: table-row !important;
  }

  .participants-table th,
  .participants-table td,
  .debt-table th,
  .debt-table td {
    display: table-cell !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 5px;
  }

  .debt-table td::before {
    content: none !important;
  }

/* Symmetry + compact tables refinement (2026-03-04) */
.topbar form {
  margin: 0;
}

.data-table td .inline-actions,
.summary-table td .inline-actions {
  justify-content: flex-start;
  gap: 6px;
}

.data-table td .inline-actions form,
.summary-table td .inline-actions form {
  margin: 0;
}

.compact-table {
  table-layout: fixed;
}

.compact-table th,
.compact-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .compact-table {
    font-size: 0.74rem;
  }

  .compact-table th,
  .compact-table td {
    padding: 3px 4px;
    white-space: nowrap;
  }

  .compact-table .btn,
  .compact-table button {
    min-height: 24px;
    padding: 2px 6px;
    font-size: 0.68rem;
  }

  .profile-archive-table th:nth-child(2),
  .profile-archive-table td:nth-child(2) {
    max-width: 86px;
  }

  .participants-table th:nth-child(4),
  .participants-table td:nth-child(4) {
    max-width: 72px;
  }
}

/* Global mobile-app like top banner */
.app-shell {
  position: sticky;
  top: 0;
  z-index: 2500;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(226, 242, 255, 0.92) 0%, rgba(243, 248, 255, 0.92) 100%);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #cfe0f3;
}

.app-shell-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.app-shell-brand {
  display: inline-flex;
  align-items: center;
}

.app-shell-logo {
  width: 132px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.app-shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell-actions a {
  text-decoration: none;
}

.app-shell-logout-form {
  margin: 0;
}

.app-shell-btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  color: #075985;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-shell-btn.secondary {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.app-shell-btn.danger-lite {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.page-head {
  gap: 4px;
}

.page-head h1 {
  margin-bottom: 0;
}
  .app-shell {
    padding: 6px 8px;
  }

  .app-shell-inner {
    border-radius: 12px;
    padding: 7px 8px;
    gap: 8px;
  }

  .app-shell-logo {
    width: 108px;
    height: 30px;
  }

  .app-shell-actions {
    gap: 6px;
  }

  .app-shell-btn {
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 0.73rem;
  }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid #c7ddf6;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  color: #1d4e89;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.12);
  text-decoration: none;
  padding: 0;
  cursor: pointer;
}

.app-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-icon-btn:hover {
  border-color: #93c5fd;
  background: #eaf4ff;
  text-decoration: none;
}

.app-shell-actions {
  margin-left: auto;
}

.expenses-table .col-note {
  min-width: 180px;
}

.note-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #d8e2ee;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
  .app-shell-left {
    gap: 6px;
  }

  .app-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .app-icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .app-shell-logo {
    width: 96px;
    height: 28px;
  }

  .app-shell-actions {
    gap: 5px;
  }

  .app-shell-btn {
    min-height: 29px;
    padding: 4px 7px;
    font-size: 0.7rem;
  }

  .expenses-table .col-note {
    min-width: 124px;
    max-width: 140px;
  }

  .note-pill {
    max-width: 120px;
    font-size: 0.7rem;
    padding: 3px 7px;
  }

/* Banner layout refinement (2026-03-04) */
.app-shell-inner {
  justify-content: space-between;
}

.app-shell-brand {
  margin-left: auto;
}

.app-user-strip {
  width: 100%;
  padding: 6px 10px 0;
}

.app-user-strip-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}

.app-user-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-user-actions a {
  text-decoration: none;
}
  .app-user-strip {
    padding: 4px 8px 0;
  }

  .app-user-strip-inner {
    justify-content: flex-end;
  }

  .app-user-actions {
    gap: 6px;
  }

  .app-shell-logo {
    width: 90px;
    height: 26px;
  }

/* Banner alignment update: left icons, centered logo, right user actions */
.app-shell-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.app-shell-left {
  justify-self: start;
}

.app-shell-brand {
  justify-self: center;
  margin-left: 0;
}

.app-shell-actions {
  justify-self: end;
  margin-left: 0;
}

/* legacy strip is removed from markup */
.app-user-strip,
.app-user-strip-inner,
.app-user-actions {
  display: none;
}
  .app-shell-inner {
    grid-template-columns: auto 1fr auto;
    gap: 6px;
  }

  .app-shell-brand {
    justify-self: center;
  }

  .app-shell-logo {
    width: 84px;
    height: 24px;
  }

.auth-alt-link {
  display: inline-block;
  margin-top: 16px;
  padding-top: 4px;
  font-weight: 600;
}

/* Mobile-first larger login layout */
  .auth-entry {
    max-width: 520px;
    margin: 5vh auto;
    padding: 14px;
    border-radius: 14px;
  }

  .auth-entry p {
    font-size: 0.96rem;
    margin: 4px 0 8px;
  }

  .auth-entry .brand-logo {
    width: 182px;
    height: 48px;
  }

  .auth-entry input {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.92rem;
    border-radius: 11px;
  }

  .auth-entry button {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 0.92rem;
    border-radius: 11px;
  }

  .auth-entry .auth-alt-link {
    margin-top: 18px;
    font-size: 0.9rem;
  }


/* Auth pages: logo left; after login: logo center */
.is-auth-page .app-shell-inner {
  grid-template-columns: auto 1fr;
}

.is-auth-page .app-shell-left {
  display: none;
}

.is-auth-page .app-shell-brand {
  justify-self: start;
}

.is-auth-page .app-shell-actions {
  justify-self: end;
}
  .is-auth-page .app-shell-inner {
    grid-template-columns: auto 1fr;
    gap: 8px;
  }

  .is-auth-page .app-shell-brand {
    justify-self: start;
  }

.activity-head {
  display: grid;
  gap: 6px;
}

.activity-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-head-row h1 {
  margin: 0;
}

.activity-head-meta {
  margin: 0;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.activity-head-desc {
  margin: 0;
  color: #475569;
  line-height: 1.45;
}
  .activity-head-row {
    gap: 8px;
  }

  .activity-head-meta {
    font-size: 0.78rem;
  }

  .activity-head-desc {
    font-size: 0.78rem;
  }


.participation-info > summary {
  position: relative;
  padding-right: 86px;
}

.participation-info > summary::after {
  position: absolute;
  right: 0;
  top: 0;
}

.participant-badge {
  position: absolute;
  right: 22px;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}
  .participation-info > summary {
    padding-right: 78px;
  }

  .participant-badge {
    right: 18px;
    font-size: 0.68rem;
    padding: 2px 7px;
  }

/* Table typography and overflow tuning (2026-03-04) */
.data-table,
.summary-table {
  table-layout: fixed;
}

.data-table th,
.data-table td,
.summary-table th,
.summary-table td {
  padding: 6px 8px;
  font-size: 0.8rem;
  line-height: 1.25;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table td,
.summary-table td {
  white-space: nowrap;
}

.data-table .name,
.summary-table .name {
  font-size: 0.79rem;
}

.participants-table td,
.expenses-table td,
.debt-table td,
.profile-archive-table td {
  max-width: 180px;
}
  .data-table th,
  .data-table td,
  .summary-table th,
  .summary-table td {
    padding: 4px 5px;
    font-size: 0.72rem;
  }

  .data-table .name,
  .summary-table .name {
    font-size: 0.71rem;
  }

  .participants-table td,
  .expenses-table td,
  .debt-table td,
  .profile-archive-table td {
    max-width: 110px;
  }

/* Normalize debt table to match standard data-table */
.debt-table {
  border: 1px solid #e6edf7 !important;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff !important;
}

.debt-table thead {
  display: table-header-group !important;
}

.debt-table tbody {
  display: table-row-group !important;
}

.debt-table tr {
  display: table-row !important;
  background: transparent !important;
}

.debt-table th,
.debt-table td {
  display: table-cell !important;
  border-bottom: 1px solid #e6edf7;
  padding: 8px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debt-table td::before {
  content: none !important;
}
  .debt-table {
    border: 1px solid #e6edf7 !important;
    background: #fff !important;
  }

  .debt-table th,
  .debt-table td {
    display: table-cell !important;
    border-bottom: 1px solid #e6edf7;
    padding: 4px 5px;
  }

/* Debt table alignment adjustments */
.debt-table th:nth-child(1),
.debt-table td:nth-child(1),
.debt-table th:nth-child(2),
.debt-table td:nth-child(2) {
  text-align: left;
}

.debt-table th:nth-child(4),
.debt-table td:nth-child(4) {
  text-align: center;
}

/* Summary and debt column fine alignment */
.summary-table th.net-head {
  text-align: center;
}

.debt-table th:nth-child(3),
.debt-table td:nth-child(3) {
  text-align: center;
}
.expenses-table th:nth-child(4),
.expenses-table td:nth-child(4) {
  width: 64px;
  max-width: 64px;
  text-align: center;
}

.expenses-table th.col-note,
.expenses-table td.col-note {
  width: auto;
  max-width: 260px;
}

.expenses-table .expense-edit-btn,
.expenses-table .expense-view-btn {
  min-height: 24px;
  padding: 3px 6px;
  font-size: 0.66rem;
  border-radius: 8px;
}
  .expenses-table th:nth-child(4),
  .expenses-table td:nth-child(4) {
    width: 48px;
    max-width: 48px;
  }

  .expenses-table th.col-note,
  .expenses-table td.col-note {
    max-width: 140px;
  }

  .expenses-table .expense-edit-btn,
  .expenses-table .expense-view-btn {
    min-height: 22px;
    padding: 2px 5px;
    font-size: 0.62rem;
  }

.archive-clear-btn {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.72rem;
  border-radius: 9px;
}
  .archive-clear-btn {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 0.66rem;
  }


.participants-table .kind-col {
  width: 42px;
  text-align: center;
}

.participant-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.participant-kind.real {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

.participant-kind.virtual {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}



/* Participants table compact fit (2026-03-06) */
.participants-table {
  table-layout: auto !important;
}

.participants-table th,
.participants-table td {
  padding: 4px 6px;
}

/* Keep person column as narrow as its content */
.participants-table th:nth-child(1),
.participants-table td:nth-child(1) {
  width: 1%;
  white-space: nowrap;
}

/* Keep role column as narrow as its content */
.participants-table th:nth-child(2),
.participants-table td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
}

.participants-table th:nth-child(3),
.participants-table td:nth-child(3) {
  width: 42px;
  max-width: 42px;
  text-align: center;
}

.participants-table th:nth-child(4),
.participants-table td:nth-child(4) {
  width: 76px;
  max-width: 76px;
}
  .participants-table th,
  .participants-table td {
    padding: 3px 4px;
  }

  .participants-table th:nth-child(4),
  .participants-table td:nth-child(4) {
    width: 68px;
    max-width: 68px;
  }




/* Expenses column sizing override */
.expenses-table {
  table-layout: auto !important;
}

.expenses-table th:nth-child(1),
.expenses-table td:nth-child(1) {
  width: 96px !important;
  max-width: 96px !important;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .expenses-table th:nth-child(1),
  .expenses-table td:nth-child(1) {
    width: 80px !important;
    max-width: 80px !important;
  }
}


/* Expenses note wrap override */
.expenses-table th.col-note,
.expenses-table td.col-note {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.expenses-table .note-pill {
  display: block;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}




/* Summary table fit override */
.summary-table {
  table-layout: fixed !important;
}

.summary-table th,
.summary-table td {
  padding: 5px 7px !important;
}

.summary-table th:nth-child(1),
.summary-table td:nth-child(1) {
  width: 22%;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2) {
  width: 19%;
}

.summary-table th:nth-child(3),
.summary-table td:nth-child(3) {
  width: 10%;
  text-align: center;
}

.summary-table th:nth-child(4),
.summary-table td:nth-child(4) {
  width: 19%;
}

.summary-table th:nth-child(5),
.summary-table td:nth-child(5) {
  width: 30%;
}

@media (max-width: 640px) {
  .summary-table th,
  .summary-table td {
    padding: 4px 5px !important;
    font-size: 0.72rem;
  }
}


/* Expense modal action row */
.expense-modal-actions-row {
  width: 100%;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.expense-action-left {
  margin: 0;
}

.danger-btn.compact {
  min-height: 40px;
  width: 84px;
  padding: 6px 8px;
  font-size: 0.74rem;
  border-radius: 10px;
}

.expense-save-btn {
  min-height: 40px;
  width: 100%;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .expense-modal-actions-row {
    grid-template-columns: 72px 1fr;
    gap: 8px;
  }

  .danger-btn.compact {
    width: 72px;
    min-height: 38px;
    font-size: 0.7rem;
    padding: 5px 7px;
  }

  .expense-save-btn {
    min-height: 38px;
  }
}



/* Delete confirm modal */
.delete-confirm-card {
  width: min(100%, 420px);
}

.delete-confirm-text {
  margin: 4px 0 10px;
  color: #334155;
}

.confirm-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-actions .modal-close-btn {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 10px;
}

.confirm-actions .danger-btn.compact {
  width: auto;
  min-height: 38px;
  padding: 7px 12px;
}

@media (max-width: 640px) {
  .delete-confirm-card {
    width: 100%;
  }

  .confirm-actions {
    justify-content: stretch;
  }

  .confirm-actions .modal-close-btn,
  .confirm-actions .danger-btn.compact {
    flex: 1 1 0;
    width: 100%;
  }
}

/* ── Dosya yükleme butonu ── */
.file-upload-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--bg-soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.file-upload-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.file-upload-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}
.file-input {
  display: none;
}
.receipt-thumb {
  max-width: 140px !important;
  max-height: 90px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 8px;
  margin-top: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}
.receipt-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.receipt-btns .file-upload-btn {
  flex: 1;
  max-width: 180px;
  justify-content: center;
}
.existing-receipt-box {
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.receipt-preview-wrap {
  position: relative;
  display: inline-block;
  margin-top: 6px;
}
.receipt-preview-wrap .receipt-thumb {
  margin-top: 0;
  display: block;
}
.receipt-delete-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 2;
  line-height: 1;
}
.receipt-delete-btn:hover {
  background: #991b1b;
}

/* ── Harcama detay (İncele) modalı ── */
.expense-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.expense-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.expense-detail-row:first-child { padding-top: 4px; }
.expense-detail-row:last-child  { border-bottom: none; padding-bottom: 4px; }
.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 88px;
  flex-shrink: 0;
  padding-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.detail-value {
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-word;
  flex: 1;
  line-height: 1.4;
}
.detail-amount {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.01em;
}
.receipt-detail-row {
  align-items: flex-start;
}
/* Görseli sabit boyutlu wrapper ile kısıtla */
.receipt-thumb-wrap {
  width: 160px;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  flex-shrink: 0;
  cursor: zoom-in;
}
.receipt-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.receipt-img { /* fallback — artık wrapper içinde */ }

/* ── Harcama satırı aksiyon butonları ── */
.action-btns {
  display: block !important;
}
.action-btns .expense-view-btn,
.action-btns .expense-edit-btn {
  display: block !important;
  width: 100% !important;
  margin-bottom: 4px;
  text-align: center;
  box-sizing: border-box;
}
.action-btns .expense-view-btn:last-child,
.action-btns .expense-edit-btn:last-child {
  margin-bottom: 0;
}

/* ── Lightbox ── */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2200;
  cursor: zoom-out;
}
.lightbox-backdrop.is-hidden {
  display: none !important;
}
.lightbox-img {
  max-width: min(92vw, 1000px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
  display: block;
}
.lightbox-close-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2201;
}
.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.receipt-img-clickable {
  cursor: zoom-in;
}

/* ── Katılımcı çıkarma ── */
.participant-remove-btn {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.participant-remove-btn:hover {
  background: #fee2e2;
}
.remove-warn-body {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
}
.remove-warn-list {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: var(--ink);
}
.remove-warn-list li {
  margin-bottom: 6px;
}
.remove-warn-tip {
  margin: 0;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--accent-strong);
}
