/* ==========================================================================
   Red & White brand theme
   --------------------------------------------------------------------------
   Layered on top of the (recoloured) Tabler theme. The compiled Tabler CSS
   carries the primary colour as hard-coded hex values, so
   `tools/recolor-theme.py` handles the component colours; this file adds the
   brand's visual language:

     * warm off-white page canvas
     * white surfaces with soft, low-contrast shadows and rounded corners
     * a deep red gradient down the vertical menu (the "hero" red block)
     * a clean white top navbar
     * red used for every accent, action and highlighted figure

   Loaded last on every page so it wins the cascade.
   ========================================================================== */

:root {
  --rw-red: #c1272d;
  --rw-red-hover: #a31f24;
  --rw-red-dark: #8e1b24;
  --rw-red-deep: #75141c;
  --rw-red-soft: #fbe7e5;
  --rw-red-tint: #f6d8d6;
  --rw-red-line: #f0c9c6;

  --rw-bg: #f7f4f4;
  --rw-surface: #ffffff;
  --rw-text: #212529;
  --rw-muted: #6e6e73;
  --rw-border: #efe9e9;

  --rw-radius: 12px;
  --rw-radius-lg: 16px;
  --rw-shadow: 0 2px 10px rgba(26, 16, 16, 0.05);
  --rw-shadow-md: 0 4px 16px rgba(26, 16, 16, 0.07);
  --rw-shadow-lg: 0 10px 34px rgba(26, 16, 16, 0.1);
}

/* --------------------------------------------------------------------------
   Canvas
   -------------------------------------------------------------------------- */

body {
  background-color: var(--rw-bg);
  color: var(--rw-text);
}

.content-wrapper,
.page-body {
  background-color: transparent;
}

/* --------------------------------------------------------------------------
   Surfaces — white cards, soft shadows, rounded corners
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--rw-surface);
  border: 1px solid var(--rw-border);
  border-radius: var(--rw-radius);
  box-shadow: var(--rw-shadow);
}

.card-header {
  background-color: var(--rw-surface);
  border-bottom: 1px solid var(--rw-border);
  border-radius: var(--rw-radius) var(--rw-radius) 0 0;
  font-weight: 600;
}

.card-footer {
  background-color: var(--rw-surface);
  border-top: 1px solid var(--rw-border);
  border-radius: 0 0 var(--rw-radius) var(--rw-radius);
}

.card-title {
  color: var(--rw-text);
  font-weight: 700;
}

.card-subtitle,
.text-muted {
  color: var(--rw-muted) !important;
}

/* --------------------------------------------------------------------------
   Vertical menu — the deep red gradient block
   -------------------------------------------------------------------------- */

.layout-menu,
.menu.bg-menu-theme {
  background: linear-gradient(180deg, #a9232a 0%, var(--rw-red-dark) 55%, var(--rw-red-deep) 100%);
  color: #fff;
}

.layout-menu .app-brand,
.app-brand.demo {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.app-brand-link,
.app-brand-title,
.app-brand.demo .app-brand-text {
  color: #fff;
}

.menu.bg-menu-theme .menu-link {
  color: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.menu.bg-menu-theme .menu-link:hover,
.menu.bg-menu-theme .menu-link:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.menu.bg-menu-theme .menu-item.active > .menu-link,
.menu.bg-menu-theme .menu-item.active > .menu-link.menu-toggle,
.menu.bg-menu-theme .menu-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.18) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.menu.bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
  background-color: rgba(255, 255, 255, 0.18) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.menu.bg-menu-theme .menu-icon {
  color: rgba(255, 255, 255, 0.82);
}

.menu.bg-menu-theme .menu-item.active > .menu-link .menu-icon,
.menu.bg-menu-theme .menu-link.active .menu-icon {
  color: #fff;
}

.menu.bg-menu-theme .menu-header-text {
  color: rgba(255, 255, 255, 0.55);
}

.menu.bg-menu-theme .menu-sub > .menu-item > .menu-link {
  color: rgba(255, 255, 255, 0.68);
}

.menu.bg-menu-theme .menu-sub > .menu-item > .menu-link:hover {
  color: #fff;
}

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

/* --------------------------------------------------------------------------
   Top navbar — clean white bar
   -------------------------------------------------------------------------- */

.navbar.bg-navbar-theme,
.navbar.navbar-detached {
  background-color: var(--rw-surface);
  border-bottom: 1px solid var(--rw-border);
  box-shadow: var(--rw-shadow);
}

.navbar.bg-navbar-theme .nav-link,
.navbar.bg-navbar-theme .navbar-brand,
.navbar.bg-navbar-theme .navbar-text {
  color: var(--rw-text);
}

.navbar.bg-navbar-theme .nav-link:hover {
  color: var(--rw-red);
}

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */

.page-header {
  margin-bottom: 1rem;
}

.page-header .page-title {
  color: var(--rw-text);
  font-weight: 700;
}

.page-header .page-subtitle {
  color: var(--rw-muted);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  border-radius: 8px;
}

.btn-primary {
  background-color: var(--rw-red);
  border-color: var(--rw-red);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--rw-red-hover) !important;
  border-color: var(--rw-red-hover) !important;
}

.btn-outline-primary {
  color: var(--rw-red);
  border-color: var(--rw-red);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--rw-red) !important;
  border-color: var(--rw-red) !important;
  color: #fff !important;
}

.btn-icon.btn-sm,
.btn-sm.btn-icon {
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-control,
.form-select {
  border-radius: 8px;
  border-color: var(--rw-border);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--rw-red);
  box-shadow: 0 0 0 0.2rem rgba(193, 39, 45, 0.15);
}

.form-check-input:checked {
  background-color: var(--rw-red);
  border-color: var(--rw-red);
}

.form-check-input:focus {
  border-color: var(--rw-red);
  box-shadow: 0 0 0 0.2rem rgba(193, 39, 45, 0.15);
}

.input-group-text {
  background-color: var(--rw-bg);
  border-color: var(--rw-border);
}

/* --------------------------------------------------------------------------
   Badges, labels, progress
   -------------------------------------------------------------------------- */

.badge.bg-label-primary {
  background-color: var(--rw-red-soft) !important;
  color: var(--rw-red) !important;
}

.progress {
  background-color: var(--rw-bg);
  border-radius: 999px;
}

.progress-bar {
  background-color: var(--rw-red);
  border-radius: 999px;
}

.avatar {
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table > :not(caption) > * > * {
  border-color: var(--rw-border);
}

.table thead th {
  background-color: var(--rw-bg);
  color: var(--rw-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.table-hover > tbody > tr:hover > * {
  background-color: rgba(193, 39, 45, 0.04);
}

/* --------------------------------------------------------------------------
   Dropdowns, modals, alerts
   -------------------------------------------------------------------------- */

.dropdown-menu {
  border-color: var(--rw-border);
  border-radius: var(--rw-radius);
  box-shadow: var(--rw-shadow-md);
}

.modal-content {
  border-radius: var(--rw-radius-lg);
  box-shadow: var(--rw-shadow-lg);
  border: 0;
}

.modal-header,
.modal-footer {
  border-color: var(--rw-border);
}

.alert {
  border-radius: var(--rw-radius);
}

.alert-primary {
  background-color: var(--rw-red-soft);
  border-color: var(--rw-red-line);
  color: var(--rw-red-hover);
}

.list-group-item {
  border-color: var(--rw-border);
}

.list-group-item.active {
  background-color: var(--rw-red);
  border-color: var(--rw-red);
}

/* --------------------------------------------------------------------------
   Dashboard accents
   -------------------------------------------------------------------------- */

.text-primary {
  color: var(--rw-red) !important;
}

a.text-primary:hover,
a.text-primary:focus {
  color: var(--rw-red-hover) !important;
}

/* Stat tiles: white card, red icon chip, red headline figure */
.card .badge-p-2.bg-label-info,
.card .badge-p-2.bg-label-danger,
.card .badge-p-2.bg-label-success,
.card .badge-p-2.bg-label-warning {
  border-radius: 10px;
}

.card .card-title + small,
.card small.text-muted {
  color: var(--rw-muted);
}

/* Figures that represent money read in red, matching the reference */
.card .h4.text-primary,
.card .h3.text-primary,
.card h4.text-primary,
.card h3.text-primary {
  color: var(--rw-red) !important;
}

/* Large standalone money values inside a card */
.content-wrapper .card h4.mb-0 {
  color: var(--rw-red);
}

/* Bootstrap's .text-white should reach headings, but Tabler sets an explicit
   colour on h1-h6 which then wins over the inherited white. */
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6 {
  color: #fff !important;
}

/* Brand block in the sidebar */
.app-brand.demo {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.app-brand.demo .app-brand-text {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Timeline (profile page)
   -------------------------------------------------------------------------- */

.timeline-event h6 {
  color: var(--rw-text);
}

/* --------------------------------------------------------------------------
   Authentication pages — red gradient panel
   -------------------------------------------------------------------------- */

.authentication-wrapper {
  background-color: var(--rw-bg);
}

.auth-cover-bg-color {
  background: linear-gradient(150deg, #a9232a 0%, var(--rw-red-dark) 60%, var(--rw-red-deep) 100%);
}

.authentication-wrapper .card,
.authentication-wrapper .form-control,
.authentication-wrapper .form-select {
  border-radius: var(--rw-radius);
}

.authentication-wrapper .card {
  border: 1px solid var(--rw-border);
  box-shadow: var(--rw-shadow-md);
}
