/* =====================================================
   Portal BKon — Fase 2
   Arquivos reais · Agenda real · Admin Reuniões
   ===================================================== */

/* ══════════════════════════════════════════════════════
   ARQUIVOS — Tela global e aba de projeto
══════════════════════════════════════════════════════ */

.files-proj-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.files-category {
  margin-bottom: 24px;
}

.files-category__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.files-category__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.files-category__count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 6px;
  line-height: 18px;
}

/* File items */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
  transition: border-color var(--duration-fast) var(--easing),
              background var(--duration-fast) var(--easing);
}

.file-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.file-item__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-item__icon--pdf {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
}

.file-item__icon--img {
  background: color-mix(in srgb, var(--accent-text) 10%, transparent);
  color: var(--accent-text);
  border: 1px solid color-mix(in srgb, var(--accent-text) 20%, transparent);
}

.file-item__icon--generic {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

.file-item__info {
  flex: 1;
  min-width: 0;
}

.file-item__name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-item__meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Botão excluir — variante danger ghost */
.btn--danger-ghost {
  color: var(--danger) !important;
}

.btn--danger-ghost:hover {
  background: var(--danger-soft) !important;
  border-color: color-mix(in srgb, var(--danger) 30%, transparent) !important;
}

/* Container de arquivos na tela global */
#files-global-container {
  margin-top: 4px;
}

/* Aba de arquivos */
.files-tab-content {
  padding: 4px 0;
}

/* ── Área de Upload ── */

.upload-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 20px;
  transition: border-color var(--duration-fast) var(--easing);
}

.upload-area:focus-within {
  border-color: var(--border-focus);
}

.upload-area__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-area__icon {
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  flex-shrink: 0;
}

.upload-area__text {
  flex: 1;
  min-width: 0;
}

.upload-area__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.upload-area__hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.upload-area__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-area__cat {
  max-width: 130px;
  font-size: 12px !important;
  padding: 6px 10px !important;
  height: auto !important;
}

.upload-area__btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Barra de progresso */
.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.upload-progress__bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg-raised);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.15s ease-out;
  width: 0%;
}

.upload-progress__label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.upload-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════════════
   AGENDA — reunião real + status badge
══════════════════════════════════════════════════════ */

.booking-meeting-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.booking-meeting-item:last-child {
  border-bottom: none;
}

.booking-meeting-item--past {
  opacity: 0.55;
}

.booking-meeting__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 6px 4px;
}

.booking-meeting__day {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.booking-meeting__month {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.booking-meeting__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.booking-meeting__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-meeting__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.booking-meeting__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.booking-meeting__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}

.booking-meeting__meet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.booking-meeting__meet:hover {
  background: color-mix(in srgb, var(--accent-text) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-text) 40%, transparent);
  text-decoration: none;
}

/* Empty state de reuniões */
.meetings-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ── Cal.com / agendamento ── */

.calcom-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  transition: border-color var(--duration-fast);
}

.calcom-block:hover {
  border-color: var(--border-strong);
}

.calcom-block__icon {
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  flex-shrink: 0;
}

.calcom-block__info {
  flex: 1;
  min-width: 0;
}

.calcom-block__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.calcom-block__desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.calcom-block__btn {
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none !important;
}

.calcom-unavailable {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

/* Skeleton da seção cal.com enquanto carrega */
.calcom-skeleton {
  height: 72px;
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════
   ADMIN — Modal agendar reunião
══════════════════════════════════════════════════════ */

.modal--wide {
  max-width: 520px;
}

/* Campo datetime-local */
input[type="datetime-local"].form-input {
  color-scheme: dark;
}

[data-theme="light"] input[type="datetime-local"].form-input {
  color-scheme: light;
}

/* ══════════════════════════════════════════════════════
   BADGES — status de reunião
══════════════════════════════════════════════════════ */

/* Reusa os badges existentes, sem repetir */

/* ══════════════════════════════════════════════════════
   Tela de reunião — layout revisado
══════════════════════════════════════════════════════ */

.booking-section-upcoming {
  margin-top: 8px;
}

.booking-section-upcoming .booking-section-title {
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════════
   Responsividade — arquivos
══════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════
   RESUMO DE CATEGORIAS — tela de Arquivos
   Barra segmentada horizontal ou mini-cards compactos
   mostrando contagem de arquivos por categoria.
   Discreto, informativo, dual-theme.
══════════════════════════════════════════════════════ */

.file-category-summary {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.file-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: border-color var(--duration-fast) var(--easing),
              background var(--duration-fast) var(--easing);
}

.file-cat-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.file-cat-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.file-cat-pill__dot--general     { background: var(--text-muted); }
.file-cat-pill__dot--deliverable { background: var(--accent); }
.file-cat-pill__dot--reference   { background: var(--info); }
.file-cat-pill__dot--report      { background: var(--accent-2); }
.file-cat-pill__dot--contract    { background: var(--warning); }

.file-cat-pill__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Responsivo: pills ficam menores no mobile */
@media (max-width: 480px) {
  .file-cat-pill {
    font-size: 11px;
    padding: 4px 8px;
    gap: 5px;
  }
}

@media (max-width: 600px) {
  .file-item {
    flex-wrap: wrap;
  }
  .file-item__actions {
    width: 100%;
    justify-content: flex-end;
  }
  .upload-area__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .upload-area__controls {
    width: 100%;
  }
  .calcom-block {
    flex-wrap: wrap;
  }
  .calcom-block__btn {
    width: 100%;
    justify-content: center;
  }
  .booking-meeting-item {
    flex-wrap: wrap;
  }
}
