:root {
  --brand: #2563eb;
  --bg: #f4f7fc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(900px 500px at 10% -10%, #e8efff 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  min-height: 100vh;
}
[v-cloak] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.boot { min-height: 80vh; display: grid; place-items: center; color: var(--muted); text-align: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #dbe4f3; border-top-color: var(--brand);
  animation: spin 0.8s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 12px; padding: 10px 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; margin-top: 14px; padding: 12px; }
.link { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 6px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.auth-card {
  width: min(430px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 30px; box-shadow: var(--shadow);
}
.auth-logo {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff;
  font-size: 24px; font-weight: 800; margin-bottom: 16px;
}
.auth-card h1 { font-size: 25px; letter-spacing: -0.5px; margin-bottom: 6px; }
.auth-card label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; margin: 14px 0 6px; }
.auth-card input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; outline: none;
}
.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.error { color: var(--red); background: #fef2f2; border: 1px solid #fecaca; padding: 9px 11px; border-radius: 10px; margin-top: 12px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

.shell { min-height: 100vh; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo, .brand-mark {
  width: 38px; height: 38px; border-radius: 11px; object-fit: contain; background: #eef3ff;
}
.brand-mark { display: grid; place-items: center; color: var(--brand); font-weight: 800; font-size: 18px; }
.brand strong { display: block; font-size: 14.5px; }
.brand .muted { display: block; font-size: 12px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 22px 60px; }
.hero h1 { font-size: 32px; letter-spacing: -0.8px; margin-bottom: 6px; }
.hero p { max-width: 620px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; margin-top: 22px; }
.project-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: 0.18s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: #c7d7f5; }
.project-top { display: flex; justify-content: space-between; gap: 12px; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.project-top h2 { font-size: 19px; margin: 4px 0 0; letter-spacing: -0.3px; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; border: 1px solid transparent; white-space: nowrap;
}
.health-green { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.health-yellow { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.health-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.ring-row { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.ring {
  width: 92px; height: 92px; border-radius: 50%; position: relative;
  display: grid; place-items: center; flex: none;
}
.ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); }
.ring span { position: relative; z-index: 1; font-size: 23px; font-weight: 800; letter-spacing: -0.8px; }
.ring small { position: relative; z-index: 1; color: var(--muted); font-size: 10px; display: block; text-align: center; }
.ring.big { width: 124px; height: 124px; }
.ring.big span { font-size: 31px; }
.ring-info { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.project-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 12.5px; }
.open { color: var(--brand); font-weight: 800; white-space: nowrap; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty.small { padding: 22px 8px; }
.empty h2 { color: var(--text); }

.project-detail .back { border: 0; background: none; color: var(--muted); padding: 0 0 14px; font-weight: 700; }
.detail-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.detail-hero h1 { font-size: 29px; letter-spacing: -0.7px; margin: 5px 0 9px; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }

.action-card {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid #c7d2fe; border-radius: 20px; padding: 18px 20px; margin-bottom: 16px;
}
.action-card h2 { font-size: 17px; margin-bottom: 12px; }
.approval { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid #dbeafe; }
.approval:first-of-type { border-top: 0; }
.approval-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.panel h2 { font-size: 18px; margin-bottom: 16px; letter-spacing: -0.3px; }
.phase { padding: 12px 0; border-top: 1px solid var(--line); }
.phase:first-of-type { border-top: 0; padding-top: 0; }
.phase-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.phase-title { display: flex; align-items: center; gap: 9px; }
.phase-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; flex: none; }
.phase-dot.done { background: var(--green); }
.phase-dot.doing { background: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.phase-dot.pending { background: #cbd5e1; }
.bar { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #7c3aed); transition: width 0.4s ease; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.milestone { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.milestone:first-child { border-top: 0; padding-top: 0; }
.milestone-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; background: #cbd5e1; }
.milestone-dot.done { background: var(--green); }
.milestone-dot.pending { background: var(--yellow); }
.milestone-dot.missed { background: var(--red); }
.milestone-body { flex: 1; }
.milestone-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.approval-note { margin-top: 5px; font-size: 12px; color: var(--brand); font-weight: 700; }

.update { padding: 13px 0; border-top: 1px solid var(--line); }
.update:first-of-type { border-top: 0; padding-top: 0; }
.update-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.update p { margin: 0; color: #334155; white-space: pre-wrap; }
.detail-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 60; font-size: 13px;
}

@media (max-width: 640px) {
  .wrap { padding: 18px 15px 50px; }
  .hero h1 { font-size: 26px; }
  .detail-hero { flex-direction: column; align-items: flex-start; }
  .detail-hero .ring.big { align-self: center; }
  .project-grid { grid-template-columns: 1fr; }
  .approval { flex-direction: column; align-items: flex-start; }
  .approval-actions { width: 100%; }
  .approval-actions .btn { flex: 1; }
}

@media print {
  body { background: #fff; }
  .top, .back, .detail-actions, .action-card, .toast { display: none !important; }
  .wrap { max-width: 100%; padding: 0; }
  .panel, .detail-hero { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .project-detail { display: block; }
}
