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

:root {
  --primary: #ffb81c;
  --dark: #00111a;
  --secondary: #f5f5f5;
  --border: #e0e0e0;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fafafa;
  color: #333;
  line-height: 1.6;
}

/* ────────────────────────── LAYOUT ────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: var(--dark);
  color: white;
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--primary);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.sidebar-brand {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand .logo {
  width: 100%;
  height: auto;
  max-width: 180px;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-item {
  background: none;
  border: none;
  color: #aaa;
  padding: 0.75rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 184, 28, 0.1);
  color: var(--primary);
}

.nav-item.active {
  background: rgba(255, 184, 28, 0.2);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: calc(1.5rem - 3px);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #666;
}

.main-content {
  margin-left: 220px;
  min-height: 100vh;
  padding: 2rem;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

/* ────────────────────────── PAGES ────────────────────────── */
.page {
  animation: fadeIn 0.3s ease;
}

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

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header h1 {
  font-size: 1.8rem;
  color: var(--dark);
}

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

.stat {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--dark);
}

/* ────────────────────────── PROJECTS GRID ────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.project-card h3 {
  color: var(--dark);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.project-card .meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.project-card .cost {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 1rem;
}

.project-card .actions {
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #999;
  font-style: italic;
}

/* ────────────────────────── BUTTONS ────────────────────────── */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: var(--dark);
}

.btn-primary:hover {
  background: #e6a516;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 184, 28, 0.3);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-ghost {
  background: none;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-ghost:hover {
  background: var(--primary);
  color: var(--dark);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #da190b;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ────────────────────────── FORMS ────────────────────────── */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 184, 28, 0.1);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  color: #666;
  font-size: 0.85rem;
}

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

.form-value {
  padding: 0.75rem;
  background: var(--secondary);
  border-radius: 6px;
  display: block;
  color: #666;
}

/* ────────────────────────── MODALS ────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

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

.modal h2 {
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* ────────────────────────── CARDS ────────────────────────── */
.card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.card h3 {
  color: var(--dark);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.card h4 {
  color: var(--dark);
  margin-bottom: 1rem;
}

/* ────────────────────────── WIZARD ────────────────────────── */
.wizard-bar {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wizard-step {
  position: relative;
  padding-left: 2.5rem;
  color: #999;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

.wizard-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #ddd;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.wizard-step.active {
  color: var(--dark);
}

.wizard-step.active::before {
  background: var(--primary);
  border-color: var(--primary);
}

.wizard-step.complete::before {
  background: var(--success);
  border-color: var(--success);
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.wizard-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ────────────────────────── TABLE ────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  background: var(--secondary);
  border-bottom: 2px solid var(--primary);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

tr:hover {
  background: rgba(255, 184, 28, 0.05);
}

/* ────────────────────────── TOAST ────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 3000;
  display: none;
  animation: slideUp 0.3s ease;
}

/* ────────────────────────── RESPONSIVE ────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-brand .logo {
    max-width: 40px;
  }

  .nav-item {
    padding: 0.75rem 0.5rem;
    font-size: 0;
  }

  .nav-item::before {
    content: attr(data-label);
    font-size: 1.2rem;
  }

  .main-content {
    margin-left: 60px;
    padding: 1rem;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .wizard-bar {
    flex-direction: column;
    gap: 1rem;
  }
}
