/* General Styling Improvements */
:root {
  --primary-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --accent-blue: #3b82f6;
  --success-color: #10b981;
  --error-color: #ef4444;
  --deep-navy: #0f172a;
  --soft-border: #e2e8f0;
  --muted-text: #64748b;
  --hover-surface: #f1f5f9;
  --input-bg: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --shadow-soft: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --radius-card: 40px;
  --radius-control: 16px;
  --radius-button: 14px;
  --surface-2: #f8fafc;

  /* legacy aliases to avoid breaking existing classes */
  --primary-color: var(--accent-blue);
  --secondary-color: var(--text-main);
  --accent-color: var(--error-color);
  --text-color: var(--text-main);
  --light-gray: var(--surface-2);
  --border-color: var(--soft-border);
  --warning-color: #f59e0b;
  --danger-color: var(--error-color);
  --info-color: var(--accent-blue);
}

.dark-theme {
  --primary-bg: #0f172a;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text-main: #f1f5f9;
  --soft-border: rgba(148, 163, 184, 0.22);
  --muted-text: #cbd5e1;
  --hover-surface: rgba(148, 163, 184, 0.14);
  --input-bg: rgba(15, 23, 42, 0.8);
  --glass-bg: rgba(15, 23, 42, 0.72);
  --surface-2: rgba(148, 163, 184, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--primary-bg) 0%, #eef2ff 100%);
  overflow-x: hidden;
}

.dark-theme body {
  background: linear-gradient(180deg, var(--primary-bg) 0%, #020617 100%);
}

/* Dark mode readability baseline */
.dark-theme p,
.dark-theme span,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4,
.dark-theme h5,
.dark-theme h6,
.dark-theme td,
.dark-theme th,
.dark-theme label,
.dark-theme li,
.dark-theme small {
  color: #f1f5f9 !important;
}

.dark-theme a {
  color: #bfdbfe;
}

.dark-theme input,
.dark-theme textarea,
.dark-theme select {
  color: #f8fafc;
}

.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--secondary-color);
  line-height: 1.3;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #2980b9;
}

/* Icon refresh for legacy FontAwesome class usage */
.fa-sign-in-alt:before {
  content: "\f52b";
  /* fa-door-open */
}

.fa-sign-out-alt:before {
  content: "\f52a";
  /* fa-door-closed */
}

.fa-user-circle:before {
  content: "\f4fb";
  /* fa-user-astronaut */
}

img {
  max-width: 100%;
  height: auto;
}

/* Responsive Typography */
h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.85rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.4rem;
  }
}

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

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.3rem;
  }
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  margin-bottom: 20px;
}

@media (max-width: 576px) {
  .card {
    padding: 15px;
  }
}

.card-header {
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  margin-bottom: 20px;
}

table th,
table td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: none;
  background-color: var(--card-bg);
}

table th {
  background-color: var(--surface-2);
  font-weight: 600;
}

table tr:hover {
  background-color: transparent;
}

table tbody tr td:first-child {
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

table tbody tr td:last-child {
  border-radius: var(--radius-control) 0 0 var(--radius-control);
}

table tbody tr:hover td {
  background-color: var(--hover-surface);
}

/* Responsive table */
@media (max-width: 768px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    width: 100%;
    min-width: 500px;
  }
}

@media (max-width: 576px) {
  .table-stack-sm {
    display: block;
  }

  .table-stack-sm thead {
    display: none;
  }

  .table-stack-sm tbody,
  .table-stack-sm tr,
  .table-stack-sm td {
    display: block;
    width: 100%;
  }

  .table-stack-sm tr {
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
  }

  .table-stack-sm td {
    text-align: right;
    padding: 8px;
    position: relative;
    border-bottom: 1px dotted var(--border-color);
  }

  .table-stack-sm td:last-child {
    border-bottom: none;
  }

  .table-stack-sm td:before {
    content: attr(data-label);
    float: right;
    font-weight: bold;
    margin-left: 10px;
  }
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-control);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Responsive Form Grid */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.form-col {
  flex: 1;
  padding: 0 10px;
  min-width: 0;
}

@media (max-width: 768px) {
  .form-col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .form-col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 576px) {
  .form-row {
    display: block;
    margin-right: 0;
    margin-left: 0;
  }

  .form-col {
    padding: 0;
    margin-bottom: 15px;
  }
}

.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  position: relative;
}

.alert-success {
  background-color: rgba(46, 204, 113, 0.1);
  border: 1px solid var(--success-color);
  color: var(--success-color);
}

.alert-warning {
  background-color: rgba(243, 156, 18, 0.1);
  border: 1px solid var(--warning-color);
  color: var(--warning-color);
}

.alert-danger {
  background-color: rgba(231, 76, 60, 0.1);
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}

.alert-info {
  background-color: rgba(52, 152, 219, 0.1);
  border: 1px solid var(--info-color);
  color: var(--info-color);
}

/* Spacing utilities */
.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mt-5 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

/* Responsive flex utilities */
.d-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

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

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.flex-grow-1 {
  flex-grow: 1;
}

@media (max-width: 992px) {
  .d-lg-none {
    display: none !important;
  }

  .d-lg-block {
    display: block !important;
  }

  .d-lg-flex {
    display: flex !important;
  }

  .flex-lg-column {
    flex-direction: column !important;
  }
}

@media (max-width: 768px) {
  .d-md-none {
    display: none !important;
  }

  .d-md-block {
    display: block !important;
  }

  .d-md-flex {
    display: flex !important;
  }

  .flex-md-column {
    flex-direction: column !important;
  }
}

@media (max-width: 576px) {
  .d-sm-none {
    display: none !important;
  }

  .d-sm-block {
    display: block !important;
  }

  .d-sm-flex {
    display: flex !important;
  }

  .flex-sm-column {
    flex-direction: column !important;
  }
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background-color: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.3s;
  z-index: 99;
}

#back-to-top:hover {
  background-color: #2980b9;
  transform: translateY(-5px);
}

/* Page overlay for mobile menu */
.page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

/* .page-overlay.active {
  display: block;
} */

body.menu-open {
  overflow: hidden;
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

@media (max-width: 992px) {
  .mobile-nav-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
  }

  .main-nav.active {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav li {
    margin: 0;
    margin-bottom: 10px;
  }
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  background-color: var(--light-gray);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item+.breadcrumb-item {
  padding-right: 0.5rem;
}

.breadcrumb-item+.breadcrumb-item::before {
  display: inline-block;
  padding-left: 0.5rem;
  color: #6c757d;
  content: "/";
}

.breadcrumb-item.active {
  color: #6c757d;
}

@media (max-width: 576px) {
  .breadcrumb {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Enhanced Alert Styling */
.alert {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  position: relative;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-icon {
  margin-left: 15px;
  font-size: 1.2rem;
}

.alert-content {
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.alert-close:hover {
  opacity: 1;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .dashboard-cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.dashboard-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-card);
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
  .dashboard-card {
    padding: 15px;
  }

  .dashboard-card:hover {
    transform: none;
  }
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.dashboard-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.dashboard-card-title {
  color: var(--muted-text);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.dashboard-card-value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.dashboard-card-footer {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  margin-top: auto;
}

.dashboard-card-change {
  margin-right: 8px;
}

.change-up {
  color: var(--success-color);
}

.change-down {
  color: var(--danger-color);
}

/* Responsive Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  /* margin-right: -15px; */
  /* margin-left: -15px; */
}

.col {
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-3 {
  flex: 0 0 25%;
  max-width: 25%;
}

@media (max-width: 992px) {
  .col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (max-width: 768px) {
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

@media (max-width: 576px) {
  .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Data Tables */
.data-table-container {
  background-color: var(--card-bg);
  border-radius: var(--radius-card);
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 30px;
}

.data-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--soft-border);
  background-color: var(--surface-2);
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .data-table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.data-table-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.data-table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .data-table-actions {
    width: 100%;
  }

  .data-table-actions .btn {
    flex: 1;
  }
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.data-table th,
.data-table td {
  padding: 15px 20px;
  text-align: right;
  border-bottom: none;
  background-color: var(--card-bg);
}

.data-table th {
  font-weight: 600;
  background-color: var(--surface-2);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background-color: transparent;
}

.data-table tbody tr td:first-child {
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.data-table tbody tr td:last-child {
  border-radius: var(--radius-control) 0 0 var(--radius-control);
}

.data-table tbody tr:hover td {
  background-color: var(--hover-surface);
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {

  .data-table th,
  .data-table td {
    padding: 12px 15px;
  }
}

@media (max-width: 576px) {

  .data-table th,
  .data-table td {
    padding: 10px;
  }

  .data-table-stack-sm {
    display: block;
  }

  .data-table-stack-sm thead {
    display: none;
  }

  .data-table-stack-sm tbody,
  .data-table-stack-sm tr,
  .data-table-stack-sm td {
    display: block;
    width: 100%;
  }

  .data-table-stack-sm tr {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
  }

  .data-table-stack-sm td {
    text-align: right;
    padding: 8px 10px;
    position: relative;
    border-bottom: 1px dotted var(--border-color);
  }

  .data-table-stack-sm td:last-child {
    border-bottom: none;
  }

  .data-table-stack-sm td:before {
    content: attr(data-label);
    float: right;
    font-weight: bold;
    margin-left: 10px;
  }
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.5em 0.6em;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-success {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.badge-warning {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

.badge-danger {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.badge-info {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

/* Enhanced form styling */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  background-color: var(--surface-2);
  border: 1px solid var(--soft-border);
}

.input-group> :not(:first-child) {
  margin-right: -1px;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.input-group> :not(:last-child) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

@media (max-width: 576px) {
  .input-group {
    flex-direction: column;
  }

  .input-group> :not(:first-child) {
    margin-right: 0;
    margin-top: -1px;
    border-radius: 0;
  }

  .input-group> :first-child {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  .input-group> :last-child {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
  }
}

/* Search box */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border-radius: 50px;
  border: 1px solid var(--soft-border);
  background-color: var(--input-bg);
  color: var(--text-main);
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-text);
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--card-bg);
  border-radius: calc(var(--radius-card) - 8px);
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-soft);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* RTL Support */
[dir="rtl"] {
  .breadcrumb-item+.breadcrumb-item {
    padding-right: 0;
    padding-left: 0.5rem;
  }

  .breadcrumb-item+.breadcrumb-item::before {
    padding-left: 0;
    padding-right: 0.5rem;
  }

  .alert-icon {
    margin-left: 0;
    margin-right: 15px;
  }

  .dashboard-card-change {
    margin-right: 0;
    margin-left: 8px;
  }

  .search-box i {
    left: auto;
    right: 15px;
  }

  .search-box input {
    padding: 10px 40px 10px 15px;
  }

  .table-stack-sm td:before,
  .data-table-stack-sm td:before {
    float: left;
    margin-left: 0;
    margin-right: 10px;
  }

  #back-to-top {
    right: auto;
    left: 20px;
  }

  .main-nav {
    right: auto;
    left: -280px;
  }

  .main-nav.active {
    right: auto;
    left: 0;
  }
}

/* CSS to add to your style.css file */
.flash-container {
  position: fixed;
  top: 20px;
  left: 20px;
  /* Left for RTL */
  z-index: 9999;
  width: 300px;
  max-width: 90%;
}

.flash {
  position: relative;
  padding: 16px 50px 16px 20px;
  /* RTL padding */
  margin-bottom: 15px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white;
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease-out forwards;
  opacity: 0;
  transform: translateX(-30px);
  /* RTL direction */
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-30px);
    /* RTL direction */
  }
}

.flash-success {
  background-color: #4CAF50;
  border-right: 5px solid #388E3C;
  /* RTL border */
}

.flash-error {
  background-color: #F44336;
  border-right: 5px solid #D32F2F;
  /* RTL border */
}

.flash-info {
  background-color: #2196F3;
  border-right: 5px solid #1976D2;
  /* RTL border */
}

.flash-icon {
  position: absolute;
  right: 15px;
  /* RTL positioning */
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
}

.flash-content {
  flex-grow: 1;
  word-wrap: break-word;
}

.flash-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  position: absolute;
  left: 10px;
  /* RTL positioning */
  top: 50%;
  transform: translateY(-50%);
}

.flash-close:hover {
  opacity: 1;
}

.hero-title {
  font-size: 70px;
  font-weight: 900;
  line-height: 1.2;
}

.hero-desc {
  font-size: 26px;
  line-height: 1.6;
  margin-top: 15px;
}

/* Unified controls and Bootstrap table upgrade */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
  border-radius: var(--radius-button) !important;
}

.btn {
  font-weight: 600;
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.45);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px -14px rgba(15, 23, 42, 0.6);
}

.dark-theme .card,
.dark-theme .dashboard-card,
.dark-theme .data-table-container,
.dark-theme .modal {
  box-shadow: var(--shadow-strong);
}

.table {
  border-collapse: separate !important;
  border-spacing: 0 10px !important;
}

.table> :not(caption)>*>* {
  border-bottom-width: 0 !important;
  background: var(--card-bg);
  color: var(--text-main);
}

.table>thead>tr>th {
  background: var(--surface-2);
  color: var(--text-main);
}

.table>tbody>tr:hover>* {
  background: var(--hover-surface);
}

/* Sidebar/navbar glassmorphism coverage across common ERP class names */
.sidebar,
.main-sidebar,
.app-sidebar,
.navbar,
.topbar {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(14px);
  border: 1px solid var(--soft-border);
}

/* High-contrast documents and invoices in dark mode */
.dark-theme .invoice-container,
.dark-theme .statement-container,
.dark-theme .financial-summary,
.dark-theme .info-section {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: #dbe3ef !important;
}

.dark-theme .invoice-container *,
.dark-theme .statement-container * {
  color: #1e293b !important;
}

.dark-theme .invoice-container .items-table thead th,
.dark-theme .invoice-container .summary-table th,
.dark-theme .invoice-container .summary-table td,
.dark-theme .invoice-container .items-table tbody td {
  color: #1e293b !important;
}

.dark-theme .invoice-container .items-table thead th {
  background: #e2e8f0 !important;
}

.dark-theme .invoice-container .items-table tbody tr:nth-child(even) {
  background: #f8fafc !important;
}

.dark-theme .invoice-container .items-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.08) !important;
}

/* Tablet */
@media (max-width: 992px) {
  .hero-title {
    font-size: 48px;
  }

  .hero-desc {
    font-size: 20px;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .hero-title {
    font-size: 32px;
    text-align: center;
  }

  .hero-desc {
    font-size: 16px;
    text-align: center;
  }
}