/* ============================================================
   Project Zeratul — modules/files.css
   Document library styles
   ============================================================ */

/* ── Root layout ─────────────────────────────────────────── */

.files-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
}

.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.files-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.files-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}


/* ── Sidebar ─────────────────────────────────────────────── */

.files-sidebar {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  background: var(--surface-raised, var(--surface));
}

.files-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 12px;
  font-family: var(--font-ui);
  letter-spacing: 0.03em;
  color: var(--stone-light);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-radius: 3px;
  margin: 1px 6px;
  position: relative;
}

.files-sidebar-item:hover {
  background: var(--hover-bg);
  color: var(--cream-muted);
}

.files-sidebar-item.active {
  background: var(--active-bg, rgba(200,170,100,0.08));
  color: var(--gold);
}

.files-folder-icon {
  flex-shrink: 0;
  font-size: 13px;
}

.files-arch-icon {
  color: var(--gold-muted);
}

.files-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.files-badge {
  margin-left: auto;
  font-size: 10px;
  color: var(--stone-mid);
  font-family: var(--font-mono);
  min-width: 16px;
  text-align: right;
}

.files-sidebar-item.active .files-badge {
  color: var(--gold-muted);
}


/* ── Main panel ──────────────────────────────────────────── */

.files-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-width: 0;
}

.files-loading {
  font-size: 12px;
  color: var(--stone-light);
  padding: 40px 0;
  text-align: center;
  letter-spacing: 0.05em;
  font-family: var(--font-ui);
}

.files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 8px;
}

.files-empty-icon {
  font-size: 32px;
  opacity: 0.3;
  margin-bottom: 4px;
}

.files-empty-text {
  font-size: 13px;
  color: var(--stone-light);
  letter-spacing: 0.04em;
  font-family: var(--font-ui);
}

.files-empty-hint {
  font-size: 11px;
  color: var(--stone-mid);
  letter-spacing: 0.03em;
}


/* ── File table ──────────────────────────────────────────── */

.files-table {
  width: 100%;
  table-layout: auto;
}

.files-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
  min-width: 0;
}

.files-name-cell .files-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.files-name-cell .files-arch-tag {
  flex-shrink: 0;
}

.files-file-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.files-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.files-actions-cell .btn {
  margin-left: 4px;
}


/* ── Category badges ─────────────────────────────────────── */

.files-cat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid;
  font-family: var(--font-ui);
  white-space: nowrap;
}

.files-cat-badge.cat-subscription {
  color: var(--gold);
  border-color: var(--gold-muted);
  background: var(--gold-dim, rgba(200,170,100,0.06));
}

.files-cat-badge.cat-diligence {
  color: #7eb8d4;
  border-color: rgba(126,184,212,0.4);
  background: rgba(126,184,212,0.05);
}

.files-cat-badge.cat-arch {
  color: var(--gold-muted);
  border-color: rgba(200,165,70,0.3);
  background: rgba(200,165,70,0.06);
}

.files-cat-badge.cat-other {
  color: var(--stone-mid);
  border-color: var(--border);
  background: transparent;
}

.files-cat-badge.cat-form_468 {
  color: #7eb8d4;
  border-color: rgba(126,184,212,0.4);
  background: rgba(126,184,212,0.05);
}


/* ── Folder overview grid ────────────────────────────────── */

.files-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 8px 0;
}

.files-folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base);
  text-align: center;
}

.files-folder-card:hover {
  border-color: var(--gold-muted);
  background: var(--surface-raised);
}

.files-folder-card-icon {
  font-size: 28px;
  line-height: 1;
  opacity: 0.75;
}

.files-folder-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--cream-muted);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.files-folder-card-count {
  font-size: 11px;
  color: var(--stone-light);
  letter-spacing: 0.03em;
}


/* ── Upload modal ────────────────────────────────────────── */

.files-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.files-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.files-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.2s ease;
}
