/* ── Upload Queue Panel ─────────────────────────────────────────── */
.uq-panel {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: var(--navy, #14213D);
  border: 1.5px solid var(--gold, #D4AF37);
  border-radius: 0.875rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--text-primary, #e8e0d0);
}
.uq-hidden { display: none !important; }
.uq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: rgba(212,175,55,0.10);
  border-bottom: 1px solid rgba(212,175,55,0.25);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.uq-title { color: var(--gold, #D4AF37); }
.uq-clear-btn {
  background: none;
  border: 1px solid rgba(239,68,68,0.5);
  color: #ef4444;
  border-radius: 0.375rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s;
}
.uq-clear-btn:hover { background: rgba(239,68,68,0.12); }
.uq-list { padding: 0.5rem 0; max-height: 260px; overflow-y: auto; }
.uq-item {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.uq-item:last-child { border-bottom: none; }
.uq-item-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.uq-item-icon { flex-shrink: 0; font-size: 0.9rem; }
.uq-item-uploading .uq-item-icon { color: var(--gold, #D4AF37); }
.uq-item-error .uq-item-icon { color: #ef4444; }
.uq-item-done .uq-item-icon { color: #22c55e; }
.uq-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-primary, #e8e0d0);
}
.uq-item-pct { flex-shrink: 0; font-size: 0.75rem; color: var(--text-muted, #8a7e6e); min-width: 2.5rem; text-align: right; }
.uq-cancel-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted, #8a7e6e);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
}
.uq-cancel-btn:hover { color: #ef4444; }
.uq-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.uq-bar-fill {
  height: 100%;
  background: var(--gold, #D4AF37);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.uq-error-msg {
  font-size: 0.72rem;
  color: #ef4444;
  margin-top: 0.2rem;
}
@keyframes uq-spin { to { transform: rotate(360deg); } }
.uq-spin { display: inline-block; animation: uq-spin 1s linear infinite; }

/* Admin Panel */
.admin-panel { min-height: 100vh; background: var(--navy-dark); }

/* Desktop: layout com sidebar lateral */
@media (min-width: 900px) {
  .admin-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 220px 1fr;
    grid-template-areas:
      "header header"
      "sidebar content";
    height: 100vh;
    overflow: hidden;
  }
  .admin-header   { grid-area: header; }
  .admin-tabs-bar { grid-area: sidebar; overflow-y: auto; overflow-x: hidden; }
  .admin-content  { grid-area: content; overflow-y: auto; }
}

.admin-header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-header-logo {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.admin-header-logo .icon-svg { width: 18px; height: 18px; }
.admin-header-badge {
  background: var(--gold);
  color: var(--navy);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.admin-header-name {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
@media (max-width: 420px) {
  .admin-header-name { display: none; }
}

/* Back to app button */
.back-to-app {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  background: none;
  border: none;
  transition: var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
}
.back-to-app:hover { color: var(--gold); }
.back-to-app .icon-svg { width: 16px; height: 16px; }

/* Tabs bar — mobile: horizontal scroll | desktop: sidebar vertical */
.admin-tabs-bar {
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0.5rem;
}
.admin-tabs-bar::-webkit-scrollbar { display: none; }

@media (min-width: 900px) {
  .admin-tabs-bar {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 0.75rem 0;
  }
}

.admin-tab {
  padding: 0.75rem 0.875rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-tab .tab-icon { display: flex; align-items: center; }
.admin-tab .tab-icon .icon-svg { width: 14px; height: 14px; }

@media (min-width: 900px) {
  .admin-tab {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-bottom: none;
    border-left: 3px solid transparent;
    border-radius: 0;
    justify-content: flex-start;
    white-space: normal;
  }
  .admin-tab.active {
    border-bottom-color: transparent;
    border-left-color: var(--gold);
    background: rgba(212,175,55,0.07);
  }
  .admin-tab .tab-icon .icon-svg { width: 16px; height: 16px; }
  .admin-tab .tab-label { display: inline; }
}

@media (max-width: 480px) {
  .admin-tab { padding: 0.625rem 0.625rem; font-size: 0.7rem; gap: 0.25rem; }
  .admin-tab .tab-label { display: none; }
  .admin-tab .tab-icon .icon-svg { width: 18px; height: 18px; }
  .admin-tab { padding: 0.75rem 0.75rem; }
}

/* Page title */
.admin-page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}
.admin-page-title .icon-svg { width: 20px; height: 20px; color: var(--gold); }

/* Content area */
.admin-content { padding: 1.25rem; max-width: 1200px; margin: 0 auto; min-width: 0; }
@media (min-width: 900px) { .admin-content { padding: 1.5rem 2rem; margin: 0; } }
@media (max-width: 480px) { .admin-content { padding: 1rem 0.875rem; } }

/* Admin stat cards */
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.875rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }

.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
}
.admin-stat-icon {
  width: 44px;
  height: 44px;
  background: var(--gold-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.625rem;
  color: var(--gold);
}
.admin-stat-icon .icon-svg { width: 22px; height: 22px; }
.admin-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.admin-stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Responsive 2-col grid */
.admin-2col { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .admin-2col { grid-template-columns: 1fr 1fr; } }

/* Admin table */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); margin-bottom: 1.5rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table thead tr { background: var(--surface-2); }
.admin-table th { padding: 0.875rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); white-space: nowrap; }
.admin-table td { padding: 0.75rem 1rem; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.admin-table tbody tr { background: var(--surface); transition: var(--transition); }
.admin-table tbody tr:hover { background: var(--surface-2); }

/* Admin forms */
.admin-form-card { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-form-title { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.admin-form-title .icon { color: var(--gold); display: flex; align-items: center; }
.admin-form-title .icon .icon-svg { width: 18px; height: 18px; }

/* Form grid used in modals (exercises, materials, etc.) */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}
@media (max-width: 520px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-form-grid [style*="grid-column:1/-1"],
  .admin-form-grid [style*="grid-column: 1 / -1"] { grid-column: 1 !important; }
}
.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.admin-form-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.admin-form-field input,
.admin-form-field select,
.admin-form-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
  resize: vertical;
}
.admin-form-field input:focus,
.admin-form-field select:focus,
.admin-form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.admin-form-field select {
  cursor: pointer;
  appearance: auto;
}

/* Drag-and-drop items */
.draggable-list { display: flex; flex-direction: column; gap: 0.5rem; }
.draggable-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  cursor: default;
}
.draggable-item.dragging { opacity: 0.4; border: 2px dashed var(--gold); }
.draggable-item.drag-over { border-top: 3px solid var(--gold); }
.draggable-info { flex: 1; min-width: 0; }
.draggable-name { font-weight: 600; font-size: 0.875rem; }
.draggable-meta { font-size: 0.75rem; color: var(--text-muted); }
.draggable-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }

/* Action buttons */
.action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.action-btn .icon-svg { width: 14px; height: 14px; }
.action-btn:hover { border-color: var(--border); color: var(--text-primary); }
.action-btn.edit:hover { border-color: var(--gold); color: var(--gold); }
.action-btn.delete:hover { border-color: var(--danger); color: var(--danger); }

/* User status */
.user-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }
.dot-active { background: var(--success); }
.dot-blocked { background: var(--danger); }

/* Status text badges */
.status-text { font-size: 0.75rem; font-weight: 600; }
.status-ok { color: var(--success); }
.status-no { color: var(--text-muted); }

/* Chart mini */
.mini-chart { display: flex; gap: 4px; align-items: flex-end; height: 60px; padding: 4px 0; }
.mini-bar { flex: 1; background: var(--gold-muted); border-radius: 2px; min-height: 2px; border: 1px solid var(--border); }

/* Admin section header */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}
.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-section-title .icon-svg { width: 18px; height: 18px; color: var(--gold); }

/* Filter bar */
.filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-bar input, .filter-bar select { padding: 0.5rem 0.875rem; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.875rem; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--gold); }

/* ── Upload Area ── */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.05);
}
.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-upload-icon {
  width: 40px;
  height: 40px;
  background: rgba(212,175,55,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.file-upload-icon .icon-svg { width: 20px; height: 20px; }
.file-upload-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.file-upload-text strong { color: var(--gold); }
.file-upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.file-upload-area.has-file {
  border-color: var(--gold);
  background: rgba(212,175,55,0.07);
}
.file-upload-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  max-width: 100%;
  word-break: break-all;
  text-align: left;
}
.file-upload-selected-icon { color: var(--gold); flex-shrink: 0; }
.file-upload-selected-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-selected-size { color: var(--text-muted); flex-shrink: 0; font-size: 0.72rem; }
