/* Minimal styles placeholder (requested later: modern & responsive) */
:root {
  --bg: #0b1020;
  --card: #111a33;
  --text: #e7ecff;
  --muted: #b9c3ff;
  --border: rgba(255, 255, 255, 0.12);
  --primary: #6ea8ff;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #182553, var(--bg));
  color: var(--text);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

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

.header__title {
  margin: 0;
  font-size: 1.3rem;
}

.card {
  margin: 20px 0;
  padding: 18px;
  background: rgba(17, 26, 51, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.card__header { margin-bottom: 12px; }
.card__title { margin: 0; font-size: 1.05rem; }
.card__subtitle { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

.table-wrap { overflow-x: auto; }

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

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th { color: var(--muted); font-weight: 600; }

.table__actions { width: 220px; }

.table td.table__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn--primary {
  background: rgba(110, 168, 255, 0.15);
  border-color: rgba(110, 168, 255, 0.45);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
}

.btn--danger {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.5);
}

.empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.12);
  color: var(--text);
}

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

.form__row {
  display: grid;
  gap: 6px;
}

.form__label {
  color: var(--muted);
  font-weight: 600;
}

.form__input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.form__input:focus {
  border-color: rgba(110, 168, 255, 0.55);
}

.detail {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail__label {
  color: var(--muted);
  font-weight: 600;
}

.detail__value {
  margin: 0;
}

@media (max-width: 520px) {
  .header__content {
    flex-direction: column;
    align-items: flex-start;
  }

  .table td.table__actions {
    justify-content: flex-start;
  }

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

/* Mobile-first improvements for the contacts table */
@media (max-width: 720px) {
  .card {
    padding: 14px;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .table {
    min-width: 0;
  }

  /* Hide header and show each row as a card */
  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
  }

  .table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .table td:last-child {
    border-bottom: 0;
  }

  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
    flex: 0 0 110px;
  }

  .table td.table__actions {
    justify-content: flex-start;
    align-items: center;
  }

  .table td.table__actions::before {
    align-self: center;
  }

  .table td.table__actions .btn {
    flex: 1 1 auto;
  }
}

.footer {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  margin-top: auto;
}
