:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #d8dce1;
  --color-text: #1f2430;
  --color-muted: #5b6472;
  --color-primary: #2952a3;
  --color-danger: #b3261e;
  --color-success: #1d7a4c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans Bengali", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: var(--color-primary); }

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}

.app-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.app-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
}
.app-nav a:hover { text-decoration: underline; }
.app-nav a.active {
  background: var(--color-primary);
  color: #fff;
}
.app-nav a.active:hover { text-decoration: none; opacity: 0.92; }

.app-main {
  max-width: 90%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 420px;
  margin: 0 auto;
}

.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.form-row input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { opacity: 0.92; }

.errorlist { color: var(--color-danger); list-style: none; padding: 0; margin: 0 0 0.75rem; }
.helptext { color: var(--color-muted); font-size: 0.85rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.messages .success { background: #e6f4ea; color: var(--color-success); }
.messages .error { background: #fbe9e7; color: var(--color-danger); }

.report-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(31, 36, 48, 0.08);
  background: var(--color-surface);
}

table.report-table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  white-space: nowrap;
}

table.report-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}
table.report-table thead th:first-child { border-top-left-radius: 10px; }
table.report-table thead th:last-child { border-top-right-radius: 10px; }
table.report-table th a { color: inherit; text-decoration: none; }
table.report-table th a:hover { text-decoration: underline; }

table.report-table td {
  text-align: left;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

table.report-table tbody tr:nth-child(even) { background: #f7f8fa; }
table.report-table tbody tr:hover { background: #eef2fb; }
table.report-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e8eaf0;
  color: var(--color-text);
}
.badge-hot { background: #fbe2e0; color: #9a2c22; }
.badge-warm { background: #fdf0d5; color: #8a5a00; }
.badge-cold { background: #e1edfb; color: #1f4e8c; }
.badge-dead { background: #e8eaf0; color: var(--color-muted); }
.badge-review { background: #fdf0d5; color: #8a5a00; }

.pagination { display: flex; gap: 0.5rem; margin-top: 1rem; }

.empty-state {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 1rem;
}

.upload-progress {
  margin: 1rem 0;
}

/* Bootstrap 5's .progress/.progress-bar component, reproduced directly
   rather than loading the whole Bootstrap CSS bundle -- this page already
   uses app.css's own .btn/.card/.form-row classes, and Bootstrap defines
   those exact same class names with different rules, which would clobber
   them if the full framework were loaded here. */
.progress {
  display: flex;
  height: 1.25rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: var(--color-border);
  border-radius: 0.375rem;
}
.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  width: 0;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}
.progress-bar.bg-danger {
  background-color: var(--color-danger);
}

.upload-progress-status {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}
