:root {
  font-family: Arial, sans-serif;
  background: #f3f5f7;
  color: #1f2937;
}

* { box-sizing: border-box; }

body { margin: 0; }

.container {
  width: min(1180px, 94%);
  margin: auto;
}

header {
  background: #1f4f78;
  color: white;
  margin-bottom: 28px;
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
}

.brand {
  font-size: 1.35rem;
  font-weight: bold;
  margin-left: 0 !important;
}

.card {
  background: white;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.login-card {
  max-width: 440px;
  margin: 60px auto;
}

.topbar,
.controls,
.search,
.quick-links,
.actions,
.contact-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar,
.contact-head {
  justify-content: space-between;
}

.controls {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search {
  flex: 1;
  min-width: 280px;
}

.search input {
  flex: 1;
}

.quick-links {
  flex-wrap: wrap;
}

h1, h2 { margin-top: 0; }

label {
  display: block;
  font-weight: bold;
  margin: 12px 0 6px;
}

input,
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font: inherit;
}

button,
.button {
  display: inline-block;
  border: 0;
  background: #1f4f78;
  color: white;
  padding: 10px 14px;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

button:hover,
.button:hover { opacity: .9; }

.secondary { background: #64748b; }

.danger { background: #b42318; }

.small {
  padding: 7px 10px;
  font-size: .9rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.contact-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.contact-card h2 {
  margin-bottom: 3px;
}

.contact-card p {
  margin: 7px 0;
  overflow-wrap: anywhere;
}

.star {
  background: transparent;
  color: #d97706;
  font-size: 1.7rem;
  padding: 2px 6px;
}

.details {
  min-height: 135px;
}

.notes {
  background: #f8fafc;
  padding: 9px;
  border-radius: 6px;
}

.muted {
  color: #64748b;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.full {
  grid-column: 1 / -1;
}

.checkbox-row input {
  width: auto;
  margin-right: 8px;
}

.alert {
  padding: 12px;
  border-radius: 7px;
  margin-bottom: 16px;
}

.alert.success {
  background: #dcfce7;
}

.alert.danger {
  background: #fee2e2;
  color: #7f1d1d;
}

.empty {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .grid-form {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .nav {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .nav a {
    margin-left: 0;
    margin-right: 12px;
  }

  .controls,
  .search,
  .quick-links {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
  }
}
