/* ============================================================
   COMPONENTS — buttons, inputs, badges, tables, cards
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, transform 100ms, box-shadow 140ms;
}
.btn:hover { background: var(--panel-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 22px var(--accent-glow); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }

.btn-danger {
  background: rgba(251, 113, 133, 0.15);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fda4af;
}
.btn-danger:hover { background: rgba(251, 113, 133, 0.22); }

.btn-large { padding: 14px 28px; font-size: 14px; }

.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }

/* Inputs */
textarea, input[type=text], input[type=datetime-local], select {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
textarea {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  min-height: 240px; resize: vertical;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.2);
}

.hint { font-size: 11px; color: var(--muted); }

/* Details/summary */
details {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
details summary {
  cursor: pointer;
  font-size: 12px; color: var(--muted);
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 8px; color: var(--text); }
details .details-inner { display: flex; flex-direction: column; gap: 8px; }

/* Tags / chips */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag.good { background: rgba(74, 222, 128, 0.15); color: #bbf7d0; border-color: rgba(74, 222, 128, 0.4); }
.tag.warn { background: rgba(253, 224, 71, 0.15); color: #fef08a; border-color: rgba(253, 224, 71, 0.4); }
.tag.bad  { background: rgba(251, 113, 133, 0.15); color: #fda4af; border-color: rgba(251, 113, 133, 0.4); }

/* Priority badges */
.priority {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: lowercase;
}
.priority.high   { background: rgba(251, 113, 133, 0.2); color: #fda4af; }
.priority.medium { background: rgba(253, 224, 71, 0.2);  color: #fef08a; }
.priority.low    { background: rgba(74, 222, 128, 0.2);  color: #bbf7d0; }

/* Generic stat grid */
.meta-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.meta-grid .stat .label {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.meta-grid .stat .val {
  font-size: 16px; font-weight: 600; margin-top: 2px;
  font-family: var(--mono);
}

/* Empty state */
.empty {
  color: var(--muted); font-size: 12.5px;
  padding: 22px; text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: var(--muted); font-weight: 500; font-size: 11px;
  padding: 7px 8px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; user-select: none;
}
th:hover { color: var(--text); }
th .sort-arrow { display: inline-block; width: 10px; opacity: 0.7; margin-left: 2px; }
td { padding: 9px 8px; border-bottom: 1px solid rgba(42, 47, 61, 0.5); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.quote { color: var(--muted); font-style: italic; font-size: 12px; margin-top: 3px; display: block; }
td.conf { font-family: var(--mono); }

/* Speaker chips */
.speakers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* Copy button */
.copy-btn {
  padding: 5px 11px; font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 140ms;
}
.copy-btn:hover { color: var(--text); background: var(--panel-3); }
.copy-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.copy-btn.copied { color: #bbf7d0; border-color: rgba(74, 222, 128, 0.5); }

/* ============================================================
   MODAL — quota-exceeded message
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(11, 15, 26, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  animation: modalFade 220ms ease;
}
.modal-overlay.hidden { display: none; }
@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: 100%; max-width: 460px;
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 28px 28px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 60px var(--accent-glow);
  text-align: center;
  animation: modalSlideUp 320ms cubic-bezier(0.2, 1.4, 0.3, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-size: 28px;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.modal h3 {
  margin: 0 0 12px;
  font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
}
.modal p {
  margin: 8px 0;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-dim);
}
.modal-email {
  margin: 18px 0;
  padding: 10px 14px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  color: #67e8f9;
  word-break: break-all;
}
.modal-actions {
  display: flex; gap: 10px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.modal-actions .btn { flex: 1; min-width: 140px; }
@media (max-width: 480px) {
  .modal { padding: 22px 18px 18px; }
  .modal h3 { font-size: 17px; }
}
