/*
 * Bootstrap shell bridge.
 *
 * The dashboard templates still share a few legacy utility names. Keep those
 * names lightweight and Bootstrap-based so pages can migrate incrementally
 * without loading the old Material Dashboard stylesheet.
 */
:root {
  --dashboard-primary: #e11d48;
  --dashboard-info: #2563eb;
  --dashboard-success: #16a34a;
  --dashboard-warning: #d97706;
  --dashboard-danger: #dc2626;
  --dashboard-dark: #0f172a;
}

body.bootstrap-shell-body,
body.bootstrap-dashboard-body {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.bootstrap-dashboard-body {
  min-height: 100vh;
  background: #f1f5f9 !important;
}

body.bootstrap-dashboard-body .main-content {
  min-height: 100vh;
  min-width: 0;
}

.bootstrap-sidebar-backdrop[hidden] { display: none !important; }

@media (max-width: 1199.98px) {
  body.bootstrap-dashboard-body.bootstrap-sidebar-overlay { overflow: hidden !important; }

  .bootstrap-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(2, 8, 23, .58);
  }

  body.bootstrap-dashboard-body .main-content,
  body.bootstrap-dashboard-body .main-content > .container-fluid,
  body.bootstrap-dashboard-body .main-content .card,
  body.bootstrap-dashboard-body .main-content .table-responsive {
    min-width: 0;
    max-width: 100%;
  }

  body.bootstrap-dashboard-body .main-content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767.98px) {
  body.bootstrap-dashboard-body .main-content > .container-fluid {
    --bs-gutter-x: 1rem;
  }

  body.bootstrap-dashboard-body .main-content .row > * { min-width: 0; }
  body.bootstrap-dashboard-body .main-content img,
  body.bootstrap-dashboard-body .main-content video,
  body.bootstrap-dashboard-body .main-content iframe { max-width: 100%; }
}

.text-xs { font-size: .75rem !important; }
.text-sm { font-size: .875rem !important; }
.text-md { font-size: 1rem !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-bolder { font-weight: 800 !important; }
.letter-spacing-2 { letter-spacing: .12em !important; }
.border-radius-lg { border-radius: .75rem !important; }
.px-7 { padding-right: 3rem !important; padding-left: 3rem !important; }

.bg-gradient-primary { background-image: linear-gradient(135deg, #fb7185, var(--dashboard-primary)) !important; }
.bg-gradient-secondary { background-image: linear-gradient(135deg, #94a3b8, #475569) !important; }
.bg-gradient-info { background-image: linear-gradient(135deg, #60a5fa, var(--dashboard-info)) !important; }
.bg-gradient-success { background-image: linear-gradient(135deg, #4ade80, var(--dashboard-success)) !important; }
.bg-gradient-warning { background-image: linear-gradient(135deg, #fbbf24, var(--dashboard-warning)) !important; }
.bg-gradient-danger { background-image: linear-gradient(135deg, #f87171, var(--dashboard-danger)) !important; }
.bg-gradient-dark { background-image: linear-gradient(135deg, #334155, var(--dashboard-dark)) !important; }

/* Bootstrap form controls with the existing floating-label wrapper. */
.input-group.input-group-static {
  position: relative;
  display: block;
}

.input-group.input-group-static > label {
  position: relative;
  display: block;
  margin-bottom: .35rem;
  color: #64748b;
  font-size: .75rem;
  font-weight: 600;
}

.input-group.input-group-static > .form-control,
.input-group.input-group-static > .form-select {
  width: 100%;
  border-radius: .5rem;
}

@media (max-width: 767.98px) {
  .px-7 { padding-right: 1.5rem !important; padding-left: 1.5rem !important; }
}

/* Shared save actions on full-page forms. Service modals keep their own footer layout. */
@media (max-width: 1199.98px) {
  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    float: none !important;
    width: 100%;
    gap: .625rem !important;
    margin: 1rem 0 0 !important;
  }

  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    margin: 0 !important;
    padding: .625rem .75rem;
    border-radius: .625rem;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions > .btn-outline-secondary,
  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions > .btn-default {
    border-color: #cbd5e1;
    background: #fff;
    color: #475569;
  }

  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions:not(.service-popup-actions) > input[type="submit"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body.bootstrap-dashboard-body:not(.service-modal-page) .dashboard-form-actions:not(.service-popup-actions) > input[type="submit"] {
    grid-column: auto;
  }
}
