/* CaseFlow shared styles */
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1e293b;
  background-color: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.025em;
}

.sidebar-active-link {
  background: linear-gradient(90deg, rgba(60, 131, 246, 0.1) 0%, rgba(60, 131, 246, 0.05) 100%);
  color: #3C83F6;
  font-weight: 500;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #dee1e6;
}

.form-section-shadow {
  box-shadow: 0 1px 2.5px 0 #171a1f12, 0 0 2px 0 #171a1f14;
}

.dashed-dropzone {
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='10' ry='10' stroke='%23dee1e6' stroke-width='2' stroke-dasharray='8%2c 8' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
  border-radius: 10px;
}

.input-focus-ring:focus {
  outline: none;
  border-color: #3c83f6;
  box-shadow: 0 0 0 2px rgba(60, 131, 246, 0.2);
}

.toggle-switch {
  width: 2.75rem;
  height: 1.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  transition: transform 0.2s;
}

.peer:checked + .toggle-switch {
  background: #3c83f6;
}

.peer:checked + .toggle-switch::after {
  transform: translateX(1.25rem);
  border-color: white;
}

.case-tab-active {
  border-bottom: 2px solid #3C83F6;
  color: #3C83F6;
  font-weight: 500;
}

.timeline-item .timeline-line::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: -12px;
  width: 1px;
  background-color: #dee1e6;
}

.timeline-item:last-child .timeline-line::before {
  display: none;
}

.email-list-active {
  border-left: 3px solid #3C83F6;
  background: rgba(60, 131, 246, 0.06);
}

.kebab-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  min-width: 10rem;
  background: white;
  border: 1px solid #dee1e6;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.kebab-wrap:focus-within .kebab-menu,
.kebab-wrap.open .kebab-menu {
  display: block;
}

.view-toggle-active {
  background: #3C83F6;
  color: white;
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.table-row-hover:hover {
  background-color: #f8fafc;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dropzone-active {
  border-color: #3C83F6 !important;
  background-color: rgba(60, 131, 246, 0.05);
}

.kanban-card.dragging {
  opacity: 0.5;
}

.kanban-column.drag-over {
  background-color: rgba(60, 131, 246, 0.08);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: #f3f4f6;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.125rem;
}

.access-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: #fafafb;
  border: 1px solid #dee1e6;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Finder-style document browser */
.finder-shell {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: min(72vh, 720px);
}

.finder-shell-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.finder-shell-sidebar {
  width: 14rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fafafb;
  border-right: 1px solid #dee1e6;
  min-height: 0;
}

@media (min-width: 1024px) {
  .finder-shell-sidebar {
    width: 16rem;
  }
}

.finder-shell-sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.finder-shell-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.finder-shell-list {
  flex: 1 1 auto;
  min-height: 200px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.finder-shell-list .h-full {
  height: 100%;
}

.finder-shell-statusbar {
  flex-shrink: 0;
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  color: #565d6d;
  background: #fafafb;
  border-top: 1px solid #dee1e6;
}

.finder-shell-toolbar {
  flex-shrink: 0;
}

.case-tab-panel.hidden {
  display: none !important;
}

/* Sidebar folder tree (Finder-style) */
.folder-tree-node {
  margin: 1px 0;
}

.folder-tree-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  min-height: 1.75rem;
}

.folder-tree-summary::-webkit-details-marker {
  display: none;
}

.folder-tree-summary:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.folder-tree-branch[open] > .folder-tree-summary .folder-tree-chevron {
  transform: rotate(90deg);
}

.folder-tree-chevron {
  transition: transform 0.15s ease;
}

.folder-tree-chevron-spacer {
  display: inline-block;
  width: 0.875rem;
  flex-shrink: 0;
}

.folder-tree-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #171a1f;
  text-decoration: none;
}

.folder-tree-label:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.folder-tree-leaf {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.25rem;
  min-height: 1.75rem;
}

.folder-tree-leaf .folder-tree-label {
  flex: 1;
}

.folder-tree-children {
  margin-left: 0.625rem;
  padding-left: 0.5rem;
  border-left: 1px solid #e2e8f0;
}

.folder-tree-delete {
  flex-shrink: 0;
  opacity: 0;
}

.folder-tree-summary:hover .folder-tree-delete,
.folder-tree-leaf:hover .folder-tree-delete,
.group\/branch:hover .folder-tree-delete {
  opacity: 1;
}

.rich-editor-toolbar button.active {
  background-color: #e0e7ff;
  color: #3C83F6;
}

.finder-doc-row-selected {
  background-color: rgba(60, 131, 246, 0.08);
}

.finder-doc-row-selected td {
  border-color: rgba(60, 131, 246, 0.12);
}

.file-preview-pane iframe {
  display: block;
}

.task-row:hover {
  background-color: rgba(60, 131, 246, 0.03);
}

.status-badge {
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  display: inline-block;
}

.tasks-dashboard .case-tab-active,
.case-tab-active {
  color: #3c83f6;
  border-bottom: 2px solid #3c83f6;
  font-weight: 500;
}

.case-detail-page .timeline-line::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: -12px;
  width: 1px;
  background-color: #dee1e6;
}

.case-detail-page .timeline-item:last-child .timeline-line::before {
  display: none;
}
