.explorer-page {
  gap: 1.35rem;
}

.explorer-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.explorer-card-head h3 {
  margin-top: 0.22rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.explorer-card-head p {
  max-width: 24rem;
  color: var(--muted);
  line-height: 1.65;
  text-align: right;
}

.explorer-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
}

.search-results {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.search-result {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.44);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  transition-delay: var(--hover-out-delay);
}

[data-theme="dark"] .search-result {
  background: rgba(15, 23, 42, 0.48);
}

.search-result:hover {
  border-color: var(--hover-border);
  background: var(--hover-surface);
  box-shadow: var(--hover-shadow);
  transition-delay: 0s;
}

.search-result small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  word-break: break-word;
}

.explorer {
  display: grid;
  gap: 1rem;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.explorer-toolbar .left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.explorer-toolbar .right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.explorer-toolbar-tight {
  margin-bottom: 0.6rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: wrap;
  min-width: 0;
}

.breadcrumb .crumb {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  transition: background var(--transition), color var(--transition);
}

.breadcrumb .crumb:hover,
.breadcrumb .crumb[aria-current="page"] {
  background: rgba(0, 113, 227, 0.08);
  color: var(--text);
}

.breadcrumb .sep {
  color: var(--muted);
}

.view-toggle {
  display: inline-flex;
  padding: 0.24rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
}

[data-theme="dark"] .view-toggle {
  background: rgba(15, 23, 42, 0.48);
}

.view-toggle .btn {
  min-width: 2.55rem;
}

.view-toggle .btn.is-active {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.18);
}

.explorer-content {
  display: grid;
  gap: 0.85rem;
}

.files-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.32);
}

[data-theme="dark"] .files-list {
  background: rgba(15, 23, 42, 0.34);
}

.files-header,
.files-list .row {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 12rem 7rem 7rem;
  gap: 0.75rem;
  align-items: center;
}

.files-header {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.files-header .sortable {
  cursor: pointer;
}

.files-header .sortable:hover {
  color: var(--text);
}

.files-list ul {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
}

.files-list .row {
  padding: 0.88rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  transition-delay: var(--hover-out-delay);
}

.files-list .row:hover {
  background: var(--hover-surface);
  box-shadow: inset 0 0 0 1px var(--hover-border);
  transition-delay: 0s;
}

.files-list .row.is-selected,
.file-card.is-selected {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.36);
}

.files-list .row.folder {
  font-weight: 650;
}

.files-list .row .name,
.file-card .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-list .row .name {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.file-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
}

.file-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.18rem 0.46rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
}

.file-status-badge.is-new {
  border-color: rgba(0, 113, 227, 0.24);
  background: rgba(0, 113, 227, 0.1);
  color: var(--primary);
}

.file-status-badge.is-reviewed {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.file-status-badge.is-attention,
.file-status-badge.is-duplicate {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.file-status-badge.is-payment {
  border-color: rgba(124, 58, 237, 0.24);
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}

.files-list .row .modified,
.files-list .row .size {
  color: var(--muted);
}

.file-actions-col {
  justify-self: end;
}

.file-quick-action {
  min-height: 2.15rem;
  padding: 0.42rem 0.72rem;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
}

.file-quick-action.compact {
  margin-top: 0.55rem;
}

.files-grid .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.85rem;
}

.file-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.38));
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

[data-theme="dark"] .file-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.52));
}

.file-card:hover {
  border-color: var(--hover-border);
  background: color-mix(in srgb, var(--card-bg) 94%, rgba(0, 113, 227, 0.04));
  box-shadow: var(--hover-shadow);
  transition-delay: 0s;
}

.file-card .thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.95rem;
  background: rgba(0, 113, 227, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-card .meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.file-card .sub {
  margin-top: 0.26rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.file-actions-card {
  display: grid;
  gap: 0.95rem;
}

.file-actions-head h4 {
  margin-top: 0.25rem;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.file-path-note {
  color: var(--muted);
  word-break: break-word;
  line-height: 1.6;
}

.selected-file-status {
  display: grid;
  gap: 0.45rem;
}

.selected-file-reason {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.actions-grid,
.move-grid,
.rename-grid,
.payment-grid {
  display: grid;
  gap: 0.75rem;
}

.actions-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.move-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rename-grid {
  grid-template-columns: minmax(14rem, 1fr) auto auto;
}

.payment-grid {
  grid-template-columns: minmax(12rem, 1fr) auto;
}

.move-section,
.rename-section,
.payment-section {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.3rem;
}

.move-section h5,
.rename-section h5,
.payment-section h5 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.payment-section p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.rename-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.pdf-page-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.pdf-scroll-container {
  min-height: 70vh;
  padding-top: 0.35rem;
}

.pdf-pages {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 0 0.2rem 0.3rem;
}

.pdf-page {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.hide-sm {
  display: block;
}

@media (max-width: 980px) {
  .explorer-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .explorer-card-head p {
    text-align: left;
  }

  .actions-grid,
  .move-grid,
  .rename-grid {
    grid-template-columns: 1fr 1fr;
  }

  .files-header,
  .files-list .row {
    grid-template-columns: minmax(12rem, 1fr) 10rem 6rem 6.5rem;
  }
}

@media (max-width: 720px) {
  .search-wrap {
    grid-template-columns: 1fr;
  }

  .files-header {
    display: none;
  }

  .files-list {
    border: none;
    background: transparent;
  }

  .files-list ul {
    padding: 0;
    display: grid;
    gap: 0.7rem;
  }

  .files-list .row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.42);
  }

  [data-theme="dark"] .files-list .row {
    background: rgba(15, 23, 42, 0.48);
  }

  .hide-sm {
    display: none !important;
  }

  .files-list .row .name {
    grid-column: 1 / -1;
  }

  .file-actions-col {
    justify-self: start;
  }

  .actions-grid,
  .move-grid,
  .rename-grid {
    grid-template-columns: 1fr;
  }

  .pdf-scroll-container {
    min-height: 56vh;
  }
}
