:root {
  --dpdk-blue: #0e4577;
  --dpdk-light: #1a6bb5;
  --accent: #e8740c;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1e1e1e;
  --text-muted: #5a6670;
  --border: #d1d9e0;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--dpdk-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navigation ---------- */

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--dpdk-blue);
  color: #fff;
  padding: 0 1.5rem;
  height: 3.2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .15rem;
  text-decoration: none;
}
.nav-brand:hover { opacity: .9; text-decoration: none; }
.nav-brand img { height: 2.4rem; }
.nav-brand span {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .3px;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: .15rem;
}

.nav-links a {
  color: rgba(255,255,255,.8);
  padding: .55rem .85rem;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background .15s;
}
.nav-links a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-links a.active { background: rgba(255,255,255,.18); color: #fff; }

.nav-cache { margin-left: auto; }
.nav-cache button {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.85);
  padding: .3rem .7rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .8rem;
}
.nav-cache button:hover { background: rgba(255,255,255,.1); }

/* ---------- Main content ---------- */

main {
  padding: 1.5rem 2rem;
}

h1 { margin-top: 0; color: var(--dpdk-blue); font-size: 1.6rem; }
h2 { color: var(--dpdk-blue); font-size: 1.2rem; margin-top: 2rem; }

.badge {
  background: var(--dpdk-light);
  color: #fff;
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 10px;
  vertical-align: middle;
}

.count { color: var(--text-muted); font-size: .95rem; }

/* ---------- Flash messages ---------- */

.flash-messages { margin-bottom: 1rem; }
.flash {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: .4rem;
}

/* ---------- Cards (index page) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: box-shadow .15s, border-color .15s;
  color: var(--text);
}
.card:hover {
  border-color: var(--dpdk-light);
  box-shadow: 0 2px 8px rgba(14,69,119,.12);
  text-decoration: none;
}
.card h2 { margin: 0 0 .4rem; font-size: 1.1rem; color: var(--dpdk-blue); }
.card p { margin: 0; font-size: .9rem; color: var(--text-muted); }


/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .8rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.filters label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }

.filters select, .filters button {
  font-size: .85rem;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filters input[type="text"] {
  font-size: .85rem;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 16ch;
}

.filters button {
  background: var(--dpdk-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: .4rem 1.2rem;
  min-width: 9rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.filters button:hover { background: var(--dpdk-light); }

/* ---------- Spinner ---------- */

.spinner {
  display: inline-block;
  width: .9em;
  height: .9em;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
.spinner--dark {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--dpdk-blue);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
}

th, td {
  text-align: left;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.sort-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}
.sort-link:hover { color: var(--dpdk-blue); text-decoration: none; }
.sort-link.active { color: var(--dpdk-blue); }

tbody tr:hover { background: #f0f4f8; }

td.date { white-space: nowrap; font-size: .8rem; color: var(--text-muted); }

.result-count { font-size: .9rem; color: var(--text-muted); margin: 0 0 .6rem; }

td.excerpt {
  font-size: .82rem;
  color: var(--text-muted);
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reload-cell { width: 2rem; text-align: center; }
.reload-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0;
}
.reload-btn:hover { background: var(--bg); color: var(--dpdk-blue); }
.reload-btn.reload-ok { color: #28a745; border-color: #28a745; }
.reload-btn.reload-fail { color: #dc3545; border-color: #dc3545; }

/* ---------- Priority badges ---------- */

.priority {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 3px;
  font-size: .8rem;
  font-weight: 600;
}
.priority-highest { background: #dc3545; color: #fff; }
.priority-high    { background: #fd7e14; color: #fff; }
.priority-normal  { background: #6c757d; color: #fff; }
.priority-low     { background: #17a2b8; color: #fff; }
.priority-lowest  { background: #adb5bd; color: #333; }
.priority---      { background: #e9ecef; color: #555; }

.status-fail { color: #dc3545; font-weight: 600; }

/* ---------- API key box ---------- */

.api-key-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  margin-bottom: 1rem;
  font-size: .85rem;
}
.api-key-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}
.api-key-box p { margin: .4rem 0; color: var(--text-muted); font-size: .82rem; }
.api-key-input {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
}
.api-key-input input {
  font-size: .85rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 22ch;
}
.api-key-input button {
  font-size: .8rem;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}
.api-key-input button:hover { background: var(--border); }
#bz-api-key-status { font-size: .8rem; color: #28a745; }

/* ---------- Maintainer ---------- */

.maintainer { font-weight: 500; white-space: nowrap; }
a.maintainer {
  color: var(--dpdk-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 1.6em;
  padding-right: 1.2em;
}
a.maintainer:hover { text-decoration: underline; }
a.maintainer.assigning { opacity: .5; pointer-events: none; }
a.maintainer.assign-ok { color: #28a745; }
a.maintainer.assign-fail { color: #dc3545; }
.unknown { color: var(--text-muted); }


/* ---------- Notice (placeholder pages) ---------- */

.todo-list {
  list-style: none;
  padding: 0;
  max-width: 600px;
}
.todo-list li {
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.todo-list li::before {
  content: "☐ ";
  color: var(--text-muted);
}

.notice {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  max-width: 600px;
}
.notice p { margin: .3rem 0; }
.notice code {
  background: #eef1f5;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-size: .85rem;
}
