/* rdesk design system — единый стиль для viewer и dashboard.
 *
 * Цветовая палитра построена на градиенте логотипа #0077B6 → #6C3CE9.
 * Тёмная тема, минимализм, glassmorphism для модалок.
 */

:root {
  color-scheme: dark;

  /* Brand */
  --brand-blue:   #0077B6;
  --brand-purple: #6C3CE9;
  --brand-grad:   linear-gradient(135deg, #0077B6 0%, #6C3CE9 100%);
  --brand-grad-r: linear-gradient(135deg, #6C3CE9 0%, #0077B6 100%);

  /* Surfaces */
  --bg-0: #07070c;
  --bg-1: #0e0e15;
  --bg-2: #15151f;
  --bg-3: #1c1c2a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border:  rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text:    #f3f3f7;
  --text-2:  #b0b3c4;
  --text-3:  #6e7188;

  /* Semantic */
  --success: #22c55e;
  --warn:    #f59e0b;
  --error:   #ef4444;

  /* Radius / shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(108, 60, 233, 0.35);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(0, 119, 182, 0.12), transparent 60%),
    radial-gradient(ellipse 80% 60% at 80% 100%, rgba(108, 60, 233, 0.10), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
a:hover { color: #fff; border-bottom-color: var(--brand-purple); }

/* ---------- Layout ----------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(15, 15, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.app-header .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
.app-header .brand img { width: 28px; height: 28px; }
.app-header .brand .name {
  font-size: 16px;
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.app-header .grow { flex: 1; }
.app-header .nav { display: flex; gap: 4px; align-items: center; font-size: 13px; color: var(--text-2); }
.app-header .nav a { padding: 6px 10px; border-radius: var(--r-sm); }
.app-header .nav a:hover { background: var(--surface); border-bottom-color: transparent; }
.app-header .nav .sep { opacity: 0.3; }

.main-narrow {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------------------------------------------- */
.btn {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font: inherit; font-weight: 500;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 8px 24px rgba(108, 60, 233, 0.35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--bg-3); color: var(--text-3); cursor: not-allowed; box-shadow: none; }

.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost:hover { background: var(--surface-hover); box-shadow: none; border-color: var(--border-strong); }

.btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Forms ------------------------------------------------ */
.input {
  width: 100%;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand-purple);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px rgba(108, 60, 233, 0.2);
}
.input::placeholder { color: var(--text-3); }

.label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin: 14px 0 6px;
  font-weight: 500;
}

/* ---------- Cards ----------------------------------------------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 119, 182, 0.6), rgba(108, 60, 233, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.4;
}

/* ---------- Misc -------------------------------------------------- */
.err {
  color: var(--error);
  font-size: 13px;
  margin-top: 10px;
}
.muted { color: var(--text-2); }
.tiny  { font-size: 12px; color: var(--text-3); }

.row { display: flex; gap: 10px; }
.row.mt { margin-top: 16px; }
.row > .grow { flex: 1; }

/* Скроллбар тонкий */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
