/* ==========================================================================
   TPF Component CSS Classes
   Plain CSS version (no Tailwind @apply - works without build)
   ========================================================================== */

/* ==========================================================================
   Tooltip - Hover tooltip for buttons and elements
   ========================================================================== */
.has-tooltip {
  position: relative;
}

.has-tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #1e293b;
  color: white;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.has-tooltip .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 1rem;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.has-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Dark mode tooltip */
.dark .has-tooltip .tooltip-text {
  background-color: #334155;
}

.dark .has-tooltip .tooltip-text::after {
  border-color: #334155 transparent transparent transparent;
}

/* ==========================================================================
   Tooltip Component - JavaScript-initialized tooltips (data-tooltip attribute)
   ========================================================================== */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 1000;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  white-space: pre-line;
  max-width: 250px;
  text-align: right;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 12px;
  border-width: 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-content,
.tooltip-wrapper.tooltip-active .tooltip-content {
  visibility: visible;
  opacity: 1;
}

.dark .tooltip-content {
  background: #334155;
}

.dark .tooltip-content::after {
  border-color: #334155 transparent transparent transparent;
}

/* ==========================================================================
   Icon Box - Rounded icon containers with color variants
   ========================================================================== */
.icon-box {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box-sm {
  height: 2.25rem;
  width: 2.25rem;
}

.icon-box-lg {
  height: 3rem;
  width: 3rem;
}

/* Icon Box Color Variants */
.icon-box-primary { background-color: rgb(70 105 250); }
.icon-box-success { background-color: rgb(80 199 147); }
.icon-box-danger { background-color: rgb(241 89 92); }
.icon-box-warning { background-color: rgb(250 145 107); }
.icon-box-info { background-color: rgb(12 231 250); }
.icon-box-green { background-color: #22c55e; }
.icon-box-blue { background-color: #3b82f6; }
.icon-box-red { background-color: #ef4444; }
.icon-box-orange { background-color: #f97316; }
.icon-box-purple { background-color: #a855f7; }
.icon-box-teal { background-color: #14b8a6; }
.icon-box-pink { background-color: #ec4899; }
.icon-box-rose { background-color: #f43f5e; }
.icon-box-violet { background-color: #8b5cf6; }
.icon-box-amber { background-color: #f59e0b; }
.icon-box-emerald { background-color: #10b981; }

/* ==========================================================================
   Status Badge - Status indicators with semantic colors
   ========================================================================== */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.status-not-started {
  background-color: rgb(241 245 249);
  color: rgb(71 85 105);
}
.dark .status-not-started {
  background-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.status-in-progress {
  background-color: rgb(255 244 241);
  color: rgb(150 87 64);
}
.dark .status-in-progress {
  background-color: rgb(180 83 9 / 0.2);
  color: rgb(251 191 36);
}

.status-active {
  background-color: rgb(231 254 255);
  color: rgb(7 139 150);
}
.dark .status-active {
  background-color: rgb(6 182 212 / 0.2);
  color: rgb(34 211 238);
}

.status-passed {
  background-color: rgb(231 253 241);
  color: rgb(46 109 97);
}
.dark .status-passed {
  background-color: rgb(22 163 74 / 0.2);
  color: rgb(74 222 128);
}

.status-failed {
  background-color: rgb(254 239 239);
  color: rgb(145 53 55);
}
.dark .status-failed {
  background-color: rgb(220 38 38 / 0.2);
  color: rgb(248 113 113);
}

/* ==========================================================================
   Table Utilities
   ========================================================================== */
.table-header-cell {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(71 85 105);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dark .table-header-cell {
  color: rgb(148 163 184);
}

.table-cell {
  padding: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   Card Component
   ========================================================================== */
.card {
  background-color: white;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .card {
  background-color: rgb(30 41 59);
  border-color: rgb(51 65 85);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgb(226 232 240);
}

.dark .card-header {
  border-bottom-color: rgb(51 65 85);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(30 41 59);
  margin: 0;
}

.dark .card-title {
  color: rgb(241 245 249);
}

.card-body {
  padding: 1.5rem;
}

/* ==========================================================================
   Button Component
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-primary {
  background-color: rgb(70 105 250);
  color: white;
  border-color: rgb(70 105 250);
}

.btn-primary:hover {
  background-color: rgb(55 90 230);
  border-color: rgb(55 90 230);
}

.btn-outline-primary {
  background-color: transparent;
  color: rgb(70 105 250);
  border-color: rgb(70 105 250);
}

.btn-outline-primary:hover {
  background-color: rgb(70 105 250);
  color: white;
}

.btn-outline-secondary {
  background-color: transparent;
  color: rgb(100 116 139);
  border-color: rgb(203 213 225);
}

.dark .btn-outline-secondary {
  color: rgb(148 163 184);
  border-color: rgb(71 85 105);
}

.btn-outline-secondary:hover {
  background-color: rgb(241 245 249);
  color: rgb(30 41 59);
}

.dark .btn-outline-secondary:hover {
  background-color: rgb(51 65 85);
  color: rgb(241 245 249);
}

.btn-outline-success {
  background-color: transparent;
  color: rgb(34 197 94);
  border-color: rgb(34 197 94);
}

.btn-outline-success:hover {
  background-color: rgb(34 197 94);
  color: white;
}

.btn-outline-dark {
  background-color: transparent;
  color: rgb(30 41 59);
  border-color: rgb(30 41 59);
}

.dark .btn-outline-dark {
  color: rgb(203 213 225);
  border-color: rgb(148 163 184);
}

.btn-outline-dark:hover {
  background-color: rgb(30 41 59);
  color: white;
}

.dark .btn-outline-dark:hover {
  background-color: rgb(71 85 105);
  color: white;
}

/* ==========================================================================
   Alert Component
   ========================================================================== */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid;
}

.alert-success {
  background-color: rgb(240 253 244);
  border-color: rgb(187 247 208);
  color: rgb(22 101 52);
}

.dark .alert-success {
  background-color: rgb(22 101 52 / 0.2);
  border-color: rgb(22 101 52 / 0.4);
  color: rgb(134 239 172);
}

.alert-danger {
  background-color: rgb(254 242 242);
  border-color: rgb(254 202 202);
  color: rgb(153 27 27);
}

.dark .alert-danger {
  background-color: rgb(153 27 27 / 0.2);
  border-color: rgb(153 27 27 / 0.4);
  color: rgb(252 165 165);
}

/* ==========================================================================
   Challenge Card Component
   ========================================================================== */
.challenge-card {
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  min-height: 280px;
}

.challenge-content {
  flex: 1;
}

.challenge-footer {
  margin-top: auto;
  padding-top: 1.5rem;
}

.challenge-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgb(30 41 59);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  z-index: 10;
}

[dir="ltr"] .challenge-badge {
  left: auto;
  right: 1rem;
}

.challenge-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: inherit;
}

.challenge-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.challenge-price .price {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.challenge-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: white;
  color: rgb(180 83 9);
}

.challenge-tag-light {
  background-color: rgb(254 243 199);
  color: rgb(180 83 9);
}

.challenge-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgb(71 85 105);
  margin: 0;
}

/* Dark mode - challenge description inherits card's text color */
.dark .challenge-card-warning .challenge-desc,
.dark .challenge-card-info .challenge-desc,
.dark .challenge-card-success .challenge-desc,
.dark .challenge-card-primary .challenge-desc {
  color: inherit;
  opacity: 0.85;
}

.challenge-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  border-radius: 0.5rem;
  border: 1px solid rgb(30 41 59);
  background-color: transparent;
  color: rgb(30 41 59);
  text-decoration: none;
  transition: all 0.15s ease;
}

.challenge-btn:hover {
  background-color: rgb(30 41 59);
  color: white;
}

/* Dark mode for challenge buttons on colored cards */
.dark .challenge-card-warning .challenge-btn,
.dark .challenge-card-info .challenge-btn,
.dark .challenge-card-success .challenge-btn,
.dark .challenge-card-primary .challenge-btn {
  border-color: white;
  color: white;
}

.dark .challenge-card-warning .challenge-btn:hover,
.dark .challenge-card-info .challenge-btn:hover,
.dark .challenge-card-success .challenge-btn:hover,
.dark .challenge-card-primary .challenge-btn:hover {
  background-color: white;
  color: rgb(30 41 59);
  border-color: white;
}

/* Card Variants */
.challenge-card-warning {
  background-color: rgb(254 243 199);
  color: rgb(30 41 59);
}

.dark .challenge-card-warning {
  background-color: rgb(180 83 9 / 0.2);
  color: rgb(254 243 199);
}

.challenge-card-info {
  background-color: rgb(224 242 254);
  color: rgb(30 41 59);
}

.dark .challenge-card-info {
  background-color: rgb(3 105 161 / 0.2);
  color: rgb(224 242 254);
}

.challenge-card-success {
  background-color: rgb(220 252 231);
  color: rgb(30 41 59);
}

.dark .challenge-card-success {
  background-color: rgb(22 101 52 / 0.2);
  color: rgb(220 252 231);
}

.challenge-card-primary {
  background-color: rgb(224 231 255);
  color: rgb(30 41 59);
}

.dark .challenge-card-primary {
  background-color: rgb(67 56 202 / 0.2);
  color: rgb(224 231 255);
}

.challenge-card-light {
  background-color: white;
  color: rgb(30 41 59);
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.dark .challenge-card-light {
  background-color: rgb(30 41 59);
  color: rgb(226 232 240);
  border-color: rgb(51 65 85);
}

.challenge-card-dark {
  background-color: rgb(30 41 59);
  color: white;
}

.dark .challenge-card-dark {
  background-color: rgb(15 23 42);
  border: 1px solid rgb(51 65 85);
}

.challenge-card-dark .challenge-desc {
  color: rgb(203 213 225);
}

.challenge-card-dark .challenge-btn,
.challenge-btn-dark {
  border-color: rgb(203 213 225);
  color: rgb(203 213 225);
}

.challenge-card-dark .challenge-btn:hover,
.challenge-btn-dark:hover {
  background-color: white;
  color: rgb(30 41 59);
  border-color: white;
}

.challenge-card-light .challenge-btn,
.challenge-btn-light {
  border-color: rgb(100 116 139);
  color: rgb(100 116 139);
}

.challenge-card-light .challenge-btn:hover,
.challenge-btn-light:hover {
  background-color: rgb(100 116 139);
  color: white;
}

/* ==========================================================================
   Breadcrumb Component
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  color: rgb(100 116 139);
}

.breadcrumb-item a {
  display: inline-flex;
  align-items: center;
  color: rgb(70 105 250);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
  color: rgb(55 90 230);
}

.dark .breadcrumb-item {
  color: rgb(148 163 184);
}

.dark .breadcrumb-item a {
  color: rgb(129 140 248);
}

.dark .breadcrumb-item a:hover {
  color: rgb(165 180 252);
}

.breadcrumb-separator {
  color: rgb(203 213 225);
  font-size: 0.75rem;
}

.dark .breadcrumb-separator {
  color: rgb(71 85 105);
}

/* RTL separator rotation */
[dir="rtl"] .breadcrumb-separator {
  transform: rotate(180deg);
}

/* ==========================================================================
   Shadow Utilities
   ========================================================================== */
.shadow-base {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* ==========================================================================
   Gradient Backgrounds
   ========================================================================== */
.gradient-blue {
  background: linear-gradient(to bottom right, #dbeafe, #bfdbfe);
}
.dark .gradient-blue {
  background: linear-gradient(to bottom right, rgba(30, 64, 175, 0.3), rgba(29, 78, 216, 0.3));
}

.gradient-green {
  background: linear-gradient(to bottom right, #dcfce7, #bbf7d0);
}
.dark .gradient-green {
  background: linear-gradient(to bottom right, rgba(22, 101, 52, 0.3), rgba(21, 128, 61, 0.3));
}

.gradient-purple {
  background: linear-gradient(to bottom right, #f3e8ff, #e9d5ff);
}
.dark .gradient-purple {
  background: linear-gradient(to bottom right, rgba(88, 28, 135, 0.3), rgba(107, 33, 168, 0.3));
}

.gradient-amber {
  background: linear-gradient(to bottom right, #fef3c7, #fde68a);
}
.dark .gradient-amber {
  background: linear-gradient(to bottom right, rgba(146, 64, 14, 0.3), rgba(180, 83, 9, 0.3));
}

/* ==========================================================================
   Chart Container
   ========================================================================== */
.chart-container {
  height: 400px;
  width: 100%;
}

.chart-container-sm {
  height: 300px;
  width: 100%;
}

/* ==========================================================================
   Stat Box - Unified stat cards
   ========================================================================== */
.stat-box {
  background-color: rgb(248 250 252);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(226 232 240);
  display: flex;
  align-items: center;
}

.dark .stat-box {
  background-color: rgb(30 41 59);
  border-color: rgb(51 65 85);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(100 116 139);
  margin-bottom: 0.25rem;
}

.dark .stat-label {
  color: rgb(148 163 184);
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: rgb(30 41 59);
}

.dark .stat-value {
  color: rgb(241 245 249);
}

/* ==========================================================================
   Metric Display
   ========================================================================== */
.metric-label {
  font-size: 0.75rem;
  color: rgb(100 116 139);
  margin-top: 0.125rem;
}
.dark .metric-label {
  color: rgb(148 163 184);
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(51 65 85);
}
.dark .metric-value {
  color: rgb(203 213 225);
}

.metric-value-lg {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(30 41 59);
}
.dark .metric-value-lg {
  color: rgb(226 232 240);
}

/* ==========================================================================
   Flex Utilities
   ========================================================================== */
.flex-icon-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flex-icon-text-sm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Grid Utilities
   ========================================================================== */
.grid-auto-rows-fr {
  grid-auto-rows: 1fr;
}

/* ==========================================================================
   Hero Status Badge
   ========================================================================== */
.hero-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.hero-status-not-started {
  background-color: #f1f5f9;
  color: #334155;
}
.dark .hero-status-not-started {
  background-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.hero-status-in-progress {
  background-color: #fef3c7;
  color: #b45309;
}
.dark .hero-status-in-progress {
  background-color: rgb(180 83 9 / 0.2);
  color: rgb(251 191 36);
}

.hero-status-passed {
  background-color: #dcfce7;
  color: #15803d;
}
.dark .hero-status-passed {
  background-color: rgb(22 163 74 / 0.2);
  color: rgb(74 222 128);
}

.hero-status-failed {
  background-color: #fee2e2;
  color: #b91c1c;
}
.dark .hero-status-failed {
  background-color: rgb(220 38 38 / 0.2);
  color: rgb(248 113 113);
}

/* ==========================================================================
   Alert Box Backgrounds
   ========================================================================== */
.alert-box-success {
  background-color: #f0fdf4;
}
.dark .alert-box-success {
  background-color: rgb(22 163 74 / 0.1);
}

.alert-box-danger {
  background-color: #fef2f2;
}
.dark .alert-box-danger {
  background-color: rgb(220 38 38 / 0.1);
}

.alert-header {
  background-color: #ffffff;
}
.dark .alert-header {
  background-color: rgb(30 41 59);
}

/* Alert icon boxes */
.alert-icon-success {
  background-color: #dcfce7;
}
.dark .alert-icon-success {
  background-color: rgb(22 163 74 / 0.2);
}
.alert-icon-success iconify-icon,
.alert-icon-success .icon-color {
  color: #15803d;
}
.dark .alert-icon-success iconify-icon,
.dark .alert-icon-success .icon-color {
  color: rgb(74 222 128);
}

.alert-icon-danger {
  background-color: #fee2e2;
}
.dark .alert-icon-danger {
  background-color: rgb(220 38 38 / 0.2);
}
.alert-icon-danger iconify-icon,
.alert-icon-danger .icon-color {
  color: #b91c1c;
}
.dark .alert-icon-danger iconify-icon,
.dark .alert-icon-danger .icon-color {
  color: rgb(248 113 113);
}

/* Small status tag */
.status-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-tag-success {
  background-color: #dcfce7;
  color: #15803d;
}
.dark .status-tag-success {
  background-color: rgb(22 163 74 / 0.2);
  color: rgb(74 222 128);
}

.status-tag-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}
.dark .status-tag-danger {
  background-color: rgb(220 38 38 / 0.2);
  color: rgb(248 113 113);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.touch-action-none {
  touch-action: none;
}

.tracking-otp {
  letter-spacing: 0.5em;
}

/* ==========================================================================
   Font Utility
   ========================================================================== */
.font-inter {
  font-family: 'Yekan Bakh', 'Inter', system-ui, sans-serif;
}

/* ==========================================================================
   App Layout - Sidebar and Main Content Structure
   ========================================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: rgb(248 250 252); /* slate-50 */
}

.dark .app-wrapper {
  background-color: rgb(15 23 42); /* slate-900 */
}

/* Page content area */
.page-content {
  background-color: rgb(248 250 252);
}

.dark .page-content {
  background-color: rgb(15 23 42);
}

.sidebar-wrapper {
  position: fixed;
  top: 0;
  right: 0; /* RTL */
  width: 248px;
  height: 100%;
  background-color: #fff;
  z-index: 50;
  transition: all 0.3s ease;
  border-left: 1px solid rgb(226 232 240);
}

[dir="ltr"] .sidebar-wrapper {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgb(226 232 240);
}

.dark .sidebar-wrapper {
  background-color: rgb(30 41 59);
  border-color: rgb(51 65 85);
}

/* Sidebar transition for smooth collapse */
.sidebar-wrapper {
  transition: width 0.2s ease;
}

/* Collapsed sidebar - support both html class (early) and app-wrapper class */
.app-wrapper.collapsed .sidebar-wrapper,
html.sidebar-collapsed .sidebar-wrapper {
  width: 72px;
}

.logo-segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  height: 64px;
  border-bottom: 1px solid rgb(226 232 240);
}

.dark .logo-segment {
  border-color: rgb(51 65 85);
}

/* Hide text when sidebar collapsed */
.app-wrapper.collapsed .sidebar-wrapper .logo-segment span,
html.sidebar-collapsed .sidebar-wrapper .logo-segment span {
  display: none;
}

/* Adjust logo segment when collapsed - center the logo */
.app-wrapper.collapsed .logo-segment,
html.sidebar-collapsed .logo-segment {
  justify-content: center;
  padding: 0.875rem 0.75rem;
}

/* Hide logo text when collapsed, keep logo icon */
.app-wrapper.collapsed .sidebar-logo-text,
html.sidebar-collapsed .sidebar-logo-text {
  display: none;
}

/* Center logo when collapsed */
.app-wrapper.collapsed .logo-segment > a,
html.sidebar-collapsed .logo-segment > a {
  justify-content: center;
}

/* Sidebar toggle button at bottom */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  margin-top: 0.75rem;
  background-color: rgb(241 245 249);
  border-radius: 0.5rem;
  color: rgb(71 85 105);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background-color: rgb(226 232 240);
  color: rgb(30 41 59);
}

.dark .sidebar-toggle-btn {
  background-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.dark .sidebar-toggle-btn:hover {
  background-color: rgb(71 85 105);
  color: rgb(255 255 255);
}

.sidebar-toggle-btn iconify-icon {
  font-size: 1rem;
}

/* Hide toggle text when collapsed */
.app-wrapper.collapsed .sidebar-toggle-text,
html.sidebar-collapsed .sidebar-toggle-text {
  display: none;
}

/* Center toggle button when collapsed */
.app-wrapper.collapsed .sidebar-toggle-btn,
html.sidebar-collapsed .sidebar-toggle-btn {
  justify-content: center;
  padding: 0.75rem;
}

/* Adjust sidebar-bottom padding when collapsed */
.app-wrapper.collapsed .sidebar-bottom,
html.sidebar-collapsed .sidebar-bottom {
  padding: 0;
  border-top: none;
}

.sidebar-menus {
  overflow-y: auto;
  padding: 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  height: calc(100% - 64px);
}

/* Sidebar bottom section */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgb(226 232 240);
}

.dark .sidebar-bottom {
  border-color: rgb(51 65 85);
}

/* Website link badge */
.sidebar-website-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background-color: rgb(241 245 249);
  border-radius: 0.5rem;
  color: rgb(71 85 105);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
}

.sidebar-website-link:hover {
  background-color: rgb(226 232 240);
  color: rgb(30 41 59);
}

.dark .sidebar-website-link {
  background-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.dark .sidebar-website-link:hover {
  background-color: rgb(71 85 105);
  color: rgb(255 255 255);
}

.sidebar-website-link iconify-icon {
  font-size: 1rem;
  opacity: 0.7;
}

/* Content wrapper - offset for sidebar */
.content-wrapper {
  flex: 1;
  min-width: 0;
  width: 100%;
  /* RTL: offset from right sidebar */
  margin-right: 248px;
  margin-left: 0;
  transition: margin 0.2s ease;
}

[dir="ltr"] .content-wrapper {
  margin-left: 248px;
  margin-right: 0;
}

/* Main content area should fill available width */
.content-wrapper > div {
  width: 100%;
}

/* Collapsed sidebar content adjustment */
.app-wrapper.collapsed .content-wrapper,
html.sidebar-collapsed .content-wrapper {
  margin-right: 72px;
}

[dir="ltr"] .app-wrapper.collapsed .content-wrapper,
[dir="ltr"] html.sidebar-collapsed .content-wrapper {
  margin-left: 72px;
  margin-right: 0;
}

/* Collapsed sidebar - hide menu text and titles */
.app-wrapper.collapsed .sidebar-menu-title,
html.sidebar-collapsed .sidebar-menu-title {
  display: none;
}

.app-wrapper.collapsed .navItem span,
html.sidebar-collapsed .navItem span {
  display: none;
}

/* Hide website link when collapsed, but show toggle button */
.app-wrapper.collapsed .sidebar-website-link,
html.sidebar-collapsed .sidebar-website-link {
  display: none;
}

.app-wrapper.collapsed .nav-icon,
html.sidebar-collapsed .nav-icon {
  margin: 0;
}

.app-wrapper.collapsed .navItem,
html.sidebar-collapsed .navItem {
  justify-content: center;
  padding: 0.75rem;
}

/* Sidebar menu item styles */
.sidebar-menu-title {
  padding: 0.375rem 0.75rem;
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-menu-title:first-child {
  margin-top: 0.25rem;
}

.dark .sidebar-menu-title {
  color: rgb(100 116 139);
}

.navItem {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  color: rgb(71 85 105);
  border-radius: 0.375rem;
  margin: 0.125rem 0;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.navItem:hover {
  background-color: rgb(241 245 249);
  color: rgb(15 23 42);
}

.dark .navItem {
  color: rgb(203 213 225);
}

.dark .navItem:hover {
  background-color: rgb(51 65 85);
  color: rgb(255 255 255);
}

.navItem.active {
  background-color: rgb(70 105 250);
  color: #fff;
}

.nav-icon {
  font-size: 1.125rem;
  margin-left: 0.625rem; /* RTL */
  opacity: 0.8;
}

[dir="ltr"] .nav-icon {
  margin-left: 0;
  margin-right: 0.625rem;
}

/* Sidebar close icon for mobile */
.sidebarCloseIcon {
  display: none;
}

/* Small device menu controller */
.smallDeviceMenuController {
  display: none;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: #fff;
  border-bottom: 1px solid rgb(226 232 240);
  height: 64px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
}

.app-header > div {
  height: 100%;
  display: flex;
  align-items: center;
  width: 100%;
}

.dark .app-header {
  background-color: rgb(30 41 59);
  border-color: rgb(51 65 85);
}

/* Header inner flex alignment */
.app-header .flex {
  align-items: center;
}

/* Nav tools - consistent spacing using gap */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 12px base spacing */
  margin-right: auto; /* RTL: push to the left */
}

[dir="ltr"] .nav-tools {
  margin-right: 0;
  margin-left: auto; /* LTR: push to the right */
}

@media (min-width: 1024px) {
  .nav-tools {
    gap: 1rem; /* 16px on larger screens */
  }
}

/* Ensure all nav-tools children have no extra margins */
.nav-tools > * {
  margin: 0 !important;
}

/* Logo visibility */
.black_logo {
  display: block;
}

.white_logo {
  display: none;
}

.dark .black_logo {
  display: none;
}

.dark .white_logo {
  display: block;
}

/* Extend/Collapse icons */
.extend-icon {
  display: block;
}

.collapsed-icon {
  display: none;
}

.app-wrapper.collapsed .extend-icon,
html.sidebar-collapsed .extend-icon {
  display: none;
}

.app-wrapper.collapsed .collapsed-icon,
html.sidebar-collapsed .collapsed-icon {
  display: block;
}

/* Header logo box defaults - hide both on desktop when sidebar is visible */
/* Only show on mobile/tablet when sidebar is hidden */
.vertical-box {
  display: none;
}

.horizental-box {
  display: none;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .sidebar-wrapper {
    transform: translateX(100%); /* RTL: slide from right */
    box-shadow: none;
  }

  [dir="ltr"] .sidebar-wrapper {
    transform: translateX(-100%); /* LTR: slide from left */
  }

  .sidebar-wrapper.open {
    transform: translateX(0);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  }

  .content-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .site-footer {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .sidebarCloseIcon {
    display: block;
  }

  .smallDeviceMenuController {
    display: block;
  }

  /* Show mobile logo in header when sidebar is hidden on mobile */
  .vertical-box {
    display: flex;
  }
}

/* ==========================================================================
   Tailwind Utility Classes Fallback
   These are for inline Tailwind classes that won't work without build
   ========================================================================== */

/* XL breakpoint visibility utilities */
.xl\:hidden {
  /* Default: visible */
}

@media (min-width: 1280px) {
  .xl\:hidden {
    display: none !important;
  }

  .xl\:inline-block {
    display: inline-block !important;
  }

  .xl\:block {
    display: block !important;
  }

  .xl\:flex {
    display: flex !important;
  }
}

/* MD breakpoint utilities */
.md\:hidden {
  /* Default: visible */
}

.md\:block {
  display: none;
}

.md\:inline-block {
  display: none;
}

@media (min-width: 768px) {
  .md\:hidden {
    display: none !important;
  }

  .md\:block {
    display: block !important;
  }

  .md\:inline-block {
    display: inline-block !important;
  }
}

/* RTL space reverse */
.rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

/* LTR/RTL margin utilities */
.ltr\:ml-\[248px\] {
  /* Only apply in LTR */
}

.rtl\:mr-\[248px\] {
  /* Only apply in RTL - handled by content-wrapper */
}

[dir="ltr"] .ltr\:ml-\[248px\] {
  margin-left: 248px;
}

[dir="rtl"] .rtl\:mr-\[248px\] {
  margin-right: 248px;
}

/* LTR/RTL margin utilities for specific elements - remove since content-wrapper handles it */
.app-header.ltr\:ml-\[248px\],
.app-header.rtl\:mr-\[248px\],
.site-footer.ltr\:ml-\[248px\],
.site-footer.rtl\:mr-\[248px\] {
  /* These are handled by parent content-wrapper, reset any inline margins */
  margin-left: 0;
  margin-right: 0;
}

/* RTL/LTR margin auto for notification badge */
[dir="ltr"] .ltr\:ml-auto {
  margin-left: auto;
}

[dir="rtl"] .rtl\:mr-auto {
  margin-right: auto;
}

/* Leading utility for icon alignment */
.leading-0 {
  line-height: 0;
}

/* Space utilities - used in other parts of template */
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
  margin-left: 0.5rem;
}

[dir="rtl"] .space-x-2.rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  margin-left: 0;
  margin-right: 0.5rem;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
  margin-left: 1rem;
}

[dir="rtl"] .space-x-4.rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  margin-left: 0;
  margin-right: 1rem;
}

/* ==========================================================================
   DataTables Custom Styling
   ========================================================================== */

/* DataTables wrapper */
.dataTables_wrapper {
  font-family: inherit;
}

/* Top controls container */
.dataTables_wrapper > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* DataTables length select and search */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgb(100 116 139);
  margin: 0;
  white-space: nowrap;
}

.dark .dataTables_wrapper .dataTables_length label,
.dark .dataTables_wrapper .dataTables_filter label {
  color: rgb(148 163 184);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter input[type="search"] {
  background-color: rgb(248 250 252) !important;
  border: 1px solid rgb(226 232 240) !important;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: rgb(30 41 59) !important;
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 60px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter input[type="search"] {
  min-width: 200px;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: rgb(70 105 250) !important;
}

.dark .dataTables_wrapper .dataTables_length select,
.dark .dataTables_wrapper .dataTables_filter input,
.dark .dataTables_wrapper .dataTables_filter input[type="search"] {
  background-color: rgb(30 41 59) !important;
  border-color: rgb(71 85 105) !important;
  color: rgb(241 245 249) !important;
}

.dark .dataTables_wrapper .dataTables_length select:focus,
.dark .dataTables_wrapper .dataTables_filter input:focus {
  border-color: rgb(70 105 250) !important;
}

/* DataTables table */
.dataTables_wrapper table.dataTable {
  border-collapse: collapse;
  width: 100% !important;
}

.dataTables_wrapper table.dataTable thead th {
  background-color: transparent;
  border-bottom: 1px solid rgb(226 232 240);
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(71 85 105);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .dataTables_wrapper table.dataTable thead th {
  border-color: rgb(51 65 85);
  color: rgb(148 163 184);
}

.dataTables_wrapper table.dataTable tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid rgb(241 245 249);
  font-size: 0.875rem;
  color: rgb(51 65 85);
}

.dark .dataTables_wrapper table.dataTable tbody td {
  border-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.dataTables_wrapper table.dataTable tbody tr:hover {
  background-color: rgb(248 250 252);
}

.dark .dataTables_wrapper table.dataTable tbody tr:hover {
  background-color: rgb(51 65 85 / 0.5);
}

/* Remove default DataTables border */
.dataTables_wrapper table.dataTable,
.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable tbody td {
  border-left: none;
  border-right: none;
}

/* Sorting icons */
.dataTables_wrapper table.dataTable thead .sorting,
.dataTables_wrapper table.dataTable thead .sorting_asc,
.dataTables_wrapper table.dataTable thead .sorting_desc {
  cursor: pointer;
  position: relative;
  padding-left: 1.5rem;
}

[dir="rtl"] .dataTables_wrapper table.dataTable thead .sorting,
[dir="rtl"] .dataTables_wrapper table.dataTable thead .sorting_asc,
[dir="rtl"] .dataTables_wrapper table.dataTable thead .sorting_desc {
  padding-left: 0.75rem;
  padding-right: 1.5rem;
}

/* DataTables info and pagination */
.dataTables_wrapper .dataTables_info {
  font-size: 0.875rem;
  color: rgb(100 116 139);
  padding: 1rem 0;
}

.dark .dataTables_wrapper .dataTables_info {
  color: rgb(148 163 184);
}

.dataTables_wrapper .dataTables_paginate {
  padding: 1rem 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  margin: 0 0.125rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(71 85 105);
  background-color: white;
  border: 1px solid rgb(226 232 240);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: rgb(248 250 252);
  border-color: rgb(148 163 184);
  color: rgb(51 65 85);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(to bottom right, rgb(59 130 246), rgb(37 99 235));
  color: white;
  border-color: rgb(59 130 246);
  font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(to bottom right, rgb(37 99 235), rgb(29 78 216));
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
  background-color: rgb(30 41 59);
  border-color: rgb(51 65 85);
  color: rgb(203 213 225);
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: rgb(51 65 85);
  border-color: rgb(71 85 105);
  color: rgb(226 232 240);
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(to bottom right, rgb(59 130 246), rgb(37 99 235));
  border-color: rgb(59 130 246);
  color: white;
}

/* Hide DataTables default bottom border */
.dataTables_wrapper table.dataTable.no-footer {
  border-bottom: none;
}

/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
  background-color: rgb(248 250 252);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  padding: 1rem;
  color: rgb(71 85 105);
}

.dark .dataTables_wrapper .dataTables_processing {
  background-color: rgb(51 65 85);
  border-color: rgb(71 85 105);
  color: rgb(203 213 225);
}

/* ==========================================================================
   Auth Pages - Login/Register/Forgot Password Styles
   ========================================================================== */

/* Auth wrapper - full width container for auth pages */
.auth-wrapper {
  min-height: 100vh;
  width: 100%;
  background-color: rgb(248 250 252);
}

.dark .auth-wrapper {
  background-color: rgb(15 23 42);
}

/* Login page wrapper */
.loginwrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
}

/* Inner column layout */
.lg-inner-column {
  display: flex;
  flex-direction: column;
  width: 100%;
}

@media (min-width: 1024px) {
  .lg-inner-column {
    flex-direction: row;
  }
}

/* Left column - background image area */
.left-column {
  display: none;
  flex: 1;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .left-column {
    display: block;
    min-height: 100vh;
  }
}

/* Left column heading */
.left-column h4 {
  font-size: 2rem;
  line-height: 1.3;
}

.left-column h4 span {
  display: block;
}

@media (min-width: 1280px) {
  .left-column h4 {
    font-size: 2.5rem;
  }
}

/* Right column - form area */
.right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .right-column {
    max-width: 50%;
  }
}

/* Inner content wrapper */
.inner-content {
  padding: 2rem;
}

@media (min-width: 768px) {
  .inner-content {
    padding: 3rem;
  }
}

/* Auth box - main form container */
.auth-box {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Auth box headings */
.auth-box h4 {
  color: rgb(30 41 59);
}

.dark .auth-box h4 {
  color: rgb(241 245 249);
}

/* Auth footer */
.auth-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.75rem;
  color: rgb(100 116 139);
}

.dark .auth-footer {
  color: rgb(148 163 184);
}

.auth-footer a {
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Mobile logo (hidden on desktop) */
.mobile-logo {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-logo {
    display: none;
  }
}

.mobile-logo .dark_logo {
  display: block;
  margin: 0 auto;
}

.mobile-logo .white_logo {
  display: none;
  margin: 0 auto;
}

.dark .mobile-logo .dark_logo {
  display: none;
}

.dark .mobile-logo .white_logo {
  display: block;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

/* Form group wrapper */
.fromGroup {
  margin-bottom: 0;
}

/* Form label */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(30 41 59);
  margin-bottom: 0.5rem;
}

.dark .form-label {
  color: rgb(226 232 240);
}

/* Form control - input styling */
.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(30 41 59);
  background-color: rgb(248 250 252);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-control:focus {
  border-color: rgb(70 105 250);
  box-shadow: 0 0 0 3px rgba(70, 105, 250, 0.1);
}

.form-control::placeholder {
  color: rgb(148 163 184);
}

.dark .form-control {
  color: rgb(241 245 249);
  background-color: rgb(30 41 59);
  border-color: rgb(71 85 105);
}

.dark .form-control:focus {
  border-color: rgb(70 105 250);
  box-shadow: 0 0 0 3px rgba(70, 105, 250, 0.2);
}

.dark .form-control::placeholder {
  color: rgb(100 116 139);
}

/* ==========================================================================
   Button Variants (Additional)
   ========================================================================== */

/* Dark button */
.btn-dark {
  background-color: rgb(30 41 59);
  color: white;
  border-color: rgb(30 41 59);
}

.btn-dark:hover {
  background-color: rgb(15 23 42);
  border-color: rgb(15 23 42);
}

.btn-dark:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dark .btn-dark {
  background-color: rgb(71 85 105);
  border-color: rgb(71 85 105);
}

.dark .btn-dark:hover {
  background-color: rgb(100 116 139);
  border-color: rgb(100 116 139);
}

/* Outline dark button */
.btn-outline-dark {
  background-color: transparent;
  color: rgb(30 41 59);
  border-color: rgb(30 41 59);
}

.btn-outline-dark:hover {
  background-color: rgb(30 41 59);
  color: white;
}

.btn-outline-dark:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dark .btn-outline-dark {
  color: rgb(203 213 225);
  border-color: rgb(148 163 184);
}

.dark .btn-outline-dark:hover {
  background-color: rgb(71 85 105);
  color: white;
  border-color: rgb(71 85 105);
}

/* ==========================================================================
   Checkbox styling
   ========================================================================== */
.hiddens {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Skin classes */
.skin-default {
  /* Default skin - no extra styles needed */
}

/* ==========================================================================
   Dropdown positioning
   ========================================================================== */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  z-index: 9999;
}

[dir="rtl"] .dropdown-menu {
  right: auto;
  left: 0;
}

/* Ensure header doesn't clip dropdowns */
.app-header,
.nav-tools,
.nav-tools > div {
  overflow: visible !important;
}

/* ==========================================================================
   Grayscale effect
   ========================================================================== */
.grayScale {
  filter: grayscale(100%);
}
