/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
  --primary-color: #13B5EA;
  --primary-dark: #0E9BCC;
  --secondary-color: #667eea;
  --danger-color: #dc3545;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --dark-color: #333;
  --light-color: #f8f9fa;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
  --radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* ============================================
   Landing Page Styles
   ============================================ */
.container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 3rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.logo-wrapper {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  font-weight: bold;
  box-shadow: var(--shadow);
}

h1 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2rem;
  color: var(--dark-color);
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(19, 181, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

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

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

.btn-sm {
  padding: 0.

  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   Features Section
   ============================================ */
.features {
  margin-top: 3rem;
}

.features h3 {
  margin-bottom: 1.5rem;
  color: var(--dark-color);
  font-size: 1.25rem;
}

.feature-grid {
  display: grid;
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--light-color);
  border-radius: var(--radius);
  transition: var(--transition);
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  flex-shrink: 0;
  color: var(--primary-color);
}

.feature-content h4 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  color: var(--dark-color);
}

.feature-content p {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
}

/* ============================================
   Info Section
   ============================================ */
.info-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--light-color);
  border-radius: var(--radius);
}

.info-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--dark-color);
}

.steps-list {
  padding-left: 1.5rem;
}

.steps-list li {
  margin-bottom: 0.75rem;
  color: #555;
}

/* ============================================
   Security Note
   ============================================ */
.security-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1rem;
  background: #e7f3ff;
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: #0066cc;
}

.security-note svg {
  flex-shrink: 0;
  color: var(--primary-color);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  text-align: center;
  padding: 2rem;
  color: white;
  font-size: 0.875rem;
}

.footer a {
  color: white;
  text-decoration: underline;
}

.footer a:hover {
  opacity: 0.8;
}

/* ============================================
   Dashboard Styles
   ============================================ */
.dashboard-body {
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

.header {
  background: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  font-size: 1.5rem;
  margin: 0;
}

.logo-small {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   Token Status
   ============================================ */
.token-status {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.token-valid {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.token-expired {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.token-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  padding: 2rem;
  min-height: calc(100vh - 80px);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 250px;
  flex-shrink: 0;
}

.sidebar-nav {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  color: #555;
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--light-color);
  color: var(--primary-color);
}

.nav-item.active {
  background: var(--light-color);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  flex: 1;
  min-width: 0;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Cards
   ============================================ */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--dark-color);
}

.card-body {
  padding: 1.5rem;
}

/* ============================================
   Info Grid
   ============================================ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  padding: 1rem;
  background: var(--light-color);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-color);
}

.info-label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark-color);
  word-break: break-word;
}

/* ============================================
   Tables
   ============================================ */
.table-wrapper {
  overflow-x: auto;
}

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

th {
  background: var(--light-color);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: #555;
}

tr:hover {
  background: var(--light-color);
}

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

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-paid {
  background: #d4edda;
  color: #155724;
}

.status-draft {
  background: #d1ecf1;
  color: #0c5460;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-void {
  background: #f8d7da;
  color: #721c24;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: #666;
}

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

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

/* ============================================
   Empty States
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: #ccc;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.empty-state p {
  color: #666;
}

/* ============================================
   Error States
   ============================================ */
.error-message {
  padding: 1rem;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  color: #721c24;
  margin-bottom: 1rem;
}

.error-message strong {
  display: block;
  margin-bottom: 0.5rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active {
    border-left: none;
    border-bottom-color: var(--primary-color);
  }
}

@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    justify-content: stretch;
  }

  .header-right > * {
    flex: 1;
  }

  .dashboard-container {
    padding: 1rem;
  }

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

  .table-wrapper {
    overflow-x: scroll;
  }

  table {
    min-width: 600px;
  }

  .btn {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .feature-grid {
    gap: 1rem;
  }

  .feature-item {
    flex-direction: column;
    text-align: center;
  }

  .card-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header,
  .sidebar,
  .btn,
  .footer {
    display: none;
  }

  .dashboard-container {
    padding: 0;
  }

  .card {
    box-shadow: none;
    page-break-inside: avoid;
  }
}
