:root {
  --primary: #0f4c5c;
  --primary-light: #1a6b7c;
  --accent: #e36414;
  --bg: #f7f9fb;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #5c6b73;
  --success: #2a9d8f;
  --danger: #e76f51;
  --warning: #e9c46a;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(15, 76, 92, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Auth */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0f4c5c 0%, #1a6b7c 50%, #0d3d4a 100%);
}
.auth-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .logo {
  width: 56px; height: 56px; margin: 0 auto 0.75rem;
  background: var(--primary); color: white;
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem;
}
.auth-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; color: var(--primary);
}
.auth-brand p { font-size: 0.85rem; color: var(--muted); }
.auth-form .form-group { margin-bottom: 1rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand .logo {
  width: 40px; height: 40px; background: white; color: var(--primary);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.brand h1 { font-family: 'Playfair Display', serif; font-size: 1.25rem; }
.brand span { font-size: 0.7rem; opacity: 0.85; display: block; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.user-chip {
  font-size: 0.85rem; background: rgba(255,255,255,0.15);
  padding: 0.35rem 0.75rem; border-radius: 20px;
}

/* Layout */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 64px); }
.sidebar {
  background: white; border-right: 1px solid var(--border);
  padding: 1.25rem 0; overflow-y: auto;
}
.sidebar-section { padding: 0 1rem 1rem; }
.sidebar-title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; margin-bottom: 0.5rem; padding: 0 0.5rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 0.9rem;
  margin-bottom: 2px; transition: all 0.15s;
}
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #e8f4f6; color: var(--primary); font-weight: 600; }

.main { padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  margin-bottom: 1.25rem; overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fafbfc;
}
.card-header h2 { font-size: 1.1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer {
  padding: 0.85rem 1.25rem; border-top: 1px solid var(--border);
  background: #fafbfc; display: flex; justify-content: space-between; align-items: center;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.stat-card {
  background: white; border-radius: var(--radius); padding: 1.1rem;
  border: 1px solid var(--border); text-align: center;
}
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 0.8rem; color: var(--muted); }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 500;
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; background: white;
}
.form-control:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(15,76,92,0.12);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6b73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2rem;
}

.btn {
  border: none; border-radius: 8px; padding: 0.55rem 1rem;
  font-weight: 500; font-size: 0.875rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #d35400; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: white; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

.alert {
  padding: 0.85rem 1rem; border-radius: 8px; font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-info { background: #e8f4f6; color: #0f4c5c; border-left: 4px solid var(--primary); }
.alert-success { background: #e8f8f5; color: #1a6b5a; border-left: 4px solid var(--success); }
.alert-danger { background: #fde8e4; color: #9b2c1a; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef9e7; color: #7d6608; border-left: 4px solid var(--warning); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 0.7rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #f8fafc; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.table tr:hover td { background: #f8fafc; }

.tag {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600;
}
.tag-green { background: #d1fae5; color: #065f46; }
.tag-orange { background: #ffedd5; color: #9a3412; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-gray { background: #f1f5f9; color: #475569; }

.path-card {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; cursor: pointer; transition: all 0.2s;
  background: white; height: 100%; text-decoration: none; color: inherit; display: block;
}
.path-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.path-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--primary); }
.path-card p { font-size: 0.85rem; color: var(--muted); }

.q-item { padding: 1rem 0; border-bottom: 1px solid #f0f0f0; }
.q-item:last-child { border-bottom: none; }
.q-num { font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 0.25rem; }
.q-text { font-size: 0.95rem; margin-bottom: 0.6rem; }
.q-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.q-opt {
  flex: 1; min-width: 80px; text-align: center;
  padding: 0.5rem 0.4rem; border: 1.5px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 0.8rem;
  transition: all 0.15s; background: white;
}
.q-opt:hover { border-color: var(--primary-light); }
.q-opt.selected { background: var(--primary); color: white; border-color: var(--primary); }
.q-opt input { display: none; }

.score-box {
  background: linear-gradient(135deg, #e8f4f6, #f0f9f7);
  border-radius: var(--radius); padding: 1.25rem; text-align: center; margin: 1rem 0;
}
.score-box .big { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.score-box .sub { font-size: 0.9rem; color: var(--muted); }

.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width 0.4s; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state a { color: var(--primary); font-weight: 600; }

@media print {
  .app-header, .sidebar, .no-print { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .main { padding: 0; max-width: 100%; }
}
