/* ========================================================
   SmartBMS Custom Overrides
   Applied globally after Bootstrap / AdminLTE styles
   ======================================================== */

/* --- Global border-radius increase --- */
:root {
  --border-radius-sm:  0.35rem;
  --border-radius:     0.6rem;
  --border-radius-lg:  0.9rem;
}

/* Cards */
.card {
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}
.card-header:first-child {
  border-radius: calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) 0 0 !important;
}
.card-footer:last-child {
  border-radius: 0 0 calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) !important;
}

/* Small stat boxes (dashboard tiles) */
.small-box {
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}
.small-box .small-box-footer {
  border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
}

/* Buttons */
.btn {
  border-radius: var(--border-radius-sm) !important;
}
.btn-lg {
  border-radius: var(--border-radius) !important;
}

/* Inputs, selects, textareas */
.form-control,
.input-group-text,
.custom-select {
  border-radius: var(--border-radius-sm) !important;
}
.input-group > .form-control:first-child,
.input-group > .custom-select:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.input-group > .form-control:last-child,
.input-group > .custom-select:last-child {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}
.input-group .input-group-text:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.input-group .input-group-text:last-child {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius-sm) !important;
}

/* Badges */
.badge {
  border-radius: var(--border-radius-sm) !important;
}

/* Dropdowns */
.dropdown-menu {
  border-radius: var(--border-radius-sm) !important;
}

/* Modal */
.modal-content {
  border-radius: var(--border-radius) !important;
}
.modal-header {
  border-radius: calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) 0 0 !important;
}

/* Tables */
.table {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

/* Sidebar */
.main-sidebar,
.sidebar {
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0 !important;
}

/* Callout boxes */
.callout {
  border-radius: var(--border-radius-sm) !important;
}

/* Info boxes */
.info-box {
  border-radius: var(--border-radius) !important;
}

/* Progress bars */
.progress {
  border-radius: var(--border-radius-sm) !important;
}
.progress-bar {
  border-radius: var(--border-radius-sm) !important;
}

/* Teal button variant (used by bootstrap-select data-style) */
.btn-teal {
  color: #fff !important;
  background-color: rgba(32, 201, 151, 0.9) !important;
  border-color: rgba(28, 180, 135, 0.9) !important;
}
.btn-teal:hover,
.btn-teal:focus {
  color: #fff !important;
  background-color: #1aa67d !important;
  border-color: #18936e !important;
}
.btn-teal:active,
.btn-teal.active {
  background-color: #18936e !important;
  border-color: #14805f !important;
}

/* Bootstrap-select v1.13 dropdown styling */
.bootstrap-select .dropdown-menu {
  border-radius: var(--border-radius-sm) !important;
}
.bootstrap-select > .dropdown-toggle {
  border-radius: var(--border-radius-sm) !important;
}

/* Fix footer positioning: push it to the bottom of the viewport on short pages.
   AdminLTE 3 relies on min-height:100% cascading from html→body→#cover→.wrapper,
   but the #cover loader div has no height set, breaking the chain.
   Replacing with viewport units bypasses the parent-height dependency. */
.wrapper {
  min-height: 100vh !important;
}

/* Fix content-wrapper grey block: AdminLTE's Layout JS uses $(window).height()
   which returns document.documentElement.clientHeight. Because AdminLTE sets
   html { min-height: 100% }, clientHeight equals the document height (not the
   viewport height) when content is tall. This inflates the panelAutoHeight
   calculation and sets a wrong inline min-height on .content-wrapper via JS.
   Additionally, AdminLTE's .content-wrapper { height: 100% } fills the entire
   wrapper min-height (100vh), creating a large empty grey area below the content.
   Both rules are overridden here to restore correct sizing. */
.content-wrapper {
  height: auto !important;
  min-height: calc(100vh - calc(3.5rem + 1px) - calc(3.5rem + 1px)) !important;
}
