body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.navbar {
  background: #0f172a;
  color: white;
}

.navbar .container {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
}

.navbar a {
  color: white;
  text-decoration: none;
}

.navbar a.brand {
  font-weight: 700;
  margin-right: auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card h3,
.card h4,
.card p {
  margin-top: 0;
}

.table-wrap,
.list-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

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

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
  font: inherit;
  background: white;
  color: #1f2937;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  box-sizing: border-box;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

button,
.btn {
  background: #1d4ed8;
  color: white;
}

button:hover,
.btn:hover {
  background: #1e40af;
}

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

.btn.secondary {
  background: #334155;
  color: white;
}

.btn.secondary:hover {
  background: #1f2937;
}

button.secondary {
  background: #334155;
  color: white;
}

button.secondary:hover {
  background: #1f2937;
}

button.danger,
.btn.danger {
  background: #b91c1c;
  color: white;
}

button.danger:hover,
.btn.danger:hover {
  background: #991b1b;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.status-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-done {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-missed {
  background: #fee2e2;
  color: #991b1b;
}

.status-inactive {
  background: #e5e7eb;
  color: #374151;
}

.flash {
  padding: 12px;
  border-radius: 10px;
  margin: 10px 0;
}

.flash.success {
  background: #dcfce7;
  color: #166534;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.actions form {
  margin: 0;
}

.table-wrap a:not(.btn),
.list-card a:not(.btn),
.card a:not(.btn) {
  color: #4c1d95;
  text-decoration: underline;
}

#map {
  height: 70vh;
  border-radius: 14px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .navbar .container {
    flex-wrap: wrap;
  }

  .mobile-hide {
    display: none !important;
  }
}

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

.table-wrap table {
  min-width: 900px;
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .navbar .container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 12px 16px;
  }

  .navbar a.brand {
    width: 100%;
    margin-right: 0;
    margin-bottom: 4px;
  }

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

  .card,
  .list-card,
  .table-wrap {
    padding: 14px;
  }

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

  .actions .btn,
  .actions button {
    width: 100%;
  }

  .table-wrap table {
    min-width: 820px;
  }

  th,
  td {
    white-space: nowrap;
  }
}
@media (max-width: 768px) {
  .table-wrap table {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 8px 6px;
    white-space: normal;
    vertical-align: top;
  }

  .table-wrap .btn,
  .table-wrap button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

}
@media (max-width: 768px) {
  .table-wrap table {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 8px 6px;
    white-space: normal;
    vertical-align: top;
  }

  .table-wrap .btn,
  .table-wrap button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .objects-table th:nth-child(3),
  .objects-table td:nth-child(3),
  .objects-table th:nth-child(5),
  .objects-table td:nth-child(5) {
    display: none;
  }

  .objects-table td .actions .btn + .btn.secondary {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .mobile-hide {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .mobile-hide {
    display: none !important;
  }
}
.mobile-hide {
  display: block;
}
/* Карта: фильтры на мобильной версии горизонтально */
@media (max-width: 768px) {
  .list-card .actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .list-card .actions label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
  }

  .list-card .actions .map-filter-btn {
    flex: 1 1 auto;
  }
}

.mobile-hide {
  display: block;
}

@media (max-width: 768px) {
  .mobile-hide {
    display: none !important;
  }

  .objects-table th:nth-child(3),
  .objects-table td:nth-child(3),
  .objects-table th:nth-child(5),
  .objects-table td:nth-child(5) {
    display: none;
  }

}

/* Карточка объекта — кнопки компактно */
@media (max-width: 768px) {
  .actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .actions .btn {
    width: 100%;
  }

  .actions form {
    width: 100%;
  }

  .actions form .btn {
    width: 100%;
  }
}
