/* Corporate Trust Design System */
:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #7C3AED;
  --bg-color: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-colored: 0 10px 25px -5px rgba(79, 70, 229, 0.25);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* Background Blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
}
.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: float 10s infinite ease-in-out alternate;
}
.blob-2 {
  width: 350px;
  height: 350px;
  background: var(--secondary);
  bottom: -50px;
  right: -50px;
  animation: float 12s infinite ease-in-out alternate-reverse;
}

@keyframes float {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Views */
.view-container {
  display: none;
  min-height: 100vh;
}
.view-container.active {
  display: flex;
}

/* Auth View */
#auth-view {
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-colored);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.school-logo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

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

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-color);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 0.5rem;
}

.auth-links {
  margin-top: 1.5rem;
  font-size: 0.875rem;
}
.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }

.alert {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.alert-error {
  background-color: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}
.alert-success {
  background-color: #F0FDF4;
  color: #15803D;
  border: 1px solid #86EFAC;
}

/* App View */
#app-view {
  display: none;
}
#app-view.active {
  display: flex;
}

.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 2rem 1.5rem;
}

.nav-links {
  list-style: none;
  flex-grow: 1;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-link:hover {
  color: var(--primary);
  background: var(--bg-color);
}
.nav-link.active {
  color: var(--primary);
  background: #EEF2FF;
  border-left-color: var(--primary);
  font-weight: 600;
}

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

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-container {
  padding: 2rem;
  flex-grow: 1;
  overflow-y: auto;
}

.page-view {
  display: none;
}
.page-view.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

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

.stat-card, .card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

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

.item-list {
  list-style: none;
  margin-top: 1rem;
}
.item-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.item-list li:last-child {
  border-bottom: none;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-color);
  color: var(--text-main);
}
.badge.Tervezett { background: #EEF2FF; color: var(--primary); }
.badge.Folyamatban { background: #FEF3C7; color: #D97706; }
.badge.Lezárt { background: #D1FAE5; color: #059669; }

.search-bar {
  display: flex;
  gap: 1rem;
}
.search-bar input {
  flex-grow: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.search-bar button {
  width: auto;
}

@media (max-width: 768px) {
  #app-view { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .stats-grid { grid-template-columns: 1fr; }
}
