/* Sticky Footer Layout */
html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Persistent trial-mode notice */
body.trial-mode-active {
  --trial-banner-height: 2.75rem;
  padding-top: var(--trial-banner-height);
}

.trial-mode-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1050;
  height: var(--trial-banner-height);
  display: flex;
  align-items: center;
  color: #4b2e00;
  background: #fff3cd;
  border-bottom: 1px solid #e5b84b;
  box-shadow: 0 2px 6px rgba(75, 46, 0, 0.12);
}

.trial-mode-banner__content {
  width: 100%;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  line-height: 1.25;
  text-align: center;
}

.trial-mode-banner__icon {
  flex: 0 0 auto;
  color: #a15c00;
  font-size: 1rem;
}

.trial-mode-banner__label {
  flex: 0 0 auto;
  padding: 0.16rem 0.45rem;
  color: #fff;
  background: #8a4f00;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.trial-mode-banner__message {
  min-width: 0;
}

body.trial-mode-active .app-header.navbar {
  top: var(--trial-banner-height);
}

@media (max-width: 575.98px) {
  body.trial-mode-active {
    --trial-banner-height: 4.25rem;
  }

  .trial-mode-banner__content {
    align-items: flex-start;
    padding-inline: 0.65rem;
    gap: 0.4rem;
    font-size: 0.78rem;
    text-align: start;
  }

  .trial-mode-banner__icon {
    margin-top: 0.12rem;
  }

  .trial-mode-banner__label {
    margin-top: 0.02rem;
    padding-inline: 0.35rem;
    font-size: 0.68rem;
  }

  .trial-mode-banner__message {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 991.98px) {
  body.trial-mode-active.sidebar-expand-lg .app-sidebar {
    top: var(--trial-banner-height);
    max-height: calc(100vh - var(--trial-banner-height));
  }

  body.trial-mode-active.sidebar-expand-lg .app-sidebar .sidebar-wrapper {
    height: calc(100vh - var(--trial-banner-height) - 3.5rem - 1px);
  }
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: row;
}

.app-sidebar {
    flex: 0 0 auto;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Typography */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* RTL Layout Fixes */
[dir="rtl"] .main-sidebar {
  right: 0;
  left: auto;
}

[dir="rtl"] .content-wrapper {
  margin-right: 250px;
  margin-left: 0;
}

[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

[dir="rtl"] .brand-link {
  text-align: right;
}

[dir="rtl"] .nav-sidebar .nav-link > p {
  margin-right: 0.5rem;
  margin-left: 0;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  float: right;
  padding-left: 0.5rem;
  padding-right: 0;
}

/* Fix nav-arrow icon overlapping with submenu items when expanded */
.sidebar-menu .nav-item > .nav-link {
  overflow: hidden;
}
.sidebar-menu .nav-arrow {
  font-size: 0.75rem;
  line-height: 1;
}

/* ========================================
   Smart Casual Theme - Modern & Professional
   ======================================== */

/* Topbar Styling */
.app-header.navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e3e6ea;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.app-header .nav-link {
  color: #4a5568 !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  border-radius: 0.375rem;
}

.app-header .nav-link:hover {
  color: #4a6fa5 !important;
  background-color: #f7f8fc;
}

.app-header .nav-link[data-lte-toggle="sidebar"] {
  font-size: 1.5rem;
  padding: 0.25rem 0.75rem;
}

.app-header .form-select {
  border: 1px solid #e3e6ea;
  color: #4a5568;
  font-size: 0.875rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.app-header .form-select:focus {
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* Sidebar Styling */
.app-sidebar {
  background: #f8f9fc !important;
  border-right: 1px solid #e3e6ea;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.sidebar-brand {
  background: #ffffff;
  border-bottom: 1px solid #e3e6ea;
  padding: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  color: #2c3e50 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: all 0.2s ease;
}

.brand-link:hover {
  color: #4a6fa5 !important;
}

.brand-text {
  margin-left: 0.75rem;
}

/* Sidebar Navigation */
.sidebar-menu .nav-link {
  color: #4a5568 !important;
  font-weight: 500;
  padding: 0.625rem 1rem;
  margin: 0.125rem 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.sidebar-menu .nav-link:hover {
  background-color: #e8eaf5;
  color: #4a6fa5 !important;
}

.sidebar-menu .nav-link.active {
  background-color: #4a6fa5;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(74, 111, 165, 0.2);
}

.sidebar-menu .nav-link.active:hover {
  background-color: #3d5a8a;
}

.sidebar-menu .nav-icon {
  font-size: 1.125rem;
  margin-right: 0.75rem;
  min-width: 1.5rem;
  text-align: center;
}

.sidebar-menu .nav-link.active .nav-icon {
  color: #ffffff;
}

/* Nested menu items */
.sidebar-menu .nav-treeview {
  padding-left: 0;
}

.sidebar-menu .nav-treeview .nav-link {
  padding-left: 2.5rem;
  font-size: 0.9375rem;
  font-weight: 400;
}

.sidebar-menu .nav-treeview .nav-treeview .nav-link {
  padding-left: 3.5rem;
  font-size: 0.875rem;
}

/* Menu arrow indicator */
.sidebar-menu .nav-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.sidebar-menu .menu-open > .nav-link .nav-arrow {
  transform: rotate(90deg);
}

.sidebar-menu .nav-link:hover .nav-arrow {
  opacity: 1;
}

/* Active menu state for parent items */
.sidebar-menu .menu-open > .nav-link {
  background-color: #e8eaf5;
  color: #4a6fa5 !important;
}

/* Sidebar Divider */
.sidebar-menu > .nav-item:not(:last-child) {
  margin-bottom: 0.25rem;
}

/* Smooth scrolling for sidebar */
.sidebar-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.sidebar-wrapper::-webkit-scrollbar {
  width: 6px;
}

.sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
  background-color: #cbd5e0;
  border-radius: 3px;
}

.sidebar-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #a0aec0;
}

/* Footer styling to match theme */
.app-footer {
  background: #ffffff;
  border-top: 1px solid #e3e6ea;
  color: #718096;
  padding: 1rem;
}

/* Enhance form elements to match theme */
.form-control:focus,
.form-select:focus {
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* Card shadows for consistency */
.card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e3e6ea;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Button primary color adjustment */
.btn-primary {
  background-color: #4a6fa5;
  border-color: #4a6fa5;
}

.btn-primary:hover {
  background-color: #3d5a8a;
  border-color: #3d5a8a;
}

/* Alert info color adjustment */
.alert-info {
  background-color: #e8f4fd;
  border-color: #b8dff7;
  color: #2c5282;
}

/* Links */
a {
  color: #4a6fa5;
}

a:hover {
  color: #3d5a8a;
}

/* Language Switcher - Modern Toggle */
.language-switcher {
  background: #f1f3f5;
  border-radius: 0.5rem;
  padding: 0.125rem;
  display: inline-flex;
  gap: 0.125rem;
}

.language-btn {
  background: transparent;
  border: none;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  min-width: 2.5rem;
}

.language-btn:hover {
  background: #e9ecef;
  color: #495057;
  transform: none;
}

.language-btn.active {
  background: #ffffff;
  color: #4a6fa5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-btn:focus {
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15);
}

/* RTL Support for Navbar */
[dir="rtl"] .navbar-nav.ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .language-switcher {
  direction: ltr;
}

/* ========================================
   DataTables & Table Styling
   ======================================== */

/* DataTables Search Box Styling */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e3e6ea;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
  outline: none;
}

/* DataTables Length Select Styling */
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #e3e6ea;
  border-radius: 0.375rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  margin: 0 0.5rem;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
  outline: none;
}

/* DataTables Pagination Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  margin: 0 0.125rem;
  border: 1px solid #e3e6ea;
  background: #ffffff;
  color: #4a5568 !important;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  border-color: #4a6fa5;
  background: #f7f8fc;
  color: #4a6fa5 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  border-color: #4a6fa5;
  background: #4a6fa5 !important;
  color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* DataTables Info Text */
.dataTables_wrapper .dataTables_info {
  color: #718096;
  padding-top: 0.75rem;
}

/* Table Styling - Modern & Clean */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table-hover tbody tr {
  transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
  background-color: #f7f8fc;
  transform: scale(1.002);
}

.table thead.table-light th {
  background-color: #f8f9fc;
  color: #4a5568;
  font-weight: 600;
  border-bottom: 2px solid #e3e6ea;
  padding: 0.875rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.5px;
}

.table tbody td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f5;
  color: #4a5568;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Badge Styling - Modern Pills */
.badge {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

.badge.rounded-pill {
  padding: 0.375rem 0.875rem;
}

/* Action Buttons - Solid Style with Icons */
.btn-group-sm > .btn,
.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.btn-group-sm > .btn i,
.btn-sm i {
  font-size: 0.875rem;
}

/* Button Colors - Smart Casual Theme */
.btn-info {
  background-color: #17a2b8;
  border-color: #17a2b8;
  color: #ffffff;
}

.btn-info:hover {
  background-color: #138496;
  border-color: #117a8b;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-primary {
  background-color: #4a6fa5;
  border-color: #4a6fa5;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #3d5a8a;
  border-color: #3d5a8a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(74, 111, 165, 0.3);
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
  color: #ffffff;
}

/* Button Group Spacing */
.btn-group {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
}

.btn-group .btn {
  margin: 0;
  position: relative;
}

.btn-group .btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.btn-group .btn:last-child {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.btn-group .btn:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Content Header Styling */
.content-header {
  padding: 1rem 0;
}

.content-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #2c3e50;
}

.content-header h1 i {
  margin-right: 0.5rem;
}

/* Section Content */
section.content {
  padding: 0.5rem 0;
}

/* Responsive Table Adjustments */
@media (max-width: 768px) {
  .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Pagination Styling */
.pagination {
  margin-bottom: 0;
}

.pagination .page-link {
  color: #4a6fa5;
  border: 1px solid #e3e6ea;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
}

.pagination .page-link:hover {
  color: #3d5a8a;
  background-color: #f7f8fc;
  border-color: #4a6fa5;
}

.pagination .page-item.active .page-link {
  background-color: #4a6fa5;
  border-color: #4a6fa5;
  color: #ffffff;
  font-weight: 600;
}

.pagination .page-item.disabled .page-link {
  color: #a0aec0;
  background-color: #f8f9fc;
  border-color: #e3e6ea;
  cursor: not-allowed;
}

