/* Blasts (announcements) app-specific styles. Shared chrome (masthead,
   buttons, auth screen, tokens, .tabs) lives in theme.css. */

:root {
  --container-max: 900px;
}

#app-screen {
  text-align: left;
  padding: 30px;
}

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

.error-message,
.success-message {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.success-message {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.hint {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* Tabs (strip scrolling lives in theme.css) */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: #666;
  cursor: pointer;
}

.tab-btn.active {
  color: #02133e;
  border-bottom-color: #02133e;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #02133e;
}

.filter-field select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
}

.filter-check label {
  font-weight: 400;
  font-size: 0.95rem;
}

/* Announcement cards */
.blast-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.blast-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.blast-title {
  color: #02133e;
  font-size: 1.15rem;
  margin: 0;
}

.new-badge {
  background: #c0392b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.blast-body {
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.blast-body p,
.editor p {
  margin: 0 0 8px;
}

.blast-body ul,
.blast-body ol,
.editor ul,
.editor ol {
  margin: 0 0 8px 22px;
}

.blast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #666;
}

.status-pill {
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e9ecef;
  color: #444;
}

.blast-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  color: #666;
  text-align: center;
  padding: 30px 0;
}

/* Add / edit form */
.blast-form {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.blast-form h2 {
  color: #02133e;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #02133e;
}

.form-row input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
}

/* Rich-text editor */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: #f1f3f5;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.editor-toolbar .tb,
.editor-toolbar select {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.editor-toolbar .tb:hover {
  background: #e9ecef;
}

.editor {
  min-height: 180px;
  max-height: 480px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 0 0 6px 6px;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.editor:focus {
  outline: 2px solid #02133e;
  outline-offset: -1px;
}

/* Weekly email tab */
.email-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.order-list {
  margin-bottom: 24px;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 6px;
}

.order-row.dragging {
  opacity: 0.4;
}

.drag-handle {
  cursor: grab;
  color: #8a94a3;
  padding: 0 4px;
}

.new-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #c0392b;
  white-space: nowrap;
  margin: 0 6px;
}

.order-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #02133e;
}

.order-dates {
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
}

.preview-heading {
  color: #02133e;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.email-preview {
  background: #fff;
  border: 1px dashed #aab;
  border-radius: 8px;
  padding: 20px;
}

@media (max-width: 600px) {
  #app-screen {
    padding: 16px;
  }

  .order-dates {
    display: none;
  }
}

/* Posting guidelines */
.guidelines {
  background: #fff8e1;
  border: 1px solid #f0d98a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.guidelines ul {
  margin: 6px 0 6px 20px;
}

.guidelines-foot {
  color: #666;
}

.pin-badge {
  background: #02133e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.pin-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #02133e;
  white-space: nowrap;
  margin: 0 6px;
}

.edition-row input[type="date"] {
  max-width: 200px;
}
