/* ===== Rentrovo Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --bg-primary: #0C0F14;
  --bg-secondary: #141821;
  --bg-card: #1A1F2B;
  --bg-input: #1E2330;
  --text-primary: #F2F0ED;
  --text-secondary: #8A8F9E;
  --text-muted: #5A5F6E;
  --accent: #D4A853;
  --accent-dim: rgba(212, 168, 83, 0.12);
  --accent-glow: rgba(212, 168, 83, 0.25);
  --accent-hover: #E0B861;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --success: #4ADE80;
  --success-dim: rgba(74, 222, 128, 0.12);
  --warning: #FBBF24;
  --warning-dim: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-dim: rgba(248, 113, 113, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  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); }

/* Grid background */
.grid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.content { position: relative; z-index: 1; }

/* ===== Nav ===== */
.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; max-width: 1200px; margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 20px; color: var(--text-primary); letter-spacing: -0.5px;
}
.logo-dot {
  display: inline-block; width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  margin-left: 2px; vertical-align: super;
}
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-user {
  font-size: 13px; color: var(--text-secondary);
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: 20px;
}

/* ===== Layout ===== */
.app-container { max-width: 1200px; margin: 0 auto; padding: 32px; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.page-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.page-header p { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; font-family: 'DM Sans', sans-serif;
  border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: var(--bg-primary);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg-primary); }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent-glow); }
.btn-danger { background: var(--danger-dim); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-success { background: var(--success-dim); color: var(--success); }
.btn-success:hover { background: rgba(74, 222, 128, 0.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Cards ===== */
.card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px;
}
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.card-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; }
.stat-value.accent { color: var(--accent); }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238A8F9E' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-accept { background: var(--success-dim); color: var(--success); }
.badge-review { background: var(--warning-dim); color: var(--warning); }
.badge-reject { background: var(--danger-dim); color: var(--danger); }
.badge-pending { background: rgba(138, 143, 158, 0.12); color: var(--text-secondary); }
.badge-screened { background: var(--accent-dim); color: var(--accent); }

/* ===== Score Ring ===== */
.score-ring {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700;
  border: 4px solid;
}
.score-ring.accept { border-color: var(--success); color: var(--success); }
.score-ring.review { border-color: var(--warning); color: var(--warning); }
.score-ring.reject { border-color: var(--danger); color: var(--danger); }

/* ===== Score Bar ===== */
.score-bar-container { margin-bottom: 12px; }
.score-bar-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.score-bar-label { font-size: 13px; color: var(--text-secondary); }
.score-bar-value { font-size: 13px; font-weight: 600; font-family: 'Space Grotesk', sans-serif; }
.score-bar { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.score-bar-fill.high { background: var(--success); }
.score-bar-fill.mid { background: var(--warning); }
.score-bar-fill.low { background: var(--danger); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 16px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  font-weight: 500;
}
td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

/* ===== Properties Grid ===== */
.properties-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto; padding: 32px;
}
.modal h2 { font-size: 22px; margin-bottom: 24px; }

/* ===== Alert ===== */
.alert {
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 20px;
}
.alert-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(74, 222, 128, 0.2); }
.alert-error { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.2); }
.alert-info { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(212, 168, 83, 0.2); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { font-size: 15px; margin-bottom: 24px; }

/* ===== Copy Link ===== */
.copy-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer;
  transition: border-color var(--transition);
}
.copy-link:hover { border-color: var(--accent); }
.copy-link code {
  flex: 1; font-size: 13px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-link .copy-icon { color: var(--accent); font-size: 14px; flex-shrink: 0; }

/* ===== Section dividers ===== */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 14px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-secondary); margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ===== Loading ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 20px;
  margin-bottom: 8px; font-size: 14px; min-width: 280px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Auth Pages ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 20px;
}
.auth-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px;
}
.auth-card .logo { text-align: center; margin-bottom: 32px; }
.auth-card .logo span {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 28px;
}
.auth-card h2 { font-size: 22px; margin-bottom: 8px; text-align: center; }
.auth-card .subtitle { color: var(--text-secondary); font-size: 15px; text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .app-nav { padding: 16px 20px; }
  .app-container { padding: 20px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .properties-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .modal { padding: 24px; max-width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
