:root {
  --navy: #031229;
  --navy-2: #0D2140;
  --navy-3: #183056;
  --green: #1DB954;
  --green-tint: #E0F7E8;
  --white: #FFFFFF;
  --gray-text: #93A4C2;
  --text-dim: #C3CEE3;
  --gray-line: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(29,185,84,0.16) 0%, rgba(29,185,84,0) 60%),
    radial-gradient(700px 500px at -5% 100%, rgba(29,185,84,0.08) 0%, rgba(29,185,84,0) 60%),
    var(--navy);
  background-attachment: fixed;
  color: var(--white);
}

.dash-particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.dash-particles span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  animation: particle-drift 7s ease-in-out infinite;
}
.dash-particles span:nth-child(1) { top: 8%; left: 55%; animation-delay: 0.2s; }
.dash-particles span:nth-child(2) { top: 18%; left: 92%; animation-delay: 1.4s; }
.dash-particles span:nth-child(3) { top: 30%; left: 40%; animation-delay: 2.6s; }
.dash-particles span:nth-child(4) { top: 42%; left: 85%; animation-delay: 0.8s; }
.dash-particles span:nth-child(5) { top: 55%; left: 60%; animation-delay: 3.4s; }
.dash-particles span:nth-child(6) { top: 68%; left: 95%; animation-delay: 1.9s; }
.dash-particles span:nth-child(7) { top: 78%; left: 48%; animation-delay: 4.2s; }
.dash-particles span:nth-child(8) { top: 88%; left: 75%; animation-delay: 2.3s; }
.dash-particles span:nth-child(9) { top: 15%; left: 70%; animation-delay: 5s; }
.dash-particles span:nth-child(10) { top: 60%; left: 35%; animation-delay: 3.9s; }

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

@media (prefers-reduced-motion: reduce) {
  .dash-particles { display: none; }
}

a { color: var(--green); text-decoration: none; }
a:hover { color: #27d363; }

.app {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #031229;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  animation: intro-out 0.6s ease 2.1s forwards;
}

.intro-mark {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  opacity: 0;
  transform: scale(0.72);
  filter: drop-shadow(0 0 22px rgba(29,185,84,0.35));
  animation: mark-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-word {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--white);
  opacity: 0;
  transform: translateY(8px);
  animation: word-in 0.5s ease forwards;
  animation-delay: 0.55s;
}
.intro-dot { color: var(--green); }

@keyframes mark-in {
  0% { opacity: 0; transform: scale(0.72); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes intro-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { animation: intro-out 0.01s linear 0.01s forwards; }
  .intro-mark { opacity: 1; transform: none; animation: none; }
  .intro-word { opacity: 1; transform: none; animation: none; }
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(29,185,84,0.16) 0%, rgba(29,185,84,0) 70%);
  pointer-events: none;
  animation: glow-pulse 5s ease-in-out infinite;
}

.login-particles { position: absolute; inset: 0; pointer-events: none; }
.login-particles span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  animation: particle-drift 6s ease-in-out infinite;
}
.login-particles span:nth-child(1) { top: 15%; left: 12%; animation-delay: 0.1s; }
.login-particles span:nth-child(2) { top: 25%; left: 80%; animation-delay: 1.1s; }
.login-particles span:nth-child(3) { top: 70%; left: 18%; animation-delay: 2.1s; }
.login-particles span:nth-child(4) { top: 82%; left: 75%; animation-delay: 0.6s; }
.login-particles span:nth-child(5) { top: 10%; left: 55%; animation-delay: 1.6s; }
.login-particles span:nth-child(6) { top: 45%; left: 8%; animation-delay: 2.6s; }
.login-particles span:nth-child(7) { top: 60%; left: 90%; animation-delay: 3.1s; }
.login-particles span:nth-child(8) { top: 88%; left: 40%; animation-delay: 0.9s; }
.login-particles span:nth-child(9) { top: 5%; left: 30%; animation-delay: 3.6s; }
.login-particles span:nth-child(10) { top: 35%; left: 65%; animation-delay: 1.9s; }
.login-particles span:nth-child(11) { top: 55%; left: 48%; animation-delay: 4.1s; }
.login-particles span:nth-child(12) { top: 20%; left: 92%; animation-delay: 2.9s; }
.login-particles span:nth-child(13) { top: 78%; left: 10%; animation-delay: 4.6s; }
.login-particles span:nth-child(14) { top: 92%; left: 60%; animation-delay: 1.4s; }
.login-particles span:nth-child(15) { top: 40%; left: 25%; animation-delay: 5.1s; }

.login-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--navy-3);
  border: 1px solid var(--gray-line);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.15s;
}

.login-mark {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px;
  animation: logo-glow 2.6s ease-in-out infinite;
}
.login-title {
  font-family: 'Montserrat', 'Inter', sans-serif; font-size: 20px; font-weight: 800; margin: 0 0 4px; color: var(--white);
  opacity: 0; animation: field-in 0.5s ease forwards; animation-delay: 0.35s;
}
.login-sub {
  font-size: 13px; color: var(--gray-text); margin: 0 0 20px;
  opacity: 0; animation: field-in 0.5s ease forwards; animation-delay: 0.45s;
}

.field-label, .login-card input { opacity: 0; animation: field-in 0.5s ease forwards; }
.field-label[for="email"] { animation-delay: 0.55s; }
#email { animation-delay: 0.6s; }
.field-label[for="password"] { animation-delay: 0.65s; }
#password { animation-delay: 0.7s; }
.login-submit { opacity: 0; animation: field-in 0.5s ease forwards; animation-delay: 0.8s; }

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes particle-drift {
  0% { opacity: 0; transform: translateY(0); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-18px); }
}
@keyframes card-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(29,185,84,0.25)); }
  50% { filter: drop-shadow(0 0 14px rgba(29,185,84,0.55)); }
}
@keyframes field-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .login-glow, .login-particles span, .login-mark { animation: none; }
  .login-card, .login-title, .login-sub, .field-label, .login-card input, .login-submit {
    animation: none; opacity: 1; transform: none;
  }
}

.field-label { font-size: 12px; font-weight: 600; color: var(--gray-text); margin: 12px 0 6px; }

.login-card input {
  background: var(--navy-2);
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--white);
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--green); }

.login-error {
  margin-top: 12px;
  font-size: 12.5px;
  color: #f0906a;
  background: rgba(216,90,48,0.12);
  border-radius: 8px;
  padding: 8px 10px;
}

.login-submit { margin-top: 20px; width: 100%; }

.sidebar {
  width: 280px;
  flex: 0 0 280px;
  min-width: 240px;
  background: var(--navy-2);
  border-right: 1px solid var(--gray-line);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: block; object-fit: cover;
}
.brand-name {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 800; font-size: 18px; letter-spacing: -0.1px;
}

.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--gray-text); font-size: 14px; font-weight: 500;
}
.nav-link.active { background: rgba(29,185,84,0.16); color: var(--green); font-weight: 600; }

.divider { height: 1px; background: var(--gray-line); }

.section-label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gray-text); font-weight: 600; padding: 0 12px 8px;
}

.client-search {
  width: 100%; background: var(--navy-2); border: 1px solid var(--gray-line);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--white);
  font-family: inherit; margin-bottom: 8px;
}
.client-search::placeholder { color: var(--gray-text); }
.client-search:focus { outline: none; border-color: var(--green); }
.client-search::-webkit-search-cancel-button { filter: invert(0.6); }

.client-empty { font-size: 12.5px; color: var(--gray-text); padding: 10px 12px; }

.client-list { display: flex; flex-direction: column; gap: 2px; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user-row { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.logout-btn {
  background: transparent; border: 1px solid var(--gray-line); color: var(--gray-text);
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer;
  font-family: inherit;
}
.logout-btn:hover { color: var(--white); border-color: var(--white); }

.client-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: background-color 0.18s ease, transform 0.12s ease;
}
.client-row:active { transform: scale(0.98); }
.client-row:hover { background: rgba(255,255,255,0.04); }
.client-row.selected { background: rgba(29,185,84,0.14); }

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--navy); flex: 0 0 auto;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; animation: avatar-glow 2.8s ease-in-out infinite; }

@keyframes avatar-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,185,84,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(29,185,84,0); }
}

.client-info { flex: 1; min-width: 0; }
.client-name { font-size: 13.5px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-last { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pending-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }

.main {
  flex: 999 1 640px;
  min-width: 0;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.view[hidden] {
  display: none;
}

.view > * {
  opacity: 0;
  transform: translateY(10px);
  animation: panel-in 0.45s ease forwards;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.view > *:nth-child(1) { animation-delay: 0.05s; }
.view > *:nth-child(2) { animation-delay: 0.12s; }
.view > *:nth-child(3) { animation-delay: 0.19s; }
.view > *:nth-child(4) { animation-delay: 0.26s; }

.main.content-fade-out .view > * {
  opacity: 0 !important;
  transform: translateY(6px) !important;
  animation: none !important;
}

@keyframes panel-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .view > * { animation: none; opacity: 1; transform: none; transition: none; }
}

.profile-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.profile-id { display: flex; align-items: center; gap: 14px; }
.profile-name { margin: 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 22px; font-weight: 800; color: var(--white); }
.profile-meta { font-size: 13px; color: var(--text-dim); }

.btn-primary {
  background: var(--green); color: var(--navy); border: none; border-radius: 8px;
  padding: 11px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.btn-primary:hover { background: #27d363; }
.btn-primary:active { transform: scale(0.97); }

.card {
  background: var(--navy-3); border: 1px solid var(--gray-line);
  border-radius: 14px; padding: 20px 22px;
}
.card-label { font-family: 'Montserrat', 'Inter', sans-serif; font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 14px; }
.card-label.accent { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--green); }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hint { font-size: 11px; color: var(--gray-text); }

.summary-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: #C9D4EA; }

.facts-list { display: flex; flex-direction: column; gap: 14px; }
.fact-row { display: flex; gap: 14px; align-items: flex-start; }
.tag {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 5px;
}
.tag-sold { background: var(--green); color: var(--navy); }
.tag-agreed { background: rgba(29,185,84,0.16); color: var(--green); border: 1px solid rgba(29,185,84,0.35); }
.tag-pending { background: var(--white); color: var(--navy); }
.tag-deadline {
  background: var(--navy); color: var(--green);
  border: 1.5px solid var(--green);
  animation: tag-pulse 2.2s ease-in-out infinite;
}

@keyframes tag-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,185,84,0.35); }
  50% { box-shadow: 0 0 0 4px rgba(29,185,84,0); }
}

@media (prefers-reduced-motion: reduce) {
  .tag-deadline { animation: none; }
}
.fact-text { font-size: 13.5px; line-height: 1.5; color: #C9D4EA; padding-top: 2px; }

.history-list { display: flex; flex-direction: column; gap: 14px; }
.history-row { display: flex; gap: 12px; align-items: flex-start; }
.history-time { font-size: 11px; color: var(--gray-text); width: 70px; flex: 0 0 auto; padding-top: 2px; }
.history-bubble { flex: 1; min-width: 0; background: var(--navy-2); border-radius: 8px; padding: 10px 14px; }
.history-from {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--green); background: rgba(29,185,84,0.14);
  padding: 2px 8px; border-radius: 5px; margin-bottom: 6px;
}
.history-text { font-size: 13.5px; line-height: 1.55; color: #DCE4F4; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.team-card { background: var(--navy-3); border: 1px solid var(--gray-line); border-radius: 14px; padding: 18px 20px; }
.team-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.team-card-name { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--white); margin: 0; }
.team-card-email { font-size: 12px; color: var(--gray-text); margin: 0; }
.team-card-stats { display: flex; gap: 16px; margin-bottom: 14px; }
.team-stat { display: flex; flex-direction: column; }
.team-stat-num { font-size: 20px; font-weight: 700; color: var(--white); }
.team-stat-label { font-size: 11px; color: var(--gray-text); text-transform: uppercase; letter-spacing: 0.04em; }
.team-client-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.team-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--navy-2); border-radius: 20px; padding: 4px 10px 4px 4px;
  font-size: 12px; color: var(--text-dim);
}
.team-chip .avatar { width: 20px; height: 20px; font-size: 9px; }
.team-chip.has-pending { color: var(--white); }

.handover-select {
  width: 100%; background: var(--navy-2); border: 1px solid var(--gray-line);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--white); font-family: inherit;
}

.handover-summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#handover-result { display: flex; flex-direction: column; gap: 16px; }
.handover-client-name { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--white); margin: 0 0 4px; }
.handover-client-phone { font-size: 12px; color: var(--gray-text); margin: 0 0 10px; }
.handover-empty { color: var(--gray-text); font-size: 13.5px; padding: 8px 0; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--gray-line);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 13px; color: var(--gray-text); }
.settings-value { font-size: 14px; color: var(--white); font-weight: 500; }
.settings-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.settings-form input {
  background: var(--navy-2); border: 1px solid var(--gray-line);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--white); font-family: inherit;
}
.settings-form input:focus { outline: none; border-color: var(--green); }
.settings-form .btn-primary { align-self: flex-start; }
.settings-success {
  font-size: 12.5px; color: var(--green); background: rgba(29,185,84,0.12);
  border-radius: 8px; padding: 8px 10px;
}

.settings-user-list { display: flex; flex-direction: column; gap: 10px; }
.settings-user-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy-2); border-radius: 8px; padding: 10px 12px;
}
.settings-user-info { display: flex; flex-direction: column; }
.settings-user-name { font-size: 13.5px; font-weight: 600; color: var(--white); }
.settings-user-email { font-size: 12px; color: var(--gray-text); }
.settings-user-remove {
  background: transparent; border: 1px solid var(--gray-line); color: var(--gray-text);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font-family: inherit;
}
.settings-user-remove:hover { color: #f0906a; border-color: #f0906a; }
