:root {
  --brand: #3d5470;
  --brand-hover: #2c3f55;
  --navy: #1c2433;
  --steel: #4e5864;
  --menu: #1eb3a8;
  --menu-hover: #168f87;
  --menu-soft: #d7f4f1;
  --sand: #eef1f4;
  --ink: #1c2433;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --danger: #b42318;
  --good: #168f87;
  --sidebar: #3a434d;
  --shadow: 0 10px 30px rgba(31, 41, 51, 0.05);
  --shadow-lg: 0 30px 80px rgba(31, 41, 51, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body.is-in #login { display: none !important; }
body.is-in #app,
body.is-in #app.staff-app { display: grid; }

body {
  font-family: Manrope, Gilroy, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(820px 380px at 8% -8%, rgba(30, 179, 168, 0.14), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(78, 88, 100, 0.12), transparent 46%),
    linear-gradient(180deg, #f5f7f9 0%, #e8edf1 100%);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(78, 88, 100, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 88, 100, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
}

body > * { position: relative; z-index: 1; }

h1, h2, h3 { letter-spacing: -0.03em; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -22px) scale(1.08); }
}
@keyframes logo-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 84, 112, 0.28); }
  50% { box-shadow: 0 0 0 8px rgba(61, 84, 112, 0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

.float-orb { animation: float-orb 9s ease-in-out infinite; }
.float-orb-delayed { animation: float-orb 11s ease-in-out infinite reverse; }
.logo-glow { animation: logo-glow 2.6s ease-in-out infinite; }
.page-enter { animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-slide-in { animation: slide-in-left 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* —— Login (как specteh.rad55.ru/login) —— */
.login-wrap {
  display: grid;
  min-height: 100vh;
  width: 100%;
}
@media (min-width: 1024px) {
  .login-wrap { grid-template-columns: 1.05fr 0.95fr; }
}

.login-hero {
  display: none;
  position: relative;
  overflow: hidden;
  background: #3a434d;
  color: #fff;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
}
@media (min-width: 1024px) {
  .login-hero { display: flex; }
}

.login-hero-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 10%, rgba(30, 179, 168, 0.32), transparent 38%),
    radial-gradient(circle at 90% 88%, rgba(255, 255, 255, 0.08), transparent 40%);
}
.login-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(48px);
  pointer-events: none;
}
.login-orb-a {
  left: -64px;
  top: 80px;
  width: 288px;
  height: 288px;
  background: rgba(30, 179, 168, 0.25);
}
.login-orb-b {
  right: -40px;
  bottom: 32px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.1);
}

.login-hero-copy { position: relative; max-width: 32rem; }
.login-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--menu-soft);
}
.login-hero h1 {
  margin: 16px 0 0;
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
}
.login-hero p.lead {
  margin: 20px 0 0;
  max-width: 28rem;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}
.login-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}
.login-pills span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.login-copy {
  position: relative;
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.35);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.login-card {
  width: min(28rem, 100%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #fff;
  border-radius: 2rem;
  padding: 36px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.login-mobile-brand { display: block; margin-bottom: 12px; }
@media (min-width: 1024px) {
  .login-mobile-brand { display: none; }
}

.dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--menu);
}
.dots .bar {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(30, 179, 168, 0.7);
}

.login-card h1,
.login-card h2 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--menu-hover);
}
.muted { color: var(--muted); margin: 0; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

input, select, textarea {
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px 14px;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--menu);
  box-shadow: 0 0 0 4px rgba(30, 179, 168, 0.18);
}

button[type="submit"], .primary {
  background: var(--menu);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(30, 179, 168, 0.28);
}
button[type="submit"]:hover, .primary:hover { background: var(--menu-hover); }

.error { color: var(--danger); margin: 0; font-size: 14px; }

.ghost-link {
  color: var(--menu-hover);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.ghost-link:hover { text-decoration: underline; }

/* —— Brand —— */
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: inherit;
}
.mark, .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  background: #050533;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-logo.lg { width: 64px; height: 64px; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand strong, .brand-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}
.brand-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}

/* —— App shell —— */
#app.staff-app,
#app {
  min-height: 100vh;
  display: none;
  grid-template-columns: 272px 1fr;
}
body.is-in #app,
body.is-in #app.staff-app {
  display: grid;
}

aside {
  position: relative;
  overflow: hidden;
  background-color: var(--sidebar);
  background-image:
    radial-gradient(circle at 16% 10%, rgba(30, 179, 168, 0.32), transparent 38%),
    radial-gradient(circle at 90% 88%, rgba(255, 255, 255, 0.08), transparent 40%);
  color: #f5f5f4;
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 8px 0 32px rgba(31, 41, 51, 0.18);
}
aside::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 48px 48px;
}
aside > * { position: relative; z-index: 1; }

.sidebar-accent {
  height: 4px;
  margin: 0 -12px;
  background: linear-gradient(90deg, var(--menu), #7ee0d8, rgba(30, 179, 168, 0.3));
}

aside .brand { padding: 20px 8px 12px; }

nav { display: grid; gap: 4px; flex: 1; }
nav button, .ghost {
  text-align: left;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
nav button .ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
nav button .ico svg { width: 16px; height: 16px; }
nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(2px);
}
nav button.active {
  background: var(--menu);
  color: #fff;
  box-shadow: 0 8px 18px rgba(30, 179, 168, 0.35);
  transform: none;
}
nav button.active .ico { background: rgba(255, 255, 255, 0.2); }

.nav-label {
  margin: 12px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.ghost {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.55);
  justify-content: center;
  font-weight: 600;
}
.ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.workspace { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(31, 41, 51, 0.04);
}
.topbar .office {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.topbar .today {
  margin: 2px 0 0;
  font-size: 12px;
  color: #a8a29e;
  text-transform: capitalize;
}

.period { display: flex; gap: 12px; align-items: end; }
.period label { font-size: 12px; }

main { padding: 28px 36px 48px; }

.page-head { margin-bottom: 24px; }
.page-head h2 {
  margin: 10px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.page-head .sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card, .panel {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--menu);
}
.card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.card strong {
  display: block;
  font-size: 24px;
  margin-top: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.neg { color: var(--danger) !important; }
.pos { color: var(--good) !important; }

.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: rgba(215, 244, 241, 0.35); }

.row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
form.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
form.grid .wide { grid-column: span 2; }
form.grid .full { grid-column: 1 / -1; }
.hint { color: var(--muted); font-size: 13px; }

.danger {
  background: transparent;
  border: 1px solid rgba(180, 35, 24, 0.35);
  color: var(--danger);
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.danger:hover { background: #fff1f0; }

@media (max-width: 980px) {
  #app.staff-app,
  #app { grid-template-columns: 1fr; }
  aside {
    position: sticky;
    top: 0;
    z-index: 30;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px 12px;
  }
  .sidebar-accent { width: 100%; margin: -8px -12px 4px; }
  aside .brand { padding: 4px; }
  nav {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    flex: none;
  }
  .nav-label { grid-column: 1 / -1; margin-top: 4px; }
  .ghost { margin-top: 0; width: auto; }
  .topbar { flex-wrap: wrap; }
  main { padding: 20px 16px 80px; }
  .cards, .row, form.grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
  .login-hero h1 { font-size: 36px; }
}
