:root {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

body {
  margin: 0;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header > div {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

p.lead {
  margin: 0 0 20px;
  color: #475569;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}

.upload {
  display: flex;
  align-items: center;
  gap: 12px;
}

button {
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}

th {
  background: #f1f5f9;
  font-weight: 600;
}

.people {
  display: grid;
  gap: 12px;
}

.person-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.summary-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.muted {
  color: #64748b;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e0f2f1;
  color: #0f766e;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

.inline-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tax-input {
  width: 120px;
}

.unassigned {
  color: #dc2626;
  font-weight: 600;
}

.tax-summary {
  display: flex;
  justify-content: flex-end;
  flex: 1;
}

.item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  background: #64748b;
}

.btn-small:hover {
  background: #475569;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

.editable-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.editable-cell input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-size: 13px;
}

.editable-cell button {
  padding: 4px 8px;
  font-size: 11px;
}

.edit-mode {
  display: flex;
  gap: 4px;
  align-items: center;
}

.info-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #475569;
  text-align: center;
  line-height: 16px;
  font-size: 11px;
  cursor: help;
  margin-left: 4px;
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  visibility: hidden;
  background-color: #1e293b;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  width: 200px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

.mobile-instructions {
  display: none;
}

  .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

.modal {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
  }

.modal-header {
    margin-bottom: 16px;
  }

.modal-body .form-group {
    margin-bottom: 16px;
    margin-right: 18px;
  }

.modal-body .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
  }

.modal-body .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }

.modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
  }

/* Mobile responsive styles */
@media (max-width: 768px) {
  .page {
    padding: 16px 12px 24px;
  }

  h1 {
    font-size: 22px;
  }

  .card {
    padding: 12px 14px;
  }

  .inline-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .tax-summary {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .pill {
    flex-wrap: wrap;
    font-size: 11px;
    padding: 4px 8px;
  }

  table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td {
    padding: 8px 6px;
  }

  .tags {
    flex-wrap: wrap;
  }

  .tag {
    font-size: 11px;
    padding: 3px 6px;
  }

  .mobile-instructions {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
  }

  .desktop-instructions {
    display: none;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .editable-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .item-actions {
    flex-direction: column;
    gap: 4px;
  }

  .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .modal {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
  }

  .modal-header {
    margin-bottom: 16px;
  }

  .modal-body .form-group {
    margin-bottom: 16px;
  }

  .modal-body .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
  }

  .modal-body .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }

  .modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
  }

  .inline-inputs {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }

  .tax-inputs {
      display: flex;
      gap: 8px;
  }

}