/* =============================================
   HMS Admin Panel — Master Stylesheet
   ============================================= */

:root {
  --hms-primary: #1a2942;
  --hms-secondary: #1e3a5f;
  --hms-accent: #c5a880;
  --hms-accent-light: #ede2cf;
  --hms-sidebar-width: 194px;
  --hms-topbar-height: 60px;
  --hms-bg: #f0f4f8;
  --hms-card-bg: #ffffff;
  --hms-text: #1e293b;
  --hms-muted: #64748b;
  --hms-border: #e2e8f0;
  --hms-success: #0ea472;
  --hms-danger: #e53e3e;
  --hms-warning: #d97706;
  --hms-info: #3b82f6;
  --hms-radius: 10px;
  --hms-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body.hms-body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background: var(--hms-bg);
  color: var(--hms-text);
  margin: 0;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.hms-sidebar {
  width: var(--hms-sidebar-width);
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 164, 59, 0.16), transparent 27%),
    linear-gradient(180deg, #073b36 0%, #052b28 100%);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow: hidden;
}

.hms-sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.hms-sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(224, 164, 59, 0.18);
  border: 1px solid rgba(224, 164, 59, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--hms-accent);
  flex-shrink: 0;
}

.hms-sidebar-brand-text {
  color: #ffffff;
}

.hms-sidebar-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.hms-sidebar-brand-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hms-sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hms-sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hms-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hms-sidebar-user-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hms-sidebar-user-role {
  font-size: 0.72rem;
  color: var(--hms-accent);
}

.hms-sidebar-menu {
  padding: 10px 0 50px;
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(0, 0, 0, 0.15);
}

.hms-sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.hms-sidebar-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.hms-sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

.hms-sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.hms-sidebar-heading {
  padding: 14px 20px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.35);
}

.hms-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  margin: 3px 12px;
  border-radius: 9px;
  padding: 11px 14px;
  transition: all 0.18s ease;
}

.hms-sidebar-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-left-color: var(--hms-accent);
}

.hms-sidebar-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(224, 164, 59, 0.24), rgba(224, 164, 59, 0.08));
  border-left-color: var(--hms-accent);
}

.hms-sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

.hms-sidebar-group-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.18s ease;
  cursor: pointer;
}

.hms-sidebar-group-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.hms-sidebar-group-link .hms-caret {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.2s;
}

.hms-sidebar-group-link:not(.collapsed) .hms-caret {
  transform: rotate(90deg);
}

.hms-sidebar-submenu {
  background: rgba(0, 0, 0, 0.15);
}

.hms-sidebar-submenu .hms-sidebar-link {
  padding-left: 48px;
  font-size: 0.83rem;
}

/* =============================================
   TOPBAR
   ============================================= */
.hms-topbar {
  height: var(--hms-topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--hms-border);
  position: fixed;
  top: 0;
  left: var(--hms-sidebar-width);
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: left 0.3s ease;
}

#sidebarToggle {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--hms-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--hms-muted);
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}

#sidebarToggle:hover {
  background: #e2e8f0;
  color: var(--hms-text);
}

.hms-topbar-search {
  flex: 1;
  max-width: 340px;
}

.hms-topbar-search .input-group-text {
  background: var(--hms-bg);
  border-color: var(--hms-border);
  color: var(--hms-muted);
}

.hms-topbar-search .form-control {
  background: var(--hms-bg);
  border-color: var(--hms-border);
  font-size: 0.875rem;
}

.hms-topbar-search .form-control:focus {
  box-shadow: none;
  border-color: var(--hms-accent);
}

.hms-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hms-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--hms-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--hms-muted);
  font-size: 16px;
  position: relative;
  transition: background 0.15s;
  text-decoration: none;
}

.hms-icon-btn:hover {
  background: #e2e8f0;
  color: var(--hms-text);
}

.hms-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--hms-danger);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hms-user-dropdown {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--hms-border);
  background: #fff;
  transition: background 0.15s;
}

.hms-user-dropdown:hover {
  background: var(--hms-bg);
}

.hms-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hms-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.hms-user-info-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hms-text);
}

.hms-user-info-role {
  font-size: 0.72rem;
  color: var(--hms-accent);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.hms-main-wrapper {
  margin-left: var(--hms-sidebar-width);
  padding-top: var(--hms-topbar-height);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.hms-page-content {
  padding: 24px;
}

/* Sidebar collapsed state */
#hms-root.sidebar-collapsed .hms-sidebar {
  width: 66px;
}

#hms-root.sidebar-collapsed .hms-sidebar-brand-text,
#hms-root.sidebar-collapsed .hms-sidebar-user-name,
#hms-root.sidebar-collapsed .hms-sidebar-user-role,
#hms-root.sidebar-collapsed .hms-sidebar-heading,
#hms-root.sidebar-collapsed .hms-link-text,
#hms-root.sidebar-collapsed .hms-caret {
  display: none;
}

#hms-root.sidebar-collapsed .hms-main-wrapper {
  margin-left: 66px;
}

#hms-root.sidebar-collapsed .hms-topbar {
  left: 66px;
}

#hms-root.sidebar-collapsed .hms-sidebar-link,
#hms-root.sidebar-collapsed .hms-sidebar-group-link {
  justify-content: center;
  padding: 10px 0;
}

/* =============================================
   BREADCRUMB BAR
   ============================================= */
.hms-page-header {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.hms-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hms-text);
  margin: 0;
}

.hms-breadcrumb {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--hms-muted);
}

.hms-breadcrumb a {
  color: var(--hms-muted);
  text-decoration: none;
}

.hms-breadcrumb a:hover {
  color: var(--hms-primary);
}

.hms-breadcrumb .sep {
  opacity: 0.5;
}

.hms-breadcrumb .current {
  color: var(--hms-text);
  font-weight: 500;
}

/* =============================================
   CARDS
   ============================================= */
.hms-card {
  background: var(--hms-card-bg);
  border-radius: var(--hms-radius);
  box-shadow: var(--hms-shadow);
  border: 1px solid var(--hms-border);
  overflow: hidden;
}

.hms-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--hms-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hms-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--hms-text);
  margin: 0;
}

.hms-card-body {
  padding: 20px;
}

/* Prevent flex columns with tables or charts from expanding past grid boundaries */
.row>[class*="col-"] {
  min-width: 0;
}

.table-responsive {
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* HERO KPI CARDS */
.hms-kpi-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--hms-border);
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hms-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.08);
}

.hms-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hms-kpi-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--hms-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hms-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.hms-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--hms-text);
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hms-kpi-sub {
  font-size: 0.78rem;
  color: var(--hms-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* MINI PROPERTY STAT STRIP */
.hms-mini-stat {
  background: #ffffff;
  border: 1px solid var(--hms-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.hms-mini-stat:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.hms-mini-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.hms-mini-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hms-text);
  line-height: 1.1;
}

.hms-mini-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--hms-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* STAT CARDS (Legacy / General) */
.hms-stat-card {
  background: var(--hms-card-bg);
  border-radius: var(--hms-radius);
  border: 1px solid var(--hms-border);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--hms-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

.hms-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.hms-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.hms-stat-icon.bg-primary-soft {
  background: rgba(26, 41, 66, 0.1);
  color: var(--hms-primary);
}

.hms-stat-icon.bg-success-soft {
  background: rgba(14, 164, 114, 0.12);
  color: var(--hms-success);
}

.hms-stat-icon.bg-danger-soft {
  background: rgba(229, 62, 62, 0.12);
  color: var(--hms-danger);
}

.hms-stat-icon.bg-warning-soft {
  background: rgba(217, 119, 6, 0.12);
  color: var(--hms-warning);
}

.hms-stat-icon.bg-info-soft {
  background: rgba(59, 130, 246, 0.12);
  color: var(--hms-info);
}

.hms-stat-icon.bg-accent-soft {
  background: rgba(197, 168, 128, 0.15);
  color: var(--hms-accent);
}

.hms-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--hms-text);
  line-height: 1.2;
  margin-bottom: 2px;
}

.hms-stat-label {
  font-size: 0.78rem;
  color: var(--hms-muted);
  font-weight: 600;
  white-space: nowrap;
}


/* =============================================
   TABLES & DATATABLES
   ============================================= */
.table,
table.dataTable {
  font-size: 0.825rem;
  /* Reduced compact font size for data */
}

.table thead th,
table.dataTable thead th {
  background: #f8fafc;
  color: var(--hms-muted);
  font-weight: 700;
  font-size: 0.75rem;
  /* Crisp compact header */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--hms-border);
  white-space: nowrap;
  padding: 10px 14px;
}

.table tbody td,
table.dataTable tbody td {
  padding: 9px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.825rem;
  /* Reduced data font size */
  color: #334155;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table small,
table.dataTable small {
  font-size: 0.75rem;
}

.table strong,
table.dataTable strong {
  font-size: 0.84rem;
}

.table .badge,
table.dataTable .badge {
  font-size: 0.74rem;
  padding: 3px 8px;
  font-weight: 600;
}

.table .btn-sm,
table.dataTable .btn-sm {
  font-size: 0.75rem;
  padding: 9px 8px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 0.82rem;
  padding: 6px 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-size: 0.8rem !important;
  padding: 3px 8px !important;
}


/* =============================================
   STATUS BADGES
   ============================================= */
.badge-active,
.badge-available {
  background: rgba(14, 164, 114, 0.12);
  color: #0ea472;
}

.badge-inactive {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.badge-occupied,
.badge-checked_in {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.badge-reserved,
.badge-confirmed {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.badge-maintenance,
.badge-cancelled {
  background: rgba(229, 62, 62, 0.12);
  color: #dc2626;
}

.badge-cleaning,
.badge-pending {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.badge-blocked {
  background: rgba(15, 23, 42, 0.12);
  color: #1e293b;
}

.hms-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-hms-primary {
  background: var(--hms-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-hms-primary:hover {
  background: var(--hms-secondary);
  color: #fff;
}

.btn-hms-accent {
  background: var(--hms-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-action-edit {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.btn-action-edit:hover {
  background: #3b82f6;
  color: #fff;
}

.btn-action-del {
  background: rgba(229, 62, 62, 0.1);
  color: #dc2626;
}

.btn-action-del:hover {
  background: #dc2626;
  color: #fff;
}

.btn-action-view {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.btn-action-view:hover {
  background: #7c3aed;
  color: #fff;
}

.btn-action-green {
  background: rgba(14, 164, 114, 0.1);
  color: #0ea472;
}

.btn-action-green:hover {
  background: #0ea472;
  color: #fff;
}

/* =============================================
   FORMS
   ============================================= */
.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--hms-text);
  margin-bottom: 5px;
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid var(--hms-border);
  font-size: 0.875rem;
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hms-accent);
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

/* =============================================
   FOOTER
   ============================================= */
.hms-footer {
  background: #ffffff;
  border-top: 1px solid var(--hms-border);
  padding: 14px 24px;
  font-size: 0.82rem;
  color: var(--hms-muted);
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
  .hms-sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

  .hms-sidebar.show {
    transform: translateX(0);
  }

  .hms-main-wrapper {
    margin-left: 0 !important;
  }

  .hms-topbar {
    left: 0 !important;
  }

  #mobileSidebarToggle {
    display: flex !important;
  }

  #sidebarToggle {
    display: none !important;
  }

  #sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
  }

  #sidebarOverlay.show {
    display: block;
  }
}

@media (min-width: 992px) {
  #mobileSidebarToggle {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .hms-page-content {
    padding: 14px;
  }

  .hms-stat-card {
    padding: 14px;
  }

  .hms-topbar-search {
    display: none;
  }
}

/* ================================================================
   HMS ADMIN — COMPACT PREMIUM UI V2
   Global compatibility layer for both new and legacy admin pages.
   ================================================================ */
:root { --hms-primary:#4f46e5; --hms-secondary:#3730a3; --hms-accent:#06b6d4; --hms-accent-light:#cffafe; --hms-sidebar-width:252px; --hms-topbar-height:64px; --hms-bg:#f6f7fb; --hms-card-bg:#fff; --hms-text:#172033; --hms-muted:#697386; --hms-border:#e7eaf0; --hms-radius:14px; --hms-shadow:0 1px 2px rgba(15,23,42,.03),0 8px 24px rgba(15,23,42,.045); }
html { font-size:14px; }
body.hms-body { background:radial-gradient(circle at 100% 0,rgba(79,70,229,.045),transparent 28rem),var(--hms-bg); font-size:.875rem; line-height:1.5; -webkit-font-smoothing:antialiased; }

/* Sidebar */
.hms-sidebar { background:linear-gradient(180deg,#111827 0%,#172033 58%,#111827 100%); border-right:1px solid rgba(255,255,255,.055); box-shadow:12px 0 40px rgba(15,23,42,.09); }
.hms-sidebar-brand { min-height:64px; padding:11px 16px; gap:10px; }
.hms-sidebar-brand-icon { width:36px; height:36px; border-radius:11px; font-size:15px; color:#fff; border:0; background:linear-gradient(145deg,#6366f1,#06b6d4); box-shadow:0 7px 18px rgba(79,70,229,.32); }
.hms-sidebar-brand-title { font-size:.88rem; letter-spacing:-.01em; }
.hms-sidebar-brand-sub { font-size:.6rem; letter-spacing:.12em; color:rgba(255,255,255,.44); }
.hms-sidebar-menu { padding:8px 9px 32px; }
.hms-sidebar-heading { padding:15px 10px 5px; font-size:.57rem; letter-spacing:.14em; }
.hms-sidebar-link,.hms-sidebar-group-link { min-height:36px; margin:2px 0; padding:8px 10px; border:0; border-radius:9px; gap:10px; font-size:.76rem; color:rgba(255,255,255,.67); }
.hms-sidebar-link i,.hms-sidebar-group-link>i:first-child { width:17px; font-size:12px; }
.hms-sidebar-link:hover,.hms-sidebar-group-link:hover { color:#fff; border:0; background:rgba(255,255,255,.07); }
.hms-sidebar-link.active { color:#fff; border:0; background:linear-gradient(135deg,rgba(99,102,241,.92),rgba(79,70,229,.82)); box-shadow:0 6px 15px rgba(30,27,75,.3); }
.hms-sidebar-submenu { margin:2px 0 5px 17px; padding-left:7px; background:transparent; }
.hms-sidebar-submenu .hms-sidebar-link { padding:7px 9px; min-height:32px; font-size:.72rem; }
.hms-sidebar-group-link .hms-caret { font-size:8px; }

/* Topbar */
.hms-topbar { padding:0 22px; gap:10px; background:rgba(255,255,255,.92); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:0 1px 0 var(--hms-border); border:0; }
#sidebarToggle,.hms-icon-btn { width:34px; height:34px; border-radius:10px; font-size:13px; }
.hms-topbar-search { max-width:370px; }
.hms-topbar-search .input-group { border:1px solid var(--hms-border); background:#f8fafc; border-radius:10px; overflow:hidden; }
.hms-topbar-search .input-group-text,.hms-topbar-search .form-control { height:34px; border:0; background:transparent; font-size:.75rem; }
.hms-user-dropdown { min-height:40px; padding:4px 8px 4px 5px; border-radius:11px; }
.hms-topbar-avatar { width:30px; height:30px; font-size:10px; background:linear-gradient(145deg,#4f46e5,#06b6d4); }
.hms-user-info-name { font-size:.72rem; }
.hms-user-info-role { font-size:.62rem; color:var(--hms-muted); }

/* Page shell and legacy layout normalization */
.hms-page-content { padding:20px 22px 28px; }
.hms-page-content>.main-content,.hms-page-content>.main-content>.page-content { margin:0!important; padding:0!important; min-height:auto!important; }
.hms-page-content>.main-content>.page-content>.container-fluid { padding:0!important; }
#page-topbar { display:none!important; }
.hms-page-header { margin-bottom:16px; gap:8px; }
.hms-page-title,.page-title-box h4,h4.page-title { font-size:1.05rem!important; font-weight:700; letter-spacing:-.025em; }
.hms-breadcrumb,.breadcrumb,.page-title-box .breadcrumb { font-size:.7rem; }
h1 { font-size:1.4rem; } h2 { font-size:1.22rem; } h3 { font-size:1.08rem; } h4 { font-size:.98rem; } h5 { font-size:.88rem; } h6 { font-size:.8rem; }
p,label,input,select,textarea,button { font-size:.78rem; }

/* Cards */
.card,.hms-card { border:1px solid var(--hms-border)!important; border-radius:var(--hms-radius)!important; background:rgba(255,255,255,.98); box-shadow:var(--hms-shadow)!important; }
.card { margin-bottom:18px; }
.card-header,.hms-card-header { min-height:48px; padding:12px 15px; background:#fff; border-bottom:1px solid var(--hms-border); }
.card-title,.hms-card-title { margin:0; font-size:.82rem; font-weight:700; color:var(--hms-text); }
.card-body,.hms-card-body { padding:15px; }
.hms-kpi-card { padding:15px 16px; border-radius:14px; box-shadow:var(--hms-shadow); }
.hms-kpi-top { margin-bottom:8px; } .hms-kpi-title { font-size:.65rem; letter-spacing:.07em; }
.hms-kpi-icon { width:36px; height:36px; border-radius:10px; font-size:14px; }
.hms-kpi-value { font-size:1.38rem; margin-bottom:5px; } .hms-kpi-sub { font-size:.67rem; }
.hms-mini-stat { padding:10px 12px; border-radius:11px; } .hms-mini-icon { width:32px; height:32px; font-size:12px; }
.hms-mini-value { font-size:.95rem; } .hms-mini-label { font-size:.61rem; }

/* Forms */
.form-label { margin-bottom:4px; font-size:.72rem; font-weight:650; color:#3c4658; }
.form-control,.form-select { min-height:36px; padding:7px 10px; border-color:#dfe3ea; border-radius:9px; background-color:#fff; font-size:.76rem; }
textarea.form-control { min-height:72px; } .form-control::placeholder { color:#a4adbb; }
.form-control:focus,.form-select:focus { border-color:#818cf8; box-shadow:0 0 0 3px rgba(99,102,241,.11); }
.input-group-text { font-size:.75rem; border-color:#dfe3ea; } .form-check-label,.form-text { font-size:.7rem; }

/* Buttons */
.btn { border-radius:9px; font-size:.73rem; font-weight:650; padding:7px 12px; }
.btn-sm { padding:5px 9px; font-size:.68rem; }
.btn-hms-primary,.btn-primary { border-color:#4f46e5; background:linear-gradient(135deg,#5b55e8,#4338ca); color:#fff; box-shadow:0 4px 10px rgba(79,70,229,.15); }
.btn-hms-primary:hover,.btn-primary:hover { border-color:#3730a3; background:#3730a3; color:#fff; }
.btn-light { border-color:var(--hms-border); background:#f8fafc; }
.btn-action { width:27px; height:27px; border-radius:8px; font-size:11px; }

/* Tables and DataTables */
.table-responsive { border-radius:10px; }
.table,table.dataTable { margin-bottom:0!important; font-size:.72rem; }
.table thead th,table.dataTable thead th { padding:9px 11px; font-size:.62rem; letter-spacing:.07em; color:#748094; background:#f8fafc; border-bottom-width:1px; }
.table tbody td,table.dataTable tbody td { padding:9px 11px; font-size:.71rem; color:#465166; }
.table tbody tr:last-child td { border-bottom:0; }
.table strong,table.dataTable strong { font-size:.73rem; color:#273248; }
.table small,table.dataTable small { font-size:.64rem; }
.table .badge,table.dataTable .badge,.hms-badge { padding:4px 7px; border-radius:99px; font-size:.61rem; }
.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate { font-size:.68rem; }
.dataTables_wrapper .form-select,.dataTables_wrapper .form-control { min-height:31px; padding:5px 8px; font-size:.68rem; }
.page-link { min-width:30px; padding:5px 8px; font-size:.68rem; text-align:center; color:#4f46e5; }
.active>.page-link,.page-link.active { background:#4f46e5; border-color:#4f46e5; }

/* Dialogs and feedback */
.modal-content { border:0; border-radius:16px; box-shadow:0 24px 70px rgba(15,23,42,.18); overflow:hidden; }
.modal-header { padding:13px 16px; background:#f8fafc!important; border-bottom-color:var(--hms-border); }
.modal-title { font-size:.88rem; } .modal-body { padding:16px!important; font-size:.76rem; overflow-y:auto; }
.modal-footer { padding:10px 16px; background:#f8fafc!important; border-top-color:var(--hms-border); }
.modal-dialog-scrollable .modal-content,.modal-dialog .modal-content { max-height:calc(100vh - 32px); }
.dropdown-menu { padding:6px; border:1px solid var(--hms-border)!important; border-radius:11px!important; box-shadow:0 15px 35px rgba(15,23,42,.11)!important; }
.dropdown-item { padding:7px 9px; border-radius:7px; font-size:.72rem; }
.alert { padding:10px 12px; border-radius:10px; font-size:.73rem; }
#toast-container>div { border-radius:11px; font-size:.72rem; box-shadow:0 12px 35px rgba(15,23,42,.18); }
.hms-footer { margin-left:var(--hms-sidebar-width); padding:11px 22px; font-size:.67rem; transition:margin-left .3s ease; }
#hms-root.sidebar-collapsed .hms-footer { margin-left:66px; }

@media (max-width:991.98px) {
  .hms-topbar { padding:0 14px; } .hms-page-content { padding:16px 14px 24px; }
  .hms-footer { margin-left:0!important; padding:10px 14px; } .modal-dialog { margin:12px; }
}
@media (max-width:575.98px) {
  html { font-size:13px; } .hms-page-header { align-items:flex-start; }
  .hms-page-header>.d-flex { width:100%; } .hms-page-header>.d-flex .btn { flex:1; }
  .card-body,.hms-card-body { padding:12px; } .hms-topbar-actions { gap:4px; }
  .table thead th,table.dataTable thead th,.table tbody td,table.dataTable tbody td { padding:8px 9px; }
}


/* =========================================================
   ENTRY IN / OUT DROPDOWN
========================================================= */

.hms-sidebar-dropdown {
    width: 100%;
}

.hms-dropdown-toggle {
    position: relative;
}

.hms-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
}

.hms-sidebar-submenu {
    display: none;
    width: 100%;
    padding: 3px 0 6px;
}

.hms-sidebar-submenu.show {
    display: block;
}

/* Sub Menu Item */
.hms-sidebar-sub-link {
    display: flex;
    align-items: center;
    gap: 11px;

    /*margin: 2px 10px 2px 28px;*/
    padding: 9px 12px;

    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;

    font-size: 0.81rem;
    font-weight: 500;

    border-radius: 7px;

    transition: all 0.2s ease;
}

.hms-sidebar-sub-link i {
    width: 17px;
    min-width: 17px;
    text-align: center;
    font-size: 11px;
}

/* Hover */
.hms-sidebar-sub-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

/* Active */
.hms-sidebar-sub-link.active {
    color: #ffffff;
    background: rgba(220, 156, 50, 0.16);
    font-weight: 600;
}

.hms-sidebar-sub-link.active i {
    color: #dc9c32;
}

/* Parent Active */
.hms-dropdown-toggle.active {
    color: #ffffff;
}

/* Arrow when opened */
.hms-dropdown-toggle.active .hms-dropdown-arrow {
    transform: rotate(180deg);
}

/* Arrow normal */
.hms-dropdown-toggle .hms-dropdown-arrow {
    transform: rotate(0deg);
}