:root {
  /* GitHub-inspired Color Palette */
  --primary: #238636;
  --primary-hover: #2ea043;
  --secondary: #6e7681;
  --success: #238636;
  --danger: #da3633;
  --warning: #d29922;
  --info: #58a6ff;
  --light: #f6f8fa;
  --dark: #24292f;
  --bg-body: #f6f8fa;
  --bg-card: #ffffff;
  --border-color: #d0d7de;
  --text-main: #24292f;
  --text-muted: #656d76;
  --shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow: 0 3px 6px rgba(140, 149, 159, 0.15);
  --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
  --radius: 6px;
  --font-sans: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* GitHub Dark Mode */
.dark {
  --bg-body: #0d1117;
  --bg-card: #161b22;
  --border-color: #30363d;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --light: #21262d;
  --primary: #238636;
  --primary-hover: #2ea043;
  --danger: #f85149;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Checkbox Styling */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Pagination - GitHub Style */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s ease;
}

.page-link:hover {
  background-color: var(--light);
  border-color: var(--border-color);
  color: var(--primary);
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-item.active .page-link:hover {
  background-color: var(--primary-hover);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  background-color: var(--light);
  cursor: not-allowed;
  opacity: 0.6;
}

.dark .page-link {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.dark .page-link:hover {
  background-color: var(--light);
}

/* Base Styles */
html {
  height: 100%;
  background-color: var(--bg-body);
  /* Ensure html background matches body */
}

/* Apply dark mode to html when body has .dark class */
body.dark~html,
html:has(body.dark),
.dark {
  background-color: #0b1120;
}

body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  /* Prevent horizontal scroll on body */
}

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

a:hover {
  color: var(--primary-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Utilities */
.text-muted {
  color: var(--text-muted) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-dark {
  color: var(--text-main) !important;
}

.bg-light {
  background-color: var(--light) !important;
}

.rtl .list-group {
  padding: 0;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

/* Buttons - GitHub Style */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius);
  padding: 5px 16px;
  transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
  border: 1px solid rgba(31, 35, 40, 0.15);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transition-duration: 0.1s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border-color: rgba(31, 35, 40, 0.15);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary,
.btn-outline-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
  background: transparent;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

.btn-success {
  background-color: var(--success);
  color: white;
  border-color: rgba(31, 35, 40, 0.15);
}

.btn-success:hover {
  background-color: #2ea043;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  border-color: rgba(31, 35, 40, 0.15);
}

.btn-danger:hover {
  background-color: #b62324;
}

.btn-info {
  background-color: var(--info);
  color: white;
}

.btn-dark {
  background-color: #334155;
  color: white;
  border-color: #334155;
}

.btn-dark:hover {
  background-color: #1e293b;
  color: white;
}

.btn-link {
  box-shadow: none;
  color: var(--primary);
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
}

.btn-link:hover {
  text-decoration: none;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: none;
  transform: none;
  border-radius: 4px;
}

.dark .btn-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

/* Cards - GitHub Style */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-body {
  padding: 1rem;
}

.card-header {
  background: var(--light);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
}

/* Forms */
.form-control,
.custom-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.custom-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  text-align: right;
}

/* Tables - Enhanced Professional Design */
.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-main);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 1rem 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.table tbody tr {
  transition: all 0.15s ease;
  background-color: var(--bg-card);
}

.table-hover tbody tr:hover {
  background-color: var(--light);
  transform: scale(1.001);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Custom Table Classes */
.lw {
  /* Email column - allow wrapping to fit */
  word-break: break-word;
}

/* Responsive table - no horizontal scroll */
.table-responsive {
  overflow-x: visible;
}

@media (min-width: 768px) {
  .table {
    width: 100%;
    table-layout: auto;
  }

  /* Compact columns */
  .table th,
  .table td {
    padding: 0.5rem;
    vertical-align: middle;
  }
}

.text-nowrap {
  white-space: nowrap !important;
}

/* Dialogs */
.dialog-container {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  overflow: auto;
  padding: 2rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dialog {
  background: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
  border-top: 4px solid var(--primary);
  color: var(--text-main);
}

/* Mobile Dialog Fix */
@media (max-width: 767px) {
  .dialog-container {
    padding: 0.5rem !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: auto;
  }

  .dialog-container .dialog {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 1rem) !important;
    margin: 0.5rem !important;
    border-radius: var(--radius);
    box-sizing: border-box;
    left: 0.5rem !important;
    right: 0.5rem !important;
    position: relative !important;
  }

  .dialog .dialog-heading {
    padding: 0.75rem;
    font-size: 1rem;
    text-align: center;
    word-break: break-word;
  }

  .dialog .dialog-content {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .dialog .dialog-btns {
    padding: 0.75rem;
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .dialog .dlg-btn {
    flex: 1 1 auto;
    min-width: 80px;
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 0 !important;
  }
}

.dialog-heading {
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.dialog-content {
  padding: 1rem;
}

.dialog-btns {
  padding: 1rem;
  background: var(--light);
  text-align: right;
  border-top: 1px solid var(--border-color);
}

.dlg-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--border-color);
  color: var(--text-main);
  margin-left: 0.5rem;
}

.dlg-btn:hover {
  opacity: 0.9;
}

.dlg-btn.dlg-btn-primary {
  background: var(--primary);
  color: white;
}

.dlg-btn.dlg-btn-yellow {
  background: var(--warning);
  color: white;
}

.dlg-btn.dlg-btn-green {
  background: var(--success);
  color: white;
}

.dlg-btn.dlg-btn-red {
  background: var(--danger);
  color: white;
}

/* Toasts */
.toast-wrapper {
  position: fixed;
  z-index: 10000;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #334155;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  min-width: 200px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.toast.toast-style-success {
  background: var(--success);
}

.toast.toast-style-danger {
  background: var(--danger);
}

.toast.toast-style-warning {
  background: var(--warning);
  color: black;
}

/* Misc */
.lss {
  font-family: 'Consolas', 'Monaco', monospace;
  background: var(--light);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: inline-block;
  vertical-align: middle;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lss:hover {
  background: var(--border-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge {
  padding: 0.45em 0.85em;
  font-size: 0.8em;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* Loading indicator */
.PROGRESS_TOAST:after {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: fa-spin 1s linear infinite;
  margin-left: 10px;
}

.PROGRESS_TOAST {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  font-weight: bold;
  z-index: 9999;
}

/* =========================================
   Responsive Card View for Tables
   ========================================= */
@media (max-width: 767px) {

  /* Only trigger on actual mobile, not tablets */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-top: 1rem !important;
  }

  h1 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    display: block;
  }

  .btn-sm {
    width: auto;
    display: inline-block;
  }

  /* Stack columns */
  .col-md-6,
  .col-md-4,
  .col-md-8 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
  }

  .view-reports {
    margin-top: 1.5rem;
  }

  /* Card View Styles - Compact & Friendly */
  .view-reports table,
  .view-reports thead,
  .view-reports tbody,
  .view-reports th,
  .view-reports td,
  .view-reports tr {
    display: block;
  }

  .view-reports thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .view-reports tr {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.2s ease;
  }

  .view-reports tr:active {
    transform: scale(0.98);
  }

  .view-reports td {
    border: none;
    position: relative;
    padding-right: 90px !important;
    padding-left: 0 !important;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    text-align: right;
    white-space: normal !important;
    font-size: 0.95rem;
    min-height: 2rem;
    display: block;
    line-height: 1.5;
  }

  .view-reports td:before {
    position: absolute;
    top: 0.6rem;
    right: 0;
    left: auto;
    width: 80px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: right;
    letter-spacing: 0.5px;
  }

  /* Row 1: ID - left aligned (since RTL), no label */
  .view-reports td:nth-of-type(1) {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.5rem;
    padding-right: 0 !important;
    text-align: left;
    padding-left: 0;
  }

  .view-reports td:nth-of-type(1):before {
    display: none;
  }

  /* Row 2: User (Name + Email) */
  .view-reports td:nth-of-type(2) {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    text-align: left;
  }

  .view-reports td:nth-of-type(2):before {
    content: "نام";
  }

  .view-reports td:nth-of-type(2) .small.text-muted {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: visible;
    text-align: left;
    direction: ltr;
  }

  /* Row 3: Product */
  .view-reports td:nth-of-type(3) {
    font-weight: 500;
    text-align: left;
  }

  .view-reports td:nth-of-type(3):before {
    content: "محصول";
  }

  /* Row 4: License - centered, no label */
  .view-reports td:nth-of-type(4) {
    padding-top: 1.25rem !important;
    padding-left: 0 !important;
    text-align: center;
    border-top: 2px dashed var(--border-color);
    margin-top: 0.75rem;
  }

  .view-reports td:nth-of-type(4):before {
    display: none;
  }

  .view-reports td:nth-of-type(4) code {
    display: block;
    margin: 0.5rem auto;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }

  .view-reports td:nth-of-type(4) .badge {
    margin: 0.35rem;
    font-size: 0.85rem;
  }

  /* Row 5: Actions - centered with buttons */
  .view-reports td:nth-of-type(5) {
    padding: 1rem 0 0 0 !important;
    display: flex !important;
    justify-content: center;
    gap: 1rem;
    padding-left: 0 !important;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
  }

  .view-reports td:nth-of-type(5):before {
    display: none;
  }

  /* Action buttons styling for mobile */
  .view-reports td:nth-of-type(5) .btn-group {
    display: flex;
    gap: 0.75rem;
  }

  .view-reports td:nth-of-type(5) .btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 48px;
    height: 44px;
    padding: 0 1rem;
    background: var(--light);
    border-radius: 10px;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
  }

  .view-reports td:nth-of-type(5) .btn-group .btn i {
    margin-left: 0.5rem;
  }

  .view-reports td:nth-of-type(5) .btn-group .btn.text-primary {
    color: var(--primary) !important;
  }

  .view-reports td:nth-of-type(5) .btn-group .btn.text-primary:hover {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
  }

  .view-reports td:nth-of-type(5) .btn-group .btn.text-danger {
    color: var(--danger) !important;
  }

  .view-reports td:nth-of-type(5) .btn-group .btn.text-danger:hover {
    background: var(--danger);
    color: white !important;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }

  /* Mobile button text and icon spacing */
  .view-reports td:nth-of-type(5) .btn-group .btn span {
    margin-right: 0.4rem;
    font-weight: 500;
  }

  /* Onfocus tr replacement */
  .onfocus-tr {
    display: inline-block !important;
    margin: 0;
  }

  .onfocus-tr br {
    display: none;
  }

  /* Dialog adjustment */
  .dialog {
    width: 95%;
    margin: 1rem auto;
  }
}

/* =========================================
   Enhanced Table Styles - Professional
   ========================================= */

/* Search and Filter Section */
.view-reports .card-body>div:first-child {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* Action Icons Enhanced */
.table td a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.table td a:hover {
  background: var(--primary);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25);
}

.table td a.text-muted:hover {
  background: var(--danger) !important;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

/* Email Column - Better Typography */
.table .lw {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

/* Product Column - Better Spacing */
.table td:nth-child(4) {
  font-weight: 500;
}

/* License Column - Center Aligned & Spaced */
.table td:nth-child(6) {
  text-align: center;
}

/* Number Column - Muted & Compact */
.table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Quantity Badge in License */
.table .badge+span {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Expire Date Styling */
.table td small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* License Key Enhanced */
.table .lss {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  margin: 0.25rem 0;
}

/* Status Indicators Colors */
.badge.bg-danger,
.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.badge.bg-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.badge.bg-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
}

.badge.bg-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

/* Smooth Page Load Animation */
.table tbody tr {
  animation: fadeInUp 0.3s ease-out backwards;
}

.table tbody tr:nth-child(1) {
  animation-delay: 0.05s;
}

.table tbody tr:nth-child(2) {
  animation-delay: 0.1s;
}

.table tbody tr:nth-child(3) {
  animation-delay: 0.15s;
}

.table tbody tr:nth-child(4) {
  animation-delay: 0.2s;
}

.table tbody tr:nth-child(5) {
  animation-delay: 0.25s;
}

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

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

/* Dark Mode Table Enhancements */
.dark .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .table thead th {
  background-color: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.5);
}

/* Scrollbar Styling */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
  transition: background 0.2s;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Search Input Enhanced */
input[type="search"],
input[placeholder*="Search"] {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

input[type="search"]:focus,
input[placeholder*="Search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* Filter Dropdown Enhanced */
.custom-select,
select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
  font-size: 0.95rem;
  background-position: left 0.75rem center;
  cursor: pointer;
}

.custom-select:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  outline: none;
}

.custom-select:hover,
select:hover {
  border-color: var(--primary);
}

/* =========================================
   Additional Professional Enhancements
   ========================================= */

/* Better Text Rendering */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improved Focus States */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Enhanced Typography in Table */
.table td {
  line-height: 1.5;
}

.table strong,
.table b {
  font-weight: 600;
  color: var(--text-main);
}

/* Name Column - Better Typography */
.table td:nth-child(2) {
  font-weight: 500;
  color: var(--text-main);
}

/* Better Spacing for Icons */
.table i {
  font-size: 1.1em;
  vertical-align: middle;
}

/* Hover Effects for Clickable Elements */
.table a,
.table button {
  cursor: pointer;
  user-select: none;
}

/* Loading State Animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Better Container Spacing */
.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

@media (max-width: 767px) {
  .container {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Card Header Enhancements */
.card-header {
  background: var(--light);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem 1.5rem;
  font-weight: 600;
}

/* Better Button Groups */
.btn-group {
  display: inline-flex;
  gap: 0.5rem;
}

/* Enhanced Form Controls */
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Better HR Styling */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

/* Improved List Styling */
ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Code Blocks */
code,
pre {
  font-family: 'Consolas', 'Monaco', monospace;
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.9em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  display: block;
}

/* Selection Styling */
::selection {
  background: rgba(79, 70, 229, 0.3);
  color: var(--text-main);
}

.dark ::selection {
  background: rgba(79, 70, 229, 0.5);
}

/* Skeleton Loading for Tables */
.skeleton {
  background: linear-gradient(90deg,
      var(--light) 0%,
      var(--border-color) 50%,
      var(--light) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Performance Optimization - GPU Acceleration */
.table tbody tr,
.badge,
.btn,
.card,
.lss {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print Styles */
@media print {

  .btn,
  .table td:last-child {
    display: none;
  }

  .table {
    border: 1px solid #000;
  }

  .table thead th {
    background: #f0f0f0 !important;
  }
}

/* Animations */
.fa-spin {
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(359deg);
  }
}

/* Additional Tweaks */
.icons {
  font-size: 12px;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.25em;
  font-size: 2rem;
  border: 1px dotted var(--border-color);
  border-radius: var(--radius);
  min-width: 1.5em;
  text-align: center;
  min-height: 1.5em;
  background: var(--bg-body);
  padding: 4px;
}

/* Modern App Styles - GitHub Style */
.app-body {
  background-color: var(--bg-body);
  min-height: 100vh;
}

.app-navbar {
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
}

.dark .app-navbar {
  background-color: var(--bg-card) !important;
}

.app-card {
  background-color: var(--bg-card);
  border-radius: var(--radius) !important;
  box-shadow: none;
  border: 1px solid var(--border-color) !important;
}

.app-card:hover {
  box-shadow: var(--shadow);
}

.form-control,
.custom-select {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-control:focus,
.custom-select:focus {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  border-color: var(--primary);
}

.btn {
  border-radius: 0.5rem;
  padding: 0.5rem 1.2rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Table Styles */
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.license-row {
  transition: background-color 0.15s;
}

.license-row:hover {
  background-color: rgba(79, 70, 229, 0.02) !important;
}

/* Dark Mode Overrides */
.dark .app-navbar .navbar-brand,
.dark .app-navbar .nav-link,
.dark .app-navbar .btn-link {
  color: var(--text-main) !important;
}

.dark .bg-light {
  background-color: #1e293b !important;
  /* Slate 800 */
}

.dark .btn-light {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

.dark .btn-light:hover {
  background-color: #475569 !important;
  color: #fff !important;
}

.dark .form-control,
.dark .custom-select {
  background-color: #0f172a !important;
  /* Slate 900 */
  border-color: #334155;
  color: var(--text-main);
}

.dark .form-control:focus {
  border-color: var(--primary);
}

.dark .input-group-text {
  background-color: #1e293b !important;
  border-color: #334155;
  color: var(--text-muted);
}

.dark .table {
  color: var(--text-main);
}

.dark .table-hover tbody tr:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.dark .border-top {
  border-color: var(--border-color) !important;
}

/* Utilities */
.avatar {
  font-size: 1.2rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* Compact Table Styles */
.table td,
.table th {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.table th {
  white-space: nowrap;
}

/* RTL Alignment Fixes */
.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

/* Ensure input groups look good in RTL */
.input-group>.input-group-append>.btn,
.input-group>.input-group-prepend>.input-group-text {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.input-group>.form-control:not(:last-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Fix for stretched tables */
.table-responsive {
  overflow-x: auto;
}

/* Form Row Spacing */
.form-row>.col,
.form-row>[class*='col-'] {
  padding-right: 5px;
  padding-left: 5px;
}

.form-row {
  margin-right: -5px;
  margin-left: -5px;
}


/* Dark Mode Component Fixes */
.dark .badge-light {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .btn-light {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: transparent;
}

.dark .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.dark .bg-light {
  background-color: #1e293b !important;
  /* Matches card bg or slightly different */
}

/* RTL Table Alignment Fixes */
html[dir='rtl'] .table {
  text-align: right;
}

html[dir='rtl'] .table th,
html[dir='rtl'] .table td {
  text-align: right;
}

/* Operations column (last child) should align left in RTL */
html[dir='rtl'] .table th:last-child,
html[dir='rtl'] .table td:last-child {
  text-align: left !important;
}

/* First column padding adjustment for RTL */
html[dir='rtl'] .table th:first-child,
html[dir='rtl'] .table td:first-child {
  padding-right: 1.5rem !important;
  padding-left: 0.75rem !important;
}

/* Last column padding adjustment for RTL */
html[dir='rtl'] .table th:last-child,
html[dir='rtl'] .table td:last-child {
  padding-left: 1.5rem !important;
  padding-right: 0.75rem !important;
}

/* Fix for input group radius in RTL (Refined) */
html[dir='rtl'] .input-group>.input-group-prepend>.input-group-text,
html[dir='rtl'] .input-group>.input-group-append>.btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

html[dir='rtl'] .input-group>.form-control:not(:last-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}


/* =========================================
   ULTIMATE PROFESSIONAL POLISH
   ========================================= */

/* 1. Refined Glassmorphism & Depth */
.app-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

.dark .app-card {
  background-color: rgba(30, 41, 59, 0.7);
  /* Semi-transparent */
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* 2. Modern Input Fields */
.form-control,
.custom-select {
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus,
.custom-select:focus {
  background-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}

.dark .form-control,
.dark .custom-select {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .form-control:focus,
.dark .custom-select:focus {
  background-color: rgba(15, 23, 42, 0.9) !important;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* 3. Table Polish */
.table thead th {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 1rem;
  opacity: 0.7;
}

.dark .table thead th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.license-row {
  border-radius: 8px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.license-row:hover {
  transform: scale(1.005);
  background-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  z-index: 1;
  position: relative;
}

.dark .license-row:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 4. Button Glows */
.btn-primary {
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

/* 5. Custom Scrollbar (Refined) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 6. Typography Tweaks */
h5 {
  letter-spacing: -0.025em;
}

.small,
small {
  font-size: 85%;
}

/* 7. Status Badges */
.badge {
  padding: 0.35em 0.65em;
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 6px;
}

/* 8. Avatar Glow */
.avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.dark .avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Email Check Results Styling */
#ecresult {
  max-height: 500px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(35, 134, 54, 0.25);
  margin-top: 1rem !important;
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease;
  box-sizing: border-box;
  width: 100%;
  z-index: 50;
}

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

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

.email-check-results {
  font-size: 0.9rem;
  width: 100%;
}

.result-section {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.masters-section {
  background: rgba(35, 134, 54, 0.08);
  border-right: 4px solid var(--primary);
}

.trials-section {
  background: rgba(88, 166, 255, 0.08);
  border-right: 4px solid var(--info);
}

.dark .masters-section {
  background: rgba(35, 134, 54, 0.2);
}

.dark .trials-section {
  background: rgba(88, 166, 255, 0.2);
}

.result-section .section-header {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-section .section-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.license-item {
  padding: 1rem;
  margin: 0;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.license-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.license-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.license-header .badge {
  font-size: 0.85rem;
  padding: 0.4em 0.75em;
}

.license-code-display {
  width: 100%;
}

.license-code-display code {
  display: block;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  background: var(--light);
  color: var(--primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
  overflow-x: auto;
  direction: ltr;
  cursor: pointer;
  transition: all 0.2s ease;
}

.license-code-display code:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.02);
}

.dark .license-code-display code {
  background: #1a2332;
  color: #00d9ff;
  border-color: rgba(0, 217, 255, 0.3);
}

.dark .license-code-display code:hover {
  background: var(--primary);
  color: white;
}

#ecresult::-webkit-scrollbar {
  width: 8px;
}

#ecresult::-webkit-scrollbar-track {
  background: var(--light);
  border-radius: 4px;
}

#ecresult::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

#ecresult::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}