/* ========== APP CHROME ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.app-logo:hover { color: var(--accent); }

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--fg); background: var(--bg-elevated); }
.nav-link-active { color: var(--fg) !important; }

.nav-link-primary {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(212, 160, 51, 0.25);
}

.nav-link-primary:hover {
  color: var(--accent-light) !important;
  background: rgba(212, 160, 51, 0.18) !important;
}

.app-main { min-height: calc(100vh - 64px - 89px); }

/* ========== PAGE HEADER ========== */
.page-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ========== DEAL BOARD ========== */
.board-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s;
}

.deal-card:hover { border-color: rgba(212, 160, 51, 0.3); }

.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.deal-address {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}

.deal-deadline {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.deal-deadline.soon {
  color: #d4a033;
  background: var(--accent-dim);
  border-color: rgba(212, 160, 51, 0.3);
}

.deal-deadline.urgent {
  color: #e05252;
  background: rgba(224, 82, 82, 0.1);
  border-color: rgba(224, 82, 82, 0.3);
}

.deal-numbers {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.deal-number {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
}

.deal-number-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 4px;
}

.deal-number-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.deal-number-value.accent { color: var(--accent); }

.deal-number-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.deal-spread {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.deal-spread strong { color: var(--fg); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #0c0c0e;
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
}

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

.btn-interest {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(212, 160, 51, 0.25);
  width: 100%;
}

.btn-interest:hover {
  background: rgba(212, 160, 51, 0.2);
  border-color: rgba(212, 160, 51, 0.5);
  color: var(--accent-light);
}

.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p { margin-bottom: 24px; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 440px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--fg); }

.modal-address {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

/* ========== FORMS ========== */
.form-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px;
}

.submit-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; flex: 1; }

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

.form-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-dim);
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input::placeholder { color: var(--fg-dim); }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Date input dark fix */
.form-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

.form-error {
  font-size: 0.85rem;
  color: #e05252;
  padding: 10px 14px;
  background: rgba(224, 82, 82, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 82, 82, 0.25);
}

.form-error-banner {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #e05252;
  padding: 12px 16px;
  background: rgba(224, 82, 82, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 82, 82, 0.25);
}

.form-success {
  font-size: 0.85rem;
  color: #52c97a;
  padding: 10px 14px;
  background: rgba(82, 201, 122, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 201, 122, 0.25);
}

/* ========== SUCCESS CARD ========== */
.success-card {
  text-align: center;
  padding: 60px 24px;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(82, 201, 122, 0.12);
  border-radius: 50%;
  font-size: 1.5rem;
  color: #52c97a;
  margin-bottom: 20px;
}

.success-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-card p {
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== ADMIN ========== */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.admin-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--fg);
}

.admin-empty {
  color: var(--fg-muted);
  font-size: 0.9rem;
  padding: 24px 0;
}

.admin-stats {
  display: flex;
  gap: 24px;
}

.admin-stat {
  text-align: right;
}

.admin-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.admin-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--fg-dim);
  margin-top: 2px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover td { background: var(--bg-elevated); }

.td-id { color: var(--fg-dim); font-family: var(--font-display); font-size: 0.8rem; }
.td-address { max-width: 220px; }
.td-accent { color: var(--accent); font-weight: 600; }
.td-muted { color: var(--fg-muted); font-size: 0.82rem; }
.td-email { color: var(--accent); text-decoration: none; }
.td-email:hover { text-decoration: underline; }

.status-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.status-active {
  color: #52c97a;
  background: rgba(82, 201, 122, 0.1);
  border: 1px solid rgba(82, 201, 122, 0.25);
}

.status-closed {
  color: var(--fg-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .admin-stats { align-self: flex-start; }
  .deal-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .app-nav { gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 0.8rem; }
  .modal { padding: 24px; }
}
