/* ==========================================================================
   SC-Oracare — sc_base.css (2026-07-11 nice_static decoupling)
   --------------------------------------------------------------------------
   The complete replacement for what pages still consumed from the NiceAdmin
   theme's style.min.css. Loaded AFTER vendor/bootstrap/bootstrap.min.css and
   BEFORE the shell overlay (sc_design.css / admin_theme.css / sc_patient.css)
   on: core/base.html, core/base2.html, core/admin_base.html,
   core/patient_base.html. NOT loaded by public_base.html or the error pages
   (they never used theme classes).

   Every rule is either extracted from the theme's unminified style.css
   (marked E — git history keeps the source after deletion) or a deliberate
   rewrite (marked R). No runtime data-attribute selectors anywhere — the
   admin shell keys off plain classes set by sc_admin_shell.js.
   ========================================================================== */

/* --- 1. Body compat tokens (R) --------------------------------------------
   NiceAdmin continuity: the whole app was typeset against a .875rem body and
   the theme's muted ink. Relaxing these to stock Bootstrap defaults is a
   deliberate follow-up, not part of the asset cutover. */
:root {
  --bs-body-font-size: .875rem;
  --bs-body-color: #6a7a8c;
}

/* --- 2. fs-1..fs-7 legacy scale (E — FROZEN) -------------------------------
   The theme's fs-* scale is INVERTED vs stock Bootstrap (theme fs-2 = .75rem,
   stock fs-2 = 2rem; stock has no fs-7). 132 uses across 28 templates depend
   on the theme meaning. Declared after Bootstrap so the later same-specificity
   !important wins. Migrating templates to the stock scale is a documented
   follow-up; do NOT "fix" these values. */
.fs-1 { font-size: .625rem !important; }
.fs-2 { font-size: .75rem !important; }
.fs-3 { font-size: .875rem !important; }
.fs-4 { font-size: 1rem !important; }
.fs-5 { font-size: 1.125rem !important; }
.fs-6 { font-size: 1.25rem !important; }
.fs-7 { font-size: calc(1.275rem + 0.3vw) !important; }
@media (min-width: 1200px) {
  .fs-7 { font-size: 1.5rem !important; }
}

/* --- 3. Legacy utilities (E) ---------------------------------------------- */
.font-weight-medium { font-weight: 500; }

/* R: BS5 dropped .form-group; templates (confirm_referral, external_user_*) still
   use it for vertical rhythm. Restore its BS4 bottom margin so stacked fields
   don't collapse together. */
.form-group { margin-bottom: 1rem; }

.btn-circle {
  border-radius: 100%;
  width: 40px;
  height: 40px;
  padding: 5px;
}
.btn-circle.btn-sm, .btn-group-sm > .btn-circle.btn {
  width: 35px;
  height: 35px;
  padding: 8px 10px;
  font-size: 14px;
}
.btn-circle.btn-lg, .btn-group-lg > .btn-circle.btn {
  width: 50px;
  height: 50px;
  padding: 14px 10px;
  font-size: 18px;
}

.round {
  line-height: 45px;
  width: 45px;
  height: 45px;
}

.card-hover { transition: all 0.25s ease; }
.card-hover:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 24px rgba(62, 57, 107, 0.1);
}

/* --- 4. Layout skeleton (R) ------------------------------------------------
   Deliberately WITHOUT the theme's `.page-wrapper{display:none}` reveal dance
   (that depended on app.min.js) and WITHOUT any margin/padding offsets — the
   shell overlays (sc_design.css / admin_theme.css) own the offsets with
   !important, exactly as before the cutover. */
#main-wrapper { width: 100%; overflow: hidden; }
.page-wrapper { position: relative; transition: 0.2s ease-in; }

/* --- 5. Preloader (E + R hide-state) --------------------------------------- */
.preloader {
  width: 100%;
  height: 100%;
  top: 0;
  position: fixed;
  z-index: 99999;
  background: #fff;
}
/* R: vanilla hide hook (was jQuery fadeOut in the theme's custom.js) —
   _scripts.html adds .sc-done on window load. */
.preloader.sc-done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* --- 6. Flash alert styling (E) — used by _messages.html + page templates -- */
.alert.customize-alert { padding: 20px 25px; }
.alert.customize-alert .btn-close { width: 25px; }
.alert.customize-alert .side-line {
  position: absolute;
  width: 3px;
  height: 25px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 767.98px) {
  .alert.customize-alert { padding: 20px 15px; }
}

/* --- 7. Topbar widget dropdown internals (E) — _topbar_widgets.html --------
   Shared by the product top-nav AND the admin inline topbar. */
.mailbox .message-center {
  height: 317px;
  overflow: auto; /* native scroll — perfect-scrollbar retired */
}
.mailbox .message-center .message-item { display: flex; }
.mailbox .message-center .message-item:hover,
.mailbox .message-center .message-item.active { background: rgba(0, 0, 0, 0.025); }
.mailbox .message-center .message-item .message-title { color: #212529; }
.mailbox .message-center .message-item .user-img { width: 40px; position: relative; }
.mailbox .message-center .message-item .user-img .profile-status {
  border: 2px solid #fff;
  border-radius: 50%;
  height: 10px;
  width: 10px;
  left: 30px;
  top: 1px;
  position: absolute;
}
.mailbox .message-center .message-item .user-img .online { background: #5ac146; }
.mailbox .message-center .message-item .user-img .busy { background: #fa5838; }
.mailbox .message-center .message-item .user-img .away,
.mailbox .message-center .message-item .user-img .offline { background: #ffbc34; }

.topbar .dropdown-menu .with-arrow,
.sc-topnav .dropdown-menu .with-arrow {
  position: absolute;
  top: -10px;
  width: 40px;
  height: 10px;
  overflow: hidden;
}
.topbar .dropdown-menu .with-arrow > span,
.sc-topnav .dropdown-menu .with-arrow > span {
  width: 15px;
  height: 15px;
  position: absolute;
  content: "";
  top: 3px;
  left: 15px;
  background-color: #fff;
  border-radius: 6px 0 0 0;
  transform: rotate(45deg);
}
.topbar .dropdown-menu.dropdown-menu-end .with-arrow,
.sc-topnav .dropdown-menu.dropdown-menu-end .with-arrow { right: 0; }
.topbar .dropdown-menu.dropdown-menu-end .with-arrow > span,
.sc-topnav .dropdown-menu.dropdown-menu-end .with-arrow > span { right: 20px; left: auto; }

/* R: stock BS 5.3 dropdowns ship a border and no shadow — restore the app's
   dropdown chrome for both shells. */
.topbar .dropdown-menu,
.sc-topnav .dropdown-menu {
  padding-top: 0;
  border: 0;
  box-shadow: 1px 1px 15px rgba(0, 0, 0, 0.1);
}

/* --- 8. Admin layout skeleton (E→R) — scoped body.admin-shell ---------------
   Geometry only; admin_sidebar.css / admin_theme.css repaint every surface on
   top exactly as before (their !important rules used to beat the runtime
   skin5 attribute — now they simply apply unopposed). All state is plain
   classes toggled by sc_admin_shell.js: #main-wrapper.mini-sidebar and
   #main-wrapper.show-sidebar. No data-* selectors. */
body.admin-shell .topbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: #fff;
  height: 64px;
  box-shadow: 1px 0 7px rgba(0, 0, 0, 0.05);
  transition: 0.2s ease-in;
}
body.admin-shell .topbar .top-navbar { min-height: 64px; padding: 0; }
body.admin-shell .topbar .top-navbar .dropdown-toggle::after { display: none; }
body.admin-shell .topbar .top-navbar .navbar-header {
  width: 288px;
  line-height: 72px;
}
body.admin-shell .topbar .top-navbar .navbar-header .navbar-brand {
  display: flex;
  align-items: center;
  margin: 0;
}
body.admin-shell .topbar .navbar-collapse { padding: 0 10px 0 0; }

body.admin-shell .left-sidebar {
  position: fixed;
  width: 288px;
  height: 100%;
  top: 0;
  left: 0;
  padding-top: 64px;
  z-index: 10;
  background: #fff;
  box-shadow: 1px 0 20px rgba(0, 0, 0, 0.08);
  transition: 0.2s ease-in;
}
body.admin-shell .scroll-sidebar {
  position: relative;
  height: 100%;
  overflow-y: auto; /* native scroll — perfect-scrollbar retired */
}
body.admin-shell .sidebar-nav ul { margin: 0; padding: 0; }
body.admin-shell .sidebar-nav ul .sidebar-item { width: 100%; list-style: none; }
body.admin-shell .sidebar-nav ul .sidebar-item .sidebar-link {
  padding: 12px 15px;
  display: flex;
  white-space: nowrap;
  align-items: center;
  position: relative;
  line-height: 25px;
  font-size: 14px;
  text-decoration: none;
}
body.admin-shell .sidebar-nav ul .nav-small-cap {
  display: flex;
  font-size: 12px;
  white-space: nowrap;
  align-items: center;
  list-style: none;
}

/* Content offset (replaces the theme's data-attr-activated rules) */
body.admin-shell .page-wrapper {
  margin-left: 288px;
  padding-top: 64px;
}

/* Mini sidebar — class-driven (desktop toggler in sc_admin_shell.js) */
#main-wrapper.mini-sidebar .left-sidebar { width: 65px; }
#main-wrapper.mini-sidebar .left-sidebar .hide-menu,
#main-wrapper.mini-sidebar .left-sidebar .nav-small-cap,
#main-wrapper.mini-sidebar .left-sidebar .sc-sb-footer { display: none; }
body.admin-shell #main-wrapper.mini-sidebar .page-wrapper { margin-left: 65px; }
#main-wrapper.mini-sidebar .topbar .top-navbar .navbar-header { width: 65px; }

/* Auto-mini on narrow desktops (replaces the theme's <1170px resize JS) */
@media (min-width: 768px) and (max-width: 1169.98px) {
  body.admin-shell .left-sidebar { width: 65px; }
  body.admin-shell .left-sidebar .hide-menu,
  body.admin-shell .left-sidebar .nav-small-cap,
  body.admin-shell .left-sidebar .sc-sb-footer { display: none; }
  body.admin-shell .page-wrapper { margin-left: 65px; }
  body.admin-shell .topbar .top-navbar .navbar-header { width: auto; }
}

/* Mobile off-canvas — class-driven (mobile toggler in sc_admin_shell.js) */
@media (max-width: 767.98px) {
  body.admin-shell .left-sidebar { left: -288px; }
  body.admin-shell #main-wrapper.show-sidebar .left-sidebar { left: 0; }
  body.admin-shell .page-wrapper { margin-left: 0; }
  body.admin-shell .topbar .top-navbar .navbar-header { width: auto; line-height: normal; }
}

/* --- 9. Icon sizing shim (R) ------------------------------------------------
   The feather→bootstrap-icons remap swaps 18px SVGs (.feather-sm) for font
   glyphs; .sc-ico normalises their box so surrounding layout doesn't shift. */
.sc-ico {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  vertical-align: -0.125em;
}
