/* ==========================================================================
   Informa Designer - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables & Root Styles
   ========================================================================== */
:root {
  /* Primary Colors */
  --primary-color: #3498db;
  --primary-hover-color: #2980b9;
  --primary-dark: #2980b9;
  --primary-light: #5dade2;
  
  /* Secondary Colors */
  --secondary-color: #2c3e50;
  --secondary-hover-color: #7f8c8d;
  --secondary-dark: #1a252f;
  
  /* Status Colors */
  --success-color: #27ae60;
  --success-hover-color: #229954;
  --success-light: #2ecc71;
  --danger-color: #e74c3c;
  --danger-hover-color: #c0392b;
  --danger-light: #ec7063;
  --warning-color: #f39c12;
  --warning-light: #f8c471;
  --info-color: #3498db;
  
  /* Text Colors */
  --text-dark: #2c3e50;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-light: #f5f5f5;
  
  /* Border Colors */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --border-dark: #d1d5db;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* ==========================================================================
   2. Base Styles & Resets
   ========================================================================== */

/* ==========================================================================
   3. Typography
   ========================================================================== */



/* ==========================================================================
   4. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

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

/* Button Variants */
.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-dark);
}

.btn-danger {
  background: white;
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: var(--danger-color);
}

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

.btn-success:hover:not(:disabled) {
  background: #219a52;
}

/* Button Sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

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

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Button Modifiers */
.btn-block {
  width: 100%;
}

.btn-block.btn-primary {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-light);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-medium);
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent;
  opacity: 0.8;
  cursor: wait !important;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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


/* Button states for auth pages */
.auth-form .btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-form .btn-text,
.auth-form .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   5. Forms
   ========================================================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-dark);
  background: white;
  transition: var(--transition-fast);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.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='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.form-error {
  color: var(--danger-color);
}

/* Form Layouts */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-col {
  flex: 1;
}

/* Input Groups */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-light);
  pointer-events: none;
}

.input-group .form-control {
  padding-left: 2.5rem;
}

/* Checkboxes & Radios */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-check-input {
  margin-right: 0.5rem;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dark);
}

/* ==========================================================================
   6. Cards & Containers
   ========================================================================== */
.card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

/* Status Cards */
.status-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

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

.metric-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

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


.metric-card h3 {
  margin: 0 0 0.5rem 0;
  color: #666;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.metric-change {
  font-size: 0.875rem;
  color: #666;
}

.metric-change.positive {
  color: #27ae60;
}

.metric-change.negative {
  color: #e74c3c;
}


/* ==========================================================================
   7. Modals
   ========================================================================== */


.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--bg-secondary);
}

.modal-header-gradient {
  gap: 1.5rem;
  background: linear-gradient(135deg, #2c3e50 0%, #52718f 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px 12px 0 0;
}

.modal-header-gradient h2,
.modal-header-gradient h3 {
  color: white;
}

.modal-header-gradient .modal-close {
  color: white;
}

.modal-header-gradient .modal-close:hover {
  color: gray;
}


/* Modal Sizes */
.modal-content.modal-sm { max-width: 400px; }
.modal-content.modal-lg { max-width: 800px; }
.modal-content.modal-xl { max-width: 1200px; }

/* ==========================================================================
   8. Tables
   ========================================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

.table th {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

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

/* Table Variants */
.table-striped tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

.table-bordered {
  border: 1px solid var(--border-color);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border-color);
}

/* Data Tables */
.data-table {
  width: 100%;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table .table {
  margin: 0;
}

/* ==========================================================================
   9. Badges & Tags
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

/* Badge Variants */
.badge-primary {
  background: var(--primary-color);
  color: white;
}

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

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

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

/* Status Badges */
.badge-active {
  background: var(--success-color);
  color: white;
}

.badge-inactive {
  background: var(--bg-tertiary);
  color: var(--text-light);
}

.badge-pending {
  background: var(--warning-color);
  color: white;
}

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

/* ==========================================================================
   10. Alerts & Notifications
   ========================================================================== */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error,
.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ==========================================================================
   11. Navigation & Headers
   ========================================================================== */
.app-header {
  background: var(--secondary-color);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-center {
  flex: 1;
  justify-content: center;
}

.app-logo {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  color: var(--text-dark);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  display: none;
}
.user-info {
  padding: 1rem;
}

.user-email {
  font-size: 0.9rem;
  color: #666;
}

.user-org {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-secondary);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

.user-dropdown hr {
  margin: 0;
  border: none;
  border-top: 1px solid #ddd;
}


/* ==========================================================================
   12. Layout Components
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1rem;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Flex Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-wrap {
  flex-wrap: wrap;
}


/* ==========================================================================
   13. Utility Classes
   ========================================================================== */

/* Colors */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-light); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: white; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Borders */
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-0 { border: 0; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ==========================================================================
   14. Page Specific Styles
   ========================================================================== */

/* Auth Pages */
.auth-container {
  display: flex;
  max-width: 1100px;
  width: 90%;
  margin: 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: 650px;
}

.auth-card {
  flex: 1;
  padding: 60px;
  min-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  position: relative;
}

.auth-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-light), transparent);
}

.auth-info {
  flex: 1;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-info::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  transform: rotate(45deg);
}

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

.auth-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.auth-header p {
  margin: 0;
  color: var(--text-medium);
  font-size: 1rem;
  line-height: 1.5;
}

.logo {
  width: 80px;
  height: 80px;
  background: transparent;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2.5rem;
  color: white;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.error-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid #fecaca;
  margin-bottom: 1rem;
}

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

.checkbox-wrapper:hover {
  color: var(--text-dark);
}

.checkbox-wrapper input[type="checkbox"] {
  cursor: pointer;
}

.link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.link:hover {
  text-decoration: underline;
}

.auth-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.auth-footer p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Auth Info Side */
.auth-info h2 {
  margin: 0 0 1rem 0;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.auth-info p {
  margin: 0 0 2rem 0;
  font-size: 1.125rem;
  opacity: 0.95;
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 1rem;
}

.feature-list i {
  color: #a7f3d0;
  font-size: 1.125rem;
}

/* Dashboard */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.welcome-section {
  margin-bottom: 2rem;
}

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

.action-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.action-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Admin action card special styling */
.action-card.admin-action {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    text-decoration: none;
}

.action-card.admin-action:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.action-card.admin-action .action-icon {
    color: white;
}

.action-card.admin-action h3 {
    color: white;
}

.action-card.admin-action p {
    color: rgba(255, 255, 255, 0.9);
}


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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e0e0e0;
}

.stat-icon {
    font-size: 2rem;
    color: #3498db;
    opacity: 0.8;
}

.stat-content h4 {
    margin: 0 0 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
    font-weight: normal;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Section Styles */
.section {
    margin-bottom: 3rem;
}

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

.section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
}

.view-all-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #2980b9;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transition: all 0.3s;
}

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

.template-card.shared {
    border-color: #9b59b6;
}

.template-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 1px solid #f0f0f0;
}

.template-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-by {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-top: 0.25rem;
}

.template-menu-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s;
}

.template-menu-btn:hover {
    color: #333;
}

.template-preview {
    padding: 1rem;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.template-preview:hover {
    background: #f0f0f0;
}

.template-preview i {
    font-size: 3rem;
    color: #bbb;
}

.permission-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #e0e0e0;
    color: #666;
}

.permission-badge.edit {
    background: #3498db;
    color: white;
}

.permission-badge.view {
    background: #95a5a6;
    color: white;
}

.template-footer {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.template-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.template-shared {
    color: #9b59b6;
}

/* Template Menu */
.template-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
    padding: 0.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item.danger {
    color: #e74c3c;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
}

/* Recent Activity Table Styles */
  .recent-activity {
      background: white;
      border-radius: 8px;
      padding: 1.5rem;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      margin-bottom: 2rem;
  }

  .recent-activity .section-header {
      margin-bottom: 1.5rem;
  }

  .recent-activity .section-header h3 {
      margin: 0;
      font-size: 1.25rem;
      color: #111827;
  }

  .activity-table-container {
      overflow-x: auto;
  }

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

  .activity-table thead th {
      text-align: left;
      padding: 0.75rem 1rem;
      border-bottom: 2px solid #e5e7eb;
      font-weight: 600;
      font-size: 0.875rem;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.05em;
  }

  .activity-table tbody tr {
      border-bottom: 1px solid #f3f4f6;
      transition: background-color 0.2s;
  }

  .activity-table tbody tr:hover {
      background-color: #f9fafb;
  }

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

  .activity-table td {
      padding: 1rem;
      font-size: 0.875rem;
  }

  .activity-icon-cell {
      width: 40px;
      padding-right: 0 !important;
  }

  .activity-icon {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: #eff6ff;
      color: #3b82f6;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.875rem;
  }

  .activity-description {
      color: #111827;
      font-weight: 500;
  }

  .activity-user {
      color: #6b7280;
  }

  .activity-time {
      color: #9ca3af;
      font-size: 0.8125rem;
      white-space: nowrap;
  }

  /* Different icon colors based on activity type */
  .activity-icon .fa-sign-in-alt {
      color: #10b981;
  }

  .activity-icon .fa-file-alt {
      color: #3b82f6;
  }

  .activity-icon .fa-edit {
      color: #f59e0b;
  }

  .activity-icon .fa-trash {
      color: #ef4444;
  }

  .activity-icon .fa-share-alt {
      color: #8b5cf6;
  }

/* Subscription */
.subscription-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 20px;
}

.subscription-header {
  margin-bottom: 30px;
}

.subscription-header h1 {
  margin: 0 0 10px 0;
  color: #111827;
  font-size: 2rem;
}

.subscription-header p {
  color: #6b7280;
  margin: 0;
}

.subscription-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.status-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
  
.status-card h3 {
  margin: 0 0 15px 0;
  color: #6b7280;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.plan-name {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.badge-active {
  background: #10b981;
  color: white;
}


.badge-past-due {
  background: #f59e0b;
  color: white;
}

.badge-canceled {
  background: #ef4444;
  color: white;
}


.plans-section h2 {
  margin: 0 0 30px 0;
  color: #111827;
  font-size: 1.75rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.plan-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  position: relative;
  transition: var(--transition-normal);
}

.plan-card.current-plan {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.plan-card.recommended {
  border-color: var(--success-color);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.plan-card.recommended::before {
  content: "Recommended";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.plan-card h3 {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: #111827;
}

.plan-price {
  font-size: 36px;
  font-weight: 700;
  color: #111827;
  margin: 20px 0;
}
  
.plan-price span {
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 30px 0;
  text-align: left;
}
  
.plan-features li {
  padding: 8px 0;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features i {
  color: #10b981;
  font-size: 14px;
}

/*
.btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
  
.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 2px solid #e5e7eb;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
*/

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-danger {
  background: white;
  color: #dc2626;
  border: 2px solid #dc2626;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.status-detail p {
  margin: 4px 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.billing-section {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 40px;
}

.billing-section h2 {
  margin: 0 0 20px 0;
  color: #111827;
  font-size: 1.5rem;
}

.billing-history {
  overflow-x: auto;
}

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

.billing-table th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6b7280;
}

.billing-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #f3f4f6;
}

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

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

.status-paid {
  background: #d1fae5;
  color: #065f46;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state i {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 16px;
}


/*
 * Organization
 */

.org-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 20px;
}

.org-header {
  margin-bottom: 30px;
}

.org-header h1 {
  margin: 0 0 10px 0;
  color: #111827;
  font-size: 2rem;
}

.org-header p {
  color: #6b7280;
  margin: 0;
}

.org-info {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.org-info h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #111827;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.info-item label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.info-item .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.members-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.members-header h2 {
  font-size: 1.5rem;
  color: #111827;
}

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

.members-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6b7280;
}

.members-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

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

.member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.member-details h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.member-details p {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-owner {
  background: #fef3c7;
  color: #92400e;
}

.role-admin {
  background: #dbeafe;
  color: #1e40af;
}

.role-member {
  background: #e5e7eb;
  color: #4b5563;
}

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

.btn-icon {
  background: none;
  border: 1px solid #e5e7eb;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.btn-icon:hover {
  background: #f9fafb;
  color: #374151;
}

.btn-icon.danger:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
}


/* Template Filters */
.template-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  border-bottom: 2px solid #e5e7eb;
}

.template-filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  cursor: pointer;
}

.template-filters input[type=radio] {
  cursor: pointer;
}

.filter-btn {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.filter-btn:hover {
  color: #111827;
}

.filter-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Template Items */
.template-item {
  transition: opacity 0.2s;
}

/* Fix for template filters */
.template-filters input[type="radio"] {
  cursor: pointer;
}

.template-item[style*="display: none"] {
  opacity: 0;
}

.template-description {
  margin: 0 0 1rem 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
  padding: 1rem;
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: auto;
}


/* Admin */
.admin-container {
  display: flex;
  height: calc(100vh - 60px);
}

.admin-sidebar {
  width: 175px;
  background: var(--secondary-color);
  color: white;
  overflow-y: auto;
}

.admin-nav-item {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
  transition: var(--transition-fast);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-color);
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg-secondary);
}

/* ==========================================================================
   15. Components
   ========================================================================== */

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  color: var(--border-dark);
  margin-bottom: 1rem;
  display: block;
}

/* Loading States */
.loading-placeholder {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

/* Template Cards */
.template-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition-normal);
}

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

.template-preview {
  padding: 2rem;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-preview:hover {
  background: var(--bg-tertiary);
}

/* Activity Items */
.activity-item {
  display: flex;
  align-items: start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/*
  Success
*/
.success-container {
  max-width: 600px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

.success-icon {
  font-size: 5rem;
  color: #27ae60;
  margin-bottom: 2rem;
  animation: checkmark 0.5s ease-in-out;
}

.success-content h1 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.success-content p {
  color: #666;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

@keyframes checkmark {
  0% {
      transform: scale(0);
      opacity: 0;
  }
  50% {
      transform: scale(1.2);
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

/*
  Cancel
*/
.cancel-container {
  max-width: 600px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

.cancel-icon {
  font-size: 5rem;
  color: #e74c3c;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.cancel-content h1 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.cancel-content p {
  color: #666;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}


/* ==========================================================================
   16. 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 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   17. Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .auth-info {
    display: none;
  }
  
  .auth-card {
    min-width: auto;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-sidebar {
    width: 60px;
  }
  
  .admin-nav-item span {
    display: none;
  }
  
  .admin-nav-item {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
  }
  
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .header-center {
    display: none;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .auth-card {
    padding: 2rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .hide-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .card-header,
  .card-body {
    padding: 1rem;
  }
}