/* css/styles.css */
:root {
  --bg: #09101d;
  --bg-2: #0d1525;
  --panel: #10192b;
  --panel-2: #12203a;
  --panel-3: #172641;
  --text: #e7edf8;
  --muted: #99a7c2;
  --line: #223250;
  --line-2: #2d4368;
  --accent: #7aa2ff;
  --accent-2: #9fc0ff;
  --good: #83d3a3;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --container: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(20, 34, 60, 0.35), transparent 260px),
    linear-gradient(90deg, rgba(122, 162, 255, 0.08), transparent 32%, transparent 68%, rgba(122, 162, 255, 0.04)),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(100% - 24px, var(--container));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 12, 22, 0.96);
}

.topbar-inner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brandline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.brandline strong {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.brandline span,
.topstats span {
  color: var(--muted);
  font-size: 11px;
}

.topstats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 16, 29, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
}

.search-wrap input,
.compact-filters select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(13, 21, 37, 0.94);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search-wrap input {
  width: 100%;
}

.search-wrap input:focus,
.compact-filters select:focus {
  border-color: var(--line-2);
  box-shadow: 0 0 0 2px rgba(122, 162, 255, 0.12);
}

.compact-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.main-shell {
  padding: 12px 0 24px;
}

.folder-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  padding: 0 0 1px;
  scrollbar-width: thin;
}

.folder-tab {
  position: relative;
  border: 1px solid var(--line);
  border-bottom: none;
  background: linear-gradient(180deg, #17233a, #111b2e);
  color: #c8d5ee;
  padding: 9px 14px 8px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
  min-height: 34px;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.folder-tab::before,
.folder-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: transparent;
}

.folder-tab::before {
  left: -10px;
  border-bottom-right-radius: 8px;
  box-shadow: 4px 4px 0 0 transparent;
}

.folder-tab::after {
  right: -10px;
  border-bottom-left-radius: 8px;
  box-shadow: -4px 4px 0 0 transparent;
}

.folder-tab:hover {
  background: linear-gradient(180deg, #1b2a45, #132039);
  color: #edf4ff;
}

.folder-tab.active {
  z-index: 2;
  background: linear-gradient(180deg, #213557, #182843);
  color: #ffffff;
  border-color: var(--line-2);
  transform: translateY(1px);
}

.folder-stage {
  margin-top: -1px;
}

.folder-sheet {
  border: 1px solid var(--line-2);
  border-radius: 0 8px 8px 8px;
  background:
    linear-gradient(180deg, rgba(25, 40, 67, 0.9), rgba(14, 23, 40, 0.97) 120px),
    var(--panel);
  box-shadow: var(--shadow);
  min-height: 60vh;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sheet-head h1 {
  margin: 0 0 3px;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.sheet-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
}

.resource-list {
  display: grid;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resource-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.resource-main {
  min-width: 0;
}

.resource-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.resource-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.resource-summary {
  color: #b1bed7;
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 5px;
  max-width: 980px;
}

.meta-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid #334a70;
  background: rgba(122, 162, 255, 0.08);
  color: #d8e5ff;
  font-size: 10px;
  letter-spacing: 0.01em;
}

.tag.soft {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: #b8c4db;
}

.tag.good {
  background: rgba(131, 211, 163, 0.1);
  border-color: rgba(131, 211, 163, 0.28);
  color: #d8f4e2;
}

.resource-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: #d8e5ff;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn.primary {
  border-color: #3f5f93;
  background: rgba(122, 162, 255, 0.12);
}

.btn.primary:hover {
  background: rgba(122, 162, 255, 0.18);
}

.empty-state {
  padding: 24px 14px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .resource-row {
    grid-template-columns: 1fr;
  }

  .resource-actions {
    justify-content: flex-start;
  }
}