/* ============================================================================
   RAFF — estilos específicos do DMS (complementam styles.css do portal).
   Reutiliza as variáveis de tema (--primary, --accent, --navy, etc.).
   ============================================================================ */

/* ===== Login ===== */
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.login-brand h1 { margin: 0; font-size: 1.4rem; color: var(--navy); }
.login-brand .subtitle { margin: 0; }
.login-hint { margin-top: 1rem; font-size: 0.78rem; color: var(--text-muted); text-align: center; }

/* ===== Busca na topbar ===== */
.search-form { display: flex; align-items: center; gap: 0.4rem; }
.search-form input[type='search'] {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
  font-family: inherit;
}
.search-form input[type='search']:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ===== Cabeçalho de página com ações ===== */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.25rem 0; }

.section-title {
  font-size: 1rem;
  color: var(--navy);
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--surface-tint);
}

/* ===== Cartões de pasta (home) ===== */
.folder-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
}
.folder-card-icon { font-size: 1.8rem; line-height: 1; }
.folder-card h3 { margin: 0.25rem 0 0; }

/* ===== Chips de subpasta ===== */
.folder-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.folder-chip:hover { border-color: var(--primary); background: #e3f2f5; transform: translateY(-1px); }

/* ===== Nomes de documento em tabelas ===== */
.doc-name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; white-space: normal; }
.doc-name a { color: var(--primary); font-weight: 600; text-decoration: none; }
.doc-name a:hover { text-decoration: underline; }
.fic { font-size: 1.1rem; }
.doc-orig { color: var(--text-muted); font-size: 0.78rem; width: 100%; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.row-current { background: var(--surface-tint); }

/* ===== Detalhe do documento ===== */
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.doc-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
}
.preview-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }
.preview-text { background: #fff; }
.preview-image { width: 100%; height: auto; object-fit: contain; margin: auto; }
.preview-none { margin: auto; text-align: center; }

.doc-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  align-self: start;
}
.doc-meta h3 { color: var(--navy); font-size: 0.95rem; margin-bottom: 0.75rem; }
.doc-meta .info-list dd { margin: 0; word-break: break-word; }

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: var(--surface-tint);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Formulários inline (<details>) ===== */
.inline-form { display: inline-block; }
.inline-form.align-right { }
.inline-form > summary { list-style: none; cursor: pointer; display: inline-block; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > summary { margin-bottom: 0.6rem; }
.inline-form .stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(8, 57, 68, 0.08);
}
.stack label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.stack input[type='text'],
.stack input[type='search'],
.stack input[type='file'],
.stack select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  font-weight: 400;
}
.stack input:focus, .stack select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}
.stack .btn { align-self: flex-start; }

/* ===== Diversos ===== */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}
.hint { color: var(--text-muted); font-size: 0.8rem; }
.stat { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin: 0; }

.alert-info {
  background: #e6f4f8;
  color: var(--accent-dark);
  border: 1px solid #bfe0ea;
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b52a37; }

/* Botões dentro de formulários inline lado a lado */
form { margin: 0; }

/* ===== Responsivo ===== */
@media (max-width: 760px) {
  .doc-grid { grid-template-columns: 1fr; }
  .search-form input[type='search'] { min-width: 130px; }
  .preview-frame { height: 55vh; }
}
