* {
  box-sizing: border-box;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  background: #f4f5f7;
  color: #1f2933;
}

.topbar {
  background: #1f2933;
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.nav-btn.active {
  background: #4f6ef7;
  border-color: #4f6ef7;
}

#app {
  padding: 20px 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

h2 {
  margin-top: 0;
}

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

button {
  background: #4f6ef7;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

button.danger {
  background: #e25563;
}

button:hover {
  opacity: 0.9;
}

/* Today tasks */
.today-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-btn {
  background: #e6e9ef;
  color: #333;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.filter-btn.active {
  background: #4f6ef7;
  color: white;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: white;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-card.overdue {
  border-left: 4px solid #e25563;
}

.task-card .badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e6e9ef;
}

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.kanban-column {
  background: #ebecf0;
  border-radius: 8px;
  padding: 8px;
  min-height: 200px;
}

.kanban-column h3 {
  font-size: 14px;
  margin: 4px 8px 8px;
}

.kanban-card {
  background: white;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-size: 13px;
}

.kanban-card .contact-name {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.kanban-card .amount {
  color: #4f6ef7;
  font-weight: 600;
}

.kanban-card .unpaid {
  color: #e25563;
  font-weight: 600;
}

/* Contacts table */
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.contacts-table th, .contacts-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #ebecf0;
  font-size: 14px;
}

.contacts-table tbody tr {
  cursor: pointer;
}

.contacts-table tbody tr:hover {
  background: #f4f5f7;
}

#contact-search {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-right: 8px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 10px;
  padding: 24px;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  color: #999;
  font-size: 20px;
  padding: 0;
  line-height: 1;
}

#contact-form, #order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#contact-form label, #order-form label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 4px;
}

#contact-form input, #contact-form select, #contact-form textarea,
#order-form input, #order-form select, #order-form textarea {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.interaction-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 160px;
  overflow-y: auto;
}

.interaction-item {
  background: #f4f5f7;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

.interaction-item .meta {
  color: #999;
  font-size: 11px;
  margin-bottom: 2px;
}

.interaction-form {
  display: flex;
  gap: 6px;
}

.interaction-form input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.interaction-form select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
