:root {
  --red:       #cc0e0e;
  --red-dark:  #a50b0b;
  --text:      #1a1a1a;
  --muted:     #6b7280;
  --bg:        #f3f4f6;
  --card:      #ffffff;
  --border:    #e5e7eb;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-h:  0 6px 18px rgba(0,0,0,.13);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────── */
header {
  background: var(--red);
  color: #fff;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  text-decoration: none;
  line-height: 1;
}
.header-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: .8;
  margin-left: auto;
}

/* ── Main ───────────────────────────────── */
main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 48px;
  flex: 1;
}

/* ── Search ─────────────────────────────── */
.search-wrap {
  position: relative;
  max-width: 500px;
  margin-bottom: 8px;
}
.search-wrap .ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
#searchInput {
  width: 100%;
  padding: 11px 16px 11px 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
#searchInput:focus { border-color: var(--red); }

#countLabel {
  margin-bottom: 24px;
  font-size: .82rem;
  color: var(--muted);
  min-height: 1.2em;
}

/* ── Grid ───────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Card ───────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-3px);
}
.card-icon { color: var(--red); flex-shrink: 0; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.card-date  { font-size: .78rem; color: var(--muted); }
.card-desc  { font-size: .84rem; color: var(--muted); flex: 1; }

.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); }

/* ── Empty state ─────────────────────────── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty svg { opacity: .3; margin-bottom: 14px; }
.empty p { font-size: .95rem; line-height: 1.7; }

/* ── Toast ───────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #111;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: transform .3s ease;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Footer ──────────────────────────────── */
footer {
  text-align: center;
  padding: 20px 24px;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--red); text-decoration: none; }
footer a:hover { text-decoration: underline; }
