/*
 * Professional blue theme — overrides the template's default purple.
 * Loaded after core.css / demo.css, so only values that differ are set here.
 */

:root,
[data-bs-theme="light"] {
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-primary-text-emphasis: #1e3a8a;
  --bs-primary-bg-subtle: #dbeafe;
  --bs-primary-border-subtle: #bfdbfe;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-link-hover-color-rgb: 29, 78, 216;
  --bs-body-bg: #f3f6fb;
  --bs-body-bg-rgb: 243, 246, 251;
  --bs-purple: #2563eb;
}

body,
.layout-page,
.content-wrapper {
  background-color: #f3f6fb;
}

/* Buttons */
.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1e40af;
  --bs-btn-active-border-color: #1e40af;
  --bs-btn-disabled-bg: #2563eb;
  --bs-btn-disabled-border-color: #2563eb;
  --bs-btn-focus-shadow-rgb: 37, 99, 235;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary {
  --bs-btn-color: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #2563eb;
  --bs-btn-hover-border-color: #2563eb;
  --bs-btn-active-bg: #2563eb;
  --bs-btn-active-border-color: #2563eb;
  --bs-btn-disabled-color: #2563eb;
  --bs-btn-disabled-border-color: #2563eb;
  --bs-btn-focus-shadow-rgb: 37, 99, 235;
}

/* Secondary action buttons: slate instead of green */
.btn-success {
  --bs-btn-bg: #334155;
  --bs-btn-border-color: #334155;
  --bs-btn-hover-bg: #1e293b;
  --bs-btn-hover-border-color: #1e293b;
  --bs-btn-active-bg: #0f172a;
  --bs-btn-active-border-color: #0f172a;
  --bs-btn-disabled-bg: #334155;
  --bs-btn-disabled-border-color: #334155;
  --bs-btn-focus-shadow-rgb: 51, 65, 85;
  box-shadow: 0 2px 4px rgba(51, 65, 85, 0.3) !important;
}

.btn-outline-success {
  --bs-btn-color: #334155;
  --bs-btn-border-color: #334155;
  --bs-btn-hover-bg: #334155;
  --bs-btn-hover-border-color: #334155;
  --bs-btn-active-bg: #334155;
  --bs-btn-active-border-color: #334155;
}

.badge.bg-success,
.bg-label-success {
  background-color: #dbeafe !important;
  color: #1e40af !important;
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.15);
}

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
  background-color: #2563eb;
  border-color: #2563eb;
}

.form-check-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.15);
}

/* Soft primary labels, badges, links */
.bg-label-primary {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
}

.bg-primary {
  background-color: #2563eb !important;
}

.text-primary {
  color: #2563eb !important;
}

.list-group-item.active {
  background-color: #2563eb;
  border-color: #2563eb;
}

.page-item.active .page-link {
  background-color: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.nav-pills .nav-link.active {
  background-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Cards: crisper, more corporate */
.card {
  border: 1px solid #e3e9f3;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.table thead th {
  background-color: #f8fafc;
  color: #475569;
}

/* Flash messages: always full width, solid left accent */
.alert {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 0.5rem;
  box-shadow: none;
}

.alert ul {
  padding-left: 1.1rem;
}

.alert-success {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  color: #1e40af;
}

.alert-danger {
  background: #fef3f2;
  border-color: #fecdca;
  border-left-color: #f04438;
  color: #b42318;
}

.alert-warning {
  background: #fffaeb;
  border-color: #fedf89;
  border-left-color: #f79009;
  color: #b54708;
}

.alert-info,
.alert-secondary {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  color: #1e40af;
}

/* Outline buttons: no template glow, white fill so they sit cleanly on the page background */
.btn-outline-primary {
  background-color: #fff;
  box-shadow: none !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: #2563eb;
  color: #fff;
}

/* ==========================================================================
   Modern admin look — flatter surfaces, more whitespace, softer corners.
   Everything below is additive; the Sneat template files are untouched.
   ========================================================================== */

:root,
[data-bs-theme="light"] {
  --bs-border-radius: 0.6rem;
  --bs-border-radius-sm: 0.45rem;
  --bs-border-radius-lg: 0.85rem;
  --bs-card-border-radius: 0.85rem;
  --bs-body-color: #334155;
  --bs-heading-color: #0f172a;
}

body {
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Flatten the floating "detached" navbar into a plain sticky top bar. */
.layout-navbar.navbar-detached {
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-block: 0 !important;
  inline-size: 100% !important;
  max-inline-size: none !important;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line, #e3e9f3);
}

.layout-navbar {
  min-block-size: 4rem;
}

/* Sidebar: flat white surface with a hairline border instead of a shadow. */
:root {
  --bs-menu-bg: #ffffff;
  --bs-menu-box-shadow: none;
  --bs-menu-item-spacer: 0.25rem;
  --bs-menu-vertical-link-padding-y: 0.6rem;
  --bs-menu-vertical-link-padding-x: 1rem;
}

.layout-menu {
  border-inline-end: 1px solid #e3e9f3;
}

.menu-vertical .menu-inner > .menu-item > .menu-link {
  border-radius: 0.6rem;
  font-weight: 500;
  font-size: 0.92rem;
}

.menu-inner-shadow {
  display: none;
}

.app-brand {
  padding-block: 1.3rem 1rem !important;
}

/* Google-account-style fallback avatar: initials on a colored circle, same
   footprint as the 34px logo image so swapping between the two doesn't shift
   the brand bar's layout. */
.app-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex: none;
}

.menu-divider {
  border-color: #eef2f8 !important;
}

/* Profile avatar initials, used instead of a generic stock photo. */
.avatar-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Cards: airy padding, hairline border, barely-there shadow. */
.card {
  border-radius: var(--bs-card-border-radius);
}

.card .card-header {
  background: transparent;
  font-weight: 600;
  border-bottom: 1px solid #eef2f8;
}

/* Tables: quieter borders, more breathing room per row. */
.table > :not(caption) > * > * {
  padding-block: 0.85rem;
  border-bottom-color: #eef2f8;
}

.table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom-width: 1px;
}

/* Dropdowns: soften the default template shadow/border. */
.dropdown-menu {
  border: 1px solid #eef2f8;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-radius: 0.75rem;
}

/* Footer: quiet, no border-top card look. */
.content-footer.footer {
  background: transparent;
  border-top: 1px solid #eef2f8;
}

/* Slimmer, modern scrollbar inside the sidebar menu. */
.menu-inner::-webkit-scrollbar {
  width: 6px;
}

.menu-inner::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 999px;
}

/* Sidebar collapse toggle: a pinned circular button on the brand bar's edge.
   Positioned relative to .app-brand so it tracks the sidebar's own width,
   correctly hugging the edge whether the sidebar is expanded or collapsed. */
.app-brand {
  position: relative;
}

.sidebar-collapse-btn {
  position: absolute;
  inset-inline-end: -14px;
  inset-block-start: 1.4rem;
  z-index: 5;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-collapse-btn:hover {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
}

.sidebar-collapse-btn i {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

/* Point the arrow the other way once collapsed, so it always hints at what clicking it will do. */
.layout-menu-collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

/* Collapsed sidebar: the brand bar is only ~84px wide, too tight for the full
   name as well. Keep the logo/initials mark, drop the text, and center what's
   left so it doesn't fight the pinned toggle button for space. */
.layout-menu-collapsed .app-brand-link {
  justify-content: center;
  margin-inline-end: 0;
}

.layout-menu-collapsed .app-brand-link .app-brand-text {
  display: none;
}

.layout-menu-collapsed .app-brand-link img,
.layout-menu-collapsed .app-brand-link .app-brand-mark {
  margin-inline-end: 0 !important;
}

/* Small circular icon badge used on dashboard cards (e.g. WhatsApp account summary). */
.icon-wrap {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: var(--bs-primary-bg-subtle, #dbeafe);
  color: var(--bs-primary);
  display: grid;
  place-items: center;
}
