* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  color: #333;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #f0f2f5;
}

/* ── Navbar ─────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 2rem;
  color: #fff;
  background: linear-gradient(135deg, #1a5fa8, #2c8fc9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-user {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
}

.navbar-logout {
  padding: 0.3rem 0.9rem;
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: background 0.2s;
}

.navbar-logout:hover {
  background: rgba(255, 255, 255, 0.35);
}

.navbar-links {
  display: flex;
  align-items: center;
}

.navbar-home {
  padding: 0.3rem 0.9rem;
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: background 0.2s;
}

.navbar-home:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ── Page container ─────────────────────── */
.page {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}

/* ── Footer ─────────────────────────────── */
.footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  padding: 0.6rem 2rem;
  color: #aaa;
  font-size: 0.85rem;
  text-align: center;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.footer a {
  color: #999;
  text-decoration: none;
}

.footer a:hover {
  color: #666;
  text-decoration: underline;
}

/* ── Typography ─────────────────────────── */
h1 {
  margin-bottom: 0.3rem;
  padding-bottom: 0.5rem;
  color: #1a5fa8;
  font-size: 1.8rem;
  font-weight: 700;
  border-bottom: 2px solid #dde3ea;
}

h2 {
  margin: 0 0 0.4rem;
  color: #1a5fa8;
  font-size: 1rem;
  font-weight: 600;
}

a {
  color: #1a5fa8;
}

p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

ul,
li {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

ul.circle,
ul.circle > li {
  margin-left: 1.5rem;
  list-style-type: circle;
}

/* ── Home header ────────────────────────── */
.home-header {
  padding: 3rem 0 1.5rem;
  text-align: center;
}

.home-header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1a5fa8, #2c8fc9);
  border: none;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-subtitle {
  margin-top: 0.3rem;
  color: #888;
  font-size: 1rem;
  font-weight: 400;
}

/* ── Card grid ──────────────────────────── */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  display: block;
  width: calc(50% - 0.75rem);
  padding: 1.8rem;
  color: #333;
  text-decoration: none;
  background: white;
  border-top: 4px solid #2c8fc9;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.card-icon {
  margin-bottom: 0.8rem;
  font-size: 2rem;
}

.card h2 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.card-disabled {
  cursor: not-allowed;
  opacity: 0.5;
  border-top-color: #cccc;
}

.card-disabled-hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.card-unavailable {
  margin-top: 0.75rem !important;
  color: #aaa !important;
  font-size: 0.8rem !important;
  font-style: italic;
}

/* ── Login form ─────────────────────────── */
.login-box {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
  margin-bottom: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
  border: none;
}

.login-box p {
  margin-bottom: 1rem;
  color: #555;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
  outline: none;
  border-color: #2c8fc9;
}

.login-box input[type="submit"] {
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.75rem;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1a5fa8, #2c8fc9);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-box input[type="submit"]:hover {
  opacity: 0.9;
}

/* ── Upload / Form box ──────────────────── */
.form-box {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.form-box input[type="submit"] {
  margin-top: 1rem;
  padding: 0.65rem 2rem;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1a5fa8, #2c8fc9);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.form-box input[type="submit"]:hover {
  opacity: 0.9;
}

/* ── Section link lists (Miscellaneous page) */
.section-group {
  margin-bottom: 1.5rem;
}

.section-group:last-child {
  margin-bottom: 0;
}

.section-group > h2 {
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  color: #999;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid #eee;
}

.section-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-links li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #f4f4f4;
}

.section-links li:last-child {
  border-bottom: none;
}

.section-links a {
  color: #1a5fa8;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.section-links a:hover {
  text-decoration: underline;
}

/* ── Danger button ───────────────────────── */
input.btn-danger {
  background: linear-gradient(135deg, #c0392b, #e74c3c) !important;
}

input.btn-danger:hover {
  opacity: 0.85;
}

/* ── Data tables (pandas HTML output) ───── */
table {
  width: 100%;
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
  border-collapse: collapse;
}

th {
  padding: 0.5rem 0.75rem;
  color: #1a5fa8;
  font-weight: 600;
  text-align: left;
  background: #f0f4f8;
  border-bottom: 2px solid #dde3ea;
}

td {
  padding: 0.4rem 0.75rem;
  color: #444;
  border-bottom: 1px solid #eee;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f7f9fc;
}

/* ── Flash & Error messages ─────────────── */
.flash {
  margin-bottom: 0.5rem;
  padding: 0.7rem 1rem;
  color: #1a5fa8;
  font-size: 0.9rem;
  background: #e8f4fd;
  border-left: 4px solid #2c8fc9;
  border-radius: 6px;
}

.error {
  padding: 0.7rem 1rem;
  color: #c0392b;
  font-size: 0.9rem;
  background: #fdecea;
  border-left: 4px solid #e74c3c;
  border-radius: 6px;
}
