:root {
  --green: #2f9e3a;
  --green-dark: #217a2c;
  --green-soft: #eef7ef;
  --ink: #1f2429;
  --muted: #6b7480;
  --line: #e6eaee;
  --bg: #eef1f4;
  --surface: #ffffff;
  --radius: 10px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 1px 2px rgba(20, 28, 36, 0.04), 0 8px 24px rgba(20, 28, 36, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fa 0%, var(--bg) 40%),
    var(--bg);
}

.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  color: var(--ink);
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(20, 28, 36, 0.03);
}

.logo-link {
  display: flex;
  justify-content: center;
  padding: 0.4rem 0.35rem 1rem;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: block;
  width: min(100%, 176px);
  height: auto;
}

.sidebar-label {
  margin: 0.15rem 0 0;
  padding: 0 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #8a939e;
  font-weight: 700;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  overflow: auto;
  padding: 0.1rem;
}

.cat-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #4d5660;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 0.62rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.cat-btn:hover {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: #cfe8d2;
}

.cat-btn.active {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: #cfe8d2;
  box-shadow: inset 3px 0 0 var(--green);
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-wrap {
  width: min(100%, 280px);
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrap input:focus {
  border-color: #9fd4a4;
  box-shadow: 0 0 0 3px rgba(47, 158, 58, 0.12);
}

main {
  padding: 1.1rem 1.35rem 1.4rem;
  flex: 1;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.category-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
  border-bottom: 1px solid var(--line);
}

.category-head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #3d4650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table-fixed {
  table-layout: fixed;
}

.table-fixed .col-file {
  width: auto;
}

.table-fixed .col-category {
  width: 18%;
}

.table-fixed .col-size {
  width: 110px;
}

.table-fixed .col-date {
  width: 160px;
}

.table-fixed .col-action {
  width: 96px;
}

.table-all .col-file {
  width: 42%;
}

.table th,
.table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.9rem;
}

.table th {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fbfcfd;
  font-weight: 700;
}

.table td.col-size,
.table td.col-date,
.table td.col-action,
.table .cat-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table td.col-action {
  text-align: right;
}

.table .cat-cell {
  color: #4d5660;
  font-weight: 600;
  font-size: 0.84rem;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--green-soft);
}

.table tbody tr:hover .file-name {
  color: var(--green-dark);
}

.table tbody tr:hover .cat-cell {
  color: var(--green-dark);
}

.file-name {
  display: inline;
  font-weight: 600;
  word-break: break-all;
  color: var(--ink);
  text-decoration: none;
}

.file-name:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  padding: 0.38rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.btn-download:hover {
  background: var(--green-dark);
}

.empty {
  margin: 1rem 0;
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-brand {
  color: #e67e22;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.footer-contacts a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.footer-contacts a:hover {
  color: var(--green);
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    box-shadow: none;
  }

  .category-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cat-btn.active {
    box-shadow: none;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    width: 100%;
  }

  .table-fixed .col-date,
  .table th:nth-child(3),
  .table td.col-date {
    display: none;
  }

  .table-all th:nth-child(4),
  .table-all td.col-date {
    display: none;
  }

  .table-all th:nth-child(3),
  .table-all .cat-cell {
    display: table-cell;
  }
}

@media (max-width: 560px) {
  .table-fixed .col-size,
  .table td.col-size {
    display: none;
  }

  .table:not(.table-all) th:nth-child(2),
  .table:not(.table-all) td.col-size {
    display: none;
  }

  .table-all .col-category,
  .table-all th:nth-child(2),
  .table-all .cat-cell {
    display: none;
  }
}
