/* eSIM Premium Design System
   Professional, clean, and consistent styling for eSIM functionality
   ========================================================================== */

/* Typography System */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Color Palette - Professional & Premium */
  --color-primary: #dbfa5e;
  --color-primary-dark: #c4e03a;
  --color-primary-light: #e6ff7f;
  --color-success: #16a34a;
  --color-error: #ef4444;
  --color-error-light: #fef2f2;
  --color-danger: #ef4444;
  --color-warning: #ea580c;
  --color-warning-light: #fef3c7;
  --color-warning-dark: #92400e;

  /* Neutral Colors */
  --color-text: #111827;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;

  /* Link Colors - Good contrast on light backgrounds */
  --color-link: #374151;
  --color-link-hover: #111827;
  --color-link-visited: #6b7280;

  /* Gray Scale */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Spacing Scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Container Styles */
.esim-container {
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  padding: 1.5rem 2rem 2rem 2rem;
  box-sizing: border-box;
}

/* Link Styles - High contrast for readability */
.esim-container a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.esim-container a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.esim-container a:visited {
  color: var(--color-link-visited);
}

/* Utility class for explicit link styling */
.esim-link {
  color: var(--color-link) !important;
  text-decoration: underline;
  font-weight: 500;
}

.esim-link:hover {
  color: var(--color-link-hover) !important;
}

/* Page Header */
.esim-page-header {
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-xl) 0;
  margin-bottom: var(--spacing-2xl);
}

.esim-page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.025em;
}

.esim-page-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

/* Section Styles */
.esim-section {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.esim-section:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border-color: var(--color-border);
}

.esim-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-lg) 0;
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-border-light);
}

/* Search Form Styles */
.esim-search-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.esim-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.esim-button-group {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border-light);
}

.esim-form-group {
  display: flex;
  flex-direction: column;
}

.esim-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.025em;
}

.esim-form-input,
.esim-form-select {
  padding: 0.375rem var(--spacing-md);
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
  box-sizing: border-box;
  height: 2.125rem;
  line-height: 1.25rem;
}

/* Ensure select elements match input height */
.esim-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

.esim-form-input:focus,
.esim-form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.esim-form-input::placeholder {
  color: var(--color-text-muted);
}

/* Button Styles */
.esim-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  letter-spacing: 0.025em;
}

.esim-btn-primary {
  background: var(--color-primary);
  color: #000000 !important;
}

a.esim-btn-primary,
a.esim-btn-primary:link,
a.esim-btn-primary:visited {
  color: #000000 !important;
  text-decoration: none;
}

.esim-btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  color: #000000 !important;
}

.esim-btn-secondary {
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
}

.esim-btn-secondary:hover {
  background: #f9f9f9;
  box-shadow: var(--shadow-sm);
}

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

.esim-btn-success:hover {
  background: #15803d;
  box-shadow: var(--shadow-md);
}

.esim-btn-group {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

/* Results Table */
.esim-table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

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

.esim-table thead {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.esim-table th {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.esim-table td {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-light);
}

.esim-table tbody tr:hover {
  background: var(--color-bg-secondary);
}

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

/* Badge Styles */
.esim-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  letter-spacing: 0.025em;
}

.esim-badge-primary {
  background: rgba(219, 250, 94, 0.2);
  color: #000000;
}

.esim-badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-success);
}

.esim-badge-warning {
  background: rgba(234, 88, 12, 0.1);
  color: var(--color-warning);
}

.esim-badge-neutral {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.esim-badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* Price Display */
.esim-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: #000000;
}

.esim-price-currency {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Modal Styles */
.esim-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.esim-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.esim-modal-content {
  background: var(--color-bg-primary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

.esim-modal-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
}

.esim-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.esim-modal-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.esim-modal-close {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-secondary);
}

.esim-modal-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.esim-modal-body {
  padding: var(--spacing-xl);
}

.esim-modal-footer {
  padding: var(--spacing-xl);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* Dashboard Grid Layout */
.esim-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

/* Package Card Styles */
.esim-package-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  background: var(--color-bg-primary);
  transition: all 0.2s ease;
  height: fit-content;
}

.esim-package-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.esim-package-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--spacing-md);
}

.esim-package-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.esim-package-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.esim-package-detail {
  display: flex;
  flex-direction: column;
}

.esim-package-detail-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-xs);
}

.esim-package-detail-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Status Indicators */
.esim-status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.esim-status-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
}

.esim-status-active {
  background: var(--color-success);
}

.esim-status-inactive {
  background: var(--color-text-muted);
}

.esim-status-pending {
  background: var(--color-warning);
}

/* Alert/Message Boxes - High Visibility */
.esim-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  font-size: 0.9375rem;
  line-height: 1.6;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.esim-alert strong {
  font-weight: 700;
}

.esim-alert-success {
  background-color: #d1fae5;
  border-left-color: var(--color-success);
  color: #065f46;
}

.esim-alert-error {
  background-color: #fee2e2;
  border-left-color: var(--color-error);
  color: #991b1b;
}

.esim-alert-warning {
  background-color: #fff7ed;
  border-left-color: var(--color-warning);
  color: #9a3412;
}

.esim-alert-info {
  background-color: #f3f4f6;
  border-left-color: #6b7280;
  color: #374151;
}

/* QR Code Display */
.esim-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-xl);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin: var(--spacing-lg) 0;
}

.esim-qr-code {
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.esim-qr-code img {
  display: block;
  width: 200px;
  height: 200px;
}

.esim-qr-instructions {
  margin-top: var(--spacing-lg);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Success State */
.esim-success-container {
  text-align: center;
  padding: var(--spacing-2xl);
}

.esim-success-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--spacing-lg);
  background: rgba(22, 163, 74, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  font-size: 2rem;
}

.esim-success-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.esim-success-message {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
}

/* Pagination */
.esim-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border-light);
}

.esim-pagination-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.esim-pagination-btn:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  border-color: var(--color-primary);
  color: #000000;
}

.esim-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.esim-pagination-btn.active {
  background: var(--color-primary);
  color: #000000;
  border-color: var(--color-primary);
}

.esim-pagination-info {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin: 0 var(--spacing-md);
}

/* Loading States */
.esim-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-secondary);
}

.esim-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-lg);
}

/* Empty States */
.esim-empty {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--color-text-secondary);
}

.esim-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.esim-empty-message {
  font-size: 0.875rem;
  margin-bottom: var(--spacing-xl);
}

/* Info Box */
.esim-info-box {
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
}

.esim-info-box-title {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.esim-info-box-content {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

/* Responsive Design */
/* Large screens - more padding for comfort */
@media (min-width: 1920px) {
  .esim-container {
    padding: 1.5rem 3rem 2rem 3rem;
  }
}

/* Medium to large screens - standard padding */
@media (min-width: 1200px) and (max-width: 1919px) {
  .esim-container {
    padding: 1.5rem 2rem 2rem 2rem;
  }
}

/* Tablets and smaller desktops */
@media (max-width: 1199px) {
  .esim-container {
    padding: 1.5rem 1.5rem 2rem 1.5rem;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .esim-container {
    padding: 1.25rem 1rem 1.5rem 1rem;
  }

  .esim-search-grid {
    grid-template-columns: 1fr;
  }

  .esim-modal-content {
    width: 95%;
    margin: var(--spacing-md);
  }

  .esim-table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .esim-section {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: var(--spacing-lg);
  }
}

/* Print Styles */
@media print {
  .esim-btn,
  .esim-modal,
  .esim-pagination {
    display: none !important;
  }

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

  .esim-table th,
  .esim-table td {
    border: 1px solid #000;
  }
}

/* Utility Classes */
.esim-text-center { text-align: center; }
.esim-text-right { text-align: right; }
.esim-text-muted { color: var(--color-text-muted); }
.esim-mt-sm { margin-top: var(--spacing-sm); }
.esim-mt-md { margin-top: var(--spacing-md); }
.esim-mt-lg { margin-top: var(--spacing-lg); }
.esim-mb-sm { margin-bottom: var(--spacing-sm); }
.esim-mb-md { margin-bottom: var(--spacing-md); }
.esim-mb-lg { margin-bottom: var(--spacing-lg); }
.esim-flex { display: flex; }
.esim-flex-center { display: flex; align-items: center; justify-content: center; }
.esim-gap-sm { gap: var(--spacing-sm); }
.esim-gap-md { gap: var(--spacing-md); }
.esim-gap-lg { gap: var(--spacing-lg); }

/* Additional Modal-Specific Styles */
.esim-modal-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #000000;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.esim-modal-header-success {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #000000;
}

.esim-modal-header-error {
  background: linear-gradient(135deg, var(--color-danger) 0%, #f87171 100%);
  color: white;
}

.esim-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.esim-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.esim-modal-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

/* Success Modal Specific */
.esim-success-icon svg {
  color: var(--color-success);
}

.esim-order-info {
  background: #f1f5f9;
  padding: 12px 20px;
  border-radius: 12px;
  margin: 0 auto 32px;
  display: inline-block;
  width: 100%;
  text-align: center;
}

.esim-order-detail {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

/* QR Code Section */
.esim-qr-section {
  background: linear-gradient(135deg, #fef7f7 0%, #fdf2f2 100%);
  border: 2px solid rgba(242, 152, 157, 0.2);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 32px;
  text-align: center;
}

.esim-qr-image {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: white;
}

.esim-qr-image img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.esim-qr-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text-primary);
}

.esim-lpa-code {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-family: monospace;
  font-size: 12px;
  color: var(--color-text-secondary);
  word-break: break-all;
}

/* Action Buttons */
.esim-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

/* Instructions */
.esim-instructions {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  margin-bottom: 24px;
}

.esim-instructions-title {
  color: #92400e;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
}

.esim-instructions-list {
  color: #92400e;
  font-size: 14px;
  line-height: 1.7;
  padding-left: 20px;
}

.esim-instructions-list li {
  margin-bottom: 8px;
}

/* Package Display Styles */
.esim-package-highlight {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
}

.esim-country-badge {
  width: 48px;
  height: 32px;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  border-radius: 4px;
  margin-right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.esim-package-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.esim-package-info p {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.esim-package-features {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.esim-feature-card {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.esim-feature-value {
  font-size: 24px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
}

.esim-feature-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.esim-price-display {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.esim-price-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.esim-price-amount {
  font-size: 28px;
  font-weight: 800;
  color: #000000;
}

/* Payment Method Styles */
.esim-payment-method {
  background: linear-gradient(135deg, #fef7f7 0%, #fdf2f2 100%);
  border: 2px solid rgba(242, 152, 157, 0.3);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

.esim-payment-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  color: #000000;
  font-size: 16px;
  font-weight: 600;
}

.esim-payment-icon span {
  color: #000000;
}

.esim-payment-details {
  flex: 1;
}

.esim-payment-details h3 {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 16px;
  margin-bottom: 4px;
}

.esim-payment-details p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.esim-selected-account {
  background: rgba(242, 152, 157, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 13px;
}

.esim-account-selector {
  margin-left: 16px;
  position: relative;
}

.esim-btn-small {
  background: none;
  border: 1px solid #e2e8f0;
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.esim-select-hidden {
  opacity: 0;
  position: absolute;
  left: -80px;
  top: 0;
}

/* Price Breakdown */
.esim-price-breakdown {
  background: #f8fafc;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.esim-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
}

.esim-price-value {
  font-weight: 600;
}

.esim-price-positive {
  color: var(--color-success);
}

.esim-price-negative {
  color: #000000;
}

.esim-price-total {
  border-top: 2px solid #e2e8f0;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.esim-price-label-large {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.esim-price-value-large {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-success);
}

/* Error Message Styles */
.esim-error-message {
  background: linear-gradient(135deg, #fef7f7 0%, #fdf2f2 100%);
  border: 2px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
  text-align: center;
}

.esim-error-icon {
  width: 48px;
  height: 48px;
  background: var(--color-danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
  font-size: 24px;
  font-weight: 700;
}

.esim-error-message p {
  color: var(--color-text-primary);
  font-size: 16px;
}

.esim-full-width-link {
  display: block;
  width: 100%;
}

.esim-btn-large {
  width: 100%;
  padding: 16px 32px !important;
  font-size: 16px !important;
}

.esim-package-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.esim-package-provider {
  font-size: 14px;
  color: var(--color-text-secondary);
}



    .stats-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .calendar-section {
        background: white;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
        padding: 2rem;
        margin-bottom: 2rem;
    }

    .calendar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--color-border-light);
    }

    .calendar-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--color-text);
    }

    .download-options {
        display: flex;
        gap: 1rem;
    }

    .download-btn {
        padding: 0.625rem 1.25rem;
        background: var(--color-primary);
        color: #000000;
        border: none;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

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

    .download-btn-secondary {
        background: white;
        color: var(--color-text);
        border: 1px solid var(--color-border);
    }

    .download-btn-secondary:hover {
        background: var(--color-gray-50);
    }
    .stats-info {
        background: var(--color-gray-50);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .stats-info-icon {
        color: var(--color-info);
    }

    .stats-info-text {
        color: var(--color-text-muted);
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Calendar Controls */
    .calendar-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: white;
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .month-selector {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .month-display {
        display: flex;
        gap: 0.75rem;
    }

    .month-dropdown,
    .year-dropdown {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        background: white;
        color: var(--color-text);
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 120px;
    }

    .month-dropdown:hover,
    .year-dropdown:hover {
        border-color: var(--color-primary);
    }

    .month-dropdown:focus,
    .year-dropdown:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(219, 250, 94, 0.1);
    }
    .nav-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all 0.2s ease;
    }

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

    .nav-btn:hover svg {
        stroke: #000000;
    }

    .today-btn {
        padding: 0.625rem 1.5rem;
        background: white;
        border: 2px solid var(--color-primary);
        border-radius: var(--radius-md);
        color: var(--color-text);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

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

    .calendar-wrapper {
        background: var(--color-bg-primary);
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        padding: 1.5rem;
        overflow-x: auto;
    }

    /* Calendar Styles - Simplified without navigation */
    #main-content {
        font-family: var(--font-primary);
    }

    /* Calendar table base */
    #main-content table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    /* Days of week header - PHP uses td.calendar-day-head, not th */
    #main-content th,
    #main-content td.calendar-day-head {
        background: #f8f9fa;
        color: var(--color-text-muted);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0.875rem;
        border: 1px solid var(--color-border-light);
        text-align: center;
    }

    /* Calendar date cells - base styles */
    #main-content td {
        background: white;
        position: relative;
        transition: all 0.2s ease;
        border: 1px solid var(--color-border-light);
        text-align: center;
    }

    #main-content td:hover {
        background: var(--color-gray-50);
        cursor: pointer;
        border-color: var(--color-border);
    }

    /* Calendar day cells - more specific styles override base */
    #main-content td.calendar-day {
        vertical-align: top;
        padding: 0;
        min-height: 85px;
        height: 85px;
        width: 12.5%;
        text-align: left;
        position: relative;
        transition: all 0.15s ease;
    }

    #main-content td.calendar-day:hover {
        background: var(--color-gray-50);
    }

    #main-content td.calendar-day .day-number {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        font-weight: 600;
        color: #333;
        font-size: 0.85rem;
        line-height: 1;
        z-index: 2;
        min-width: 1.5rem;
        text-align: center;
    }
    /* Today's date highlight */
    #main-content td.calendar-day.is-today .day-number {
        background: var(--color-primary);
        color: #000;
        padding: 0.3rem 0.45rem;
        border-radius: 50%;
        font-weight: 700;
        min-width: auto;
    }

    #main-content td.calendar-day.is-today {
        background: rgba(219, 250, 94, 0.08);
    }

    /* Container for download links */
    #main-content td.calendar-day .download-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0.5rem;
        padding-top: 2rem;
    }

    #main-content td.calendar-day a {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.625rem;
        background: white;
        color: var(--color-text);
        border-radius: var(--radius-sm);
        text-decoration: none;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        transition: all 0.15s ease;
        border: 1px solid var(--color-border);
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    #main-content td.calendar-day a:hover {
        background: var(--color-primary);
        color: #000;
        border-color: var(--color-primary);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    #main-content td.calendar-day a svg {
        width: 10px;
        height: 10px;
        stroke: currentColor;
        stroke-width: 2.5;
    }

    /* Days with downloads available */
    #main-content td.calendar-day.has-downloads {
        background: rgba(219, 250, 94, 0.04);
    }

    #main-content td.calendar-day.has-downloads:hover {
        background: rgba(219, 250, 94, 0.12);
    }

    /* Days without downloads */
    #main-content td.calendar-day.no-data .day-number {
        color: var(--color-text-light);
    }

    /* Hide the nbsp padding paragraphs */
    #main-content td.calendar-day p {
        display: none;
    }

    /* Weekend columns subtle highlight */
    #main-content td.calendar-day:nth-child(6),
    #main-content td.calendar-day:nth-child(7) {
        background: rgba(0, 0, 0, 0.02);
    }

    #main-content td.calendar-day:nth-child(6):hover,
    #main-content td.calendar-day:nth-child(7):hover {
        background: rgba(0, 0, 0, 0.04);
    }

    /* Hide original calendar navigation row (has colspan=8) */
    #main-content table tr:first-child td.calendar-day-head[colspan] {
        display: none;
    }

    #main-content table tr:first-child:has(td[colspan]) {
        display: none;
    }

    /* Fallback for browsers without :has() support - hide via class added by JS */
    #main-content table tr.calendar-nav-row {
        display: none;
    }

    /* Today's date */
    #main-content td.today {
        background: rgba(219, 250, 94, 0.08);
        position: relative;
    }
    #main-content td.today::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        background: var(--color-primary);
        border-radius: 50%;
    }

    /* Selected date */
    #main-content td.selected {
        background: var(--color-primary);
    }

    #main-content td.selected a {
        color: #000000;
        font-weight: 600;
    }

    /* Weekend cells */
    #main-content td.weekend {
        background: rgba(0, 0, 0, 0.02);
    }

    /* Disabled dates */
    #main-content td.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    #main-content td.disabled:hover {
        background: white;
        border-color: var(--color-border-light);
    }

    #main-content td.disabled a {
        pointer-events: none;
    }

    .quick-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .stat-card {
        background: white;
        border-radius: var(--radius-lg);
        padding: 1.5rem;
        border-left: 3px solid var(--color-primary);
        box-shadow: var(--shadow-sm);
    }

    .stat-label {
        font-size: 0.875rem;
        color: var(--color-text-muted);
        margin-bottom: 0.5rem;
    }
    .stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--color-text);
    }

    .stat-card.calls {
        border-left-color: var(--color-info);
    }

    .stat-card.minutes {
        border-left-color: var(--color-success);
    }

    .stat-card.revenue {
        border-left-color: var(--color-warning);
    }

