/* Aplicación móvil — página de administración autónoma (public/app-movil-admin.html). */
.ama-page {
  margin: 0;
  min-height: 100vh;
  background: var(--itc-navy-950);
  color: var(--itc-text-primary);
  font-family: "Montserrat", system-ui, sans-serif;
  padding: 0 16px 48px;
}
.ama-header { max-width: 1180px; margin: 0 auto; padding: 24px 0 12px; }
.ama-header h1 { margin: 6px 0 0; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.ama-kicker { color: var(--itc-gold-500); font-size: 0.75rem; letter-spacing: 0.12em; font-weight: 700; }
.ama-back { color: var(--itc-text-secondary); text-decoration: none; font-size: 0.9rem; display: inline-block; margin-bottom: 12px; }
.ama-back:hover { color: var(--itc-gold-400); }
main, .ama-auth { max-width: 1180px; margin: 0 auto; }

.ama-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.ama-tab {
  background: var(--itc-surface-3); color: var(--itc-text-secondary); border: 1px solid var(--itc-border-blue);
  border-radius: 999px; padding: 10px 16px; cursor: pointer; font: inherit; font-size: 0.9rem;
}
.ama-tab.is-active { color: #000; background: var(--itc-gold-500); border-color: var(--itc-gold-500); font-weight: 700; }
.ama-tab:focus-visible, .ama-btn:focus-visible { outline: var(--itc-focus-ring); outline-offset: 2px; }

.ama-card {
  background: var(--itc-surface-2); border: 1px solid var(--itc-border-blue); border-radius: var(--itc-radius);
  padding: 20px; margin-bottom: 16px;
}
.ama-card h2 { font-size: 1.05rem; color: var(--itc-gold-500); margin: 0 0 12px; }
.ama-card h2:not(:first-child) { margin-top: 24px; }
.ama-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--itc-text-secondary); margin-bottom: 12px; }
.ama-card small, .ama-hint { color: var(--itc-text-secondary); font-size: 0.8rem; }
.ama-card input, .ama-card select, .ama-card textarea {
  background: var(--itc-navy-900); color: var(--itc-text-primary); border: 1px solid var(--itc-border-blue);
  border-radius: var(--itc-radius-sm); padding: 10px 12px; font: inherit; font-size: 0.95rem;
}
.ama-card textarea { resize: vertical; }
.ama-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.ama-span-2 { grid-column: 1 / -1; }
.ama-switch { flex-direction: row !important; align-items: center; gap: 10px !important; color: var(--itc-text-primary) !important; }
.ama-switch input { width: 20px; height: 20px; accent-color: var(--itc-gold-500); }
/* ¿Quién verá esta publicación? — «Para todos» o «Solo esta promoción». */
.ama-audience { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ama-audience legend { font-weight: 700; color: var(--itc-text-primary); margin-bottom: 10px; padding: 0; }
.ama-audience-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.ama-card .ama-audience-option {
  flex-direction: row; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--itc-border-blue); border-radius: var(--itc-radius-sm); background: var(--itc-navy-900);
}
.ama-card .ama-audience-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ama-audience-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--itc-surface-3); color: var(--itc-text-secondary);
}
.ama-audience-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ama-audience-text strong { color: var(--itc-text-primary); font-size: 0.92rem; }
.ama-audience-option:has(input:checked) { border-color: var(--itc-gold-500); background: rgba(218, 182, 62, 0.1); }
.ama-audience-option:has(input:checked) .ama-audience-icon { background: var(--itc-gold-500); color: #000; }
.ama-audience-option:has(input:focus-visible) { outline: var(--itc-focus-ring); outline-offset: 2px; }
.ama-audience .ama-hint { margin: 8px 0 0; }
.ama-flag.is-audience-all { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.ama-flag.is-audience-promotion { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }

.ama-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ama-inline-form input[type="text"] { flex: 1 1 200px; }

.ama-btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: var(--itc-radius-sm); padding: 10px 16px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--itc-border-gold);
  background: transparent; color: var(--itc-gold-400); text-decoration: none;
}
.ama-btn-gold { background: var(--itc-gold-500); color: #000; border-color: var(--itc-gold-500); }
.ama-btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.ama-btn-danger { color: var(--itc-danger); border-color: var(--itc-danger); }

.ama-offerings { display: grid; gap: 8px; margin-bottom: 16px; }
.ama-offering { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 10px 12px; border: 1px solid var(--itc-border-blue); border-radius: var(--itc-radius-sm); margin: 0 !important; color: var(--itc-text-primary) !important; }
.ama-offering input { width: 18px; height: 18px; accent-color: var(--itc-gold-500); }
.ama-offering .ama-fee { margin-left: auto; color: var(--itc-gold-400); font-weight: 600; white-space: nowrap; }

.ama-feedback { max-width: 1180px; margin: 0 auto 12px; padding: 12px 16px; border-radius: var(--itc-radius-sm); background: var(--itc-surface-3); border-left: 4px solid var(--itc-success); }
.ama-feedback.is-error { border-left-color: var(--itc-danger); }

.ama-table-wrap { overflow-x: auto; }
.ama-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.ama-table th, .ama-table td { border-bottom: 1px solid var(--itc-border-blue); padding: 8px; text-align: left; vertical-align: top; white-space: nowrap; }
.ama-table th { color: var(--itc-text-secondary); font-weight: 600; }
.ama-table select { padding: 4px 6px; font-size: 0.8rem; }
.ama-meeting-head { display: flex; flex-direction: column; gap: 4px; }
.ama-meeting-actions { display: flex; gap: 6px; margin-top: 6px; }
.ama-meeting-cancelled { opacity: 0.45; text-decoration: line-through; }
.ama-pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; }
.ama-pill-ok { background: rgba(0, 200, 81, 0.18); color: var(--itc-success); }
.ama-pill-bad { background: rgba(255, 68, 68, 0.18); color: var(--itc-danger); }

.ama-posts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ama-post { border: 1px solid var(--itc-border-blue); border-radius: var(--itc-radius-sm); padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.ama-post-body { flex: 1; }
.ama-post-body h3 { margin: 0 0 4px; font-size: 0.95rem; }
.ama-post-body p { margin: 4px 0 0; color: var(--itc-text-secondary); font-size: 0.85rem; white-space: pre-wrap; }
.ama-post-kind { color: var(--itc-gold-400); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }

.ama-uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ama-dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 2px dashed var(--itc-border-gold); border-radius: var(--itc-radius-sm); padding: 18px 12px; color: var(--itc-gold-400);
  background: rgba(218, 182, 62, 0.06); transition: background 0.15s;
}
.ama-dropzone.is-over { background: rgba(218, 182, 62, 0.16); }
.ama-dropzone > i { font-size: 1.4rem; }
.ama-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ama-pending { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; position: relative; z-index: 1; }
.ama-pending li { font-size: 0.75rem; color: var(--itc-text-primary); background: var(--itc-surface-3); border-radius: 999px; padding: 3px 10px; }

.ama-post-media { margin-top: 10px; display: grid; gap: 10px; }
.ama-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ama-thumb { margin: 0; position: relative; width: 110px; height: 82px; border-radius: 8px; overflow: hidden; border: 1px solid var(--itc-border-blue); background: var(--itc-navy-900); }
.ama-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ama-thumb-cover { position: absolute; left: 0; right: 0; bottom: 0; background: var(--itc-gold-500); color: #000; font-size: 0.65rem; font-weight: 800; text-align: center; padding: 1px 0; }
.ama-thumb-tools { position: absolute; top: 4px; left: 4px; right: 4px; display: flex; justify-content: space-between; }
.ama-thumb-tools button {
  width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; font-size: 0.7rem;
  background: rgba(12, 24, 63, 0.85); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.ama-thumb-tools .ama-thumb-del { background: #fff; color: var(--itc-danger); }
.ama-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ama-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--itc-border-blue); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; }
.ama-file a { color: var(--itc-text-primary); text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ama-file a:hover { color: var(--itc-gold-400); }
.ama-file-badge { flex: none; width: 34px; height: 38px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; background: #E5484D; color: #fff; }
.ama-file-badge.is-image { background: #2563EB; }
.ama-post-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ama-post-actions label.ama-btn { margin: 0; flex-direction: row; color: var(--itc-gold-400); }
.ama-post-actions input[type="file"] { display: none; }
.ama-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ama-flag { font-size: 0.7rem; border-radius: 999px; padding: 2px 8px; background: var(--itc-surface-3); color: var(--itc-text-secondary); }
.ama-flag.is-on { background: rgba(218, 182, 62, 0.18); color: var(--itc-gold-400); }
.ama-student { display: flex; align-items: center; gap: 10px; }
.ama-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--itc-gold-500); flex: none; background: var(--itc-surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--itc-text-primary); }
.ama-link-btn { background: none; border: 0; color: var(--itc-danger); font: inherit; font-size: 0.72rem; cursor: pointer; padding: 0; text-decoration: underline; }
.ama-busy { opacity: 0.6; pointer-events: none; }
.ama-card [hidden] { display: none !important; }

.ama-modal { position: fixed; inset: 0; background: rgba(4, 9, 26, 0.92); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.ama-modal[hidden] { display: none; }
.ama-modal-box { background: #fff; color: #0C183F; border-radius: var(--itc-radius); padding: 24px; text-align: center; max-width: 520px; width: 100%; }
.ama-modal-box h2 { margin: 0 0 12px; }
.ama-modal-box img { width: 100%; max-width: 420px; height: auto; }
.ama-countdown { font-size: 1.1rem; font-weight: 700; }
.ama-modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ama-modal-actions .ama-btn:not(.ama-btn-gold) { color: #0C183F; border-color: #0C183F; }
.ama-modal-box { max-height: calc(100vh - 32px); overflow-y: auto; }
.ama-att-count { margin: 0 0 12px; color: #0C183F; font-weight: 600; }
.ama-att-option { border: 1px solid #d8deea; border-radius: 12px; padding: 14px; margin: 0 0 12px; text-align: left; }
.ama-att-option h3 { margin: 0 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ama-att-option .ama-btn:not(.ama-btn-gold) { color: #0C183F; border-color: #0C183F; }
.ama-att-option img { display: block; margin: 8px auto; }
.ama-att-option img[hidden], .ama-ble-pairing[hidden] { display: none; }
.ama-tag { background: #e7f6ec; color: #116a33; border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; }
.ama-ble-status { margin: 0 0 10px; color: #475569; }
.ama-ble-status.ama-ble-ok { color: #116a33; font-weight: 600; }
.ama-ble-pairing img { max-width: 240px; }
.ama-ble-steps { margin: 0 0 8px; padding-left: 20px; color: #0C183F; }
.ama-ble-warning { margin: 0 0 10px; color: #b45309; font-size: 0.9rem; font-weight: 600; }

@media (max-width: 600px) {
  .ama-card { padding: 16px; }
  .ama-inline-form > * { flex: 1 1 100%; }
  .ama-post { flex-direction: column; }
  .ama-post-actions { flex-direction: row; flex-wrap: wrap; }
}
