* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f7;
  color: #111827;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 22px;
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.muted,
.small-muted {
  color: #6b7280;
}

.small-muted {
  font-size: 13px;
  line-height: 1.4;
}

form {
  margin-top: 24px;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #ffffff;
}

textarea {
  resize: none;
  min-height: 52px;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111827;
}

button {
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  margin-top: 16px;
  background: #111827;
  color: white;
  padding: 12px 16px;
}

.primary-btn:hover {
  background: #000000;
}

.secondary-btn {
  width: 100%;
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 12px 16px;
}

.secondary-btn:hover {
  background: #f3f4f6;
}

.small-btn {
  background: #111827;
  color: white;
  padding: 11px 14px;
  white-space: nowrap;
}

.error-box,
.mini-error {
  display: none;
  margin-top: 12px;
  background: #fee2e2;
  color: #991b1b;
  padding: 11px;
  border-radius: 12px;
  font-size: 13px;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
  overflow: hidden;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.sidebar-top {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.new-chat-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

.search-input {
  margin: 10px 0 12px;
}

.contact-list {
  overflow-y: auto;
  padding-right: 4px;
}

.contact-card {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 13px;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.contact-card:hover,
.contact-card.active {
  background: #f3f4f6;
}

.contact-name {
  font-weight: 800;
  margin-bottom: 4px;
}

.contact-phone,
.contact-owner,
.contact-last {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
}

.contact-last {
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  min-width: 0;
  height: 100vh;
  background: #f5f5f7;
}

.empty-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

.chat-view {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.name-editor {
  display: flex;
  gap: 10px;
  min-width: 360px;
}

.messages-list {
  overflow-y: auto;
  padding: 24px;
}

.no-messages {
  text-align: center;
  color: #6b7280;
  margin-top: 80px;
}

.message-row {
  display: flex;
  margin-bottom: 12px;
}

.message-row.outbound {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 14px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.message-row.outbound .message-bubble {
  background: #111827;
  color: #ffffff;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

.composer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
}

.composer button:disabled,
.composer textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: 45vh;
  }

  .chat-panel {
    height: 55vh;
  }

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

  .name-editor {
    min-width: 0;
  }
}

.chat-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 420px;
}

.owner-editor {
  display: flex;
  gap: 10px;
}

.owner-editor select {
  min-width: 220px;
}

@media (max-width: 900px) {
  .chat-actions {
    min-width: 0;
  }

  .owner-editor {
    flex-direction: column;
  }
}

.booking-details {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 22px;
}

.booking-details-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.booking-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  color: #4b5563;
  font-size: 14px;
}

@media (max-width: 900px) {
  .booking-details-grid {
    grid-template-columns: 1fr;
  }
}

.danger-btn {
  width: 100%;
  background: #991b1b;
  color: #ffffff;
  padding: 11px 14px;
  border-radius: 12px;
}

.danger-btn:hover {
  background: #7f1d1d;
}
