:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --light: #f3f4f6;
  --bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light);
  color: var(--text);
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.app {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 32px;
  text-align: center;
}

.sidebar-logo {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.sidebar-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.3);
  border-left: 4px solid white;
}

.nav-icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* MAIN CONTENT */
.main-container,
.main-content {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: white;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-title {
  font-size: 24px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4338ca 100%);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 100%);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* CONTENT AREA */
.content,
.pages-container {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* PAGE CONTAINERS */
.dashboard-container,
.page-container,
.settings-container,
.reports-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page {
  display: none;
  width: 100%;
}

.page.active {
  display: block;
}

/* GRID LAYOUT */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
}

.grid.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
  gap: 20px;
}

.grid.grid-1 {
  grid-template-columns: 1fr;
}

.grid.grid-2,
.grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid.grid-3,
.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid.grid-4,
.grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* CARDS */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  width: 100%;
}

.card.stats-card,
.card.event-card,
.card.volunteer-card,
.card.budget-card,
.card.task-card {
  background: white;
  border: 1px solid var(--border);
  width: 100%;
}

.card.overdue {
  border-color: var(--danger);
  border-width: 2px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.page-header > div {
  flex: 1;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.page-header p {
  font-size: 0.9em;
  color: var(--text-light);
  margin: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* STATS */
.stat-box {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.stat-change {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 8px;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* MODALS */
#modal-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}

#modal-container.visible {
  display: flex !important;
}

.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  background: transparent !important;
  width: auto !important;
  height: auto !important;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 20;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #1f2937;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* TABLES */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th {
  background: var(--light);
  padding: 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--light);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-primary {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ALERTS */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-left: 4px solid var(--secondary);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
