html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}

:root {
  --bv-primary: #2563eb;
  --bv-primary-dark: #1d4ed8;
  --bv-accent: #38bdf8;
  --bv-surface: #ffffff;
  --bv-surface-muted: #f8fbff;
  --bv-text: #0f172a;
  --bv-text-muted: #475569;
  --bv-border: #dbe5f3;
  --bv-input-border: #b8c5d6;
  --bv-input-border-hover: #94a3b8;
  --bv-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

/* Darker input border site-wide for contrast against white backgrounds. */
.form-control,
.form-select {
  border-color: var(--bv-input-border);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
  border-color: var(--bv-input-border-hover);
}

body.app-shell {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--bv-text);
  background: radial-gradient(1200px 600px at 10% 0%, #e0f2fe 0%, #f8fbff 40%, #ffffff 100%);
}

/* Sidebar layout */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 70%);
  border-right: 1px solid var(--bv-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  z-index: 1000;
}

.sidebar-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bv-border);
  margin-bottom: 0.5rem;
}

.sidebar-brand a {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--bv-primary);
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.sidebar-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--bv-text-muted);
  font-weight: 500;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus {
  color: var(--bv-primary);
  background: rgba(37, 99, 235, 0.06);
}

.sidebar-footer {
  padding: 0.5rem 0;
  border-top: 1px solid var(--bv-border);
}

.sidebar-footer .sidebar-session,
.sidebar-footer .sidebar-user {
  padding: 0.25rem 1.25rem;
}

.sidebar-user {
  font-weight: 500;
  color: var(--bv-text);
  margin-bottom: 0;
}

.sidebar-user-type {
  font-size: 0.7rem;
  padding: 0 1.25rem;
  margin-bottom: 0.25rem;
}

.sidebar-session {
  color: var(--bv-text-muted);
  margin-bottom: 0.5rem;
}

.main-content {
  min-height: 100vh;
  padding: 2rem;
}

.main-content.has-sidebar {
  margin-left: 220px;
}

.main-content main {
  padding: 0;
}

.card-panel {
  background: var(--bv-surface);
  border: 1px solid var(--bv-border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--bv-shadow);
  overflow: hidden;
}

.display-4,
.display-5 {
  color: var(--bv-text);
  letter-spacing: -0.02em;
}

.table {
  border-color: var(--bv-border);
}

.table thead {
  background: #eff6ff;
  color: var(--bv-text-muted);
}

.table a {
  color: var(--bv-primary);
  font-weight: 600;
  text-decoration: none;
}

.table a:hover,
.table a:focus {
  color: var(--bv-primary-dark);
  text-decoration: underline;
}

.alert {
  border-radius: 14px;
  border-width: 1px;
}

.alert-danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}


.alert-secondary {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.footer {
  background: transparent;
  color: var(--bv-text-muted);
  padding-top: 1.5rem;
}

.footer a {
  color: var(--bv-primary);
}

.footer a:hover,
.footer a:focus {
  color: var(--bv-primary-dark);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ── Full-bleed pages (login) ─────────────────────────────────────── */
body.app-shell.full-bleed .main-content {
  padding: 0;
  min-height: 100vh;
}

body.app-shell.full-bleed .main-content main {
  padding: 0;
}

body.app-shell.full-bleed {
  background: #ffffff;
}

/* ── Login page split layout ──────────────────────────────────────── */
.login-page {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 1fr;
  min-height: 100vh;
  width: 100%;
}

.login-form-col {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 4rem;
  background: #ffffff;
}

.login-form-inner {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4rem;
}

.login-brand-mark {
  height: 44px;
  width: auto;
}

.login-brand-title {
  height: 18px;
  width: auto;
}

.login-form-body {
  width: 100%;
}

.login-heading {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--bv-text);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: var(--bv-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.login-divider {
  border: 0;
  border-top: 1px solid var(--bv-border);
  margin: 1.75rem 0 1.75rem 0;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.login-field {
  margin-bottom: 1.25rem;
}

.login-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bv-text);
  margin-bottom: 0.4rem;
}

.login-input {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--bv-text-muted);
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.login-input-field {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.5rem;
  border: 1px solid var(--bv-input-border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--bv-text);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-field:hover {
  border-color: var(--bv-input-border-hover);
}

.login-input-field.has-trailing-icon {
  padding-right: 2.75rem;
}

.login-input-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0.35rem;
  color: var(--bv-text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.login-input-toggle:hover,
.login-input-toggle:focus {
  color: var(--bv-text);
  background: rgba(15, 23, 42, 0.05);
  outline: none;
}

.login-input-field::placeholder {
  color: #94a3b8;
}

.login-input-field:focus {
  outline: none;
  border-color: var(--bv-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-forgot {
  margin-bottom: 1.5rem;
}

.login-forgot a {
  color: var(--bv-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.login-forgot a:hover,
.login-forgot a:focus {
  color: var(--bv-primary);
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #2dbd7f;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn-login:hover,
.btn-login:focus {
  background: #26a86f;
  outline: none;
}

.btn-login:active {
  transform: translateY(1px);
}

.login-disclaimer {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--bv-text-muted);
  line-height: 1.5;
}

.login-hero-col {
  position: relative;
  overflow: hidden;
  background: #eef2f7;
}

.login-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Responsive: stack on narrow viewports */
@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-hero-col {
    display: none;
  }
  .login-form-col {
    padding: 2.5rem 1.5rem;
    align-items: center;
  }
  .login-brand {
    margin-bottom: 2.5rem;
  }
}