* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #222;
  background: #f4f4f4;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout ── */
.app-container {
  max-width: 680px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #7b1113;
  color: #fff;
}

.app-header h1 {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.app-header a {
  color: #fff;
  font-size: 13px;
  opacity: 0.85;
}

.app-header a:hover {
  opacity: 1;
}

.app-body {
  padding: 24px 20px;
}

/* ── Form fields ── */
.field-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 10px;
}

.field-label {
  width: 60px;
  min-width: 60px;
  padding-top: 7px;
  color: #555;
  font-size: 13px;
  text-align: right;
}

.field-input {
  flex: 1;
}

.field-input input[type="text"],
.field-input input[type="email"],
.field-input input[type="password"],
.field-input textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  color: #222;
}

.field-input input:focus,
.field-input textarea:focus {
  outline: none;
  border-color: #7b1113;
}

.field-input input[readonly] {
  background: #f9f9f9;
  color: #555;
  cursor: default;
}

/* ── Recipient chips ── */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-height: 34px;
  align-items: center;
  background: #fff;
  cursor: text;
}

.chips-container:focus-within {
  border-color: #7b1113;
}

.chip {
  display: inline-flex;
  align-items: center;
  background: #e8f0fe;
  border: 1px solid #c5d5f5;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 13px;
  gap: 5px;
}

.chip-remove {
  cursor: pointer;
  color: #666;
  font-size: 15px;
  line-height: 1;
  border: none;
  background: none;
  padding: 0;
}

.chip-remove:hover {
  color: #c00;
}

.chips-input {
  border: none !important;
  outline: none !important;
  padding: 2px 4px !important;
  min-width: 160px;
  flex: 1;
  font-size: 14px;
}

/* ── Autocomplete dropdown ── */
.autocomplete-wrapper {
  position: relative;
  flex: 1;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f0f4ff;
}

/* ── Newsletter block ── */
.newsletter-block {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.newsletter-info {
  flex: 1;
}

.newsletter-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 3px;
}

.newsletter-date {
  font-size: 12px;
  color: #777;
}

.newsletter-change {
  font-size: 13px;
  white-space: nowrap;
  margin-left: 12px;
}

/* ── Newsletter picker modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 6px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  background: #7b1113;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 8px 0;
  max-height: 360px;
  overflow-y: auto;
}

.newsletter-pick-item {
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.newsletter-pick-item:hover {
  background: #f5f5f5;
}

.newsletter-pick-item:last-child {
  border-bottom: none;
}

.newsletter-pick-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
}

.newsletter-pick-date {
  font-size: 12px;
  color: #777;
}

/* ── Personal note ── */
.note-textarea {
  width: 100%;
  height: 90px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  resize: vertical;
  color: #222;
}

.note-textarea:focus {
  outline: none;
  border-color: #7b1113;
}

/* ── Send button ── */
.send-btn {
  width: 100%;
  padding: 11px;
  background: #7b1113;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
}

.send-btn:hover {
  background: #9a1517;
}

.send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ── Status messages ── */
.status-message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  display: none;
}

.status-message.success {
  background: #e6f4ea;
  color: #1e6e35;
  border: 1px solid #b7dfbf;
  display: block;
}

.status-message.error {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c6c5;
  display: block;
}

/* ── CC toggle ── */
.cc-toggle {
  font-size: 12px;
  color: #0066cc;
  cursor: pointer;
  white-space: nowrap;
  padding-top: 7px;
}

.cc-row {
  display: none;
}

.cc-row.visible {
  display: flex;
}

/* ── Login page ── */
.login-container {
  max-width: 380px;
  margin: 80px auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.login-header {
  background: #7b1113;
  color: #fff;
  padding: 20px;
  text-align: center;
}

.login-header h1 {
  font-size: 18px;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 12px;
  opacity: 0.8;
}

.login-body {
  padding: 24px 20px;
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.login-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.login-field input:focus {
  outline: none;
  border-color: #7b1113;
}

.login-btn {
  width: 100%;
  padding: 10px;
  background: #7b1113;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
}

.login-btn:hover {
  background: #9a1517;
}

.login-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c6c5;
  border-radius: 4px;
  font-size: 13px;
  display: none;
}

/* ── Settings / Admin pages ── */
.page-container {
  max-width: 680px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #7b1113;
  color: #fff;
}

.page-header h1 {
  font-size: 16px;
  font-weight: bold;
}

.page-header a {
  color: #fff;
  font-size: 13px;
  opacity: 0.85;
}

.page-header a:hover {
  opacity: 1;
}

.page-body {
  padding: 24px 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: Arial, sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7b1113;
}

.form-group textarea {
  height: 120px;
  resize: vertical;
}

.save-btn {
  padding: 9px 20px;
  background: #7b1113;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.save-btn:hover {
  background: #9a1517;
}

/* ── Admin table ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
  font-weight: bold;
  color: #444;
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #fafafa;
}

.action-link {
  color: #0066cc;
  cursor: pointer;
  font-size: 12px;
  margin-right: 8px;
}

.action-link.danger {
  color: #c5221f;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
}

.badge-admin {
  background: #e8f0fe;
  color: #1a56db;
}

.badge-inactive {
  background: #f5f5f5;
  color: #999;
}

/* ── Utility ── */
.divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

.text-muted {
  color: #777;
  font-size: 12px;
}

.mt-16 {
  margin-top: 16px;
}
