/* Case Files — Dropbox-style file browser. Loaded only on Files page. */

.case-files-page { position: relative; min-height: 400px; }
.case-files-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; margin-bottom: 20px; padding: 12px 16px; background: white;
  border: 1.5px solid var(--grey-200); border-radius: var(--border-radius); box-shadow: var(--shadow);
}
.case-files-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 14px; color: var(--grey-600);
}
.case-files-breadcrumb .breadcrumb-item {
  color: var(--brand); text-decoration: none; transition: color .15s;
}
.case-files-breadcrumb .breadcrumb-item:hover { color: var(--brand-bright); }
.case-files-breadcrumb .breadcrumb-item + .breadcrumb-item::before { display: none; content: none; }
.case-files-actions { display: flex; align-items: center; gap: 8px; }
.case-files-drop-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; margin-bottom: 20px;
  background: var(--brand-ghost); border: 2px dashed var(--brand-pale);
  border-radius: var(--border-radius); font-size: 14px; color: var(--brand);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.case-files-drop-hint:hover { background: var(--brand-pale); border-color: var(--brand); }
.case-files-drop-hint svg {
  width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.case-files-drop-overlay {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: rgba(13,148,136,0.12); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; border: 3px dashed var(--brand);
}
.case-files-drop-overlay.visible { opacity: 1; pointer-events: auto; }
.case-files-drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  font-family: var(--font-serif); font-size: 24px; color: var(--brand);
}
.case-files-drop-inner svg {
  width: 64px; height: 64px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; animation: bounce .8s ease infinite;
}
.case-files-upload-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  width: 320px; max-width: calc(100vw - 48px);
  background: white; border: 1.5px solid var(--grey-200); border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: none; overflow: hidden;
}
.case-files-upload-panel.has-items { display: block; }
.case-files-upload-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--grey-50); border-bottom: 1px solid var(--grey-200);
  font-weight: 600; font-size: 13px; color: var(--navy);
}
.case-files-upload-header .btn-close-sm {
  padding: 4px; font-size: 12px; background: transparent; border: none; cursor: pointer; opacity: .6;
}
.case-files-upload-header .btn-close-sm:hover { opacity: 1; }
.case-files-upload-list {
  max-height: 240px; overflow-y: auto; padding: 8px;
}
.case-files-upload-item {
  padding: 8px 10px; font-size: 12px; border-radius: 8px; margin-bottom: 4px;
  background: var(--grey-50); display: flex; flex-direction: column; gap: 4px;
}
.case-files-upload-item:last-child { margin-bottom: 0; }
.case-files-upload-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--navy);
}
.case-files-upload-progress {
  height: 4px; background: var(--grey-200); border-radius: 999px; overflow: hidden;
}
.case-files-upload-bar {
  height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s;
}
.case-files-upload-error { font-size: 11px; color: var(--danger); }
.case-files-browser {
  display: flex; min-height: 360px; background: white;
  border: 1.5px solid var(--grey-200); border-radius: var(--border-radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.case-files-sidebar {
  width: 220px; min-width: 180px; flex-shrink: 0;
  background: var(--grey-50); border-right: 1px solid var(--grey-200);
  display: flex; flex-direction: column;
}
.case-files-sidebar-header {
  padding: 12px 16px; font-size: 11px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase; color: var(--grey-600);
  border-bottom: 1px solid var(--grey-200);
}
.case-files-folders {
  padding: 8px 0; overflow-y: auto; flex: 1;
}
.case-folder-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px; color: var(--navy);
  text-decoration: none; transition: background .1s; cursor: pointer;
}
.case-folder-item:hover { background: var(--grey-200); }
.case-folder-item.active { background: var(--brand-ghost); color: var(--brand); font-weight: 600; }
.case-folder-up { color: var(--grey-600); font-size: 12px; }
.case-folder-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
}
.case-folder-icon svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.case-folder-empty { padding: 8px 16px; font-size: 12px; color: var(--grey-500); }
.case-files-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: auto;
}
.case-files-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; color: var(--grey-500);
}
.case-files-empty-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; background: var(--grey-50);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
}
.case-files-empty-icon svg {
  width: 32px; height: 32px; stroke: var(--grey-500); fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.case-files-selection-slot {
  min-height: 44px; margin-bottom: 0; flex-shrink: 0;
}
.case-files-selection-bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 10px 16px; background: var(--brand-ghost); border: 1px solid var(--brand-pale);
  border-radius: var(--border-radius); visibility: hidden;
}
.case-files-selection-bar.visible { visibility: visible; }
.case-files-table-wrap { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.case-files-selection-count { font-size: 13px; font-weight: 600; color: var(--brand); }
.case-files-selection-actions { display: flex; gap: 8px; }
.case-files-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.case-files-table thead { position: sticky; top: 0; background: var(--grey-50); z-index: 1; }
.case-files-table th {
  padding: 10px 16px; text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase; color: var(--grey-600);
  border-bottom: 1.5px solid var(--grey-200);
}
.case-files-table th.col-actions { text-align: right; padding-right: 12px; }
.case-files-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--grey-200);
  vertical-align: middle;
}
.case-files-table tbody tr:hover { background: var(--grey-50); }
.case-files-table td.col-actions { text-align: right; padding-right: 12px; vertical-align: middle; }
.case-file-row-menu .btn { min-width: 2rem; padding: 0.2rem 0.45rem; }
.case-files-table .col-check { width: 40px; padding: 10px 8px 10px 16px; vertical-align: middle; }
.case-files-table .col-name { min-width: 200px; }
.case-files-table tbody tr.selected { background: var(--brand-ghost); }
.case-files-table .col-date { width: 110px; white-space: nowrap; color: var(--grey-600); }
.case-files-table .col-size { width: 80px; white-space: nowrap; color: var(--grey-600); }
.case-files-table .col-uploaded { width: 140px; color: var(--grey-600); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-files-table .col-actions { width: auto; min-width: 140px; max-width: 220px; }
.case-file-cell-name {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.case-file-icon-small {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-50); color: var(--grey-600);
}
.case-file-icon-small svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.case-file-cell-name .fi-img { background: #EDE9FE; color: #7C3AED; }
.case-file-cell-name .fi-pdf { background: #FEE2E2; color: #DC2626; }
.case-file-cell-name .fi-other { background: var(--grey-50); color: var(--grey-600); }
/* Row actions: ellipsis menu (always visible; matches Documents / Timeline overflow pattern). */
.case-file-actions {
  display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px;
}
.case-file-note-badge {
  font-size: 14px; margin-left: 6px; opacity: .9; color: var(--brand);
  cursor: pointer; display: inline-flex; align-items: center;
  transition: color .15s, transform .15s;
}
.case-file-note-badge:hover { color: var(--brand-bright); transform: scale(1.1); }

/* Image view modal */
.case-file-view-modal .db-modal { max-width: 90vw; max-height: 90vh; }
.case-file-view-modal .db-modal-body { padding: 0; overflow: hidden; }
.case-file-view-modal .case-file-view-img {
  max-width: 100%; max-height: 80vh; display: block; margin: 0 auto;
}
