/* Base Styles */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --light: #f8f9fa;
  --dark: #343a40;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --white: #ffffff;
  --sidebar-width: 250px;
  --header-height: 60px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.shadow { box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* Layout */
#login-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary);
  color: var(--white);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#logout-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: var(--transition);
}

#logout-btn:hover {
  background: rgba(255,255,255,0.3);
}

#app-container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--dark);
  color: var(--white);
  padding: 1rem 0;
  height: 100%;
  position: fixed;
  overflow-y: auto;
}

.sidebar h2 {
  padding: 0 1rem 1rem;
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.8);
  transition: var(--transition);
}

.sidebar a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.sidebar a.active {
  background: var(--primary);
  color: var(--white);
  border-left: 4px solid var(--warning);
}

.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  background: var(--white);
  min-height: calc(100vh - var(--header-height));
}

/* Forms */
form {
  display: grid;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

label {
  font-weight: 600;
  margin-bottom: -0.5rem;
}

input, select, textarea {
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  width: 100%;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

button[type="submit"] {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  transition: var(--transition);
}

button[type="submit"]:hover {
  background: var(--primary-dark);
}

button[type="button"] {
  background: var(--gray-light);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

button[type="button"]:hover {
  background: #d1d5db;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

th {
  background: var(--gray-light);
  font-weight: 600;
}

tr:hover {
  background: rgba(67, 97, 238, 0.05);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #c82333;
}

.btn-warning {
  background: var(--warning);
  color: var(--dark);
}

.btn-warning:hover {
  background: #e0a800;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-approved {
  background: rgba(40, 167, 69, 0.2);
  color: var(--success);
}

.status-pending {
  background: rgba(255, 193, 7, 0.2);
  color: #d39e00;
}

.status-rejected {
  background: rgba(220, 53, 69, 0.2);
  color: var(--danger);
}

.status-paid {
  background: rgba(40, 167, 69, 0.2);
  color: var(--success);
}

.status-pending-fee {
  background: rgba(255, 193, 7, 0.2);
  color: #d39e00;
}

.status-overdue {
  background: rgba(220, 53, 69, 0.2);
  color: var(--danger);
}

/* Dashboard Styles */
.dashboard-container {
  display: grid;
  gap: 1.5rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dashboard-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
}

.card-title {
  font-weight: 600;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.card-icon.blue { background: var(--primary); }
.card-icon.green { background: var(--success); }
.card-icon.orange { background: #fd7e14; }
.card-icon.purple { background: #6f42c1; }

.card-value {
  font-size: 2rem;
  font-weight: 700;
  padding: 1rem;
  text-align: center;
}

.card-footer {
  padding: 0.75rem 1rem;
  background: var(--gray-light);
  font-size: 0.85rem;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.financial-summary, .quick-actions {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.financial-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.financial-card {
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.financial-card.income {
  background: rgba(40, 167, 69, 0.1);
  border-left: 4px solid var(--success);
}

.financial-card.expenses {
  background: rgba(220, 53, 69, 0.1);
  border-left: 4px solid var(--danger);
}

.financial-card.net {
  background: rgba(23, 162, 184, 0.1);
  border-left: 4px solid var(--info);
}

.financial-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.8);
}

.financial-title {
  font-size: 0.85rem;
  color: var(--gray);
}

.financial-amount {
  font-weight: 700;
  font-size: 1.25rem;
}

.quick-actions h3 {
  margin-bottom: 1rem;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.action-btn {
  background: var(--white);
  border: 1px solid var(--gray-light);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--gray-light);
  border-color: var(--gray);
}

.chart-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-container {
  position: relative;
  height: 300px;
}

.sessions-overview, .recent-activity {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.session-stats {
  display: flex;
  justify-content: space-around;
  margin: 1.5rem 0;
}

.session-stat {
  text-align: center;
}

.session-stat.completed .stat-value {
  color: var(--success);
}

.session-stat.upcoming .stat-value {
  color: var(--primary);
}

.session-stat.cancelled .stat-value {
  color: var(--danger);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray);
}

.session-progress {
  margin-top: 1.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray);
}

.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
}

.activity-description {
  font-size: 0.9rem;
  color: var(--gray);
  margin: 0.25rem 0;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray);
}

.upcoming-tasks {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-list {
  margin-top: 1rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
}

.task-item:last-child {
  border-bottom: none;
}

.task-checkbox {
  flex-shrink: 0;
}

.task-content {
  flex: 1;
}

.task-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.task-priority {
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-priority.high {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger);
}

.task-priority.medium {
  background: rgba(255, 193, 7, 0.1);
  color: #d39e00;
}

.task-priority.low {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
}

.task-actions {
  flex-shrink: 0;
}

.task-btn {
  background: none;
  border: none;
  color: var(--gray);
}

/* Filter Section */
.filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--gray-light);
  border-radius: 8px;
}

.filter-input {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  min-width: 150px;
}

/* Loader */
.loader {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dashboard-loading {
  text-align: center;
  padding: 2rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--white);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 350px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.toast-message {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray);
  cursor: pointer;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--info);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Error State */
.error-state {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.error-state i {
  font-size: 3rem;
  color: var(--danger);
  margin-bottom: 1rem;
}

.error-state h3 {
  margin-bottom: 0.5rem;
}

.error-state p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  width: 90%;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .sidebar {
    width: 220px;
  }
  .content {
    margin-left: 220px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: var(--transition);
    z-index: 100;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    margin-left: 0;
  }
  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  .financial-cards {
    grid-template-columns: 1fr;
  }
  .action-buttons {
    grid-template-columns: 1fr;
  }
}