:root{
  --bg:#f3f7f4;
  --bg-soft:#edf5ef;
  --surface:#ffffff;
  --surface-2:#f7fbf8;
  --text:#173042;
  --muted:#637687;
  --line:#d8e3dc;
  --accent:#66b339;
  --accent-dark:#4f972b;
  --accent-soft:#edf7e7;
  --blue:#0066b0;
  --blue-dark:#12314a;
  --blue-soft:#eaf3fb;
  --danger:#d95b66;
  --ok:#2c8e45;
  --shadow:0 18px 48px rgba(18,49,74,.08);
  --shadow-soft:0 10px 24px rgba(18,49,74,.07);
}
*{box-sizing:border-box}
html{background:linear-gradient(180deg,#f8fbf9 0%,var(--bg) 100%)}
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(102,179,57,.10), transparent 22%),
    radial-gradient(circle at top right, rgba(0,102,176,.08), transparent 18%),
    linear-gradient(180deg,#f8fbf9 0%,var(--bg) 100%);
  font-family:Inter,Segoe UI,Arial,sans-serif;
}
a{color:inherit}
.site-shell{min-height:100vh;display:flex;flex-direction:column}
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:linear-gradient(135deg,#102b3f 0%,#15344d 55%,#1a4257 100%);
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 8px 30px rgba(14,32,49,.18);
}
.topbar-inner{
  max-width:1180px;
  margin:0 auto;
  min-height:76px;
  padding:0 20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  min-width:0;
}
.brand-wordmark{height:34px;width:auto;display:block}
.brand-badge{
  padding:7px 11px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
.top-actions{display:flex;gap:12px;align-items:center}
.user-chip{
  font-size:13px;
  color:#eaf3fb;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:8px 12px;
}
.ghost-button{
  text-decoration:none;
  padding:9px 14px;
  border-radius:12px;
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  background:linear-gradient(180deg,rgba(255,255,255,.10),rgba(255,255,255,.06));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14);
  font-size:13px;
  font-weight:700;
}
.page{max-width:1180px;margin:0 auto;padding:34px 20px 56px;flex:1}
.hero,
.compact-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin:6px 0 24px;
}
.hero-panel{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:24px;
  align-items:start;
  background:linear-gradient(180deg,rgba(255,255,255,.97),rgba(255,255,255,.93));
  border:1px solid rgba(216,227,220,.9);
  border-radius:28px;
  padding:28px;
  box-shadow:var(--shadow);
  margin:6px 0 24px;
}
.hero-copy{max-width:760px}
.hero-state{display:flex;flex-direction:column;align-items:flex-end;gap:12px}
.hero-note{
  color:var(--muted);
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  max-width:260px;
  text-align:right;
  box-shadow:var(--shadow-soft);
}
.hero-tags{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.tag{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 12px;
  font-size:13px;
  font-weight:700;
  color:var(--blue-dark);
}
.eyebrow{
  color:var(--accent);
  font-size:12px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:8px;
}
h1{font-size:38px;line-height:1.12;margin:0 0 10px;font-weight:800;letter-spacing:-.02em}
h2{margin:0 0 10px;font-size:24px;line-height:1.2}
p{line-height:1.6}
.muted{color:var(--muted)}
.status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--ok);
  background:#ecf8ef;
  border:1px solid #cfe9d6;
  padding:10px 14px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
  box-shadow:var(--shadow-soft);
}
.status-pill::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--ok);
  box-shadow:0 0 0 6px rgba(44,142,69,.12);
}
.module-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.module-card,.card{
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,255,255,.96));
  border:1px solid rgba(216,227,220,.95);
  border-radius:22px;
  box-shadow:var(--shadow);
}
.module-card{
  position:relative;
  min-height:180px;
  padding:24px;
  text-decoration:none;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
  overflow:hidden;
}
.module-card::after{
  content:"";
  position:absolute;
  inset:auto -60px -80px auto;
  width:180px;
  height:180px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(102,179,57,.16), rgba(102,179,57,0) 70%);
  pointer-events:none;
}
.module-card:nth-child(even)::after{background:radial-gradient(circle, rgba(0,102,176,.12), rgba(0,102,176,0) 70%)}
.module-card:not(.static):hover{
  transform:translateY(-3px);
  border-color:#bfd5c5;
  box-shadow:0 18px 42px rgba(18,49,74,.12);
}
.module-card p{margin:0;color:var(--muted);position:relative;z-index:1}
.module-card h2{position:relative;z-index:1}
.module-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--accent-dark);
  font-weight:800;
  font-size:12px;
  margin-bottom:12px;
  padding:7px 10px;
  border-radius:999px;
  background:var(--accent-soft);
  border:1px solid #d7ebca;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
  position:relative;
  z-index:1;
}
.module-card:nth-child(even) .module-kicker{
  color:var(--blue);
  background:var(--blue-soft);
  border-color:#d8e8f7;
}
.card{padding:26px}
.empty-card{max-width:760px}
.back-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--blue);
  text-decoration:none;
  margin-bottom:12px;
  font-size:14px;
  font-weight:700;
}
.login-shell{min-height:calc(100vh - 180px);display:grid;align-items:center}
.login-layout{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(340px,430px);
  gap:28px;
  align-items:center;
}
.login-side{
  padding:18px 8px 18px 0;
}
.feature-list{display:grid;gap:12px;margin-top:22px;max-width:520px}
.feature-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color:var(--text);
  background:rgba(255,255,255,.55);
  border:1px solid rgba(216,227,220,.8);
  border-radius:16px;
  padding:14px 16px;
  box-shadow:var(--shadow-soft);
}
.feature-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  margin-top:6px;
  background:linear-gradient(180deg,var(--accent),var(--accent-dark));
  box-shadow:0 0 0 5px rgba(102,179,57,.12);
  flex:0 0 auto;
}
.login-card{width:min(430px,100%);padding:28px 28px 30px}
.login-brand-mark{height:48px;width:auto;display:block;margin-bottom:16px}
.login-title{font-size:32px;margin-bottom:8px}
.field{display:block;margin-top:16px}
.field span{display:block;margin-bottom:8px;font-weight:800;font-size:14px}
input{
  width:100%;
  border:1px solid #cdd9d1;
  border-radius:14px;
  padding:13px 14px;
  font:inherit;
  background:#fff;
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(102,179,57,.15);
}
.primary-btn{
  border:1px solid rgba(79,151,43,.65);
  border-radius:14px;
  padding:13px 18px;
  background:linear-gradient(180deg,#73c143 0%,#5cab34 100%);
  color:#fff;
  font:inherit;
  font-weight:850;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(79,151,43,.24), inset 0 1px 0 rgba(255,255,255,.24);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.primary-btn:hover{filter:brightness(.98);transform:translateY(-1px);box-shadow:0 14px 28px rgba(79,151,43,.28), inset 0 1px 0 rgba(255,255,255,.24)}
.primary-btn:active{transform:translateY(0)}
.primary-btn:disabled{opacity:.65;cursor:wait;transform:none}
.login-card .primary-btn{width:100%;margin-top:20px}
.alert{padding:12px 14px;border-radius:12px;margin:14px 0}
.alert.error{background:#fff5f5;color:#b6404f;border:1px solid #f1d6da}
.diagnostics-card h2{margin-bottom:16px}
.diagnostic-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:var(--surface-2);
}
.diagnostic-grid>div{
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#fbfdfc 0%,#f6faf7 100%);
}
.diagnostic-grid>div:nth-child(odd){border-right:1px solid var(--line)}
.diagnostic-grid>div:nth-last-child(-n+2){border-bottom:0}
.diagnostic-grid span{display:block;color:var(--muted);font-size:12px;margin-bottom:6px;letter-spacing:.03em}
.actions{margin-top:18px}
.code-output{
  margin-top:16px;
  background:linear-gradient(180deg,#102436 0%,#0c1f30 100%);
  color:#d8f6e1;
  border-radius:18px;
  padding:18px;
  overflow:auto;
  white-space:pre-wrap;
  min-height:110px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
.footer{
  padding:18px 20px 28px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}
@media(max-width:980px){
  .hero-panel,.login-layout{grid-template-columns:1fr}
  .hero-state{align-items:flex-start}
  .hero-note{text-align:left;max-width:none}
  .login-side{padding:0}
}
@media(max-width:760px){
  .topbar-inner{padding:0 14px;min-height:70px}
  .brand-wordmark{height:28px}
  .brand-badge,.user-chip{display:none}
  .page{padding:22px 14px 44px}
  h1{font-size:30px}
  h2{font-size:22px}
  .hero,.compact-hero{display:block}
  .module-grid{grid-template-columns:1fr}
  .module-card{min-height:150px}
  .diagnostic-grid{grid-template-columns:1fr}
  .diagnostic-grid>div:nth-child(odd){border-right:0}
  .diagnostic-grid>div:nth-last-child(-n+2){border-bottom:1px solid var(--line)}
  .diagnostic-grid>div:last-child{border-bottom:0}
  .ghost-button{padding:8px 11px}
  .login-card{padding:24px}
}

/* v0.1.3 — светлая фирменная шапка: логотип СПЕКТР используется без изменения */
.topbar{
  background:rgba(255,255,255,.96);
  border-bottom:1px solid #dbe6df;
  box-shadow:0 8px 26px rgba(18,49,74,.08);
  backdrop-filter:blur(12px);
}
.topbar::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:2px;
  background:linear-gradient(90deg,#66b339 0 34%,#0066b0 34% 100%);
  opacity:.78;
}
.brand-wordmark{
  height:38px;
  width:auto;
  max-width:190px;
  object-fit:contain;
}
.brand-badge{
  background:#edf5ef;
  border:1px solid #d5e5d8;
  color:#12314a;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.user-chip{
  color:#12314a;
  background:#f2f7f4;
  border:1px solid #dce8e0;
}
.ghost-button{
  color:#0f5d92;
  border:1px solid #cbdde9;
  background:linear-gradient(180deg,#ffffff,#f3f8fb);
  box-shadow:0 4px 12px rgba(0,102,176,.08), inset 0 1px 0 rgba(255,255,255,.9);
}
.ghost-button:hover{
  background:#edf6fb;
  border-color:#b8d3e4;
}
@media(max-width:760px){
  .brand-wordmark{height:31px;max-width:155px}
}

/* v0.2.1 — фирменный знак пользователя без нижней подписи, файл не изменяется */
.brand-wordmark{
  height:40px;
  width:auto;
  max-width:220px;
  object-fit:contain;
}
.login-brand-mark{
  height:58px;
  width:auto;
  max-width:300px;
  object-fit:contain;
}
@media(max-width:760px){
  .brand-wordmark{height:34px;max-width:180px}
  .login-brand-mark{height:48px;max-width:250px}
}

/* v0.3.0 — OAuth Aspro.Cloud, роли и контур собственника */
.oauth-btn{
  display:block;
  margin-top:20px;
  padding:14px 18px;
  border-radius:14px;
  text-align:center;
  text-decoration:none;
  color:#fff;
  font-weight:850;
  background:linear-gradient(180deg,#0b78bf 0%,#0066b0 100%);
  border:1px solid #005b9f;
  box-shadow:0 12px 26px rgba(0,102,176,.22), inset 0 1px 0 rgba(255,255,255,.18);
  transition:transform .15s ease, box-shadow .15s ease;
}
.oauth-btn:hover{transform:translateY(-1px);box-shadow:0 15px 30px rgba(0,102,176,.27), inset 0 1px 0 rgba(255,255,255,.18)}
.system-login{margin-top:18px;border-top:1px solid var(--line);padding-top:15px}
.system-login summary{cursor:pointer;color:var(--muted);font-size:13px;font-weight:700}
.secondary-btn{
  width:100%;margin-top:16px;padding:12px 15px;border-radius:13px;cursor:pointer;
  border:1px solid #cbdde9;background:linear-gradient(180deg,#fff,#f1f7fb);color:#0f5d92;font-weight:800;
}
.center-shell{min-height:60vh;display:grid;place-items:center}
.status-card{max-width:680px;width:100%}
.identity-box{display:grid;gap:6px;margin:18px 0;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface-2)}
.identity-box span{color:var(--muted);font-size:14px}
.actions-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.secondary-link{display:inline-flex;text-decoration:none;color:var(--blue);font-weight:800;padding:10px 13px;border-radius:12px;border:1px solid #cbdde9;background:#f5f9fc}
.alert.success{background:#edf8ef;color:#237c3c;border:1px solid #cfe9d6}
.access-card{padding:0;overflow:hidden}
.access-table-wrap{overflow:auto}
.access-table{width:100%;border-collapse:collapse;min-width:820px}
.access-table th,.access-table td{padding:15px 16px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}
.access-table th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);background:var(--surface-2)}
.cell-muted{font-size:12px;color:var(--muted);margin-top:4px}
.role-form{display:flex;gap:8px;align-items:center}
.role-form select{min-width:180px;border:1px solid #cdd9d1;border-radius:11px;padding:10px;background:#fff;color:var(--text)}
.mini-btn{border:1px solid #bddbb0;background:var(--accent-soft);color:var(--accent-dark);font-weight:800;border-radius:11px;padding:10px 12px;cursor:pointer}
.role-pill{display:inline-flex;padding:7px 10px;border-radius:999px;font-size:12px;font-weight:800;background:#eef3f6;color:#456}
.role-owner{background:#edf7e7;color:#4f972b}.role-manager{background:#eaf3fb;color:#0066b0}.role-pending{background:#fff7df;color:#946b00}.role-disabled{background:#fff0f2;color:#a83f4e}
.owner-card{border-color:#c9dfbc;background:linear-gradient(180deg,#fff,#f5fbf1)}
.owner-hero{border-color:#c9dfbc}
.owner-grid .module-card{min-height:165px}
@media(max-width:760px){.role-form{align-items:stretch;flex-direction:column}.role-form select{min-width:0;width:100%}.actions-row{flex-direction:column}.secondary-link{justify-content:center}}
