/* Branch Performance System – modern responsive theme */
:root {
  --bps-primary: #0d6efd;
  --bps-primary-dark: #0a58ca;
  --bps-surface: #ffffff;
  --bps-surface-elevated: #ffffff;
  --bps-bg: #f0f4f8;
  --bps-bg-subtle: #e8eef4;
  --bps-border: rgba(0, 0, 0, 0.08);
  --bps-border-strong: rgba(0, 0, 0, 0.12);
  --bps-radius: 12px;
  --bps-radius-sm: 8px;
  --bps-radius-lg: 16px;
  --bps-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --bps-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --bps-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --bps-navbar-bg: #1a1d29;
  --bps-navbar-text: rgba(255, 255, 255, 0.9);
  --bps-navbar-hover: rgba(255, 255, 255, 0.15);
  --bps-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --bps-transition: 0.2s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--bps-font-sans);
  background: var(--bps-bg);
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Optional: load Inter for a more modern look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ----- Navbar ----- */
.bps-navbar {
  background: var(--bps-navbar-bg) !important;
  box-shadow: var(--bps-shadow-md);
  padding: 0.5rem 0;
}

.bps-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff !important;
}

.bps-navbar .nav-link {
  color: var(--bps-navbar-text) !important;
  border-radius: var(--bps-radius-sm);
  padding: 0.5rem 0.75rem !important;
  transition: background var(--bps-transition);
}

.bps-navbar .nav-link:hover {
  background: var(--bps-navbar-hover);
  color: #fff !important;
}

.bps-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
  padding: 0.35rem 0.6rem;
}

.bps-navbar .navbar-toggler-icon {
  filter: invert(1);
}

.bps-navbar .navbar-text {
  color: rgba(255, 255, 255, 0.7) !important;
}

@media (max-width: 991.98px) {
  .bps-navbar .navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .bps-navbar .nav-link {
    padding: 0.6rem 0.75rem !important;
  }
}

/* ----- Main content ----- */
.bps-main {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  min-height: calc(100vh - 56px);
}

@media (min-width: 768px) {
  .bps-main {
    padding-top: 2rem;
  }
}

/* ----- Page titles ----- */
.bps-page-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 1.25rem;
}

h2.bps-page-title, .bps-page-title.h2 { font-size: 1.5rem; }
h3.bps-page-title, .bps-page-title.h3 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h2.bps-page-title, .bps-page-title.h2 { font-size: 1.75rem; }
  h3.bps-page-title, .bps-page-title.h3 { font-size: 1.35rem; }
}

/* ----- Cards ----- */
.bps-card, .card.shadow-sm {
  border: 1px solid var(--bps-border);
  border-radius: var(--bps-radius);
  box-shadow: var(--bps-shadow);
  background: var(--bps-surface);
  transition: box-shadow var(--bps-transition), border-color var(--bps-transition);
}

.bps-card:hover, .card.shadow-sm:hover {
  box-shadow: var(--bps-shadow-md);
  border-color: var(--bps-border-strong);
}

.bps-card .card-body, .card.shadow-sm .card-body {
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .bps-card .card-body, .card.shadow-sm .card-body {
    padding: 1.5rem;
  }
}

/* ----- Dashboard stat cards ----- */
.bps-stat-card {
  height: 100%;
  border-radius: var(--bps-radius);
  border: 1px solid var(--bps-border);
  background: var(--bps-surface);
  box-shadow: var(--bps-shadow);
  transition: transform var(--bps-transition), box-shadow var(--bps-transition);
}

.bps-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bps-shadow-md);
}

.bps-stat-card .card-body {
  padding: 1.25rem;
}

.bps-stat-card .text-muted {
  font-size: 0.8125rem;
  color: #64748b !important;
}

.bps-stat-card .fs-4 {
  font-weight: 700;
  color: #0f172a;
}

/* ----- Forms ----- */
.form-control, .form-select {
  border-radius: var(--bps-radius-sm);
  border: 1px solid var(--bps-border-strong);
  padding: 0.5rem 0.75rem;
  transition: border-color var(--bps-transition), box-shadow var(--bps-transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--bps-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

/* ----- Buttons ----- */
.btn {
  border-radius: var(--bps-radius-sm);
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--bps-primary);
  border-color: var(--bps-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: var(--bps-primary-dark);
  border-color: var(--bps-primary-dark);
  box-shadow: var(--bps-shadow);
}

/* ----- Tables ----- */
.table-responsive {
  border-radius: var(--bps-radius);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bps-border-strong);
  white-space: nowrap;
}

.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.table-bordered thead th,
.table-bordered tbody td {
  border-color: var(--bps-border);
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
  background: rgba(13, 110, 253, 0.04);
}

.table-dark {
  background: var(--bps-navbar-bg) !important;
  color: #fff;
}

.table-dark th {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Responsive: allow horizontal scroll on small screens */
@media (max-width: 767.98px) {
  .table thead th,
  .table tbody td {
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
  }
  .table-responsive {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ----- Alerts ----- */
.alert {
  border-radius: var(--bps-radius-sm);
  border: 1px solid transparent;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ----- Badges ----- */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

/* ----- Auth pages (login/register) ----- */
.bps-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.bps-auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--bps-radius-lg);
  border: 1px solid var(--bps-border);
  box-shadow: var(--bps-shadow-lg);
  background: var(--bps-surface);
  overflow: hidden;
}

.bps-auth-card .card-body {
  padding: 1.75rem;
}

@media (min-width: 768px) {
  .bps-auth-card .card-body {
    padding: 2rem;
  }
}

.bps-auth-card h4,
.bps-auth-card h3 {
  font-weight: 700;
  color: #0f172a;
}

.bps-auth-card .btn {
  padding: 0.6rem 1rem;
}

/* ----- Grid responsiveness ----- */
.bps-dashboard-grid .col-md-3 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 576px) {
  .bps-dashboard-grid .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 768px) {
  .bps-dashboard-grid .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* Form rows: stack on mobile */
.bps-form-row .col-md-4,
.bps-form-row .col-md-3,
.bps-form-row .col-md-2 {
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .bps-form-row .col-md-4,
  .bps-form-row .col-md-3,
  .bps-form-row .col-md-2 {
    margin-bottom: 0;
  }
}

/* ----- Utility ----- */
.bps-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .bps-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Links in content */
main a:not(.btn) {
  color: var(--bps-primary);
  text-decoration: none;
  font-weight: 500;
}

main a:not(.btn):hover {
  text-decoration: underline;
}

/* Code in text */
code {
  background: var(--bps-bg-subtle);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
