:root {
  --bq-accent: #4361ee;
  --bq-accent-dark: #3a56d4;
  --bq-bg: #f6f7fb;
  --bq-card-bg: #ffffff;
  --bq-border: #edeff5;
  --bq-text: #1e2233;
  --bq-muted: #8890a3;
  --bq-radius: 12px;
  --bq-shadow: 0 2px 10px rgba(20, 25, 60, 0.05);
  --bq-sidebar-w: 250px;
}

* { box-sizing: border-box; }

body {
  background: var(--bq-bg);
  color: var(--bq-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { text-decoration: none; }

/* ---------- Cards ---------- */
.bq-card {
  background: var(--bq-card-bg);
  border: 1px solid var(--bq-border);
  border-radius: var(--bq-radius);
  box-shadow: var(--bq-shadow);
}

/* ---------- Buttons ---------- */
.btn-bq-primary {
  background: var(--bq-accent);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  transition: background 0.15s ease;
}
.btn-bq-primary:hover { background: var(--bq-accent-dark); color: #fff; }
.btn-bq-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-bq-outline {
  background: #fff;
  border: 1px solid var(--bq-border);
  color: var(--bq-text);
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-weight: 500;
}
.btn-bq-outline:hover { background: #f4f6fb; }

/* ---------- Auth pages ---------- */
.bq-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.bq-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
}
.bq-auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.bq-auth-logo .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bq-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bq-auth-logo .brand { font-weight: 700; font-size: 1.25rem; }

.bq-form-control {
  border: 1px solid var(--bq-border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  width: 100%;
  background: #fbfbfe;
}
.bq-form-control:focus {
  outline: none;
  border-color: var(--bq-accent);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
  background: #fff;
}

.bq-otp-input {
  letter-spacing: 10px;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.bq-alert-error {
  background: #fdecec;
  color: #c0392b;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.bq-alert-success {
  background: #e9f9ef;
  color: #1f9d55;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.bq-muted { color: var(--bq-muted); }

/* ---------- App shell (sidebar layout, used from PART 4 onward) ---------- */
.bq-sidebar {
  width: var(--bq-sidebar-w);
  background: #fff;
  border-right: 1px solid var(--bq-border);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
}
.bq-content {
  margin-left: var(--bq-sidebar-w);
  padding: 1.5rem 2rem;
}
@media (max-width: 992px) {
  .bq-sidebar { transform: translateX(-100%); transition: transform 0.2s ease; z-index: 1050; }
  .bq-sidebar.show { transform: translateX(0); }
  .bq-content { margin-left: 0; padding: 1rem; }
}

/* ---------- Animations (light, per spec section 39: fade/slide/hover only) ---------- */
@keyframes bq-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.bq-card, .bq-fade-in {
  animation: bq-fade-in 0.25s ease both;
}
.bq-card {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
a.bq-card:hover, .bq-card.bq-hoverable:hover {
  box-shadow: 0 6px 18px rgba(20, 25, 60, 0.08);
}
.btn-bq-primary, .btn-bq-outline {
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.btn-bq-primary:active, .btn-bq-outline:active { transform: scale(0.98); }

/* ---------- Loading skeleton ---------- */
@keyframes bq-skeleton-pulse {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.bq-skeleton {
  background: #eef0f6;
  background-image: linear-gradient(90deg, #eef0f6 0px, #f6f7fb 40px, #eef0f6 80px);
  background-size: 200px 100%;
  animation: bq-skeleton-pulse 1.2s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
}

/* ---------- Responsive tables -> stacked cards on mobile ---------- */
@media (max-width: 767px) {
  table.bq-responsive-table thead { display: none; }
  table.bq-responsive-table, table.bq-responsive-table tbody, table.bq-responsive-table tr, table.bq-responsive-table td {
    display: block; width: 100%;
  }
  table.bq-responsive-table tr {
    border: 1px solid var(--bq-border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  table.bq-responsive-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
    border: none !important;
    padding: 0.35rem 0 !important;
  }
  table.bq-responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--bq-muted);
    text-align: left;
  }
  table.bq-responsive-table td:empty { display: none; }
}

/* ---------- Toast container ---------- */
#bqToastContainer { z-index: 1080; }
