 :root {
      --primary: #FF741F;
      --secondary: #000000;
      --accent: #FF9A3E;
      --dark: #121212;
      --surface: #1a1a1a;
      --surface-light: #262626;
      --text-light: #e0e0e0;
      --text-muted: #a0a0a0;
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
    }

    * {
      font-family: 'Inter', sans-serif;
    }

    body {
      background-color: var(--dark);
      color: var(--text-light);
      height: 100vh;
      overflow: hidden;
    }

    /* modern scroll */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }
    ::-webkit-scrollbar-track {
      background: #1e1e1e;
    }
    ::-webkit-scrollbar-thumb {
      background: #444;
      border-radius: 10px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: var(--primary);
    }

    /* layout */
    .app-wrapper {
      display: flex;
      height: 100vh;
      width: 100%;
    }

    /* desktop sidebar - collapsible */
    .desktop-sidebar {
      width: 280px;
      background-color: var(--secondary);
      display: none;
      flex-shrink: 0;
      border-right: 1px solid #2a2a2a;
      overflow-y: auto;
      transition: width 0.2s ease;
    }
    @media (min-width: 768px) {
      .desktop-sidebar {
        display: block;
      }
    }
    .desktop-sidebar.collapsed {
      width: 80px;
    }
    .desktop-sidebar.collapsed .sidebar-header span,
    .desktop-sidebar.collapsed .nav-link span,
    .desktop-sidebar.collapsed .menu-category {
      display: none;
    }
    .desktop-sidebar.collapsed .nav-link {
      justify-content: center;
      padding: 0.7rem 0;
    }
    .desktop-sidebar.collapsed .nav-link i {
      margin: 0;
      font-size: 1.5rem;
    }
    .desktop-sidebar.collapsed .sidebar-header {
      text-align: center;
      padding: 1rem 0;
    }
    .desktop-sidebar.collapsed .sidebar-header small {
      display: none;
    }

    .sidebar-toggle {
      background: transparent;
      border: 1px solid #555;
      color: var(--text-muted);
      border-radius: 30px;
      padding: 0.25rem 0.5rem;
      margin-left: auto;
      font-size: 1.2rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    .sidebar-toggle:hover {
      border-color: var(--primary);
      color: var(--primary);
    }

    .sidebar-menu {
      padding: 1.5rem 0.75rem;
    }
    .sidebar-header {
      padding: 0 1rem 1.5rem 1rem;
      font-weight: 700;
      font-size: 1.4rem;
      color: var(--primary);
      letter-spacing: -0.5px;
      border-bottom: 1px solid #2a2a2a;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
    }
    .sidebar-header small {
      font-size: 0.8rem;
      color: var(--text-muted);
      display: block;
      font-weight: 400;
      letter-spacing: normal;
    }

    .nav-item {
      margin-bottom: 0.3rem;
    }
    .nav-link {
      color: #ccc;
      border-radius: 12px;
      padding: 0.7rem 1rem;
      font-weight: 500;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .nav-link i {
      font-size: 1.3rem;
      width: 28px;
      color: var(--text-muted);
      transition: color 0.2s;
    }
    .nav-link:hover {
      background: rgba(255, 116, 31, 0.12);
      color: white;
    }
    .nav-link:hover i {
      color: var(--primary);
    }
    .nav-link.active {
      background: rgba(255, 116, 31, 0.2);
      color: white;
      border-left: 4px solid var(--primary);
    }
    .nav-link.active i {
      color: var(--primary);
    }

    .submenu {
      padding-left: 2.8rem;
      list-style: none;
      margin-top: 0.2rem;
    }
    .submenu .nav-link {
      padding: 0.5rem 1rem;
      font-size: 0.95rem;
    }

    .menu-category {
      padding: 0 1rem;
      margin-top: 1.5rem;
      margin-bottom: 0.5rem;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text-muted);
    }

    /* main panel */
    .main-panel {
      flex: 1;
      display: flex;
      flex-direction: column;
      background-color: var(--dark);
      overflow: hidden;
    }

    /* top navbar */
    .top-navbar {
      background-color: #0e0e0e;
      padding: 0.8rem 1.5rem;
      border-bottom: 1px solid #262626;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .brand-mobile {
      font-weight: 700;
      color: var(--primary);
      font-size: 1.3rem;
    }
    .profile-btn {
      background: var(--surface);
      border: none;
      color: white;
      border-radius: 40px;
      padding: 0.3rem 0.3rem 0.3rem 1rem;
    }
    .profile-btn img {
      width: 36px;
      height: 36px;
      border-radius: 40px;
      margin-left: 8px;
      object-fit: cover;
      border: 2px solid var(--primary);
    }

    /* content area */
    .content-area {
      flex: 1;
      overflow-y: auto;
      padding: 1.8rem 2rem;
    }
    @media (max-width: 768px) {
      .content-area {
        padding: 1rem;
      }
    }

    /* cards / tables */
    .stat-card {
      background: var(--surface);
      border: none;
      border-radius: 24px;
      padding: 1.5rem;
      box-shadow: 0 8px 20px rgba(0,0,0,0.5);
      transition: transform 0.1s;
    }
    .stat-card .title {
      color: var(--text-muted);
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .stat-card .value {
      font-size: 2.2rem;
      font-weight: 700;
      color: white;
    }
    .stat-card .icon {
      font-size: 2.5rem;
      color: var(--primary);
      opacity: 0.7;
    }

    .section-card {
      background: var(--surface);
      border-radius: 28px;
      padding: 1.8rem;
      border: none;
      box-shadow: 0 8px 20px rgba(0,0,0,0.5);
      margin-bottom: 2rem;
    }
    @media (max-width: 768px) {
      .section-card {
        padding: 1rem;
      }
    }

    /* filter bar - responsive */
    .filter-bar {
      background: var(--surface-light);
      border-radius: 40px;
      padding: 1rem 1.5rem;
      margin-bottom: 1.5rem;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.8rem;
    }
    .filter-bar .form-control,
    .filter-bar .form-select {
      max-width: 150px;
      flex: 1 1 auto;
    }
    @media (max-width: 768px) {
      .filter-bar {
        border-radius: 20px;
        padding: 1rem;
      }
      .filter-bar .form-control,
      .filter-bar .form-select {
        max-width: 100%;
        width: 100%;
      }
    }

    .filter-badge {
      background: rgba(255,116,31,0.15);
      color: var(--primary);
      border-radius: 30px;
      padding: 0.4rem 1rem;
      font-size: 0.85rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }
    .filter-badge i {
      cursor: pointer;
      font-size: 1rem;
    }
    .filter-count {
      color: var(--text-muted);
      font-size: 0.9rem;
    }
    .export-icon {
      margin-left: auto;
      color: var(--text-muted);
      font-size: 1.3rem;
      cursor: pointer;
      transition: color 0.2s;
    }
    .export-icon:hover {
      color: var(--primary);
    }

    .table-custom {
      --bs-table-bg: transparent;
      --bs-table-color: var(--text-light);
      border-color: #2a2a2a;
      min-width: 600px; /* ensures table has width for horizontal scroll */
    }
    .table-custom th {
      border-bottom: 1px solid #333;
      color: var(--text-muted);
      font-weight: 600;
      text-transform: uppercase;
      font-size: 0.75rem;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }
    .table-custom td {
      vertical-align: middle;
      border-bottom: 1px solid #262626;
      white-space: nowrap;
    }
    .badge-status {
      background: rgba(255, 116, 31, 0.2);
      color: var(--primary);
      padding: 0.4rem 0.8rem;
      border-radius: 40px;
      font-weight: 500;
      white-space: nowrap;
    }

    .btn-primary-custom {
      background: var(--primary);
      border: none;
      color: black;
      font-weight: 600;
      padding: 0.5rem 1.4rem;
      border-radius: 40px;
      transition: 0.15s;
    }
    .btn-primary-custom:hover {
      background: var(--accent);
      color: black;
    }
    .btn-outline-custom {
      background: transparent;
      border: 1px solid #555;
      color: white;
      border-radius: 30px;
      padding: 0.4rem 1.2rem;
    }
    .btn-outline-custom:hover {
      border-color: var(--primary);
      color: var(--primary);
    }
    .action-icon {
      color: var(--text-muted);
      font-size: 1.2rem;
      margin: 0 5px;
      cursor: pointer;
      transition: color 0.2s;
    }
    .action-icon:hover {
      color: var(--primary);
    }

    /* modals dark */
    .modal-content {
      background-color: var(--surface);
      border: 1px solid #333;
      border-radius: 28px;
    }
    .modal-header {
      border-bottom: 1px solid #333;
    }
    .modal-footer {
      border-top: 1px solid #333;
    }
    .form-control, .form-select {
      background-color: #202020;
      border: 1px solid #666;
      color: white;
      border-radius: 16px;
      padding: 0.7rem 1rem;
    }
    .form-control:focus, .form-select:focus {
      background-color: #2a2a2a;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(255, 116, 31, 0.2);
      color: white;
    }
    .form-control::placeholder {
      color: #aaa;
      opacity: 1;
    }
    select.form-select option {
      background-color: #202020;
      color: white;
    }
    .filter-bar .form-control, .filter-bar .form-select {
      border: none;
      background-color: transparent;
      color: white;
    }
    .filter-bar .form-control::placeholder {
      color: #bbb;
    }
    .filter-bar .form-select option {
      background-color: #262626;
    }

    /* invoice */
    .invoice-box {
      background: #0e0e0e;
      border-radius: 24px;
      padding: 2rem;
    }
    @media print {
      body * {
        visibility: hidden;
      }
      .invoice-print, .invoice-print * {
        visibility: visible;
      }
      .invoice-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
        color: black;
      }
    }

    /* offcanvas mobile */
    .offcanvas {
      background-color: var(--secondary);
      color: white;
    }
    .btn-close {
      filter: invert(1);
    }

    /* hide/show sections */
    .module-section {
      display: none;
    }
    .module-section.active-section {
      display: block;
    }

    /* LOGIN PAGE STYLES */
    .login-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: radial-gradient(circle at 10% 20%, #1e1e1e, #0a0a0a);
    }
    .login-card {
      background: var(--surface);
      border-radius: 40px;
      padding: 3rem 2.5rem;
      width: 100%;
      max-width: 440px;
      box-shadow: 0 30px 50px rgba(0,0,0,0.7);
      border: 1px solid #333;
    }
    .login-logo {
      font-size: 2.5rem;
      font-weight: 700;
      color: var(--primary);
      text-align: center;
      margin-bottom: 0.5rem;
    }
    .login-logo span {
      color: white;
    }
    .login-sub {
      text-align: center;
      color: var(--text-muted);
      margin-bottom: 2.5rem;
    }
    .login-input {
      background: #202020;
      border: 1px solid #444;
      border-radius: 50px;
      padding: 0.9rem 1.5rem;
      color: white;
      width: 100%;
      margin-bottom: 1.2rem;
    }
    .login-input:focus {
      border-color: var(--primary);
      outline: none;
      background: #2a2a2a;
    }
    .login-btn {
      background: var(--primary);
      color: black;
      font-weight: 700;
      border: none;
      border-radius: 50px;
      padding: 0.9rem;
      width: 100%;
      font-size: 1.1rem;
      transition: 0.2s;
      margin-top: 1rem;
    }
    .login-btn:hover {
      background: var(--accent);
    }
    .login-footer {
      text-align: center;
      margin-top: 1.8rem;
      color: #888;
    }
    .login-footer a {
      color: var(--primary);
      text-decoration: none;
    }

    /* wrapper to toggle between login and admin */
    #adminPanel {
      display: none;
    }
    #loginPage {
      display: block;
    }

    /* Toast Notifications */
    .toast-container {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 10px;
      pointer-events: none;
      max-width: 90vw;
    }
    .toast-message {
      pointer-events: auto;
      min-width: 300px;
      max-width: 400px;
      background: rgba(30, 30, 30, 0.95);
      backdrop-filter: blur(10px);
      border-left: 4px solid;
      border-radius: 16px;
      padding: 1rem 1.2rem;
      box-shadow: 0 15px 30px rgba(0,0,0,0.5);
      color: white;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 12px;
      animation: slideIn 0.3s ease forwards;
    }
    .toast-message i {
      font-size: 1.5rem;
    }
    .toast-message.success {
      border-left-color: var(--success);
    }
    .toast-message.success i {
      color: var(--success);
    }
    .toast-message.danger {
      border-left-color: var(--danger);
    }
    .toast-message.danger i {
      color: var(--danger);
    }
    .toast-message.warning {
      border-left-color: var(--warning);
    }
    .toast-message.warning i {
      color: var(--warning);
    }
    @keyframes slideIn {
      from { transform: translateX(100%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }
    .toast-message.fade-out {
      animation: fadeOut 0.3s ease forwards;
    }
    @keyframes fadeOut {
      to { opacity: 0; transform: translateX(100%); }
    }
    @media (max-width: 768px) {
      .toast-message {
        min-width: 250px;
      }
    }

    /* Table responsive wrapper */
    .table-responsive {
      border-radius: 16px;
      margin-bottom: 0;
    }

    /* sidebar toggle button in top navbar */
    .sidebar-toggle-nav {
      background: transparent;
      border: 1px solid #555;
      color: var(--text-muted);
      border-radius: 30px;
      padding: 0.3rem 0.8rem;
      font-size: 1.3rem;
      cursor: pointer;
      transition: all 0.2s;
      margin-right: 1rem;
    }
    .sidebar-toggle-nav:hover {
      border-color: var(--primary);
      color: var(--primary);
    }

    /* content area */
    .content-area {
      flex: 1;
      overflow-y: auto;
      padding: 1.8rem 2rem;
    }
    
    
    /*New css for table*/
    /* ===== MODERN FILTER ===== */
.filter-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #1e1e1e;
  padding: 12px;
  border-radius: 50px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #262626;
  padding: 8px 14px;
  border-radius: 30px;
}

.filter-item input,
.filter-item select {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
}

/* ===== BUTTON ===== */
.btn-primary-modern {
  background: linear-gradient(135deg, #FF741F, #FF9A3E);
  border: none;
  color: black;
  font-weight: 600;
  border-radius: 30px;
  padding: 8px 20px;
}

/* ===== TABLE ===== */
.table-modern-wrapper {
  background: #1a1a1a;
  border-radius: 20px;
  overflow: hidden;
}

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead {
  background: #111;
}

.table-modern th {
  padding: 14px;
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
}

.table-modern td {
  padding: 16px 14px;
  border-top: 1px solid #2a2a2a;
}

/* hover */
.table-modern tbody tr:hover {
  background: rgba(255,116,31,0.05);
}

/* ===== USER CELL ===== */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF741F, #FF9A3E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: black;
}

.name {
  font-weight: 600;
}

.email {
  font-size: 12px;
  color: #aaa;
}

/* ===== STATUS ===== */
.status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status.active {
  background: rgba(16,185,129,0.15);
  color: #10b981;
}

.status.inactive {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
/* ===== FORCE TEXT VISIBILITY ===== */
.table-modern td,
.table-modern th,
.table-modern {
  color: #f1f1f1 !important;
}

/* Fix faded rows */
.table-modern tbody tr {
  opacity: 1 !important;
}

/* Customer name strong */
.name {
  color: #ffffff;
}

/* Email slightly muted but visible */
.email {
  color: #b5b5b5;
}

/* Contact + date */
.table-modern td {
  color: #dcdcdc;
}

/* Header stronger */
.table-modern th {
  color: #888;
}

/* ===== FILTER INPUT FIX ===== */
.filter-item input,
.filter-item select {
  color: #ffffff !important;
}

/* Date input icon fix */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Placeholder fix */
.filter-item input::placeholder {
  color: #999;
}

/* ===== EXPORT + SMALL TEXT ===== */
.text-muted {
  color: #9a9a9a !important;
}
.table-modern td {
  color: #e6e6e6;
  font-weight: 500;
}

/* ===== DROPDOWN FIX ===== */

/* Select visible text */
.filter-item select,
.form-select {
  color: #ffffff !important;
  background-color: #262626 !important;
}

/* Dropdown options (important) */
select option {
  background-color: #262626 !important;
  color: #ffffff !important;
}

/* Selected option highlight */
select option:checked {
  background-color: #FF741F !important;
  color: #000 !important;
}


/* Filter icon (left) */
.filter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,116,31,0.15);
  color: #FF741F;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
}

/* Reset button */
.btn-reset-modern {
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.btn-reset-modern:hover {
  border-color: #FF741F;
  color: #FF741F;
  transform: rotate(-90deg);
}
/* ===== MODERN PAGINATION ===== */
.pagination {
  gap: 6px;
}

.page-link {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #ccc;
  border-radius: 10px !important;
  padding: 6px 12px;
  transition: 0.2s;
}

.page-link:hover {
  background: rgba(255,116,31,0.15);
  color: #FF741F;
  border-color: #FF741F;
}

.page-item.active .page-link {
  background: linear-gradient(135deg, #FF741F, #FF9A3E);
  color: black;
  border: none;
}

.page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
}
/* ===== ACTION BUTTON ===== */
.btn-action {
  background: #262626;
  border: 1px solid #333;
  color: #aaa;
  border-radius: 10px;
  padding: 6px 10px;
  transition: 0.2s;
}

.btn-action i {
  font-size: 16px;
}

/* hover */
.btn-action.view:hover {
  background: rgba(59,130,246,0.15);
  border-color: #FF741F;
  color: #FF741F;
}
.btn-action.edit:hover {
  background: rgba(59,130,246,0.15);
  border-color: #FF741F;
  color: #FF741F;
}
.btn-action.delete:hover {
  background: rgba(59,130,246,0.15);
  border-color: #FF741F;
  color: #FF741F;
}
/* optional spacing */
td.text-end {
   text-align: right;
}
.table-modern td:last-child {
  text-align: right;
  padding-right: 20px;
}
/*Mobile freinedly*/
/* ===== MOBILE CARD UI IMPROVED ===== */
@media (max-width: 768px) {

  .table-modern thead {
    display: none;
  }

  .table-modern,
  .table-modern tbody,
  .table-modern tr {
    display: block;
    width: 100%;
  }

  .table-modern tr {
    background: #1e1e1e;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #2a2a2a;
  }

  /* top section (avatar + name) */
  .table-modern td[data-label="Customer"] {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
  }

  /* hide default label */
  .table-modern td[data-label="Customer"]::before {
    display: none;
  }

  /* rest fields */
  .table-modern td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
  }

  .table-modern td::before {
    content: attr(data-label);
    font-size: 12px;
    color: #888;
    font-weight: 500;
  }

  /* name + email */
  .user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .name {
    font-size: 15px;
    font-weight: 600;
  }

  .email {
    font-size: 12px;
    color: #aaa;
  }

  /* avatar smaller */
  .avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* status align right */
  .status {
    font-size: 12px;
    padding: 4px 10px;
  }
    
    td[data-label="Action"] {
    justify-content: flex-end;
  }

  td[data-label="Action"]::before {
    display: none;
  }
}

 /* ===== MODERN DARK LOADER ===== */
.ajax-loader {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.ajax-loader.active {
  display: flex;
}

/* box */
.ajax-loader-box {
  background: #1e1e1e;
  padding: 24px 30px;
  border-radius: 20px;
  text-align: center;
  min-width: 180px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

/* spinner */
.ajax-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #2a2a2a;
  border-top: 4px solid #FF741F;
  border-right: 4px solid #FF9A3E;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
  box-shadow: 0 0 12px rgba(255,116,31,0.4);
}

/* text */
.ajax-loader-text {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  letter-spacing: 0.4px;
}

/* animation */
@keyframes spin {
  100% {
      transform: rotate(360deg);
  }
}