@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f0f5ff;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --ok: #16a34a;
  --ok-light: #dcfce7;
  --warn: #d97706;
  --warn-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --sidebar: #1e40af;
  --sidebar-dark: #1e3a8a;
  --sidebar-hover: #2748b5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.error { color: var(--danger); }

h1 { font-size: 24px; margin: 0 0 4px; font-weight: 700; color: var(--ink); }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; color: var(--ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* Buttons */
button, .button-link {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}
button:hover, .button-link:hover {
  background: var(--primary-dark);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
button.secondary:hover { background: #f8fafc; }

button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

.danger-link {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  box-shadow: none;
  padding: 6px 12px;
  font-size: 13px;
}
.danger-link:hover { background: var(--danger); color: #fff; }

/* Inputs */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.form-grid { display: grid; gap: 16px; }
.form-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Flash messages */
.flash-list { list-style: none; padding: 0; margin: 0 0 16px; }
.flash {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash-success { background: var(--ok-light); color: var(--ok); border-left: 4px solid var(--ok); }
.flash-error { background: var(--danger-light); color: var(--danger); border-left: 4px solid var(--danger); }

/* Auth */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
}

.auth-shell { width: min(440px, 96vw); }

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
}

.auth-brand-name { font-size: 22px; font-weight: 700; color: var(--ink); }
.auth-brand-sub { color: var(--muted); font-size: 13px; }

.auth-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .muted { margin-bottom: 20px; display: block; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--sidebar);
  color: #fff;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0 24px 24px 0;
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  z-index: 10;
}

.sb-logo {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 24px 20px 20px;
}

.sb-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}

.sb-logo-text { font-weight: 700; font-size: 16px; }
.sb-logo-sub { font-size: 11px; color: rgba(255,255,255,0.6); }

.sb-section {
  padding: 20px 20px 8px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  font-weight: 600;
}

.sb-nav { display: grid; gap: 2px; padding: 0 8px; }

.sb-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: background 0.15s;
}
.sb-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }

.sb-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
}

.sb-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.sb-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sb-item:hover .sb-icon-svg,
.sb-item.active .sb-icon-svg { opacity: 1; }

.sb-foot {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  gap: 10px;
  align-items: center;
}

.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}

.sb-user-name { font-size: 13px; color: #fff; font-weight: 500; }
.sb-user a { font-size: 12px; color: rgba(255,255,255,0.5); text-decoration: none; }
.sb-user a:hover { color: #fff; }

.content-wrap {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 28px 32px;
}

.page-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

/* Dashboard KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.kpi-accent {
  height: 4px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.kpi-card:nth-child(1) .kpi-accent { background: var(--primary); }
.kpi-card:nth-child(2) .kpi-accent { background: var(--warn); }
.kpi-card:nth-child(3) .kpi-accent { background: var(--ok); }
.kpi-card:nth-child(4) .kpi-accent { background: var(--danger); }

.kpi-val {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  color: var(--ink);
}

.kpi-sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  margin-top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.quick-action {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-action:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); text-decoration: none; }

/* Solicitacoes list */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.search-bar input { border: none; padding: 0; outline: none; box-shadow: none; }
.search-bar input:focus { box-shadow: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table thead { background: #f8fafc; }
.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
}
.table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafc; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-pendente { background: var(--warn-light); color: var(--warn); }
.status-pendente::before { background: var(--warn); }
.status-completa { background: var(--ok-light); color: var(--ok); }
.status-completa::before { background: var(--ok); }
.status-cancelada { background: var(--danger-light); color: var(--danger); }
.status-cancelada::before { background: var(--danger); }

/* Wizard */
.wizard {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 24px;
}
.wizard-step { display: flex; align-items: center; gap: 8px; }
.wizard-step span {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s;
}
.wizard-step small { color: var(--muted); font-weight: 500; }
.wizard-step.done span { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.wizard-step.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.wizard-step.active small { color: var(--primary); font-weight: 600; }
.wizard-line { flex: 1; min-width: 24px; height: 2px; background: var(--line); }

.autocomplete-list { display: grid; gap: 4px; }
.autocomplete-item {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  text-align: left;
  box-shadow: none;
}
.autocomplete-item:hover { background: var(--primary-light); border-color: var(--primary); }

.full-row { grid-column: 1 / -1; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.people-list li:last-child { border-bottom: none; }

.people-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.info-panel { position: sticky; top: 16px; height: fit-content; }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 13px;
}
.info-row span { color: var(--muted); }

.link-box {
  margin-top: 12px;
  background: #f0f5ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--primary-dark);
}

.inline-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin-bottom: 0; }

.doc-preview-image {
  width: 110px; height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.doc-preview-pdf {
  width: 130px; height: 80px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* Upload publico */
.upload-body { background: var(--bg); }
.upload-header {
  background: var(--sidebar);
  color: #fff;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.upload-brand { display: flex; gap: 16px; align-items: center; }
.upload-logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
}
.upload-title { font-size: 20px; font-weight: 700; }
.upload-sub { font-size: 13px; color: rgba(255,255,255,0.6); }
.upload-meta { text-align: right; display: grid; gap: 2px; font-size: 12px; color: rgba(255,255,255,0.5); }
.upload-page { width: min(1150px, 96vw); margin: 0 auto; padding: 20px 0 90px; }
.upload-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.people-pill {
  margin-left: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}

.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.drop-zone.done { border-color: var(--ok); background: var(--ok-light); }

.doc-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.required { font-size: 11px; color: var(--warn); font-weight: 600; }
.optional { font-size: 11px; color: var(--muted); }
.doc-input { margin-bottom: 6px; }

.progress-wrap {
  width: 100%; height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin: 8px 0;
}
.progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width 0.3s; }

.preview-image {
  width: 100%; max-height: 180px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
}
.preview-pdf { width: 100%; height: 190px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.link-danger {
  margin-top: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
  font-size: 12px;
  box-shadow: none;
}
.link-danger:hover { color: var(--danger); }

.checklist-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 10px;
  height: fit-content;
  box-shadow: var(--shadow);
}
.checklist-panel h3 { margin: 0 0 12px; font-size: 15px; }

.check-progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.check-progress-track { margin-top: 6px; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.check-progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width 0.3s; }

.check-item {
  display: flex; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.check-item:last-child { border-bottom: none; }
.check-box {
  width: 18px; height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  flex-shrink: 0;
}
.check-item.done .check-box { background: var(--ok); border-color: var(--ok); }
.check-name { flex: 1; font-size: 13px; }
.check-item.done .check-name { text-decoration: line-through; color: var(--muted); }

.upload-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

/* Dynamic fields */
.campos-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.campo-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.campo-row { display: flex; align-items: center; gap: 8px; }
.campo-nome { flex: 1 1 0; min-width: 0; }
.campo-tipo { flex: 0 0 160px; width: 160px; }

.btn-remove-campo {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.btn-remove-campo:hover { background: var(--danger); color: #fff; }

.campo-prefill-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.campo-prefill-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.campo-prefill { width: 100%; }

/* Conjunto sections (nova solicitação etapa 2) */
.conjunto-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.conjunto-section h3 { margin: 0 0 12px; font-size: 15px; color: var(--ink); }

.campo-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: grab;
  transition: border-color 0.15s;
}
.campo-item:hover { border-color: var(--primary); }
.campo-item.dragging { opacity: 0.4; }
.campo-item.drag-over { border-color: var(--primary); border-style: dashed; background: var(--primary-light); }
.campo-item .drag-handle { cursor: grab; color: var(--muted); font-size: 1.2rem; user-select: none; }
.campo-item input[type="text"] { flex: 1; min-width: 0; }
.campo-item select { width: auto; min-width: 110px; }
.campo-item label.cb-todos {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; white-space: nowrap; color: var(--muted);
  cursor: pointer; font-weight: 500;
}
.campo-item label.cb-todos input { width: auto; margin: 0; }
.campo-item .btn-remove {
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 18px; padding: 0 4px; box-shadow: none;
}
.campo-item .btn-remove:hover { color: #991b1b; }
.campo-synced { opacity: 0.5; pointer-events: none; border-style: dashed; background: #f8fafc; }
.btn-edit-nome {
  background: none; border: none; box-shadow: none;
  color: var(--muted); cursor: pointer; padding: 2px 4px;
  vertical-align: middle; display: inline-flex; align-items: center;
  opacity: 0.5; transition: opacity 0.15s;
}
.btn-edit-nome:hover { opacity: 1; color: var(--primary); }

.btn-add-campo {
  margin-top: 8px;
  background: #fff;
  color: var(--primary);
  border: 1px dashed var(--primary);
  box-shadow: none;
  font-weight: 500;
}
.btn-add-campo:hover { background: var(--primary-light); }

/* Biblioteca */
.pasta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pasta-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.pasta-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.pasta-preview {
  height: 180px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.pasta-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pasta-preview-pdf {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}
.pasta-preview-empty,
.pasta-preview-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.pasta-preview-file span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pasta-info {
  padding: 14px 16px;
}
.pasta-nome {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pasta-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pasta-doc-count { font-size: 12px; color: var(--muted); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.status-pendente { background: var(--warn-light); color: var(--warn); }
.status-badge.status-pendente::before { background: var(--warn); }
.status-badge.status-completa { background: var(--ok-light); color: var(--ok); }
.status-badge.status-completa::before { background: var(--ok); }
.status-badge.status-cancelada { background: var(--danger-light); color: var(--danger); }
.status-badge.status-cancelada::before { background: var(--danger); }
.status-badge.status-manual { background: var(--primary-light); color: var(--primary); }
.status-badge.status-manual::before { background: var(--primary); }

/* Doc grid (inside pasta) */
.doc-grid-lib {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.doc-card-lib {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}
.doc-card-lib:hover { border-color: var(--primary); }

.doc-card-preview {
  height: 120px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.doc-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.doc-card-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }

.doc-card-info { padding: 10px 12px; flex: 1; }
.doc-card-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.doc-card-actions {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
}
.doc-card-actions a { color: var(--muted); transition: color 0.15s; }
.doc-card-actions a:hover { color: var(--primary); }

.drop-zone-lib {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone-lib:hover,
.drop-zone-lib.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Responsive */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pasta-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .detail-grid, .upload-grid { grid-template-columns: 1fr; }
  .info-panel, .checklist-panel { position: static; }
}

@media (max-width: 820px) {
  .pasta-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; border-radius: 0; }
  .app-shell { display: block; }
  .content-wrap { margin-left: 0; width: 100%; padding: 16px; }
  .sb-foot { margin-top: 0; }
  .page-top { flex-direction: column; align-items: flex-start; }
  .form-two-col { grid-template-columns: 1fr; }
  .upload-footer { flex-direction: column; align-items: flex-start; }
  .campo-row { flex-wrap: wrap; }
  .campo-nome { flex: 1 1 100%; }
  .campo-tipo { flex: 1 1 auto; width: auto; }
}
