/* Dashboard Styles */

/* Auth Page */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f5f7ff 0%, #fff 100%);
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.auth-header p {
  color: #666;
  font-size: 15px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #f5f7ff;
  padding: 4px;
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f8f9fc;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo .logo-icon {
  color: #667eea;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-link.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.sidebar-sublink {
  padding-left: 46px;
  font-size: 14px;
}

.sidebar-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-user-email {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-user-plan {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.sidebar-logout {
  color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar-logout:hover {
  background: rgba(220, 53, 69, 0.2) !important;
  color: #ff6b6b !important;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-bottom: 1px solid #eee;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

.mobile-sidebar-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-sidebar-toggle span {
  width: 22px;
  height: 2px;
  background: #333;
}

.mobile-logo {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.mobile-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Main Content */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.dashboard-content {
  padding: 32px;
  max-width: 1200px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.dashboard-subtitle {
  color: #666;
  font-size: 15px;
}

.back-btn {
  background: none;
  border: none;
  color: #667eea;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
}

.back-btn:hover {
  text-decoration: underline;
}

.btn-primary-dashboard {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary-dashboard:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger-outline {
  background: transparent;
  color: #dc3545;
  border: 2px solid #dc3545;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: #dc3545;
  color: white;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #eee;
}

.stat-icon {
  width: 56px;
  height: 56px;
  background: #f5f7ff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  display: block;
}

.stat-label {
  font-size: 14px;
  color: #888;
}

/* Cards Section */
.cards-section {
  margin-top: 24px;
}

.section-title-dash {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 20px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Card Tile */
.card-tile {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #eee;
  transition: all 0.2s;
}

.card-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.card-tile-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 80px;
  position: relative;
}

.card-tile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid white;
  position: absolute;
  bottom: -36px;
  left: 24px;
  object-fit: cover;
  background: white;
}

.card-tile-body {
  padding: 48px 24px 20px;
}

.card-tile-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.card-tile-title {
  font-size: 14px;
  color: #667eea;
  font-weight: 500;
  margin-bottom: 2px;
}

.card-tile-company {
  font-size: 14px;
  color: #888;
}

.card-tile-footer {
  padding: 16px 24px;
  background: #f8f9fc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
}

.card-tile-url {
  display: flex;
  align-items: center;
  gap: 6px;
}

.url-icon {
  font-size: 14px;
}

.url-text {
  font-size: 13px;
  color: #888;
  font-family: monospace;
}

.card-tile-actions {
  display: flex;
  gap: 8px;
}

.tile-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  border: 1px solid #eee;
}

.tile-btn:hover {
  background: #f0f0f0;
}

.tile-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.tile-btn-primary:hover {
  transform: scale(1.05);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: white;
  border-radius: 16px;
  border: 2px dashed #e1e5eb;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.empty-state p {
  color: #666;
  margin-bottom: 24px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-secondary-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-dashboard:hover {
  background: #f5f5ff;
  transform: translateY(-2px);
}

/* Editor Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.editor-form-container {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #eee;
}

.form-section {
  margin-bottom: 32px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* Image Upload Modern */
.image-upload-modern {
  display: flex;
  align-items: center;
  gap: 24px;
}

.image-preview-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f5f7ff;
}

.image-upload-btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f5f7ff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #667eea;
  transition: all 0.2s;
}

.image-upload-btn-modern:hover {
  background: #e8ecff;
}

.image-upload-btn-modern input {
  display: none;
}

/* Input with prefix */
.input-with-prefix {
  display: flex;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  overflow: hidden;
}

.input-prefix {
  background: #f5f7ff;
  padding: 12px 16px;
  color: #888;
  font-size: 14px;
  border-right: 2px solid #e1e5eb;
}

.input-with-prefix input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 16px;
}

.input-with-prefix input:focus {
  outline: none;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #888;
}

.slug-input-wrapper {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.slug-input-wrapper:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.slug-prefix {
  padding: 12px;
  background: #f8f9fc;
  color: #666;
  font-weight: 500;
  border-right: 1px solid #e2e8f0;
}

.slug-input-wrapper input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 15px;
  outline: none;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

/* Editor Preview */
.editor-preview {
  position: sticky;
  top: 32px;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.preview-phone {
  background: #1a1a2e;
  border-radius: 32px;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-phone::before {
  content: '';
  display: block;
  width: 60px;
  height: 20px;
  background: #1a1a2e;
  border-radius: 10px;
  margin: 0 auto 8px;
}

.preview-phone-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 24px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-card {
  background: white;
  border-radius: 16px;
  width: 100%;
  text-align: center;
  overflow: hidden;
}

.preview-header-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 60px;
}

.preview-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid white;
  margin-top: -35px;
  object-fit: cover;
  background: #f5f5f5;
}

.preview-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 12px 0 4px;
}

.preview-title-text {
  font-size: 13px;
  color: #667eea;
  margin-bottom: 2px;
}

.preview-company {
  font-size: 13px;
  color: #888;
  padding-bottom: 20px;
}

/* Customers Table */
.customers-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

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

.customers-table th {
  background: #f8fafc;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
}

.customers-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #334155;
}

.customers-table tr:hover {
  background: #f8fafc;
}

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

.customer-email {
  font-weight: 500;
  color: #1e293b;
}

.customer-plan {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.customer-plan.free {
  background: #f1f5f9;
  color: #64748b;
}

.customer-plan.pro {
  background: #dbeafe;
  color: #1d4ed8;
}

.customer-plan.enterprise {
  background: #fef3c7;
  color: #b45309;
}

.customer-role {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.customer-role.admin {
  background: #fee2e2;
  color: #dc2626;
}

.customer-role.user {
  background: #f1f5f9;
  color: #64748b;
}

.customer-actions {
  display: flex;
  gap: 8px;
}

.customer-actions .btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.customer-expires {
  font-size: 13px;
}

.customer-expires.none {
  color: #10b981;
}

.customer-expires.expired {
  color: #dc2626;
  font-weight: 600;
}

.expired-row {
  background: #fef2f2 !important;
}

.expired-row:hover {
  background: #fee2e2 !important;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: auto;
}

.modal-content h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: #1e293b;
}

/* Customer Edit Grid */
.customer-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 500px) {
  .customer-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* Customer Cards Section */
.customer-cards-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.customer-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.customer-cards-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.customer-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.customer-card-info {
  flex: 1;
}

.customer-card-name {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 2px;
}

.customer-card-slug {
  font-size: 12px;
  color: #64748b;
}

.customer-card-slug a {
  color: #6366f1;
  text-decoration: none;
}

.customer-card-slug a:hover {
  text-decoration: underline;
}

.customer-card-actions {
  display: flex;
  gap: 8px;
}

.no-cards {
  color: #64748b;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

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

.btn-success {
  background: #16a34a;
  color: white;
  border: none;
}

.btn-success:hover {
  background: #15803d;
}

.btn-warning {
  background: #f59e0b;
  color: white;
  border: none;
}

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

/* Subscription badges */
.subscription-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.subscription-badge.active {
  background: #dcfce7;
  color: #16a34a;
}

.subscription-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.subscription-badge.past-due {
  background: #fef3c7;
  color: #d97706;
}

/* Inactive card styling */
.card-item.card-inactive {
  opacity: 0.7;
  background: #f9fafb;
}

.card-item.card-inactive .card-item-image {
  filter: grayscale(50%);
}

/* Subscription info in modal */
.subscription-info {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.subscription-info p {
  margin: 8px 0;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .dashboard-main {
    margin-left: 0;
    padding-top: 60px;
  }

  .dashboard-content {
    padding: 20px;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 16px;
  }

  .dashboard-header .btn-primary-dashboard {
    width: 100%;
    justify-content: center;
  }

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

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

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

  .form-actions {
    flex-direction: column;
  }

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

  .image-upload-modern {
    flex-direction: column;
    text-align: center;
  }
}

/* QR Modal Override */
.modal-content {
  border-radius: 16px !important;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}

/* Company Tiles */
.company-tile .company-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.company-tile-logo {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

.company-tile-placeholder {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
}

.company-tile.dark-mode {
  background: #1a1a2e;
  border-color: #2d2d44;
}

.company-tile.dark-mode .card-tile-body {
  background: #1a1a2e;
}

.company-tile.dark-mode .card-tile-name {
  color: #ffffff;
}

.company-tile.dark-mode .card-tile-title,
.company-tile.dark-mode .card-tile-company {
  color: rgba(255, 255, 255, 0.7);
}

.company-tile.dark-mode .card-tile-footer {
  background: #0f0f1e;
  border-color: #2d2d44;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

/* Logo Preview */
.logo-preview {
  border-radius: 12px !important;
  object-fit: contain;
  background: #f8f9fc;
}

/* Color Picker */
.color-picker-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-picker-wrapper input[type="color"] {
  width: 50px;
  height: 42px;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
}

.color-text-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
}

.color-text-input:focus {
  outline: none;
  border-color: #667eea;
}

.color-presets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.color-preset {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-preset:hover {
  transform: scale(1.1);
  border-color: rgba(0, 0, 0, 0.2);
}

/* Mode Toggle */
.mode-toggle-wrapper {
  display: flex;
  gap: 12px;
}

.mode-toggle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 2px solid #e1e5eb;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-toggle:hover {
  border-color: #667eea;
}

.mode-toggle.active {
  border-color: #667eea;
  background: #f5f7ff;
}

.mode-icon {
  font-size: 24px;
}

.mode-toggle span:last-child {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
}

/* Font Select */
.font-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

.font-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Form Section Description */
.form-section-desc {
  color: #888;
  font-size: 14px;
  margin-top: -8px;
  margin-bottom: 20px;
}

/* Company Preview */
.preview-company-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  margin-top: -30px;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-buttons {
  padding: 16px 20px 20px;
}

.preview-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

/* Dark mode preview */
.preview-card.dark-mode {
  background: #1a1a2e;
  color: #ffffff;
}

.preview-card.dark-mode .preview-name {
  color: #ffffff;
}

.preview-card.dark-mode .preview-title-text {
  color: #a5b4fc;
}

.preview-card.dark-mode .preview-company {
  color: rgba(255, 255, 255, 0.7);
}

.preview-phone-screen.dark-mode {
  background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
}

/* Card company select */
#card-company-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

#card-company-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Preview card dark mode */
#preview-card-container.dark-mode {
  background: #1a1a2e !important;
}

#preview-card-container.dark-mode .preview-name {
  color: #ffffff !important;
}

#preview-card-container.dark-mode .preview-title-text {
  color: #a5b4fc !important;
}

#preview-card-container.dark-mode .preview-company {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background: #cdd5dc;
  border-radius: 13px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
  background: #667eea;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::before {
  transform: translateX(22px);
}

.form-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

/* Image Crop Modal */
.image-crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.image-crop-modal.hidden {
  display: none !important;
}

.image-crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.image-crop-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.image-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5eb;
  background: #ffffff;
}

.image-crop-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.image-crop-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.image-crop-close:hover {
  color: #1e293b;
}

.image-crop-area {
  width: 100%;
  height: 350px;
  background: #1a1a2e;
  overflow: hidden;
}

.image-crop-area img {
  display: block;
  max-width: 100%;
}

.image-crop-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 20px;
  border-top: 1px solid #e1e5eb;
  background: #f8fafc;
}

.crop-zoom,
.crop-rotate {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-zoom span,
.crop-rotate span {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.crop-zoom button,
.crop-rotate button {
  width: 36px;
  height: 36px;
  border: 2px solid #e1e5eb;
  background: white;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #1e293b;
}

.crop-zoom button:hover,
.crop-rotate button:hover {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.image-crop-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e1e5eb;
  justify-content: flex-end;
  background: #ffffff;
}

.image-crop-actions .btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.image-crop-actions .btn-secondary {
  background: white;
  border: 2px solid #e1e5eb;
  color: #64748b;
}

.image-crop-actions .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.image-crop-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
}

.image-crop-actions .btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Mobile adjustments for image crop */
@media (max-width: 600px) {
  .image-crop-content {
    width: 95%;
    max-height: 85vh;
  }

  .image-crop-area {
    height: 280px;
  }

  .image-crop-controls {
    gap: 16px;
    padding: 12px 16px;
  }

  .crop-zoom span,
  .crop-rotate span {
    display: none;
  }

  .image-crop-actions {
    padding: 12px 16px;
  }

  .image-crop-actions .btn {
    padding: 10px 16px;
    flex: 1;
  }
}

/* Register Form Styles */
.register-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.register-section:last-of-type {
  border-bottom: none;
}

.register-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.payment-options {
  display: flex;
  gap: 12px;
}

.payment-option {
  flex: 1;
  cursor: pointer;
}

.payment-option input {
  display: none;
}

.payment-option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s;
}

.payment-option input:checked + .payment-option-content {
  border-color: #6366f1;
  background: #f5f5ff;
}

.payment-option-icon {
  font-size: 24px;
}

.payment-option-text {
  display: flex;
  flex-direction: column;
}

.payment-option-text strong {
  font-size: 14px;
  color: #1f2937;
}

.payment-option-text small {
  font-size: 12px;
  color: #6b7280;
}

/* Auth card larger for registration */
.auth-card:has(#register-form:not(.hidden)) {
  max-width: 520px;
}

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

  .payment-options {
    flex-direction: column;
  }
}

/* My Account Page */
.account-sections {
  max-width: 800px;
}

.account-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 20px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.account-section-icon {
  font-size: 20px;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.account-field {
  margin-bottom: 0;
}

.account-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.account-field span {
  display: block;
  font-size: 15px;
  color: #1f2937;
  font-weight: 500;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.account-badge.invoice {
  background: #dbeafe;
  color: #1e40af;
}

.account-badge.card {
  background: #dcfce7;
  color: #166534;
}

.account-expires {
  font-weight: 500;
}

.account-expires.expired {
  color: #dc2626;
}

.account-expires.none {
  color: #059669;
}

.account-form .form-group {
  margin-bottom: 16px;
}

.account-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

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

  .account-section {
    padding: 16px;
  }
}

/* Impersonation Banner */
#impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 14px;
}

#impersonation-banner span {
  display: flex;
  align-items: center;
  gap: 8px;
}

#impersonation-banner strong {
  font-weight: 600;
}

#impersonation-banner button {
  background: white;
  color: #d97706;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

#impersonation-banner button:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

/* Adjust body when impersonation banner is visible */
body:has(#impersonation-banner) .dashboard-layout {
  padding-top: 52px;
}

body:has(#impersonation-banner) .sidebar {
  top: 52px;
  height: calc(100vh - 52px);
}

@media (max-width: 768px) {
  #impersonation-banner {
    padding: 10px 16px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
  }

  #impersonation-banner button {
    padding: 6px 12px;
    font-size: 12px;
  }
}
