/* Admin app — mobile-first. Touch targets, big buttons, no dense tables. */

[hidden] { display: none !important; }

/* ============ AUTH SCREEN ============ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 50% 20%, var(--rav-navy-2), var(--rav-navy-deep) 80%);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--rav-white);
  border-top: 6px solid var(--rav-red);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--rav-navy);
  text-transform: uppercase;
  line-height: var(--lh-tight);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
}
.auth-tab {
  padding: 12px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex: 1;
  min-height: 44px;
}
.auth-tab.active {
  color: var(--rav-navy);
  border-bottom-color: var(--rav-red);
}
.auth-error {
  background: #fdecec;
  color: var(--rav-red-dark);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* ============ APP SHELL ============ */
#app { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--rav-white);
  border-bottom: 3px solid var(--rav-red);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--rav-navy);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.me-button {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
}
.me-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rav-navy);
  color: var(--rav-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--color-border-strong);
  overflow: hidden;
}
.me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ TABS + BOTTOM NAV ============ */
.tab-content {
  flex: 1;
  padding: 16px 14px 96px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--rav-white);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px rgba(17,10,58,0.08);
}
.bottom-nav button {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: 6px 4px 8px;
}
.bottom-nav button.active { color: var(--rav-red); }
.bottom-nav button svg { color: currentColor; }

/* ============ COMPOSE FORM ============ */
.compose {
  background: var(--rav-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.media-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 13px;
  color: var(--rav-navy);
  background: var(--gray-50);
  flex: 1;
  min-width: 200px;
}
.media-add:hover { border-color: var(--rav-navy); }
.breaking-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--rav-navy);
  user-select: none;
}
.breaking-chip input { margin: 0; }
.breaking-chip:has(input:checked) {
  background: var(--rav-red);
  color: var(--rav-white);
  border-color: var(--rav-red-dark);
}
.compose-body {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--rav-white);
  color: var(--rav-navy);
  outline: none;
  resize: vertical;
}
.compose-body:focus { border-color: var(--rav-royal-bright); box-shadow: var(--focus-ring-blue); }
.detail-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  overflow: hidden;
}
.detail-block > summary {
  cursor: pointer;
  padding: 12px 14px;
  min-height: 44px;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--rav-navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-block > summary::-webkit-details-marker { display: none; }
.detail-block > summary::after {
  content: '＋';
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 400;
}
.detail-block[open] > summary::after { content: '−'; }
.detail-body {
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--rav-white);
  border-top: 1px solid var(--color-border);
}
.post-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}
.btn-post {
  flex: 1;
  min-height: 52px;
  font-size: 15px;
}

/* ============ ATTACHMENTS ============ */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.attachment-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-50);
  border: 1px solid var(--color-border);
}
.attachment-tile .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rav-navy);
  color: var(--rav-white);
  overflow: hidden;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--ls-wide);
}
.attachment-tile .thumb img,
.attachment-tile .thumb video { width: 100%; height: 100%; object-fit: cover; }
.attachment-tile .remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.attachment-tile.uploading .thumb::after {
  content: 'Uploading…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29,20,90,0.7);
  color: var(--rav-white);
}

/* ============ QUOTE PRESETS ============ */
.mode-tabs {
  display: inline-flex;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  align-self: flex-start;
  flex-wrap: wrap;
}
.mode-tab {
  padding: 10px 14px;
  min-height: 44px;
  background: var(--rav-white);
  border: 0;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid var(--color-border-strong);
}
.mode-tab:last-child { border-right: 0; }
.mode-tab.active { background: var(--rav-navy); color: var(--rav-white); }

/* ============ PANELS ============ */
.panel {
  background: var(--rav-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--rav-navy);
  text-transform: uppercase;
  line-height: var(--lh-snug);
}
.panel-help { margin: 0; font-size: 13px; color: var(--text-muted); }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) {
  .form-row { flex-direction: row; flex-wrap: wrap; }
  .form-row > * { flex: 1 1 180px; min-width: 0; }
}
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.small-note { font-size: 12px; color: var(--text-muted); }
.status-pill {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
.status-pill.ok { background: #e8f7ee; color: var(--success); }
.status-pill.err { background: #fdecec; color: var(--rav-red-dark); }

/* ============ RECENT POSTS LIST ============ */
.my-updates-panel { padding: 14px 12px; }
.updates-list { display: flex; flex-direction: column; gap: 10px; }
.update-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.update-row-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-condensed);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: 700;
}
.update-row-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--rav-navy);
  text-transform: uppercase;
  line-height: var(--lh-snug);
}
.update-row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.reorder-list { display: flex; flex-direction: column; gap: 6px; }
.reorder-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--rav-white);
}
.reorder-row .time {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 13px;
  color: var(--rav-navy);
  min-width: 68px;
}
.reorder-row .time.tbd { color: var(--rav-red); }
.reorder-row .body {
  min-width: 0;
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.3;
}
.reorder-row .body strong { color: var(--rav-navy); display: block; font-size: 14px; font-weight: 600; }
.reorder-row .body span { font-size: 12px; color: var(--text-muted); }
.reorder-arrows { display: flex; flex-direction: column; gap: 2px; }
.reorder-arrows button {
  min-height: 22px;
  min-width: 32px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  background: var(--gray-50);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--rav-navy);
  line-height: 1;
}
.reorder-arrows button:hover { background: var(--rav-white); border-color: var(--rav-navy); }
.reorder-arrows button:disabled { opacity: 0.35; cursor: default; }
.reorder-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ============ ACCOUNT SCREEN ============ */
.account-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
}
.account-header {
  background: var(--rav-white);
  border-bottom: 3px solid var(--rav-red);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
}
.btn-back {
  min-height: 44px;
  background: none;
  border: 0;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--rav-navy);
}
.account-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--rav-navy);
  text-transform: uppercase;
}
.account-body {
  flex: 1;
  padding: 24px 16px 40px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.avatar-preview {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--rav-navy);
  color: var(--rav-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  cursor: pointer;
  overflow: hidden;
  border: 4px solid var(--rav-white);
  box-shadow: var(--shadow-md);
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-edit-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(29,20,90,0.85);
  color: var(--rav-white);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: 6px 4px;
  text-align: center;
}
.account-signout {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* ============ DESKTOP TWEAKS ============ */
@media (min-width: 900px) {
  .tab-content { padding: 24px 20px 96px; }
  .compose { padding: 20px; }
  .compose-body { min-height: 160px; font-size: 18px; }
  .bottom-nav { grid-template-columns: 1fr 1fr; max-width: 320px; left: 50%; right: auto; transform: translateX(-50%); border-radius: 999px 999px 0 0; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); }
  .app-header { padding: 12px 24px; }
  .account-body { padding: 32px 24px 48px; }
}
