/* Admin Panel Styles */

/* Admin Screen Layout */
#admin-screen {
  flex-direction: row;
  height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--gray);
}

.sidebar-header {
  padding: 0.25rem;
  border-bottom: 1px solid var(--gray);
  text-align: center;
}

.sidebar-header h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
}

.nav-btn {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  color: var(--gray);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--darker);
  color: var(--white);
}

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

.nav-link {
  text-decoration: none;
  display: block;
}

a.nav-btn {
  text-decoration: none;
  display: block;
}

/* Collapsible Nav Groups */
.nav-group {
  margin: 0.1rem 0;
}

.nav-group-header {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  color: var(--white);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s;
}

.nav-group-header:hover {
  background: var(--darker);
}

.nav-group-items {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-group.open .nav-group-items {
  display: flex;
}

.nav-group-items .nav-btn {
  padding-left: 1.5rem;
}

.nav-link-external {
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  color: var(--gray);
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.nav-link-external:hover {
  background: var(--darker);
  color: var(--white);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--gray);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pos-link {
  padding: 0.75rem 1rem;
  background: var(--darker);
  color: var(--gray);
  text-decoration: none;
  border-radius: 0.5rem;
  text-align: center;
  transition: all 0.2s;
}

.pos-link:hover {
  background: var(--secondary);
  color: var(--white);
}

/* Main Content */
.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--darker);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stats-small {
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--dark);
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--gray);
  font-size: 0.875rem;
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--dark) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid var(--primary);
}

.stat-detail {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 0.25rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--dark);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.dashboard-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  color: var(--gray);
}

.alert-list, .sales-list {
  max-height: 300px;
  overflow-y: auto;
}

.alert-item, .sale-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--darker);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.alert-item .product-name {
  font-weight: 500;
}

.alert-item .stock-count {
  color: var(--warning);
  font-weight: 600;
}

.alert-item .stock-count.critical {
  color: var(--danger);
}

.sale-item .sale-info {
  flex: 1;
}

.sale-item .sale-id {
  font-size: 0.75rem;
  color: var(--gray);
}

.sale-item .sale-total {
  font-weight: 600;
  color: var(--primary);
}

.empty-state {
  color: var(--gray);
  text-align: center;
  padding: 2rem;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-input, .filter-select {
  padding: 0.75rem 1rem;
  background: var(--dark);
  border: 1px solid var(--gray);
  border-radius: 0.5rem;
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--primary);
}

.filter-input {
  min-width: 250px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray);
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Data Tables */
.table-container {
  background: var(--dark);
  border-radius: 0.75rem;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--darker);
}

.data-table th {
  background: var(--darker);
  color: var(--gray);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: var(--darker);
}

.data-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* Buttons */
.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s;
}

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

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--gray);
  color: var(--white);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

.btn-edit {
  background: var(--secondary);
}

.btn-edit:hover {
  background: #4f46e5;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  margin-right: 0.25rem;
}

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

.btn-small.btn-danger {
  background: var(--danger);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-info {
  background: rgba(99, 102, 241, 0.2);
  color: var(--secondary);
}

.badge-secondary {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
}

/* Modal Overrides */
.modal-large {
  width: 600px;
  max-width: 90vw;
}

.modal-small {
  width: 400px;
}

/* Customer Modal - Compact Even Layout */
.modal-customer {
  width: 520px;
  max-width: 95vw;
  padding: 1.25rem;
}

.modal-customer h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-customer .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-customer .form-group label {
  font-size: 0.75rem;
  color: var(--gray);
}

.modal-customer .form-group input,
.modal-customer .form-group select {
  padding: 0.5rem;
  font-size: 0.875rem;
  background: var(--darker);
  border: 1px solid var(--gray);
  border-radius: 0.375rem;
  color: var(--white);
}

.modal-customer .form-group input:focus,
.modal-customer .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray);
}

.photo-row > label {
  font-size: 0.75rem;
  color: var(--gray);
  min-width: 50px;
}

.modal-customer .photo-preview {
  width: 140px;
  height: 105px;
  background: var(--darker);
  border: 1px dashed var(--gray);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-customer .photo-preview img,
.modal-customer .photo-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-customer .photo-placeholder {
  font-size: 0.625rem;
  color: var(--gray);
}

.modal-customer .photo-controls {
  display: flex;
  gap: 0.5rem;
}

.modal-customer .modal-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  color: var(--gray);
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  background: var(--darker);
  border: 1px solid var(--gray);
  border-radius: 0.5rem;
  color: var(--white);
  font-size: 1rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
}

.form-static {
  padding: 0.75rem;
  background: var(--darker);
  border-radius: 0.5rem;
  color: var(--white);
}

/* Receipt Modal (for viewing sale details) */
.sale-details {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* Photo Capture */
.photo-capture-container {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.photo-preview {
  width: 200px;
  height: 150px;
  background: var(--darker);
  border: 2px dashed var(--gray);
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview img,
.photo-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  color: var(--gray);
  text-align: center;
  font-size: 0.875rem;
}

.photo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================================
   RESPONSIVE / MOBILE STYLES
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 200px;
  }

  .admin-main {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .api-modules {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  #admin-screen {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  /* Sidebar becomes top nav */
  .admin-sidebar {
    width: 100%;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 100;
    max-height: none;
  }

  .sidebar-header {
    display: block;
    padding: 0.5rem;
  }

  .sidebar-header h1 {
    font-size: 1.25rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    gap: 0.35rem;
    border-bottom: 1px solid var(--gray);
  }

  .nav-btn {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .sidebar-footer {
    flex-direction: row;
    border-top: none;
    padding: 0.5rem;
    justify-content: center;
    gap: 0.5rem;
  }

  .pos-link {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  /* Main content */
  .admin-main {
    padding: 1rem;
    overflow-y: visible;
  }

  .admin-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .section-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions button {
    flex: 1 1 auto;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-card {
    padding: 1rem;
  }

  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Forms */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Filters */
  .filters-bar {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-input {
    width: 100%;
    min-width: auto;
  }

  .filter-select {
    width: 100%;
  }

  /* Buttons */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 0.875rem 1rem;
  }

  /* Modals */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0.5rem;
    padding: 1rem;
  }

  .modal-large {
    width: 95vw !important;
  }

  .modal-customer {
    width: 95vw !important;
  }

  .customer-form-grid {
    grid-template-columns: 1fr;
  }

  /* Topbar */
  .admin-topbar {
    flex-wrap: wrap;
    padding: 0.5rem;
    margin: -1rem -1rem 1rem -1rem;
    gap: 0.5rem;
  }

  .topbar-title {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
  }

  .active-users {
    display: none;
  }

  .topbar-links {
    width: 100%;
    justify-content: center;
  }

  .topbar-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Calendar */
  .calendar-container {
    overflow-x: auto;
  }

  .calendar-grid {
    min-width: 500px;
  }

  .calendar-day {
    min-height: 70px;
    padding: 0.25rem;
  }

  .shift-badge {
    font-size: 0.5rem;
    padding: 1px 3px;
  }

  /* Analytics */
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-bar .bar-label {
    min-width: 80px;
    font-size: 0.75rem;
  }

  /* Timesheet */
  .clocked-in-list {
    flex-direction: column;
  }

  .clocked-in-item {
    min-width: auto;
    width: 100%;
  }

  /* Marketing */
  .marketing-actions {
    flex-direction: column;
    width: 100%;
  }

  .marketing-actions button {
    width: 100%;
  }

  /* Settings */
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 1rem;
  }

  .theme-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .loyalty-stats {
    grid-template-columns: 1fr;
  }

  /* API modules */
  .api-modules {
    grid-template-columns: 1fr;
  }

  /* Reports */
  .report-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .report-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }

  /* Barcodes */
  .barcode-controls {
    flex-direction: column;
  }

  .barcode-controls .control-group {
    width: 100%;
  }

  .barcode-controls .control-group select,
  .barcode-controls .control-group input {
    width: 100%;
  }

  .labels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tickets */
  .ticket-info-grid {
    grid-template-columns: 1fr;
  }

  /* Backend settings */
  .backend-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .admin-main {
    padding: 0.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 0.75rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .nav-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }

  .labels-grid {
    grid-template-columns: 1fr;
  }

  /* Hourly chart */
  .hourly-chart {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .hourly-bar {
    min-width: 25px;
  }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
  .nav-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary,
  .btn-sm {
    min-height: 44px;
  }

  .toggle-switch {
    width: 56px;
    height: 30px;
  }

  .toggle-switch::after {
    width: 24px;
    height: 24px;
  }

  .toggle-switch.active::after {
    transform: translateX(26px);
  }
}

/* Top Navigation Bar */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--dark);
  border-bottom: 1px solid var(--gray);
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.topbar-title {
  color: var(--gray);
  font-size: 0.9rem;
}

.topbar-links {
  display: flex;
  gap: 0.75rem;
}

.topbar-btn {
  padding: 0.5rem 1rem;
  background: var(--gray);
  border: none;
  border-radius: 0.375rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-btn:hover {
  background: var(--secondary);
}

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

.topbar-btn.primary:hover {
  background: #0ea271;
}

.admin-role-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--gray);
  color: var(--white);
}

.admin-role-badge.superuser {
  background: #7c3aed;
}

.admin-role-badge.admin {
  background: var(--primary);
}

.admin-role-badge.manager {
  background: #f59e0b;
}

#admin-name {
  color: var(--white);
  font-weight: 600;
}

.active-users {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-left: 1px solid #444;
  border-right: 1px solid #444;
  margin: 0 1rem;
}

.active-users-label {
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.active-users-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  color: #ccc;
  font-size: 0.85rem;
}

.active-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: #374151;
  border-radius: 1rem;
  font-size: 0.8rem;
  color: #fff;
  white-space: nowrap;
}

.active-user-badge .status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.active-user-badge.pos {
  background: #3b82f6;
}

.active-user-badge.admin {
  background: #8b5cf6;
}

.active-user-badge.checkin {
  background: #f59e0b;
}

.force-logout-btn {
  background: rgba(239, 68, 68, 0.8);
  border: none;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.force-logout-btn:hover {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Staff Reports */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.report-card {
  background: var(--dark);
  border-radius: 0.5rem;
  padding: 1rem;
}

.report-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* API Settings Modules */
.api-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.api-module {
  background: var(--dark);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--gray);
}

.api-module.enabled {
  border-color: var(--primary);
}

.api-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.api-module-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: capitalize;
}

.api-module-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--gray);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: left 0.3s;
}

.toggle-switch.active::after {
  left: 27px;
}

.api-module-status {
  font-size: 0.75rem;
  color: var(--gray);
}

.api-module-status.enabled {
  color: var(--primary);
}

.api-module-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.api-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.api-field label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
}

.api-field input {
  padding: 0.5rem;
  background: var(--darker);
  border: 1px solid var(--gray);
  border-radius: 0.25rem;
  color: var(--white);
  font-size: 0.875rem;
}

.api-field input:focus {
  outline: none;
  border-color: var(--primary);
}

.api-module-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.api-module-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

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

.btn-save-api:hover {
  background: #0ea271;
}

.btn-test-api {
  background: var(--secondary);
  color: var(--white);
}

.btn-test-api:hover {
  background: #5a5fcf;
}

/* System Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 1.5rem;
}

.settings-card {
  background: var(--dark);
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
}

/* Form grid inside settings cards - responsive */
.settings-card .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Single column on narrow cards */
@media (max-width: 500px) {
  .settings-card .form-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.settings-desc {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.settings-note {
  color: var(--gray);
  font-size: 0.75rem;
  margin-top: 1rem;
  font-style: italic;
}

.settings-example {
  background: var(--darker);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gray);
  border-left: 3px solid var(--primary);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

.toggle-text {
  font-weight: 500;
}

/* Loyalty Stats */
.loyalty-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.loyalty-stat {
  text-align: center;
  padding: 1rem;
  background: var(--darker);
  border-radius: 0.5rem;
}

.loyalty-stat .stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.loyalty-stat .stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Theme Options */
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.theme-option:hover {
  background: var(--darker);
}

.theme-option input {
  display: none;
}

.theme-option input:checked + .theme-preview {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.theme-preview {
  width: 60px;
  height: 40px;
  border-radius: 0.375rem;
  display: flex;
  overflow: hidden;
}

.theme-preview::before,
.theme-preview::after {
  content: '';
  height: 100%;
}

.theme-preview::before {
  width: 30%;
}

.theme-preview::after {
  width: 70%;
}

.theme-default::before { background: #111827; }
.theme-default::after { background: #10b981; }

.theme-ocean::before { background: #020617; }
.theme-ocean::after { background: #0ea5e9; }

.theme-sunset::before { background: #1c1917; }
.theme-sunset::after { background: #f97316; }

.theme-purple::before { background: #0f0a1e; }
.theme-purple::after { background: #a855f7; }

.theme-midnight::before { background: #09090b; }
.theme-midnight::after { background: #f43f5e; }

.theme-light::before { background: #f9fafb; }
.theme-light::after { background: #059669; }

.theme-option span:last-child {
  font-size: 0.75rem;
  color: var(--gray);
}

/* UI Theme Grid (4 unique themes) */
.ui-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.ui-theme-option {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 2px solid var(--gray);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s;
}

.ui-theme-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.ui-theme-option input {
  display: none;
}

.ui-theme-option input:checked ~ .ui-theme-preview,
.ui-theme-option input:checked ~ .ui-theme-info {
  border-color: var(--primary);
}

.ui-theme-option input:checked ~ .ui-theme-preview {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.ui-theme-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.ui-theme-preview {
  height: 120px;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.ui-theme-preview .preview-header {
  height: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ui-theme-preview .preview-body {
  flex: 1;
  display: flex;
}

.ui-theme-preview .preview-products {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 5px;
}

.ui-theme-preview .preview-products::before,
.ui-theme-preview .preview-products::after,
.ui-theme-preview .preview-body::before {
  content: '';
  border-radius: 2px;
}

.ui-theme-preview .preview-cart {
  width: 35%;
  border-left: 1px solid rgba(255,255,255,0.1);
}

/* Modern Dark Theme Preview */
.ui-theme-preview.modern {
  background: #111827;
}
.ui-theme-preview.modern .preview-header {
  background: linear-gradient(180deg, #1f2937, #111827);
}
.ui-theme-preview.modern .preview-products::before,
.ui-theme-preview.modern .preview-products::after,
.ui-theme-preview.modern .preview-body::before {
  background: #1f2937;
  border: 1px solid #10b981;
}
.ui-theme-preview.modern .preview-cart {
  background: linear-gradient(180deg, #1f2937, #111827);
  border-left-color: #10b981;
}

/* Retro Terminal Theme Preview */
.ui-theme-preview.retro {
  background: #051005;
}
.ui-theme-preview.retro .preview-header {
  background: #0a1a0a;
  border-bottom-color: #00ff00;
}
.ui-theme-preview.retro .preview-products::before,
.ui-theme-preview.retro .preview-products::after,
.ui-theme-preview.retro .preview-body::before {
  background: #0a1a0a;
  border: 1px solid #00ff00;
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}
.ui-theme-preview.retro .preview-cart {
  background: #0a1a0a;
  border-left-color: #00ff00;
  box-shadow: -5px 0 15px rgba(0, 255, 0, 0.2);
}

/* Clean Light Theme Preview */
.ui-theme-preview.light {
  background: #f1f5f9;
}
.ui-theme-preview.light .preview-header {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}
.ui-theme-preview.light .preview-products::before,
.ui-theme-preview.light .preview-products::after,
.ui-theme-preview.light .preview-body::before {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.ui-theme-preview.light .preview-cart {
  background: #ffffff;
  border-left-color: #e2e8f0;
}

/* Neon Cyberpunk Theme Preview */
.ui-theme-preview.neon {
  background: #050010;
}
.ui-theme-preview.neon .preview-header {
  background: linear-gradient(180deg, #0d0221, #050010);
  border-bottom-color: #00f5ff;
  box-shadow: 0 2px 10px rgba(0, 245, 255, 0.3);
}
.ui-theme-preview.neon .preview-products::before,
.ui-theme-preview.neon .preview-products::after,
.ui-theme-preview.neon .preview-body::before {
  background: #0d0221;
  border: 1px solid #00f5ff;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}
.ui-theme-preview.neon .preview-cart {
  background: linear-gradient(180deg, #0d0221, #050010);
  border-left-color: #ff00ff;
  box-shadow: -5px 0 20px rgba(255, 0, 255, 0.3);
}

.ui-theme-info {
  padding: 0.75rem;
  background: var(--darker);
  text-align: center;
}

.ui-theme-name {
  display: block;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.ui-theme-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--gray);
}

@media (max-width: 1200px) {
  .ui-theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ui-theme-grid {
    grid-template-columns: 1fr;
  }
}

/* Analytics Grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.analytics-card {
  background: var(--dark);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.analytics-card.full-width {
  grid-column: 1 / -1;
}

.analytics-card h3 {
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--darker);
}

.analytics-list {
  max-height: 250px;
  overflow-y: auto;
}

.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--darker);
}

.analytics-item:last-child {
  border-bottom: none;
}

.analytics-item .rank {
  width: 24px;
  height: 24px;
  background: var(--darker);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--gray);
  margin-right: 0.75rem;
}

.analytics-item .rank.top-3 {
  background: var(--primary);
  color: var(--white);
}

.analytics-item .item-info {
  flex: 1;
  min-width: 0;
}

.analytics-item .item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-item .item-detail {
  font-size: 0.75rem;
  color: var(--gray);
}

.analytics-item .item-value {
  font-weight: 600;
  color: var(--primary);
  margin-left: 1rem;
}

.analytics-item .item-secondary {
  font-size: 0.75rem;
  color: var(--gray);
  margin-left: 0.5rem;
}

/* Progress Bar for categories/payment */
.analytics-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.analytics-bar .bar-label {
  min-width: 100px;
  font-size: 0.875rem;
}

.analytics-bar .bar-container {
  flex: 1;
  height: 24px;
  background: var(--darker);
  border-radius: 0.25rem;
  overflow: hidden;
}

.analytics-bar .bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: fit-content;
}

.analytics-bar .bar-value {
  min-width: 80px;
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

/* Hourly Chart */
.hourly-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 150px;
  padding-top: 1rem;
  gap: 4px;
}

.hourly-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.hourly-bar .bar {
  width: 100%;
  max-width: 30px;
  background: var(--primary);
  border-radius: 0.25rem 0.25rem 0 0;
  margin-top: auto;
  min-height: 2px;
  transition: height 0.3s;
}

.hourly-bar .bar:hover {
  background: var(--secondary);
}

.hourly-bar .hour-label {
  font-size: 0.625rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.hourly-bar .bar-tooltip {
  font-size: 0.625rem;
  color: var(--gray);
  margin-bottom: 0.25rem;
}

/* ============================================================================
   TIMESHEET
   ============================================================================ */

.clocked-in-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.clocked-in-item {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary);
  min-width: 200px;
}

.clocked-in-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.clocked-in-time {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.25rem;
}

.clocked-in-duration {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}

/* Timesheet table action buttons */
#timesheet-entries-table .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Form actions in modal */
.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ============================================================================
   WORK SCHEDULE / CALENDAR
   ============================================================================ */

.schedule-actions {
  display: flex;
  gap: 0.5rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--dark);
  border-radius: 0.5rem;
}

.calendar-nav h3 {
  margin: 0;
  min-width: 180px;
  text-align: center;
  font-size: 1.1rem;
}

.calendar-nav-btn {
  padding: 0.5rem 1rem;
  background: var(--darker);
  border: 1px solid var(--gray);
  color: var(--white);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.schedule-summary {
  background: var(--dark);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.summary-header {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.summary-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.summary-item {
  background: var(--darker);
  padding: 0.35rem 0.6rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.summary-item .staff-name {
  font-weight: 500;
}

.summary-item .hours {
  color: var(--primary);
  font-weight: 600;
}

.calendar-container {
  background: var(--dark);
  border-radius: 0.5rem;
  overflow: hidden;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--darker);
}

.calendar-day-header {
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray);
  border-right: 1px solid var(--gray);
}

.calendar-day-header:last-child {
  border-right: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 90px;
  max-height: 110px;
  overflow: hidden;
  border: 1px solid var(--gray);
  border-top: none;
  border-left: none;
  padding: 0.35rem;
  background: var(--dark);
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:nth-child(-n+7) {
  border-top: 1px solid var(--gray);
}

.calendar-day:hover {
  background: var(--darker);
}

.calendar-day.other-month {
  background: var(--darker);
  opacity: 0.5;
}

.calendar-day.today {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
}

.calendar-day .day-number {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--gray);
}

.calendar-day.today .day-number {
  color: var(--primary);
}

.calendar-day .day-shifts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shift-badge {
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.1s;
  line-height: 1.2;
}

.shift-badge:hover {
  transform: scale(1.02);
}

.shift-badge.budtender {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-left: 3px solid #10b981;
}

.shift-badge.reception {
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
  border-left: 3px solid #6366f1;
}

.shift-badge.manager {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-left: 3px solid #f59e0b;
}

.shift-time {
  font-size: 0.55rem;
  opacity: 0.8;
}

.schedule-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--dark);
  border-radius: 0.5rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--gray);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-color.budtender {
  background: rgba(16, 185, 129, 0.3);
  border: 2px solid #10b981;
}

.legend-color.reception {
  background: rgba(99, 102, 241, 0.3);
  border: 2px solid #6366f1;
}

.legend-color.manager {
  background: rgba(245, 158, 11, 0.3);
  border: 2px solid #f59e0b;
}

/* Shift Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* More shifts indicator */
.more-shifts {
  font-size: 0.65rem;
  color: var(--gray);
  text-align: center;
  padding: 0.15rem;
  cursor: pointer;
}

.more-shifts:hover {
  color: var(--primary);
}

/* ============================================================================
   MARKETING
   ============================================================================ */

.marketing-actions {
  display: flex;
  gap: 0.5rem;
}

.marketing-stats {
  margin-bottom: 1.5rem;
}

.campaign-modal {
  max-width: 600px;
}

.templates-modal {
  max-width: 700px;
}

.segment-preview {
  background: var(--darker);
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.segment-preview .preview-count {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.segment-preview .preview-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.segment-preview .preview-number {
  font-weight: 600;
  color: var(--primary);
}

.segment-preview .preview-loading {
  color: var(--gray);
  font-style: italic;
}

.message-help {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.5rem;
}

.email-only {
  transition: opacity 0.2s;
}

.campaign-form[data-type="sms"] .email-only {
  opacity: 0.5;
}

/* Templates List */
.templates-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray);
  border-radius: 0.375rem;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray);
  cursor: pointer;
  transition: background 0.2s;
}

.template-item:last-child {
  border-bottom: none;
}

.template-item:hover {
  background: var(--darker);
}

.template-item.active {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--primary);
}

.template-item .template-info {
  flex: 1;
}

.template-item .template-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.template-item .template-type {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
}

.template-item .template-actions {
  display: flex;
  gap: 0.5rem;
}

.template-form {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.template-form h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.template-email-only {
  transition: opacity 0.2s;
}

/* Campaign Status Badges */
.campaign-status {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.campaign-status.draft {
  background: var(--darker);
  color: var(--gray);
}

.campaign-status.scheduled {
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
}

.campaign-status.sending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.campaign-status.sent {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.campaign-status.cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Campaign Type Badge */
.campaign-type-badge {
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.campaign-type-badge.email {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.campaign-type-badge.sms {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.campaign-type-badge.both {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* Campaign History */
.campaign-history-info {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.campaign-history-info h3 {
  margin: 0 0 0.5rem 0;
}

.campaign-history-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.modal-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray);
  text-align: right;
}

/* ============================================================================
   SUPPORT TICKETS
   ============================================================================ */

/* Ticket Stats */
.stat-card.urgent {
  border-color: #ef4444;
}

.stat-card.urgent .stat-value {
  color: #ef4444;
}

/* Priority badges */
.badge.priority-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge.priority-high {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.badge.priority-medium {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.badge.priority-low {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* Status badges */
.badge.status-open {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.badge.status-in_progress {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.badge.status-waiting {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.badge.status-resolved {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.badge.status-closed {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
}

/* Type badges */
.badge.badge-support { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge.badge-feedback { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge.badge-bug { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge.badge-feature { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.badge.badge-billing { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.badge.badge-other { background: rgba(107, 114, 128, 0.2); color: #6b7280; }

/* Ticket row priority indicator */
tr.priority-urgent { border-left: 3px solid #ef4444; }
tr.priority-high { border-left: 3px solid #f97316; }

/* Ticket Detail Modal */
.ticket-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
}

.ticket-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ticket-info-item label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
}

.ticket-info-item select {
  padding: 0.5rem;
  background: var(--dark);
  border: 1px solid var(--gray);
  border-radius: 0.25rem;
  color: var(--white);
  font-size: 0.875rem;
}

.ticket-info-item select:focus {
  outline: none;
  border-color: var(--primary);
}

.ticket-customer-info {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
}

.ticket-customer-info h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary);
}

.ticket-customer-info p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

/* Ticket Messages */
.ticket-messages {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--darker);
  border-radius: 0.5rem;
}

.ticket-message {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--dark);
}

.ticket-message.customer {
  border-left: 3px solid #3b82f6;
}

.ticket-message.staff {
  border-left: 3px solid #10b981;
}

.ticket-message.internal {
  border-left: 3px solid #f97316;
  background: rgba(249, 115, 22, 0.1);
}

.ticket-message.system {
  border-left: 3px solid var(--gray);
  font-style: italic;
  color: var(--gray);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.message-time {
  color: var(--gray);
  font-size: 0.75rem;
}

.internal-badge {
  background: rgba(249, 115, 22, 0.3);
  color: #f97316;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.message-body {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Reply Form */
.ticket-reply-form {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
}

.ticket-reply-form h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary);
}

.ticket-reply-form textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--dark);
  border: 1px solid var(--gray);
  border-radius: 0.25rem;
  color: var(--white);
  font-size: 0.875rem;
  resize: vertical;
  min-height: 100px;
}

.ticket-reply-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* ============================================================================
   BARCODE LABELS
   ============================================================================ */

.barcode-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.barcode-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.barcode-controls .control-group label {
  font-size: 0.75rem;
  color: var(--gray);
}

.barcode-controls .control-group select,
.barcode-controls .control-group input {
  padding: 0.5rem 1rem;
  background: var(--darker);
  border: 1px solid var(--gray);
  border-radius: 0.375rem;
  color: var(--white);
  font-size: 0.875rem;
}

.barcode-controls .select-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.label-card {
  background: #fff;
  color: #000;
  padding: 0.35rem;
  border-radius: 0.25rem;
  text-align: center;
  min-height: 70px;
  cursor: pointer;
  transition: outline 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.label-card:hover {
  outline: 2px solid var(--gray);
}

.label-card.selected {
  outline: 3px solid var(--primary);
}

.label-name {
  font-weight: 600;
  font-size: 0.7rem;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label-details {
  font-size: 0.5rem;
  color: #666;
  margin-bottom: 0.2rem;
}

.label-barcode img {
  max-width: 100%;
  height: 30px;
  image-rendering: pixelated;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.label-price {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.label-sku {
  font-size: 0.5rem;
  color: #666;
}

/* Label size variations — tiny (dymo-30333, small) */
.labels-grid.size-dymo-30333 .label-card,
.labels-grid.size-small .label-card { min-height: 48px; max-width: 100px; padding: 0.1rem; }
.labels-grid.size-dymo-30333 .label-name,
.labels-grid.size-small .label-name { font-size: 0.45rem; }
.labels-grid.size-dymo-30333 .label-details,
.labels-grid.size-small .label-details { display: none; }
.labels-grid.size-dymo-30333 .label-barcode img,
.labels-grid.size-small .label-barcode img { height: 16px; }
.labels-grid.size-dymo-30333 .label-price,
.labels-grid.size-small .label-price { font-size: 0.5rem; margin-top: 0.05rem; }
.labels-grid.size-dymo-30333 .label-sku,
.labels-grid.size-small .label-sku { font-size: 0.35rem; }

/* Label size variations — small-medium (dymo-30336, medium) */
.labels-grid.size-dymo-30336 .label-card,
.labels-grid.size-medium .label-card { min-height: 70px; padding: 0.2rem; }
.labels-grid.size-dymo-30336 .label-name,
.labels-grid.size-medium .label-name { font-size: 0.55rem; }
.labels-grid.size-dymo-30336 .label-details,
.labels-grid.size-medium .label-details { font-size: 0.4rem; }
.labels-grid.size-dymo-30336 .label-barcode img,
.labels-grid.size-medium .label-barcode img { height: 22px; }
.labels-grid.size-dymo-30336 .label-price,
.labels-grid.size-medium .label-price { font-size: 0.65rem; }
.labels-grid.size-dymo-30336 .label-sku,
.labels-grid.size-medium .label-sku { font-size: 0.4rem; }

/* Label size variations — medium (dymo-30334) — default */
.labels-grid.size-dymo-30334 .label-card { min-height: 85px; }

/* Label size variations — wide (dymo-30252) */
.labels-grid.size-dymo-30252 .label-card { min-height: 75px; min-width: 200px; }
.labels-grid.size-dymo-30252 .label-barcode img { height: 25px; }

/* Label size variations — large (dymo-30323, large, shelf) */
.labels-grid.size-dymo-30323 .label-card { min-height: 120px; min-width: 220px; }
.labels-grid.size-large .label-card { min-height: 100px; }
.labels-grid.size-shelf .label-card { min-height: 120px; }

.labels-grid.size-dymo-30323 .label-name { font-size: 0.85rem; }
.labels-grid.size-dymo-30323 .label-details { font-size: 0.55rem; }
.labels-grid.size-dymo-30323 .label-barcode img { height: 35px; }
.labels-grid.size-dymo-30323 .label-price { font-size: 1rem; }
.labels-grid.size-dymo-30323 .label-sku { font-size: 0.5rem; }

.labels-grid.size-large .label-name,
.labels-grid.size-shelf .label-name { font-size: 0.8rem; }
.labels-grid.size-large .label-details,
.labels-grid.size-shelf .label-details { font-size: 0.55rem; }
.labels-grid.size-large .label-barcode img,
.labels-grid.size-shelf .label-barcode img { height: 32px; }
.labels-grid.size-large .label-price,
.labels-grid.size-shelf .label-price { font-size: 0.95rem; }
.labels-grid.size-large .label-sku,
.labels-grid.size-shelf .label-sku { font-size: 0.5rem; }

/* Print styles for barcodes */
@media print {
  /* Override styles.css visibility:hidden that hides all elements for receipt printing */
  #admin-screen,
  #admin-screen .admin-main,
  #admin-screen #section-barcodes,
  #admin-screen #section-barcodes .labels-grid,
  #admin-screen #section-barcodes .label-card,
  #admin-screen #section-barcodes .label-card * {
    visibility: visible !important;
  }

  .admin-sidebar, .admin-topbar, .barcode-controls, .section-header {
    display: none !important;
  }

  .admin-main {
    padding: 0;
    overflow: visible;
  }

  #section-barcodes {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
  }

  .labels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.05in;
  }

  .label-card {
    border: none;
    page-break-inside: avoid;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }

  .label-card:not(.selected) {
    display: none;
  }

  .label-barcode img {
    width: 100%;
    height: auto;
  }

  /* Print — tiny (dymo-30333, small) */
  .labels-grid.size-dymo-30333 .label-card { width: 1in; height: 0.5in; padding: 0.02in; }
  .labels-grid.size-small .label-card { width: 1in; height: 0.5in; padding: 0.02in; }
  .labels-grid.size-dymo-30333 .label-name,
  .labels-grid.size-small .label-name { font-size: 5pt; }
  .labels-grid.size-dymo-30333 .label-details,
  .labels-grid.size-small .label-details { display: none; }
  .labels-grid.size-dymo-30333 .label-barcode img,
  .labels-grid.size-small .label-barcode img { max-height: 0.18in; }
  .labels-grid.size-dymo-30333 .label-price,
  .labels-grid.size-small .label-price { font-size: 6pt; margin-top: 0; }
  .labels-grid.size-dymo-30333 .label-sku,
  .labels-grid.size-small .label-sku { font-size: 4pt; }

  /* Print — small-medium (dymo-30336, medium) */
  .labels-grid.size-dymo-30336 .label-card { width: 2.125in; height: 1in; padding: 0.04in; }
  .labels-grid.size-medium .label-card { width: 2in; height: 1in; padding: 0.05in; }
  .labels-grid.size-dymo-30336 .label-name,
  .labels-grid.size-medium .label-name { font-size: 7pt; }
  .labels-grid.size-dymo-30336 .label-details,
  .labels-grid.size-medium .label-details { font-size: 5pt; }
  .labels-grid.size-dymo-30336 .label-barcode img,
  .labels-grid.size-medium .label-barcode img { max-height: 0.3in; }
  .labels-grid.size-dymo-30336 .label-price,
  .labels-grid.size-medium .label-price { font-size: 8pt; }
  .labels-grid.size-dymo-30336 .label-sku,
  .labels-grid.size-medium .label-sku { font-size: 5pt; }

  /* Print — medium default (dymo-30334) */
  .labels-grid.size-dymo-30334 .label-card { width: 2.25in; height: 1.25in; padding: 0.06in; }
  .labels-grid.size-dymo-30334 .label-name { font-size: 8pt; }
  .labels-grid.size-dymo-30334 .label-details { font-size: 5.5pt; }
  .labels-grid.size-dymo-30334 .label-barcode img { max-height: 0.35in; }
  .labels-grid.size-dymo-30334 .label-price { font-size: 9pt; }
  .labels-grid.size-dymo-30334 .label-sku { font-size: 5.5pt; }

  /* Print — wide (dymo-30252) */
  .labels-grid.size-dymo-30252 .label-card { width: 3.5in; height: 1.125in; padding: 0.06in; }
  .labels-grid.size-dymo-30252 .label-name { font-size: 8pt; }
  .labels-grid.size-dymo-30252 .label-details { font-size: 5.5pt; }
  .labels-grid.size-dymo-30252 .label-barcode img { max-height: 0.32in; }
  .labels-grid.size-dymo-30252 .label-price { font-size: 9pt; }
  .labels-grid.size-dymo-30252 .label-sku { font-size: 5pt; }

  /* Print — large (dymo-30323) */
  .labels-grid.size-dymo-30323 .label-card { width: 4in; height: 2.125in; padding: 0.1in; }
  .labels-grid.size-dymo-30323 .label-name { font-size: 11pt; }
  .labels-grid.size-dymo-30323 .label-details { font-size: 7pt; }
  .labels-grid.size-dymo-30323 .label-barcode img { max-height: 0.5in; }
  .labels-grid.size-dymo-30323 .label-price { font-size: 12pt; }
  .labels-grid.size-dymo-30323 .label-sku { font-size: 6.5pt; }

  /* Print — standard large */
  .labels-grid.size-large .label-card { width: 2.25in; height: 1.25in; padding: 0.08in; }
  .labels-grid.size-large .label-name { font-size: 8.5pt; }
  .labels-grid.size-large .label-details { font-size: 6pt; }
  .labels-grid.size-large .label-barcode img { max-height: 0.35in; }
  .labels-grid.size-large .label-price { font-size: 10pt; }
  .labels-grid.size-large .label-sku { font-size: 5.5pt; }

  /* Print — shelf tag */
  .labels-grid.size-shelf .label-card { width: 3in; height: 1.5in; padding: 0.1in; }
  .labels-grid.size-shelf .label-name { font-size: 10pt; }
  .labels-grid.size-shelf .label-details { font-size: 7pt; }
  .labels-grid.size-shelf .label-barcode img { max-height: 0.42in; }
  .labels-grid.size-shelf .label-price { font-size: 11pt; }
  .labels-grid.size-shelf .label-sku { font-size: 6pt; }
}

/* ============================================================================
   REPORTS SECTION
   ============================================================================ */

.report-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray);
  padding-bottom: 0.5rem;
}

.report-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.report-tab:hover {
  background: var(--darker);
  color: var(--white);
}

.report-tab.active {
  background: var(--primary);
  color: var(--white);
}

.report-content {
  display: none;
}

.report-content.active {
  display: block;
}

/* ============================================================================
   SYSTEM SECTION
   ============================================================================ */

.system-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--darker);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--gray);
}

.info-value {
  color: var(--white);
  font-weight: 500;
}

.backup-actions {
  margin-bottom: 1rem;
}

.backup-list {
  max-height: 300px;
  overflow-y: auto;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--darker);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.backup-item:last-child {
  margin-bottom: 0;
}

.backup-info {
  flex: 1;
}

.backup-name {
  font-weight: 500;
  color: var(--white);
}

.backup-date {
  font-size: 0.85rem;
  color: var(--gray);
}

.backup-size {
  font-size: 0.85rem;
  color: var(--gray);
  margin-left: 1rem;
}

.backup-actions-inline {
  display: flex;
  gap: 0.5rem;
}

.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.danger-zone.collapsed {
  cursor: pointer;
}

.danger-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.danger-zone-header h3 {
  color: #ef4444;
  margin: 0;
}

.danger-toggle-hint {
  font-size: 0.85rem;
  color: var(--gray);
}

.danger-zone.collapsed:hover .danger-toggle-hint {
  color: #ef4444;
}

.danger-warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  color: #fca5a5;
}

.danger-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.danger-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.danger-action-info {
  flex: 1;
  margin-right: 1rem;
}

.danger-action-info strong {
  color: var(--white);
}

.danger-action-info p {
  font-size: 0.85rem;
  color: var(--gray);
  margin: 0.25rem 0 0 0;
}

.btn-danger-extreme {
  background: #7f1d1d !important;
  border: 2px solid #dc2626 !important;
}

.btn-danger-extreme:hover {
  background: #dc2626 !important;
}

.danger-confirm-warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  color: #fca5a5;
  text-align: center;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #b91c1c;
}

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

/* ============================================================================
   BACKEND SETTINGS EDITOR
   ============================================================================ */

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.settings-card-header h3 {
  margin: 0;
}

.backend-settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.backend-settings-group {
  background: var(--darker);
  border-radius: 0.5rem;
  padding: 1rem;
}

.backend-settings-group h4 {
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray);
  color: var(--primary);
  font-size: 0.95rem;
}

.backend-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.backend-setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.backend-setting-item label {
  font-size: 0.85rem;
  color: var(--gray);
}

.backend-setting-item input,
.backend-setting-item select {
  padding: 0.5rem 0.75rem;
  background: var(--dark);
  border: 1px solid var(--gray);
  border-radius: 0.375rem;
  color: var(--white);
  font-size: 0.9rem;
}

.backend-setting-item input:focus,
.backend-setting-item select:focus {
  outline: none;
  border-color: var(--primary);
}

.backend-setting-item input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.backend-setting-item .checkbox-wrapper {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.backend-setting-item .checkbox-wrapper label {
  color: var(--white);
  cursor: pointer;
}

.restart-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  color: var(--warning);
  font-size: 0.85rem;
  display: none;
}

.restart-notice.visible {
  display: block;
}

/* ============================================================================
   TASK SCHEDULER
   ============================================================================ */

.scheduled-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.scheduled-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--darker);
  border-radius: 0.5rem;
  border-left: 3px solid var(--gray);
}

.scheduled-task-item.enabled {
  border-left-color: var(--primary);
}

.scheduled-task-item.disabled {
  opacity: 0.6;
}

.task-info {
  flex: 1;
}

.task-name {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.task-schedule {
  font-size: 0.85rem;
  color: var(--gray);
}

.task-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.task-status .last-run {
  color: var(--gray);
}

.task-status .status-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.task-status .status-badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary);
}

.task-status .status-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.task-status .status-badge.pending {
  background: rgba(107, 114, 128, 0.2);
  color: var(--gray);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.task-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--gray);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.task-toggle.active {
  background: var(--primary);
}

.task-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.task-toggle.active::after {
  transform: translateX(20px);
}

.task-btn {
  padding: 0.375rem 0.75rem;
  background: var(--dark);
  border: 1px solid var(--gray);
  border-radius: 0.375rem;
  color: var(--white);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.task-btn.run {
  background: var(--secondary);
  border-color: var(--secondary);
}

.task-btn.delete {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.task-btn.delete:hover {
  background: var(--danger);
  color: white;
}

/* ============================================================================
   DELETED RECORDS (SUPERUSER ONLY)
   ============================================================================ */

.deleted-records-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray);
  padding-bottom: 0.5rem;
}

.deleted-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.deleted-tab:hover {
  background: var(--darker);
  color: var(--white);
}

.deleted-tab.active {
  background: var(--danger);
  color: var(--white);
}

.deleted-tab-content {
  display: none;
}

.deleted-tab-content.active {
  display: block;
}

/* Superuser-only nav button styling */
.nav-btn.superuser-only {
  border-left: 3px solid #7c3aed;
  margin-top: 0.5rem;
}

.nav-btn.superuser-only:hover {
  background: rgba(124, 58, 237, 0.2);
}

/* Deleted records table styling */
#section-deleted-records .table-container {
  margin-top: 1rem;
}

#section-deleted-records .data-table tr {
  background: rgba(239, 68, 68, 0.05);
}

#section-deleted-records .data-table tr:hover {
  background: rgba(239, 68, 68, 0.1);
}

#section-deleted-records .btn-primary {
  background: var(--primary);
}

#section-deleted-records .btn-primary:hover {
  background: #0ea271;
}

/* ============================================================================
   DEALS & PROMOTIONS
   ============================================================================ */

.deals-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.deals-stats-row .stat-card {
  flex: 1;
  text-align: center;
}

.actions-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
}

.btn-sm.btn-edit {
  background: var(--primary);
}

.btn-sm.btn-edit:hover {
  background: #0ea271;
}

.btn-sm.btn-warning {
  background: #f59e0b;
}

.btn-sm.btn-warning:hover {
  background: #d97706;
}

.btn-sm.btn-success {
  background: #10b981;
}

.btn-sm.btn-success:hover {
  background: #059669;
}

.btn-sm.btn-danger {
  background: #ef4444;
}

.btn-sm.btn-danger:hover {
  background: #dc2626;
}

.multi-select {
  width: 100%;
  padding: 0.5rem;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

#deal-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#deal-modal .form-group.full-width {
  grid-column: 1 / -1;
}

#bogo-fields .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .deals-stats-row {
    flex-direction: column;
  }

  #deal-modal .form-grid {
    grid-template-columns: 1fr;
  }

  #bogo-fields .form-grid {
    grid-template-columns: 1fr;
  }
}

.status-light {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.status-light .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

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

.status-light.on .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-light.off {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.status-light.off .status-dot {
  background: #6b7280;
}

/* ============================================================================
   RETURNS SECTION STYLES
   ============================================================================ */

.badge-info {
  background: #3b82f6;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-warning {
  background: #f59e0b;
  color: #1f2937;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: #10b981;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-danger {
  background: #ef4444;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

#section-returns .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

#section-returns .stat-card {
  background: var(--darker);
  padding: 1.25rem;
  border-radius: 0.75rem;
  text-align: center;
}

#section-returns .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

#section-returns .stat-label {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

#return-detail-modal .order-info {
  background: var(--darker);
  padding: 1rem;
  border-radius: 0.5rem;
}

#return-detail-modal .order-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

#return-detail-modal .order-info-row:last-child {
  margin-bottom: 0;
}
