:root {
  --app-teal: #0d9488; /* teal-600 */
  --app-teal-dark: #0f766e; /* teal-700 */
  --app-cream: #fff7ed; /* orange-50 */
  --app-cream-2: #fffbeb; /* amber-50 */
  --app-purple: #6f42c1;
}

.text-bg-purple {
  color: #fff !important;
  background-color: var(--app-purple) !important;
}

.bg-purple-subtle {
  background-color: rgba(111, 66, 193, 0.16) !important;
}

.ra-list-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ra-list-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ra-photo-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.ra-activity-photo {
  max-width: 100%;
  width: 220px;
  max-height: 160px;
  object-fit: cover;
}

.ra-risk-icon {
  width: 24px;
  height: 24px;
}

.ra-matrix-wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.ra-risk-matrix-canvas {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.ra-legend-color {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.ra-legend-color-green {
  background: #198754;
}

.ra-legend-color-yellow {
  background: #ffc107;
}

.ra-legend-color-orange {
  background: #fd7e14;
}

.ra-legend-color-red {
  background: #dc3545;
}

.ra-ppe-icon {
  height: 50px;
  object-fit: contain;
}

.ra-ghs-icon {
  height: 24px;
  object-fit: contain;
}

.ra-photo-preview-box {
  max-width: 420px;
}

.ra-photo-preview-image {
  max-height: 260px;
  width: 100%;
  object-fit: cover;
}

.is-hidden {
  display: none;
}

.ra-risk-type-card {
  border: none;
}

.ra-risk-type-chemical {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.ra-risk-type-physical {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.ra-risk-type-mechanical {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.ra-risk-type-electrical {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
}

.ra-risk-type-biological {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ra-risk-type-ergonomic {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.ra-risk-type-psychosocial {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.ra-risk-type-environmental {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.ra-risk-type-icon {
  font-size: 1.2rem;
}

.ra-risk-chip-sm {
  font-size: 0.75rem;
}

.workers-actions-col {
  width: 60px;
}

.worker-select-col {
  width: 40px;
}

.chemical-actions-col {
  width: 80px;
}

.worker-list-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.risk-modal-content-sm {
  max-width: 600px;
}

.risk-modal-content-md {
  max-width: 700px;
}

.risk-modal-content-lg {
  max-width: 800px;
}

.risk-icon-sm {
  width: 22px;
  height: 22px;
}

.risk-icon-md {
  width: 32px;
  height: 32px;
}

.ppe-icon-lg {
  height: 60px;
  object-fit: contain;
}

.ppe-icon-md {
  height: 50px;
  object-fit: contain;
}

.ppe-remove-btn {
  padding: 0.1rem 0.3rem;
}

.ghs-icon-sm {
  height: 25px;
}

.ghs-icon-md {
  height: 30px;
}

.clickable-row {
  cursor: pointer;
}

.col-w-4 {
  width: 4%;
}

.col-w-8 {
  width: 8%;
}

.col-w-10 {
  width: 10%;
}

.col-w-12 {
  width: 12%;
}

.col-w-14 {
  width: 14%;
}

.col-w-15 {
  width: 15%;
}

.col-w-16 {
  width: 16%;
}

.col-w-18 {
  width: 18%;
}

.col-w-19 {
  width: 19%;
}

.col-w-20 {
  width: 20%;
}

.col-w-30 {
  width: 30%;
}

.col-w-34 {
  width: 34%;
}

.col-w-48 {
  width: 48%;
}

.col-w-55 {
  width: 55%;
}

.risk-assessment-list-table table,
.risk-assessment-detail-table table {
  min-width: 700px;
}

.risk-actions-col {
  width: 160px;
}

.risk-icon {
  height: 32px;
  object-fit: contain;
}

.raf-progress,
.fire-progress {
  height: 0.5rem;
  min-width: 180px;
}

.fire-section-na-wrap .form-check-input {
  width: 0.8rem;
  height: 0.8rem;
  margin-top: 0.15rem;
}

.fire-section-na-wrap {
  font-size: 0.7rem !important;
  font-weight: 400 !important;
  color: #8c939c !important;
  line-height: 1 !important;
}

.fire-section-na-label {
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
  letter-spacing: 0.15px !important;
  text-transform: none !important;
}

.fire-section-na-wrap .form-check-input:checked + .fire-section-na-label {
  color: #7b828c !important;
  font-weight: 400 !important;
}

/* Touch-friendly improvements */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

.app-bg {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.45), #ffffff 45%);
  min-height: 100vh;
}

.app-topbar {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.app-topbar-sticky {
  z-index: 1020;
}

.app-main-container {
  padding: 1.25rem 1.5rem;
}

.app-topbar-left,
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-topbar .btn {
  min-height: 2.5rem;
}

/* Global table shell consistency */
.table-responsive {
  border-radius: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

/* Mobile-first baseline for cross-module screens */
@media (max-width: 991px) {
  .app-main-container {
    padding: 1rem;
  }

  .card-header,
  .card-body,
  .card-footer {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}

@media (max-width: 768px) {
  .ra-list-hero-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ra-list-hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ra-list-hero-actions .btn {
    flex: 1 1 180px;
  }

  .ra-activity-photo {
    width: 100%;
    max-width: 100%;
  }

  .ra-photo-preview-box {
    max-width: 100%;
  }

  .risk-assessment-list-table table,
  .risk-assessment-detail-table table {
    min-width: 640px;
  }

  .app-topbar .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .app-topbar-left,
  .app-topbar-right {
    gap: 0.375rem;
  }

  .app-topbar .btn {
    min-height: 2.375rem;
    min-width: 2.375rem;
    padding: 0.45rem 0.65rem;
  }

  .app-topbar .form-select {
    min-height: 2.375rem;
    font-size: 0.9rem;
  }

  .btn,
  .form-control,
  .form-select,
  .input-group-text {
    min-height: 2.5rem;
  }

  .table-responsive {
    border-radius: 0.625rem;
  }

  .table-responsive table {
    min-width: 640px;
  }

  .modal-dialog {
    margin: 0.65rem;
  }
}

@media (max-width: 576px) {
  .risk-assessment-list-table table,
  .risk-assessment-detail-table table {
    min-width: 560px;
  }

  .app-main-container {
    padding: 0.85rem 0.7rem;
  }

  .app-topbar .btn {
    min-height: 2.25rem;
    min-width: 2.25rem;
    padding: 0.4rem 0.55rem;
  }

  .app-topbar .form-select {
    max-width: 140px;
    min-height: 2.25rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 0.85rem;
  }

  .table-responsive table {
    min-width: 560px;
  }
}

.app-sidebar {
  width: 280px;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: width 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

.flex-grow-1 {
  min-width: 0;
}

/* Sidebar colapsado (desktop) */
.app-sidebar.collapsed {
  width: 70px;
}

.app-sidebar.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.app-sidebar.collapsed .nav-link {
  justify-content: center;
}

.app-sidebar.collapsed hr {
  margin: 0.5rem 0;
}

.app-sidebar.collapsed .dropdown {
  display: none;
}

/* Ajustar contenido cuando sidebar está colapsado */
body.sidebar-collapsed .flex-grow-1 {
  margin-left: 0;
}

/* Transición suave para textos */
.sidebar-text {
  transition: opacity 0.3s ease, width 0.3s ease;
}

/* Módulos expandibles */
.sidebar-module {
  margin-bottom: 0.25rem;
}

.module-toggle {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-toggle:hover {
  background: rgba(13, 148, 136, 0.08);
  border-radius: 0.375rem;
}

.module-toggle.active {
  background: rgba(13, 148, 136, 0.14);
  color: var(--app-teal-dark);
  border-radius: 0.375rem;
}

.module-toggle i.bi-chevron-down {
  transition: transform 0.3s ease;
  font-size: 0.875rem;
}

.module-submenu {
  display: none;
  padding-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid rgba(13, 148, 136, 0.2);
  margin-left: 0.75rem;
}

.module-submenu .nav-link {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.app-sidebar .nav-pills .nav-link {
  color: rgba(15, 23, 42, 0.85);
}

.app-sidebar .nav-pills .nav-link:hover {
  background: rgba(13, 148, 136, 0.08);
}

.app-sidebar .nav-pills .nav-link.active {
  background: rgba(13, 148, 136, 0.14);
  color: var(--app-teal-dark);
}

.app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.14);
  color: var(--app-teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.25);
  font-weight: 600;
}

.app-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.app-auth-icon {
  font-size: 2.5rem;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.app-badge {
  background: var(--app-cream);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: var(--app-teal-dark);
}

.btn-primary {
  --bs-btn-bg: var(--app-teal);
  --bs-btn-border-color: var(--app-teal);
  --bs-btn-hover-bg: var(--app-teal-dark);
  --bs-btn-hover-border-color: var(--app-teal-dark);
  --bs-btn-active-bg: var(--app-teal-dark);
  --bs-btn-active-border-color: var(--app-teal-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-teal-dark);
  --bs-btn-border-color: rgba(15, 118, 110, 0.35);
  --bs-btn-hover-bg: var(--app-teal);
  --bs-btn-hover-border-color: var(--app-teal);
}

.app-hero {
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.10),
    rgba(255, 247, 237, 0.55)
  );
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.app-card {
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.04);
}

.raf-hero {
  padding: 1.5rem;
}

.raf-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.raf-table-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.raf-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.raf-table-col-index {
  width: 6%;
}

.raf-table-col-response {
  width: 28%;
}

.raf-table-col-check {
  width: 8%;
}

.raf-table-col-comments {
  width: 22%;
}

.raf-choice-btn {
  min-height: 36px;
  min-width: 44px;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  white-space: normal;
}

.dse-progress {
  height: 0.5rem;
  min-width: 180px;
}

.dse-progress-bar {
  width: 0%;
}

.mac-raf .card {
  border-radius: 1rem;
}

.mac-raf .card-body {
  padding: 1.25rem;
}

.mac-raf .badge {
  font-weight: 600;
}

.mac-raf .form-label {
  font-weight: 600;
}

.mac-raf .form-control,
.mac-raf .form-select {
  border-radius: 0.75rem;
  min-height: 44px;
}

.mac-raf textarea.form-control {
  min-height: 96px;
}

.mac-raf [id^="mac_"][id$="_matrix"] {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mac-raf .mac-grid {
  display: grid;
  width: max-content;
  min-width: 100%;
  max-width: 100%;
  grid-template-columns: var(--mac-label-width, 140px) repeat(var(--mac-cols, 5), minmax(var(--mac-cell-min, 48px), 1fr));
  gap: var(--mac-gap, 8px);
  font-size: 0.9rem;
}

.mac-raf .mac-grid-label {
  white-space: normal;
  line-height: 1.2;
}

.mac-raf .mac-grid > div {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mac-raf .mac-grid > div.small {
  justify-content: flex-start;
  text-align: left;
  padding-left: 0.35rem;
}

.mac-raf [id^="mac_"][id$="_matrix"] table {
  min-width: 560px;
  width: max-content;
}

.mac-raf .border.rounded.p-3 {
  background: rgba(15, 118, 110, 0.04);
  border-color: rgba(15, 118, 110, 0.18);
}

.mac-raf .border.rounded.p-2 {
  background: #fff;
}

.mac-raf .mac-semaforo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mac-raf .mac-semaforo .badge {
  font-size: 0.8rem;
}

.mac-raf .btn-check + .btn {
  white-space: normal;
  text-align: left;
  flex: 1 1 200px;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  border-radius: 0.75rem;
}

.mac-raf .btn-check + .btn {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.5rem;
}

.mac-raf .border.rounded.p-2 {
  padding: 0.75rem !important;
}

.mac-raf .fw-semibold {
  font-size: 0.95rem;
}

.mac-raf .btn-check + .btn .badge {
  min-width: 2.4rem;
  text-align: center;
}

.mac-raf .d-flex.flex-wrap.gap-2 {
  row-gap: 0.6rem;
}

.mac-raf .border.rounded.p-2 > .mt-2.d-flex,
.mac-raf .border.rounded.p-2 > .mt-2.d-flex.flex-wrap {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
}

.mac-raf .mt-2.d-flex.flex-wrap.gap-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
}

.mac-raf .border.rounded.p-2 > .mt-2.d-flex .btn,
.mac-raf .border.rounded.p-2 > .mt-2.d-flex.flex-wrap .btn {
  width: 100%;
}

.raf-header,
.fire-raf-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

#fireRafAccordion .accordion-header,
.raf-accordion .accordion-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fire-question > .d-flex {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fire-question {
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: rgba(15, 118, 110, 0.04);
}

.fire-question .fw-semibold {
  font-size: 0.98rem;
}

.fire-question .btn-group {
  width: 100%;
}

.fire-question .btn-group .btn {
  min-height: 44px;
  white-space: normal;
  text-align: center;
  padding: 0.55rem 0.75rem;
}

.fire-question .fire-na-toggle {
  min-height: 40px;
}

.fire-question .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fire-question .btn-group .btn {
  border-radius: 0.5rem !important;
}

.fire-question .row.g-2,
.fire-question .row.g-3 {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

.fire-question .fire-noncompliance {
  margin-top: 0.75rem;
}

.chem-hero {
  padding: 1.5rem;
}

.chem-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.chem-table-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .raf-hero {
    padding: 1rem;
  }

  .raf-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .raf-action-row .btn {
    width: 100%;
  }

  .raf-table-actions {
    display: grid;
    justify-items: stretch;
  }

  .raf-table-actions .btn,
  .raf-table-actions form {
    width: 100%;
  }

  .raf-toggle-group .btn {
    width: 100%;
  }

  .raf-choice-btn {
    min-height: 44px;
    font-size: 0.85rem;
    width: 100%;
  }

  .raf-header,
  .fire-raf-header {
    flex-direction: column;
    align-items: stretch;
  }

  .raf-header .text-end,
  .fire-raf-header .text-end {
    text-align: left !important;
  }

  .raf-progress,
  .fire-progress {
    width: 100%;
  }

  #fireRafAccordion .accordion-header .accordion-button,
  .raf-accordion .accordion-header .accordion-button {
    width: 100%;
  }

  #fireRafAccordion .fire-section-na-wrap,
  .raf-accordion .fire-section-na-wrap {
    width: 100%;
  }

  #fireRafAccordion .fire-section-na-wrap .form-check-label,
  .raf-accordion .fire-section-na-wrap .form-check-label {
    width: 100%;
  }

  #fireRafAccordion .accordion-body,
  .raf-accordion .accordion-body {
    padding: 0.75rem;
  }

  #fireRafAccordion .accordion-button,
  .raf-accordion .accordion-button {
    padding: 0.75rem 1rem;
  }

  .fire-question .row.g-2 > [class*="col-"],
  .fire-question .row.g-3 > [class*="col-"] {
    width: 100%;
  }

  .fire-question .fire-noncompliance {
    padding: 0.75rem;
  }

  .fire-question .fire-noncompliance .form-control,
  .fire-question .fire-noncompliance .form-select {
    width: 100%;
  }

  .fire-question .btn-group {
    width: 100%;
  }

  .fire-question .btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .fire-question .btn-group .btn {
    width: 100%;
  }

  .fire-question .fire-na-toggle {
    width: 100%;
  }

  .mac-raf .card-body {
    padding: 1rem;
  }

  .mac-raf .btn-check + .btn {
    width: 100%;
    font-size: 0.9rem;
  }

  .mac-raf .fw-semibold {
    font-size: 0.9rem;
  }

  .mac-raf .border.rounded.p-2 > .mt-2.d-flex,
  .mac-raf .border.rounded.p-2 > .mt-2.d-flex.flex-wrap {
    grid-template-columns: 1fr;
  }

  .mac-raf .mt-2.d-flex.flex-wrap.gap-2 {
    grid-template-columns: 1fr;
  }

  .mac-raf .badge {
    font-size: 0.85rem;
  }

  .mac-raf [id^="mac_"][id$="_matrix"] table {
    min-width: 520px;
  }

  .mac-raf .mac-grid {
    font-size: 0.8rem;
  }

  .mac-raf .mac-grid > div {
    min-height: 40px;
  }


  .fire-question .btn-group .btn {
    width: 100%;
  }

  .fire-question .fire-na-toggle {
    width: 100%;
  }

  .chem-hero {
    padding: 1rem;
  }

  .chem-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chem-action-row .btn,
  .chem-action-row .btn-group,
  .chem-action-row .btn-group .btn {
    width: 100%;
  }

  .chem-table-actions {
    display: grid;
    justify-items: stretch;
  }

  .chem-table-actions .btn,
  .chem-table-actions form {
    width: 100%;
  }
}

.form-signin {
  width: 100%;
  max-width: 330px;
  padding: 1rem;
  margin: auto;
}

.app-progress-bar {
  background-color: var(--app-teal);
}

.w-0 {
  width: 0% !important;
}

/* ========================================
   MODERN AUTH STYLES (Login/Signup)
   ======================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 
    0 20px 60px rgba(13, 148, 136, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--app-teal), var(--app-teal-dark));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(13, 148, 136, 0.25);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.25);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(13, 148, 136, 0.35);
  }
}

.auth-icon {
  font-size: 2.5rem;
  color: white;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-alert {
  padding: 1rem 1.25rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 12px;
  color: #dc2626;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.auth-label i {
  font-size: 1rem;
  color: var(--app-teal);
}

.auth-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  transition: all 0.2s ease;
  outline: none;
}

.auth-input:focus {
  border-color: var(--app-teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
  transform: translateY(-1px);
}

.auth-input::placeholder {
  color: #94a3b8;
}

.auth-button {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--app-teal), var(--app-teal-dark));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
  margin-top: 0.5rem;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button i {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.auth-button:hover i {
  transform: translateX(4px);
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #64748b;
}

.auth-link {
  color: var(--app-teal-dark);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.25rem;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--app-teal);
  text-decoration: underline;
}

/* ========================================
   GLOBAL MOBILE HARDENING
   ======================================== */

@media (max-width: 768px) {
  .btn.btn-sm {
    min-height: 40px;
  }

  .form-control,
  .form-select,
  .form-check-input {
    min-height: 42px;
  }

  .table-responsive > .table {
    min-width: 640px;
    font-size: 0.9rem;
  }

  .table-responsive th,
  .table-responsive td {
    white-space: nowrap;
    vertical-align: middle;
  }

  .table-responsive th[style*="width"],
  .table-responsive td[style*="width"] {
    width: auto !important;
    min-width: 110px;
  }

  .table-responsive th.text-center[style*="width"],
  .table-responsive td.text-center[style*="width"] {
    min-width: 96px;
  }
}

/* Decorative elements */
.auth-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.decoration-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.15), transparent 70%);
  filter: blur(40px);
  animation: float 20s ease-in-out infinite;
}

.decoration-circle-1 {
  width: 500px;
  height: 500px;
  top: -250px;
  right: -250px;
  animation-delay: 0s;
}

.decoration-circle-2 {
  width: 400px;
  height: 400px;
  bottom: -200px;
  left: -200px;
  animation-delay: 7s;
}

.decoration-circle-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-30px, 30px) scale(0.9);
  }
}

/* ========================================
   RESPONSIVE STYLES - MOBILE FIRST
   ======================================== */

/* Base responsive adjustments */
@media (max-width: 1200px) {
  .app-sidebar {
    width: 240px;
  }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
  .main-dashboard {
    padding: 1.5rem;
  }

  .tenants-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .modules-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Tablet Portrait & Mobile Landscape (576px - 768px) */
@media (max-width: 768px) {
  /* Sidebar collapse */
  .app-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 1030;
    transition: left 0.3s ease;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    width: 86vw;
    max-width: 320px;
  }

  .app-sidebar.show {
    left: 0 !important;
  }

  body:not(.sidebar-open) .app-sidebar.show {
    left: -100% !important;
  }

  /* Mobile backdrop */
  body.sidebar-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  body.sidebar-open {
    overflow: hidden;
  }

  /* Dashboard adjustments */
  .main-dashboard {
    padding: 1rem;
  }

  .dashboard-hero {
    padding: 1.5rem;
    flex-direction: column;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-actions {
    width: 100%;
  }

  .btn-hero {
    flex: 1;
  }

  .tenants-grid,
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.25rem;
  }

  /* Auth form grid */
  .auth-form-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .password-requirements {
    position: static;
    order: -1;
  }

  .welcome-features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile (< 576px) */
@media (max-width: 576px) {
  /* Container spacing */
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Auth pages */
  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }

  .auth-subtitle {
    font-size: 0.9375rem;
  }
  
  .auth-icon-wrapper {
    width: 70px;
    height: 70px;
  }
  
  .auth-icon {
    font-size: 2rem;
  }

  .auth-card-wide {
    max-width: 100%;
  }

  .auth-input {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .auth-button {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .auth-label {
    font-size: 0.8125rem;
  }

  /* Password requirements */
  .password-requirements {
    padding: 1.25rem;
  }

  .requirements-title {
    font-size: 0.9375rem;
  }

  .requirement-item {
    font-size: 0.8125rem;
  }

  /* Welcome page */
  .welcome-features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .feature-item {
    padding: 0.75rem;
  }

  .welcome-subtitle {
    font-size: 1.25rem;
  }

  /* Dashboard */
  .main-dashboard {
    padding: 1rem 0.5rem;
  }

  .dashboard-hero {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .hero-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .btn-hero {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .btn-hero i {
    font-size: 1.125rem;
  }

  /* Tenant cards */
  .tenant-card {
    padding: 1.25rem;
  }

  .tenant-icon {
    width: 40px;
    height: 40px;
  }

  .tenant-icon i {
    font-size: 1.25rem;
  }

  .tenant-name {
    font-size: 1rem;
  }

  .tenant-slug {
    font-size: 0.8125rem;
  }

  .tenant-action {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  /* Module cards */
  .module-card {
    padding: 1.5rem;
  }

  .module-icon {
    width: 56px;
    height: 56px;
  }

  .module-icon i {
    font-size: 1.75rem;
  }

  .module-name {
    font-size: 1.125rem;
  }

  .module-description {
    font-size: 0.8125rem;
  }

  .module-link {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }

  /* Section adjustments */
  .section-title {
    font-size: 1.125rem;
  }

  .section-title i {
    font-size: 1.5rem;
  }

  .section-tip {
    padding: 0.875rem;
    font-size: 0.8125rem;
  }

  /* Decorative circles - reduce size on mobile */
  .decoration-circle-1 {
    width: 300px;
    height: 300px;
  }

  .decoration-circle-2 {
    width: 250px;
    height: 250px;
  }

  .decoration-circle-3 {
    width: 200px;
    height: 200px;
  }
}

/* Extra small devices (< 375px) */
@media (max-width: 374px) {
  .auth-card {
    padding: 1.5rem 1rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .btn-hero {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .tenant-card,
  .module-card {
    padding: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn-hero {
    width: 100%;
  }
}

/* Landscape mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
  .auth-container {
    padding: 1rem;
    min-height: auto;
  }

  .auth-icon-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }

  .auth-icon {
    font-size: 1.75rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .password-requirements {
    position: static;
  }

  .dashboard-hero {
    padding: 1rem;
  }
}

/* Large screens optimization */
@media (min-width: 1400px) {
  .main-dashboard {
    max-width: 1600px;
  }

  .tenants-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }

  .modules-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Print styles */
@media print {
  .app-sidebar,
  .app-topbar,
  .hero-actions,
  .btn,
  button {
    display: none !important;
  }

  .main-dashboard {
    max-width: 100%;
    padding: 0;
  }

  .auth-decoration,
  .decoration-circle {
    display: none !important;
  }
}


/* ========================================
   PASSWORD REQUIREMENTS SIDEBAR
   ======================================== */

.auth-card-wide {
  max-width: 900px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.auth-form-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.password-requirements {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.04), rgba(13, 148, 136, 0.08));
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
}

.requirements-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.requirements-title i {
  color: var(--app-teal);
  font-size: 1.25rem;
}

.requirements-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
  transition: all 0.3s ease;
}

.requirement-item i {
  font-size: 1rem;
  color: #cbd5e1;
  transition: all 0.3s ease;
}

.requirement-item.valid {
  color: #059669;
}

.requirement-item.valid i {
  color: #059669;
}

.requirement-item.valid i::before {
  content: "\f26b";
  font-family: "bootstrap-icons";
}

.requirement-item i {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.requirement-item.valid i {
  background: rgba(5, 150, 105, 0.1);
}

.requirements-note {
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  align-items: start;
  gap: 0.5rem;
}

.requirements-note i {
  color: #3b82f6;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

@media (max-width: 768px) {
  .auth-form-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .password-requirements {
    position: static;
    order: -1;
  }
}

/* ========================================
   WELCOME PAGE STYLES
   ======================================== */

.welcome-message {
  text-align: center;
  padding: 2rem 0;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.welcome-icon i {
  font-size: 2.5rem;
  color: #3b82f6;
}

.welcome-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1rem;
}

.welcome-text {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(13, 148, 136, 0.04);
  border: 1px solid rgba(13, 148, 136, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.2);
  transform: translateY(-2px);
}

.feature-item i {
  font-size: 1.5rem;
  color: var(--app-teal);
}

.feature-item span {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

@media (max-width: 576px) {
  .welcome-features {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   MAIN DASHBOARD STYLES
   ======================================== */

.main-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Hero Section */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 300px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #3b82f6;
}

.hero-badge-env {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.hero-badge-superuser {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.hero-badge-staff {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.hero-badge-user {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.2);
  color: #0d9488;
}

.hero-badge i {
  font-size: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
}

.btn-hero i {
  font-size: 1.25rem;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--app-teal), var(--app-teal-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
  color: white;
}

.btn-hero-secondary {
  background: white;
  color: var(--app-teal-dark);
  border: 2px solid rgba(13, 148, 136, 0.2);
}

.btn-hero-secondary:hover {
  background: rgba(13, 148, 136, 0.05);
  border-color: var(--app-teal);
  transform: translateY(-2px);
  color: var(--app-teal-dark);
}

/* Dashboard Sections */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--app-teal);
  font-size: 1.75rem;
}

.section-badge {
  padding: 0.25rem 0.75rem;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-teal-dark);
}

.section-tip {
  display: flex;
  align-items: start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  font-size: 0.875rem;
  color: #475569;
}

.section-tip i {
  color: #3b82f6;
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.section-tip code {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

/* Tenants Grid */
.tenants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.tenant-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
}

.tenant-card:hover {
  border-color: var(--app-teal);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.1);
  transform: translateY(-2px);
}

.tenant-header {
  display: flex;
  align-items: start;
  gap: 1rem;
}

.tenant-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.15));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tenant-icon i {
  font-size: 1.5rem;
  color: var(--app-teal);
}

.tenant-info {
  flex: 1;
  min-width: 0;
}

.tenant-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem;
}

.tenant-slug {
  display: inline-block;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-size: 0.875rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
}

.tenant-status {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.status-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.tenant-body {
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.tenant-subscription {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
}

.tenant-subscription i {
  color: var(--app-teal);
  font-size: 1rem;
}

.tenant-subscription code {
  background: rgba(13, 148, 136, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--app-teal-dark);
}

.tenant-no-sub {
  color: #94a3b8;
}

.tenant-no-sub i {
  color: #f59e0b;
}

.tenant-footer {
  display: flex;
  gap: 0.75rem;
}

.tenant-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(13, 148, 136, 0.05);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 10px;
  color: var(--app-teal-dark);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tenant-action:hover {
  background: rgba(13, 148, 136, 0.1);
  border-color: var(--app-teal);
  color: var(--app-teal-dark);
}

.tenant-action i:first-child {
  font-size: 1rem;
}

.tenant-action i:last-child {
  font-size: 0.875rem;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.module-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--app-teal), var(--app-teal-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.module-card:hover::before {
  opacity: 1;
}

.module-card:hover {
  border-color: var(--app-teal);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.15);
  transform: translateY(-4px);
}

.module-card-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.module-card-disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #e2e8f0;
}

.module-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.module-icon i {
  font-size: 2rem;
  color: white;
}

.module-icon-safety {
  background: linear-gradient(135deg, #10b981, #059669);
}

.module-icon-accounts {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.module-icon-quality {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.module-icon-hr {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.module-icon-asset {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.module-icon-environment {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.module-icon-health {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.module-icon-warehouse {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.module-icon-maintenance {
  background: linear-gradient(135deg, #64748b, #475569);
}

.module-icon-sustainability {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.module-icon-sheq {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.module-icon-audit {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.module-icon-actions {
  background: linear-gradient(135deg, #eab308, #ca8a04);
}

.module-icon-notifications {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.module-icon-billing {
  background: linear-gradient(135deg, #a855f7, #9333ea);
}

.module-icon-rbac {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.module-icon-tenants {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

.module-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.module-description {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.module-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--app-teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.module-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  background: linear-gradient(135deg, var(--app-teal), var(--app-teal-dark));
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.module-link:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
  color: white;
}

.module-link i {
  font-size: 1.125rem;
  transition: transform 0.3s ease;
}

.module-link:hover i {
  transform: translateX(4px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(248, 250, 252, 0.5);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
}

.empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
  color: #94a3b8;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .main-dashboard {
    padding: 1rem;
  }

  .dashboard-hero {
    padding: 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .tenants-grid,
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

/* Risk Assessment Colors - 5x5 Matrix */
.bg-orange {
  background-color: #fd7e14 !important;
  color: white !important;
}

.badge.bg-orange {
  background-color: #fd7e14 !important;
  color: white !important;
}

/* ========================================
   GLOBAL COMPACT MOBILE MODE
   ======================================== */

@media (max-width: 768px) {
  html {
    font-size: 15.5px;
  }

  body {
    line-height: 1.35;
  }

  h1,
  .h1 {
    font-size: 1.55rem;
  }

  h2,
  .h2 {
    font-size: 1.35rem;
  }

  h3,
  .h3 {
    font-size: 1.2rem;
  }

  h4,
  .h4,
  h5,
  .h5,
  h6,
  .h6 {
    font-size: 1.05rem;
  }

  .btn {
    --bs-btn-padding-y: 0.35rem;
    --bs-btn-padding-x: 0.65rem;
    --bs-btn-font-size: 0.86rem;
    --bs-btn-border-radius: 0.55rem;
    min-height: 2.2rem;
  }

  .btn.btn-sm {
    --bs-btn-padding-y: 0.24rem;
    --bs-btn-padding-x: 0.5rem;
    --bs-btn-font-size: 0.78rem;
    min-height: 2rem;
  }

  .form-label,
  .form-text,
  .small {
    font-size: 0.82rem;
  }

  .form-control,
  .form-select,
  .input-group-text {
    font-size: 0.9rem;
    min-height: 2.2rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .badge {
    font-size: 0.72rem;
    padding: 0.26em 0.5em;
  }

  .card-header,
  .card-body,
  .card-footer,
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 0.75rem;
  }

  .table,
  .table > :not(caption) > * > * {
    font-size: 0.82rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .pagination .page-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 15px;
  }

  .container,
  .container-fluid {
    --bs-gutter-x: 0.85rem;
  }

  .btn {
    --bs-btn-font-size: 0.83rem;
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-padding-x: 0.58rem;
    min-height: 2.1rem;
  }

  .btn.btn-sm {
    --bs-btn-font-size: 0.75rem;
    min-height: 1.9rem;
  }

  .table,
  .table > :not(caption) > * > * {
    font-size: 0.78rem;
  }

  .modal-dialog {
    margin: 0.45rem;
  }
}


