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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a28;
  --border: #1e1e2e;
  --border-hover: #2e2e44;
  --accent: #00d4aa;
  --accent-dim: #00d4aa22;
  --accent-hover: #00e8bb;
  --text: #e8e8ed;
  --text-dim: #8888a0;
  --text-muted: #555570;
  --smb: #6366f1;
  --smb-dim: #6366f122;
  --engineer: #00d4aa;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* NAV */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
  margin-left: 0.5rem;
}

.nav-btn:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

/* PAGE LAYOUT */
.page {
  padding-top: 5rem;
  min-height: 100vh;
}

.page-header {
  padding: 3rem 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 600px;
}

.page-content {
  padding: 0 4rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  transition: all 0.25s;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* TAGS */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid #00d4aa33;
}

.tag.smb {
  background: var(--smb-dim);
  color: var(--smb);
  border-color: #6366f133;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.btn-smb:hover {
  background: #7c7ff7;
  color: white;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.85rem 2rem;
}

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

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

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select option {
  background: var(--surface);
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* FILTERS BAR */
.filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input input {
  padding-left: 2.5rem;
}

.search-input::before {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
}

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.badge-open {
  background: #10b98122;
  color: #10b981;
  border: 1px solid #10b98133;
}

.badge-available {
  background: #10b98122;
  color: #10b981;
  border: 1px solid #10b98133;
}

.badge-busy {
  background: #f59e0b22;
  color: #f59e0b;
  border: 1px solid #f59e0b33;
}

.badge-pending {
  background: #6366f122;
  color: #6366f1;
  border: 1px solid #6366f133;
}

/* BUDGET DISPLAY */
.budget {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
}

.budget-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* RATING */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--warning);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* DETAIL PAGE */
.detail-header {
  padding: 3rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.detail-main {
  flex: 1;
}

.detail-sidebar {
  width: 340px;
  flex-shrink: 0;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* SUCCESS MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.modal h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.modal p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.modal .checkmark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.8rem;
  color: var(--accent);
}

/* LOADING */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-dim);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
}

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

/* FOOTER */
footer {
  padding: 2rem 4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.footer-link {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--accent); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text);
  z-index: 300;
  transform: translateY(120%);
  transition: transform 0.3s ease;
  max-width: 400px;
}

.toast.active {
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .page-header, .page-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    padding: 2rem 1.5rem;
  }

  .detail-sidebar {
    width: 100%;
  }

  .nav-links {
    display: none;
  }

  footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 0.75rem;
  }
}
