:root {
  /* Colors */
  --primary: #0061ff;
  --primary-soft: rgba(0, 97, 255, 0.1);
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --white: #ffffff;
  
  /* Accent Colors for Icons */
  --accent-orange: #ff9c00;
  --accent-purple: #6200ea;
  --accent-red: #ff3b3b;
  --accent-green: #00c853;
  --accent-blue: #00b0ff;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Spacing */
  --sidebar-width: 280px;
  --header-height: 100px;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden; /* App container handles scrolling */
  line-height: 1.5;
}

h1, h2, h3, .logo-title {
  font-family: 'Outfit', sans-serif;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 32px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  color: var(--primary);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 0 16px;
  overflow-y: auto;
}

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

.nav-title {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
}

.nav-item ion-icon {
  font-size: 20px;
}

.nav-item:hover {
  background-color: var(--bg-app);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
}

.system-alert {
  background-color: #eff6ff;
  border-radius: var(--radius);
  padding: 16px;
}

.alert-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.alert-desc {
  font-size: 11px;
  color: #3b82f6;
  line-height: 1.4;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.header {
  padding: 40px 48px;
  background: linear-gradient(to bottom, var(--white), var(--bg-app));
}

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

.main-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.main-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  width: 320px;
  height: 44px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-box ion-icon {
  color: var(--text-muted);
  font-size: 20px;
  margin-right: 12px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text-main);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-app);
  transform: translateY(-1px);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fde6d8;
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

/* Breadcrumbs */
.breadcrumb-container {
  padding: 0 48px 24px 48px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumbs ion-icon {
  font-size: 14px;
}

.breadcrumbs .active {
  color: var(--primary);
  font-weight: 600;
}

/* Content Body */
.content-body {
  padding: 0 48px 48px 48px;
  flex: 1;
}

.event-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-year-header {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 32px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  background: var(--primary-soft);
  color: var(--primary);
}

/* Event Cards */
.event-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-bottom: 12px;
}

.event-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.event-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.event-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.icon-activity { background: #fff7ed; color: var(--accent-orange); }
.icon-meeting { background: #f5f3ff; color: var(--accent-purple); }
.icon-election { background: #f0fdf4; color: var(--accent-green); }
.icon-document { background: #fef2f2; color: var(--accent-red); }
.icon-other { background: #f0f9ff; color: var(--accent-blue); }

.event-details {
  display: flex;
  flex-direction: column;
}

.event-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-item ion-icon {
  font-size: 16px;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--bg-app);
  color: var(--primary);
}

.file-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--bg-app);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: 85vh;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title-group h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-title-group p {
  font-size: 13px;
  color: var(--text-muted);
}

.close-btn {
  background: var(--bg-app);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

.image-grid {
  flex: 1;
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  overflow-y: auto;
}

.gallery-item {
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-app);
  position: relative;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Loading States */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
  color: var(--text-muted);
  font-weight: 500;
}

.skeleton-nav {
  height: 44px;
  background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonLoad 1.5s infinite;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

@keyframes skeletonLoad {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { width: 80px; }
  .logo-text, .nav-item span, .nav-title, .system-alert, .alert-title, .alert-desc { display: none; }
  .nav-item { justify-content: center; }
  .sidebar-header { padding: 24px 0; display: flex; justify-content: center; }
  .header { padding: 24px; }
  .breadcrumb-container { padding: 0 24px 16px 24px; }
  .content-body { padding: 0 24px 24px 24px; }
}
