:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5c6570;
  --border: #d8dde3;
  --accent: #1f4e79;
  --accent-soft: #e8f0f7;
  --visa: #1f4e79;
  --finance: #1e6b4f;
  --insurance: #6b4f1e;
  --medical: #6b1e3a;
  --tasks: #3d3d6b;
  --radius: 8px;
  --shadow: none;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.05);
  background: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
}

.card.placeholder {
  opacity: 0.72;
  border-style: dashed;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.visa { color: var(--visa); background: #e8f0f7; }
.badge.finance { color: var(--finance); background: #e7f5ef; }
.badge.insurance { color: var(--insurance); background: #f5efe7; }
.badge.medical { color: var(--medical); background: #f5e7ed; }
.badge.tasks { color: var(--tasks); background: #ececf5; }

.card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.card .desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 18px;
}

.panel[hidden] {
  display: none !important;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.panel .path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-list li:nth-child(even) {
  background: #fafbfc;
}

.file-list .name {
  font-weight: 600;
}

.file-list .meta-line {
  color: var(--muted);
  font-size: 0.82rem;
}

.kind {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.empty,
.error,
.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.error {
  color: #8a1f1f;
}

.footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer code {
  font-size: 0.84rem;
  background: #eef1f4;
  padding: 1px 5px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .app {
    padding: 18px 14px 36px;
  }

  .header h1 {
    font-size: 1.35rem;
  }
}
