/* inboxur admin styles */

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: #f5f5f4;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

main {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Explainer steps */
.explainer {
  margin: 1.5rem 0;
}

.explainer-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: #404040;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #171717;
  border-radius: 50%;
  flex-shrink: 0;
}

.login-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  color: #0a0a0a;
}

/* Card list */
.card-list {
  list-style: none;
}

.card-item {
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-item:hover {
  border-color: #a3a3a3;
}

.card-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.card-meta {
  font-size: 0.75rem;
  color: #a3a3a3;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.card-slug {
  font-family: monospace;
  font-size: 0.7rem;
  color: #a3a3a3;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4d4d4;
}

.status-dot.has-reply {
  background: #22c55e;
}

.status-dot.has-maker {
  background: #a3a3a3;
}

/* Edit view */
.edit-view {
  display: none;
}

.edit-view.active {
  display: block;
}

.list-view.hidden {
  display: none;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #525252;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #a3a3a3;
  box-shadow: 0 0 0 3px rgba(163, 163, 163, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.visitor-reply-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.visitor-info {
  font-size: 0.75rem;
  color: #a3a3a3;
  margin-top: 0.35rem;
}

/* Loading */
.loading {
  text-align: center;
  color: #a3a3a3;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.empty-msg {
  text-align: center;
  color: #737373;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Error */
.error-msg {
  text-align: center;
  color: #b91c1c;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.tab {
  flex: 1;
  padding: 0.55rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  color: #737373;
  transition: background 0.15s, border-color 0.15s;
}

.tab.active {
  background: #171717;
  color: #fafafa;
  border-color: #171717;
}

/* Unread card */
.card-item.unread {
  border-color: #171717;
  border-width: 2px;
}

.card-item.unread .card-label {
  font-weight: 700;
}

.card-time {
  font-size: 0.7rem;
  color: #a3a3a3;
}

.read-only-field {
  padding: 0.6rem 0.85rem;
  background: #fafafa;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #525252;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  word-break: break-all;
}

.copy-btn {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: #f5f5f4;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  color: #525252;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: #e5e5e5;
}


/* Primary button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.7rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fafafa;
  background: #171717;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-primary:disabled {
  background: #a3a3a3;
  cursor: not-allowed;
}

/* Assign card */
.assign-intro {
  color: #737373;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Optional label */
.optional {
  font-weight: 400;
  color: #a3a3a3;
}

/* Card note in list */
.card-note {
  font-size: 0.7rem;
  color: #a3a3a3;
  font-style: italic;
}

/* QR code */
.qr-toggle {
  font-size: 0.8rem;
  color: #737373;
  text-decoration: none;
  border-bottom: 1px solid #d4d4d4;
  transition: border-color 0.15s;
}

.qr-toggle:hover {
  border-color: #737373;
}

.qr-display {
  margin-top: 0.75rem;
  text-align: center;
}

.qr-display img {
  border-radius: 8px;
}

/* Admin header with logout */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  margin-bottom: 0;
}

/* Status filter */
.status-filter {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: #737373;
  background: none;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  color: #1a1a1a;
  border-color: #a3a3a3;
}

.filter-btn.active {
  color: #1a1a1a;
  background: #171717;
  color: #fff;
  border-color: #171717;
}

/* Number input */
.field input[type="number"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: #a3a3a3;
  box-shadow: 0 0 0 3px rgba(163, 163, 163, 0.15);
}

/* Email input (login) */
.field input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input[type="email"]:focus {
  outline: none;
  border-color: #a3a3a3;
  box-shadow: 0 0 0 3px rgba(163, 163, 163, 0.15);
}

/* Progress bar */
.gen-progress {
  margin-top: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #171717;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.gen-progress-text {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: #737373;
  margin-top: 0.5rem;
}

/* Secondary button (archive, etc.) */
.btn-secondary {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #737373;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #a3a3a3;
}

/* Delete button */
.btn-danger {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #b91c1c;
  background: #fff;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* List toolbar */
.list-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.list-toolbar .btn-danger {
  width: auto;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Card checkbox in select mode */
.card-checkbox {
  margin-right: 0.5rem;
  vertical-align: middle;
  cursor: pointer;
}

/* Message bubbles (shared with visitor card page) */
.message-bubble {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  position: relative;
}

.host-bubble {
  background: #f0f0ef;
  border: 1px solid #e5e5e5;
}

.visitor-bubble {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.bubble-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a3a3a3;
  margin-bottom: 0.4rem;
}

.bubble-time {
  font-weight: 400;
  font-size: 0.65rem;
  color: #a3a3a3;
}

.bubble-text {
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.visitor-info {
  font-size: 0.7rem;
  color: #a3a3a3;
  margin-top: 0.5rem;
}

.edit-messages {
  margin-bottom: 1.5rem;
}

.edit-details {
  border-top: 1px solid #e5e5e5;
  padding-top: 1rem;
}

/* Selected card in list */
.card-item.selected {
  background: #eff6ff;
  border-color: #93c5fd;
}

/* Back nav link */
.back-nav {
  display: inline-block;
  font-size: 0.85rem;
  color: #737373;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.back-nav:hover {
  color: #1a1a1a;
}

/* Host card title (contenteditable) */
.host-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
  outline: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.host-card-title:focus {
  border-bottom-color: #a3a3a3;
}

/* Host card note (contenteditable on click) */
.host-card-note {
  font-size: 0.85rem;
  color: #737373;
  margin-bottom: 1.25rem;
  outline: none;
  cursor: pointer;
  min-height: 1.3em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.host-card-note.empty {
  color: #a3a3a3;
  font-style: italic;
}

.host-card-note:focus {
  cursor: text;
  border-bottom-color: #d4d4d4;
  font-style: normal;
  color: #737373;
}

/* Host bubble click to edit */
.host-bubble {
  cursor: pointer;
}

.host-bubble:hover {
  background: #eaeae9;
}

.edit-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: #737373;
  margin-top: 0.5rem;
  display: inline-block;
}

.edit-link:hover {
  color: #404040;
}

/* Host inline message form */
.host-inline-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.host-inline-form textarea:focus {
  outline: none;
  border-color: #a3a3a3;
  box-shadow: 0 0 0 3px rgba(163, 163, 163, 0.15);
}