*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand:    #d4af37;
  --brand-dk: #b8941f;
  --brand-lt: #f5eed6;
  --green:    #16a34a;
  --red:      #dc2626;
  --blue:     #2563eb;
  --navy:     #1a1a2e;
  --navy-lt:  #2d2d44;
  --bg:       #fafaf9;
  --sidebar:  #1a1a2e;
  --sidebar-hover: #2d2d44;
  --white:    #ffffff;
  --border:   #e5e7eb;
  --text:     #1a1a2e;
  --muted:    #6b7280;
  --radius:   8px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── LOGIN ─────────────────────────────────────── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #1a1a2e 100%);
  position: relative; overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(212,175,55,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(212,175,55,0.08) 0%, transparent 50%);
}

.login-container { width: 100%; max-width: 420px; padding: 20px; position: relative; z-index: 1; }
.login-box {
  background: var(--white); padding: 44px 40px;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border: 1px solid rgba(212,175,55,0.1);
}
.login-box h1 { 
  font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
}
.login-box h1 svg {
  width: 28px; height: 28px; color: var(--brand);
}
.login-box h2 { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.login-box .btn-primary { width: 100%; padding: 12px; font-size: 15px; }
.error-message { color: var(--red); margin-top: 12px; font-size: 13px; }

/* ─── LAYOUT ─────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

ciza-sidebar {
  width: 240px; flex-shrink: 0;
  display: block;
}

.sidebar {
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #232338 50%, #1a1a2e 100%);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(212,175,55,0.1);
  overflow-y: auto;
  transition: all .3s ease;
}

.logo {
  padding: 20px 16px;
  font-size: 14px; font-weight: 700; color: #f8fafc;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 12px;
  transition: all .2s;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-size: 15px;
  font-weight: 700;
}

.logo-sub {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

.logo svg {
  width: 24px; height: 24px; color: var(--brand);
  transition: transform .2s;
}

.logo:hover svg {
  transform: scale(1.1);
}

.nav-menu { 
  list-style: none; padding: 12px 0; flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item, .nav-group-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8; 
  text-decoration: none;
  font-size: 13px; 
  border-radius: 6px;
  transition: all .2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-icon {
  font-size: 16px;
  display: inline-flex;
  min-width: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  flex: 1;
}

.nav-toggle {
  font-size: 10px;
  transition: transform .2s;
  display: inline-flex;
  min-width: 12px;
  justify-content: flex-end;
}

.nav-group-label.expanded .nav-toggle {
  transform: rotate(180deg);
}

.nav-item:hover, .nav-group-label:hover { 
  background: rgba(212,175,55,0.1);
  color: #f1f5f9;
}

.nav-item.active { 
  background: var(--brand); 
  color: #fff; 
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212,175,55,.3);
}

.nav-submenu {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-submenu.hidden {
  display: none;
}

.nav-item-wrapper {
  list-style: none;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 36px;
  color: #7dd3c0;
  text-decoration: none;
  font-size: 12px;
  border-radius: 4px;
  transition: all .2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-subitem:hover {
  background: rgba(125,211,192,0.1);
  color: #a7e8e0;
  padding-left: 40px;
}

.nav-subitem.active {
  background: rgba(212,175,55,0.15);
  color: var(--brand);
  font-weight: 600;
  border-left: 3px solid var(--brand);
  padding-left: 33px;
}

.nav-logout { 
  margin-top: auto; 
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
}

.nav-logout .nav-item {
  color: #f87171 !important;
}

.nav-logout .nav-item:hover {
  background: rgba(248,113,113,0.1) !important;
  color: #fca5a5 !important;
}

/* ─── DETAIL VIEW ────────────────────────────────────────── */
.detail-view {
  padding: 10px 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row strong {
  color: #64748b;
  font-size: 13px;
}

.detail-row span {
  color: #1e293b;
  font-weight: 600;
  text-align: right;
}
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.settings-modal-content {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease-out;
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #334155;
}

.settings-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
}

.settings-modal-body {
  padding: 24px;
}

.settings-group {
  margin-bottom: 0;
}

.settings-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.settings-group select {
  width: 100%;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 6px;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-group select:hover {
  border-color: #64748b;
}

.settings-group select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.content { flex: 1; padding: 32px 36px; overflow-y: auto; }

@media (max-width: 1024px) {
  .content { 
    max-width: 100%;
    padding: 24px;
  }
}

@media (max-width: 768px) {
  ciza-sidebar {
    width: 200px;
  }
  
  .nav-label {
    font-size: 12px;
  }
  
  .logo-text {
    display: none;
  }
  
  .content {
    padding: 16px;
  }
}

/* ─── HEADER ─────────────────────────────────────── */
.header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
  animation: fadeInDown .5s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header h1 { 
  font-size: 28px; font-weight: 700; color: var(--text);
  background: linear-gradient(135deg, #1a1a2e 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#welcomeMsg {
  color: var(--muted);
  font-size: 14px;
  animation: fadeInUp .6s ease-out;
}

.subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ─── STAT CARDS ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
  animation: fadeInUp .5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(245,238,214,0.3) 100%);
  padding: 24px;
  border-radius: 14px; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.03), 0 8px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid rgba(212,175,55,0.15);
  border-top: 2px solid var(--brand);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(212,175,55,0.2) 0%, rgba(212,175,55,0) 100%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 20px 40px rgba(212,175,55,.2), inset 0 1px 0 rgba(255,255,255,0.9);
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(245,238,214,0.5) 100%);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: inline-block;
  animation: fadeInUp .6s ease-out;
}

.stat-icon svg {
  width: 32px;
  height: 32px;
  display: block;
  color: inherit;
  stroke: currentColor;
  flex-shrink: 0;
}

.stat-card h3 { 
  font-size: 11px; color: var(--muted); font-weight: 600; 
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; 
}

.stat-value { 
  font-size: 28px; font-weight: 700; color: var(--brand);
  animation: fadeInUp .7s ease-out;
  line-height: 1.2;
}

.stat-value-sm { font-size: 18px; }

/* Stat card color variants */
.stat-card-primary { border-top-color: #2563eb; }
.stat-card-primary .stat-value { color: #2563eb; }

.stat-card-green { border-top-color: var(--green); }
.stat-card-green .stat-value { color: var(--green); }

.stat-card-red { border-top-color: var(--red); }
.stat-card-red .stat-value { color: var(--red); }

.stat-card-blue { border-top-color: var(--blue); }
.stat-card-blue .stat-value { color: var(--blue); }

.stat-card-gold { border-top-color: #d97706; }
.stat-card-gold .stat-value { color: #d97706; }

.stat-card-orange { border-top-color: #f97316; }
.stat-card-orange .stat-value { color: #f97316; }

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-icon {
    font-size: 24px;
  }
  
  .stat-value {
    font-size: 22px;
  }
  
  .stat-value-sm {
    font-size: 14px;
  }
}

/* ─── TABLE ──────────────────────────────────────── */
table { 
  width: 100%; border-collapse: collapse; background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(245,238,214,0.15) 100%); 
  border-radius: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.02), 0 8px 20px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8); 
  overflow: hidden;
  animation: fadeInUp .6s ease-out;
  border: 1px solid rgba(212,175,55,0.1);
}

thead tr { 
  background: linear-gradient(135deg, var(--brand-lt) 0%, #f5f0e6 100%);
  border-bottom: 2px solid rgba(212,175,55,0.2);
}

th { 
  padding: 14px 16px; font-size: 12px; font-weight: 700; 
  color: var(--brand-dk); text-transform: uppercase; letter-spacing: .05em; 
  text-align: left;
}

td { 
  padding: 14px 16px; border-bottom: 1px solid rgba(212,175,55,0.08); 
  vertical-align: middle;
  transition: background .2s;
}

tbody tr { 
  transition: all .2s ease;
}

tbody tr:hover { 
  background: rgba(212,175,55,0.06);
  transform: scale(1.001);
}

tbody tr:last-child td { border-bottom: none; }

.text-center { text-align: center; }
td small { color: var(--muted); font-size: 12px; }
td a { 
  color: var(--brand); 
  text-decoration: none; 
  font-weight: 500;
  transition: all .2s;
}

td a:hover { 
  text-decoration: underline; 
  color: var(--brand-dk);
  text-shadow: 0 0 8px rgba(212,175,55,0.2);
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--white); color: var(--text);
  transition: all .2s ease; text-decoration: none;
  white-space: nowrap;
}

.btn:hover { 
  background: #f8fafc; 
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212,175,55,.15);
}

.btn-primary { 
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dk) 100%);
  color: #fff; border-color: var(--brand); 
  box-shadow: 0 4px 12px rgba(212,175,55,.25);
}

.btn-primary:hover { 
  background: linear-gradient(135deg, var(--brand-dk) 0%, #a0781a 100%);
  border-color: var(--brand-dk); 
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(212,175,55,.35);
}

.btn-sm { padding: 6px 12px; font-size: 12px; margin-right: 4px; }
.btn-danger-sm { border-color: #fca5a5; color: var(--red); background: #fff5f5; }
.btn-danger-sm:hover { background: #fee2e2; transform: translateY(-1px); }

/* ─── FORMS ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { 
  display: block; font-size: 13px; font-weight: 600; 
  color: var(--text); margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid rgba(212,175,55,0.15); 
  border-radius: 8px;
  font-size: 14px; color: var(--text);
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(245,238,214,0.1) 100%);
  transition: all .2s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(212,175,55,0.25);
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(245,238,214,0.15) 100%);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { 
  outline: none; border-color: var(--brand); 
  box-shadow: 0 0 0 3px rgba(212,175,55,.12), inset 0 1px 2px rgba(0,0,0,0.02);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(245,238,214,0.2) 100%);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { 
  display: flex; gap: 10px; justify-content: flex-end; 
  margin-top: 24px; padding-top: 16px; 
  border-top: 1px solid var(--border); 
}

/* ─── MODAL ──────────────────────────────────────── */
.modal {
  display: none; position: fixed; z-index: 999;
  inset: 0; background: rgba(26,26,46,.35);
  overflow-y: auto;
}
.modal-content {
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(245,238,214,0.2) 100%);
  margin: 48px auto; padding: 32px;
  width: 90%; max-width: 620px;
  border-radius: 16px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.04), 0 20px 60px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid rgba(212,175,55,0.15);
  border-top: 3px solid var(--brand);
  position: relative;
  backdrop-filter: blur(8px);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -1px;
  right: 50px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.modal-content h2 { 
  font-size: 18px; font-weight: 700; margin-bottom: 24px; 
  color: var(--navy); 
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(212,175,55,0.2);
}

.modal-content h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--brand) 0%, rgba(212,175,55,0.3) 100%);
  border-radius: 2px;
}

.modal-sm { max-width: 460px; }
.close {
  position: absolute; top: 16px; right: 20px;
  font-size: 24px; cursor: pointer; color: var(--muted);
  line-height: 1; background: none; border: none;
  transition: color .2s;
}
.close:hover { color: var(--brand); }

/* ─── FILTERS ────────────────────────────────────── */
.filters { 
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; 
}
.filters select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; min-width: 190px; background: var(--white);
  transition: all .2s;
}
.filters select:hover {
  border-color: var(--brand);
}
.filters select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

/* ─── BADGES ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: 5px 12px;
  border-radius: 14px; font-size: 11px; font-weight: 700;
  letter-spacing: .03em; transition: all .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}
.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.badge-success { background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%); color: #15803d; }
.badge-warning { background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%); color: #a16207; }
.badge-danger  { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #b91c1c; }
.badge-info    { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1d4ed8; }
.badge-primary { background: linear-gradient(135deg, var(--gold-lt) 0%, rgba(212,175,55,0.15) 100%); color: var(--brand-dk); }

/* ─── SECTION ────────────────────────────────────── */
.section { 
  margin-top: 36px;
  animation: fadeInUp .7s ease-out;
}

.section h2 { 
  font-size: 20px; 
  font-weight: 600; 
  margin-bottom: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── ALLOC INFO BAR ─────────────────────────────── */
.alloc-info-bar {
  background: var(--brand-lt); border: 1px solid rgba(212,175,55,0.3);
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; color: var(--text); margin-bottom: 20px;
  border-left: 4px solid var(--brand);
}

/* ─── TABS ───────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.tab {
  padding: 9px 18px; border: none; background: none;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.tab:hover { 
  color: var(--brand); 
  background: var(--brand-lt);
}
.tab.active { 
  color: var(--brand); border-bottom-color: var(--brand); 
  background: var(--brand-lt);
}

/* ─── NAV GROUP LABELS ───────────────────────────────────── */
.nav-group { 
  list-style: none;
}

.nav-submenu.hidden {
  display: none;
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar-wrap {
  background: #e2e8f0; border-radius: 4px; height: 8px; width: 100%;
  overflow: hidden;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dk) 100%); 
  height: 8px; border-radius: 4px;
  transition: width .3s;
  box-shadow: 0 2px 4px rgba(212,175,55,.3);
}

/* ─── BLUEPRINT MASTER PLAN (SHARED) ─────────────────────────── */
.blueprint-viewport {
  position: relative;
  background: #0f172a;
  border-radius: 16px;
  border: 2px solid #1e293b;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 400px; /* Default: approx 2 rows */
}

.blueprint-viewport.expanded {
  max-height: 2000px; /* Allow expansion */
}

.blueprint-canvas {
  background-image: 
    linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
  padding: 40px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

.viewport-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, #0f172a);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s;
}

.blueprint-viewport.expanded .viewport-overlay {
  opacity: 0;
}

.parcel-grid, .skyline-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; /* Street spacing */
  justify-content: center;
}

/* ─── BUILDING SKYLINE VISUALIZER ────────────────────── */
.building-parcel {
  width: 140px;
  min-height: 180px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(212, 175, 55, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
}

.building-parcel:hover {
  transform: translateY(-12px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--brand);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 20px rgba(212, 175, 55, 0.2);
  z-index: 10;
}

.b-icon-wrap {
  width: 60px;
  height: 80px;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.b-icon {
  background: rgba(212, 175, 55, 0.2);
  border: 1.5px solid var(--brand);
  width: 100%;
  position: relative;
  transition: all 0.3s;
}

.b-icon::after {
  content: '';
  position: absolute;
  inset: 5px;
  background-image: radial-gradient(rgba(212, 175, 55, 0.4) 1px, transparent 1px);
  background-size: 8px 8px;
}

.b-type-residential .b-icon { height: 40px; width: 50px; border-radius: 2px; }
.b-type-residential .b-icon::before {
  content: ''; position: absolute; top: -20px; left: -5px; right: -5px;
  border-left: 30px solid transparent; border-right: 30px solid transparent; border-bottom: 20px solid var(--brand);
}

.b-type-commercial .b-icon { height: 80px; width: 40px; }
.b-type-commercial .b-icon::before {
  content: ''; position: absolute; top: -10px; left: 10px; width: 20px; height: 10px; background: var(--brand);
}

.b-type-mixed .b-icon { height: 60px; width: 45px; }
.b-type-mixed .b-icon::before {
  content: ''; position: absolute; top: -15px; left: 0; width: 25px; height: 15px; background: rgba(212, 175, 55, 0.2); border: 1.5px solid var(--brand); border-bottom: none;
}

.b-name { font-weight: 700; color: #fff; font-size: 12px; text-align: center; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-meta { font-size: 10px; color: #64748b; font-weight: 600; text-transform: uppercase; }
.b-status-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; }

.b-status-completed .b-status-dot { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.b-status-under_construction .b-status-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.b-status-occupied .b-status-dot { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }

.b-progress-mini { width: 60%; height: 3px; background: rgba(255,255,255,0.1); margin-top: 12px; border-radius: 2px; overflow: hidden; }
.b-progress-fill { height: 100%; background: var(--brand); }

/* ─── PARCEL (Legacy Plots) ─────────────────────────────────── */


.parcel {
  width: 110px;
  height: 140px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(212, 175, 55, 0.2);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.parcel::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.parcel:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 15px rgba(212, 175, 55, 0.3);
  z-index: 10;
}

.parcel:hover::before {
  opacity: 1;
}

.parcel .p-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.parcel .p-sub {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 800;
}

.parcel .p-status-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.parcel.available { border-left: 4px solid #22c55e; }
.parcel.reserved  { border-left: 4px solid #f59e0b; }
.parcel.allocated { border-left: 4px solid #3b82f6; }
.parcel.sold      { border-left: 4px solid #ef4444; }

.parcel.available .p-status-tag { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.parcel.reserved  .p-status-tag { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.parcel.allocated .p-status-tag { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.parcel.sold      .p-status-tag { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.blueprint-legend {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 20px;
  margin-top: -20px;
  position: relative;
  z-index: 5;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

