
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --sidebar: #1e293b;
  --sidebar-accent: #334155;
  --sidebar-border: #475569;
  --sidebar-foreground: #f8fafc;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --background: #f8fafc;
  --foreground: #1e293b;
  --muted: #94a3b8;
  --border: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--background);
  color: var(--foreground);
}

.gradient-text {
  background: linear-gradient(to right, #8b5cf6, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout */
.admin-layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 250px;
  background-color: var(--sidebar);
  color: var(--sidebar-foreground);
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-hidden {
  transform: translateX(-100%);
}

@media (min-width: 768px) {
  .sidebar-hidden {
    transform: translateX(0);
  }
}

.sidebar-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--sidebar-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .sidebar-close {
    display: none;
  }
}

.sidebar-title {
  font-size: 1.5rem;
  font-weight: bold;
}

.sidebar-separator {
  height: 1px;
  background-color: var(--sidebar-border);
}

.sidebar-nav {
  padding: 1rem;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.25rem;
  transition: background-color 0.2s;
  text-decoration: none;
  color: var(--sidebar-foreground);
}

.sidebar-item:hover {
  background-color: var(--sidebar-accent);
}

.sidebar-item.active {
  background-color: var(--sidebar-accent);
  font-weight: 500;
}

.sidebar-item i {
  margin-right: 0.75rem;
}

.sidebar-user {
  padding: 1rem;
  margin-top: auto;
}

.sidebar-user-card {
  padding: 0.5rem;
  border-radius: 0.375rem;
  background-color: var(--sidebar-accent);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
  .main-content {
    margin-left: 250px;
  }
}

.header {
  height: 4rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background-color: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.menu-button {
  margin-right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .menu-button {
    display: none;
  }
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-button {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 1rem;
  height: 1rem;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: white;
}

.avatar-button {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  width: 12rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: none;
  z-index: 50;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-user-info {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.dropdown-username {
  font-weight: 500;
}

.dropdown-email {
  font-size: 0.75rem;
  color: var(--muted);
}

.dropdown-item {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: var(--border);
}

.dropdown-item i {
  margin-right: 0.5rem;
}

/* Page content */
.content {
  padding: 1rem;
  overflow: auto;
}

@media (min-width: 768px) {
  .content {
    padding: 1.5rem;
  }
}

/* Card */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted);
}

.card-content {
  padding: 1.25rem 1.5rem;
}

.card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* Form elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input {
  display: block;
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 1rem;
  line-height: 2.5rem;
  color: var(--foreground);
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  transition: border-color 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5rem;
  text-align: center;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  border: 1px solid transparent;
}

.button-primary {
  color: white;
  background: linear-gradient(to right, #8b5cf6, #3b82f6);
  border: none;
}

.button-primary:hover {
  opacity: 0.9;
}

.button-full {
  display: block;
  width: 100%;
}

/* Table */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-weight: 500;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Progress */
.progress {
  height: 0.75rem;
  overflow: hidden;
  background-color: var(--border);
  border-radius: 0.375rem;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, #8b5cf6, #3b82f6);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 28rem;
}

.login-footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 1rem;
}

/* Dashboard */
.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .stat-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stat-card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-title {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Campaign cards */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .campaign-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .campaign-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.campaign-card {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.campaign-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
}

.campaign-content {
  padding: 1.25rem;
}

.campaign-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.campaign-description {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.campaign-progress {
  margin-bottom: 0.5rem;
}

.campaign-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-icon:hover {
  background-color: var(--background);
}

.btn-edit {
  color: var(--primary);
}

.btn-delete {
  color: var(--danger);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 101;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast/alert notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.toast {
  padding: 1rem;
  background-color: white;
  color: var(--foreground);
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  max-width: 24rem;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-icon {
  margin-right: 0.75rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.875rem;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0.75rem;
}
