:root {
  --page: #f6f7fb;
  --panel: #ffffff;
  --line: #e4e8f1;
  --text: #1f2937;
  --muted: #6b7280;
  --blue: #4169e1;
  --blue-soft: #e9efff;
  --amber: #f4a62a;
  --amber-soft: #fff3df;
  --green: #0f8f69;
  --green-soft: #e4f7ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(65, 105, 225, 0.08), transparent 30rem),
    var(--page);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 3.15rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.document-browser {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
}

.browser-toolbar {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: #f9fbff;
  border-bottom: 1px solid var(--line);
}

.path-bar {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 750;
}

.breadcrumb-current,
.breadcrumb-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-button {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.breadcrumb-button:hover {
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--text);
  overflow-wrap: anywhere;
}

.separator {
  color: #a3adbd;
  font-size: 0.85rem;
}

.search-field {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04);
}

.search-field i {
  color: #7b8497;
  font-size: 1.35rem;
}

#searchInput {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 1.04rem;
  font-weight: 650;
}

#searchInput::placeholder {
  color: #7b8497;
}

.file-list {
  min-height: 150px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.document-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.document-table th {
  padding: 18px 24px;
  color: #757b8f;
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.document-table th:first-child {
  width: 62%;
}

.document-table th:nth-child(2) {
  width: 18%;
}

.document-table th:nth-child(3) {
  width: 20%;
}

.document-table td {
  padding: 18px 24px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  color: #4b5563;
  font-size: 1rem;
}

.document-table tbody tr {
  background: var(--panel);
  transition: background 160ms ease, transform 160ms ease;
}

.document-row {
  cursor: pointer;
}

.document-table tbody tr:hover {
  background: #fafcff;
}

.document-table tbody tr:last-child td {
  border-bottom: 0;
}

.entry-main,
.entry-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
}

.entry-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.entry-name {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entry-detail {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.icon-tile {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.35rem;
}

.folder-tile {
  color: var(--blue);
  background: var(--blue-soft);
}

.file-tile {
  color: var(--green);
  background: var(--green-soft);
}

.file-tile-pdf {
  color: #d93025;
  background: #fde8e7;
}

.file-tile-word {
  color: #185abd;
  background: #e8f0fe;
}

.file-tile-excel {
  color: #107c41;
  background: #e6f4ea;
}

.file-tile-powerpoint {
  color: #c43e1c;
  background: #fce8df;
}

.file-tile-image {
  color: #7c3aed;
  background: #f0e7ff;
}

.file-tile-archive {
  color: #b45309;
  background: #fef3c7;
}

.file-tile-text {
  color: #475569;
  background: #eef2f7;
}

.file-tile-generic {
  color: #0f766e;
  background: #e6fffb;
}

.folder-row:nth-child(even) .folder-tile {
  color: var(--amber);
  background: var(--amber-soft);
}

.muted-cell {
  color: var(--muted);
  font-weight: 650;
  overflow-wrap: anywhere;
}

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

.actions-heading {
  text-align: right;
}

.icon-action {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #526071;
  background: var(--panel);
  text-decoration: none;
  cursor: pointer;
}

.icon-action + .icon-action {
  margin-left: 6px;
}

.icon-action:hover {
  color: var(--blue);
  border-color: #bfd0ff;
  background: #f5f8ff;
}

.primary-action {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.primary-action:hover {
  color: #ffffff;
  border-color: #3156c8;
  background: #3156c8;
}

.search-status,
.status,
.empty {
  margin: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.search-status {
  color: #75530e;
  background: #fff8e9;
  border-color: #f6dda8;
  font-weight: 650;
}

.status,
.empty {
  color: var(--muted);
  background: #fbfcff;
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

  .browser-toolbar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .document-table {
    min-width: 0;
  }

  .document-table thead {
    display: none;
  }

  .document-table,
  .document-table tbody,
  .document-table tr,
  .document-table td {
    display: block;
    width: 100%;
  }

  .document-table tr {
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  .document-table td {
    border: 0;
    padding: 6px 0;
  }

  .document-table td:nth-child(2)::before {
    content: "Tamaño: ";
    color: var(--muted);
    font-weight: 850;
  }

  .row-actions {
    padding-top: 12px;
    text-align: left;
  }
}
