/* ============================================================
   Sekai — workspace.css
   Рабочее пространство площадки (Astra-стиль).
============================================================ */

.workspace {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Шапка */
.ws-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  flex-wrap: wrap;
}

.ws-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
}

.ws-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.ws-title {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
}

.ws-sub {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.ws-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Body */
.ws-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  min-height: 0;
}

.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  height: fit-content;
}

.ws-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  width: 100%;
}

.ws-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.ws-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ws-nav-item svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.5;
  flex-shrink: 0;
  opacity: 0.75;
}

.ws-nav-item.active svg { opacity: 1; }

.ws-nav-label { flex: 1; min-width: 0; }

.ws-content {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  padding: 26px 30px;
  position: relative;
  min-width: 0;
  overflow-y: auto;
}

.ws-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
}

.ws-content::-webkit-scrollbar { width: 6px; }
.ws-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

/* Блоки */
.ws-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--glass-line);
  margin-bottom: 26px;
}

.ws-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ws-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ws-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--text);
}

.ws-block-title svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.6;
  color: var(--text-3);
}

.ws-block-sub {
  font-size: 12.5px;
  color: var(--text-4);
  line-height: 1.5;
  margin-top: -6px;
}

/* Пресеты */
.ws-presets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-preset {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t);
  position: relative;
}

.ws-preset:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-line-hover);
}

.ws-preset.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ws-preset-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t);
  position: relative;
}

.ws-preset-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform var(--t);
}

.ws-preset.active .ws-preset-radio { border-color: var(--accent); }
.ws-preset.active .ws-preset-radio::after { transform: scale(1); }

.ws-preset-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-preset-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-preset-desc {
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.5;
}

.ws-preset-desc b {
  color: var(--text-3);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ws-preset-actions { display: flex; gap: 4px; flex-shrink: 0; }

.ws-preset-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-line);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-3);
}

.ws-preset.active .ws-preset-badge {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
}

.ws-preset-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  width: 100%;
}

.ws-preset-add:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
}

.ws-preset-add svg { width: 14px; height: 14px; stroke-width: 2; }

/* Формы */
.ws-form { display: flex; flex-direction: column; gap: 22px; }
.ws-form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ws-form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.ws-form-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ws-form-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
}

.ws-form-label b {
  color: rgba(255, 150, 150, 0.9);
  font-weight: 500;
  margin-left: 2px;
}

/* Категории */
.ws-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ws-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--glass-soft);
  border: 1px solid var(--glass-line);
  cursor: pointer;
  transition: all var(--t);
  font-size: 13px;
  color: var(--text-3);
}

.ws-cat-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-line-hover);
  color: var(--text-2);
}

.ws-cat-item.on {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.ws-cat-check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t);
  position: relative;
}

.ws-cat-check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: scale(0);
  transition: transform var(--t);
}

.ws-cat-item.on .ws-cat-check {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.ws-cat-item.on .ws-cat-check::after { transform: scale(1); }

.ws-cat-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Аккаунты */
.ws-acc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-acc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--glass-soft);
  border: 1px solid var(--glass-line);
  transition: all var(--t);
}

.ws-acc-item:hover { border-color: var(--glass-line-hover); }
.ws-acc-item.off { opacity: 0.55; }

.ws-acc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-acc-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.ws-acc-sub {
  font-size: 11.5px;
  color: var(--text-4);
}

/* Консоль */
.ws-console {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ws-console-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-4);
}

.ws-console-dots { display: flex; gap: 6px; }
.ws-console-dot { width: 10px; height: 10px; border-radius: 50%; }
.ws-console-dot.red { background: rgba(255, 95, 87, 0.7); }
.ws-console-dot.yellow { background: rgba(254, 188, 46, 0.7); }
.ws-console-dot.green { background: rgba(40, 200, 64, 0.7); }

.ws-console-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.ws-console-status {
  color: rgba(160, 220, 180, 0.9);
  font-weight: 600;
}

.ws-console-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 20px 22px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  max-height: 420px;
  overflow-y: auto;
}

.ws-console-line {
  display: flex;
  gap: 14px;
  animation: logLineIn 200ms ease both;
}

.ws-console-time { color: var(--text-4); flex-shrink: 0; }

.ws-console-msg { color: var(--text-2); word-break: break-word; }

.ws-console-line.ok .ws-console-msg { color: var(--ok); }
.ws-console-line.err .ws-console-msg { color: var(--err); }
.ws-console-line.warn .ws-console-msg { color: var(--warn); }
.ws-console-line.info .ws-console-msg { color: rgba(180, 210, 255, 0.9); }
.ws-console-line.dim .ws-console-msg { color: var(--text-4); }

/* Правая колонка */
.ws-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ws-side-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.ws-side-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.ws-side-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-4);
}

.ws-side-value {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.ws-side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-line);
}

.ws-side-row:last-child { border-bottom: none; }

.ws-side-row b {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Адаптив */
@media (max-width: 1200px) {
  .workspace { grid-template-columns: 1fr; }
  .ws-side { display: none; }
}
@media (max-width: 900px) {
  .ws-body { grid-template-columns: 1fr; }
  .ws-form-row,
  .ws-form-row-3 { grid-template-columns: 1fr; }
  .ws-cat-grid { grid-template-columns: 1fr; }
}