@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  --bg-start: #cdd6e6;
  --bg-end: #b8c3d6;
  --panel: #f8f9fc;
  --panel-strong: #ffffff;
  --text: #1b2230;
  --muted: #7b879b;
  --primary: #2c6bd9;
  --primary-dark: #1f56b7;
  --accent: #3ea1ff;
  --danger: #e05858;
  --success: #4caf7a;
  --shadow: 0 24px 60px rgba(31, 47, 76, 0.14);
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(
      900px 620px at 12% 12%,
      rgba(255, 255, 255, 0.65),
      transparent 60%
    ),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  width: min(1120px, 92vw);
  margin: 34px auto 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}


.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  position: relative;
}

.panel__chrome {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.panel__title {
  font-size: clamp(1.2rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.panel__status {
  color: var(--muted);
  font-size: 0.95rem;
}

.panel__body {
  display: block;
  position: relative;
  min-height: 360px;
}

.status {
  position: absolute;
  left: 24px;
  top: 0;
  width: 200px;
  z-index: 2;
}

.status__item {
  font-size: 0.75rem;
  color: #2b3442;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #eef3ff;
  box-shadow: 0 6px 14px rgba(36, 64, 112, 0.12);
}

.status__muted {
  color: rgba(27, 34, 48, 0.55);
  background: #f3f5f9;
}

.status__ok {
  background: #e7f6ed;
  color: #1f6b3a;
}

.status__err {
  background: #ffecec;
  color: #a63030;
}

.list {
  background: #f7f9fc;
  border-radius: 20px;
  padding: 18px 18px 26px 18px;
  border: 1px solid rgba(22, 44, 73, 0.06);
  height: clamp(360px, 58vh, 520px);
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-left: 84px;
  padding-right: 22px;
}

.list::-webkit-scrollbar {
  width: 10px;
}

.list::-webkit-scrollbar-thumb {
  background: rgba(140, 160, 190, 0.7);
  border-radius: 999px;
}

.list::-webkit-scrollbar-track {
  background: transparent;
}

.list::-webkit-scrollbar-track {
  background: transparent;
}

.row {
  display: grid;
  grid-template-columns: 210px minmax(240px, 1fr) 150px 90px 36px;
  align-items: center;
  gap: 18px;
  padding: 0 6px;
}

.input-wrap {
  position: relative;
}

.input-wrap::after {
  content: attr(data-hint);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: rgba(27, 34, 48, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.input-wrap:hover::after,
.input-wrap:focus-within::after {
  opacity: 1;
}

.input-wrap.has-value::after,
.input-wrap[data-has-value="true"]::after {
  opacity: 0;
}

.input-wrap .input {
  position: relative;
  background: #ffffff;
}

.input-wrap .input:focus + .hint {
  opacity: 0;
}

.row__user {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2b3442;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(45, 68, 102, 0.14);
  font-size: 0.82rem;
  background: #ffffff;
  transition: border var(--transition), box-shadow var(--transition);
  box-shadow: 0 5px 12px rgba(37, 62, 104, 0.08);
}

.input:focus {
  outline: none;
  border-color: rgba(44, 107, 217, 0.65);
  box-shadow: 0 0 0 3px rgba(44, 107, 217, 0.18);
}

.input--wide {
  flex: 1;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(180deg, #3d86e6, #2f6fdd);
  color: #fff;
  box-shadow: 0 8px 14px rgba(44, 107, 217, 0.22);
}

.btn--ghost {
  background: #ffe7e7;
  color: #b53a3a;
  box-shadow: 0 6px 12px rgba(188, 59, 59, 0.18);
}

.btn--danger {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  background: #ffe7e7;
  color: #b53a3a;
  box-shadow: 0 6px 12px rgba(188, 59, 59, 0.18);
  font-size: 0.9rem;
  line-height: 1;
}

.btn--add {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
  line-height: 1;
  background: #e8f0ff;
  color: #2f6fdd;
  box-shadow: 0 8px 14px rgba(44, 107, 217, 0.18);
}

.btn--remove {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.6rem;
  line-height: 1;
  background: #ffe7e7;
  color: #b53a3a;
  box-shadow: 0 8px 14px rgba(188, 59, 59, 0.18);
}


.panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 6px;
}

@media (min-width: 521px) {
  .panel__footer {
    padding-left: 84px;
    padding-right: 22px;
  }
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.page__footer {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(28, 37, 56, 0.55);
}

@media (max-width: 980px) {
  .row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .status {
    position: static;
    width: auto;
    margin-bottom: 10px;
  }
  .list {
    padding-left: 18px;
  }
  .tabs {
    padding-left: 18px;
  }
}

@media (max-width: 720px) {
  .page {
    margin: 28px auto 36px;
  }

  .panel {
    padding: 18px;
  }

  .panel__chrome {
    flex-direction: column;
    align-items: flex-start;
  }

  .list {
    height: clamp(420px, 70vh, 680px);
  }
}

@media (max-width: 520px) {
  body {
    overflow: auto;
  }

  .row {
    gap: 8px;
  }

  .btn,
  .input {
    width: 100%;
  }

  .panel {
    padding: 16px;
    padding-bottom: 120px;
  }

  .list {
    height: calc(78vh - 70px);
    padding-bottom: 120px;
  }

  .panel__footer {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;

    background: var(--panel);
    padding: 12px;
    border-radius: 16px;

    display: flex;
    justify-content: space-between;
    gap: 12px;

    box-shadow: 0 12px 30px rgba(31, 47, 76, 0.18);
  }

  .page__footer {
    font-size: 0.78rem;
  }
}

@media (min-width: 1400px) {
  .page {
    width: min(1320px, 86vw);
  }

  .list {
    max-height: 520px;
  }
}
html,
body {
  height: 100%;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: 1.2ch;
  padding-right: 22px;
  margin-bottom: 12px;
}

.tabs__list {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.tabs__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tabs__action {
  width: 42px;
  height: 42px;
}

.tab {
  border: none !important;
  cursor: pointer;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  height: 36px;
  background: linear-gradient(180deg, #3d86e6, #2f6fdd) !important;
  color: #fff !important;
  box-shadow: 0 8px 14px rgba(44, 107, 217, 0.22) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  background: linear-gradient(135deg, #1f56b7, #2c6bd9) !important;
}

.tab:active {
  transform: scale(0.98);
}

.tab--active {
  background: linear-gradient(180deg, #3d86e6, #2f6fdd) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 14px rgba(44, 107, 217, 0.22) !important;
}

.tab--active:hover {
  background: linear-gradient(135deg, #1f56b7, #2c6bd9) !important;
}

.tab--active:active {
  transform: scale(0.98);
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab__delete {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 10px;
    transition: background 0.2s;
}

.tab__delete:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 980px) {
  .tabs {
    padding-left: 1.2ch;
  }
}

@media (max-width: 520px) {
  .tabs {
    flex-direction: column;
    align-items: stretch;
    padding-left: 18px;
    padding-right: 18px;
  }

  .tabs__list {
    overflow-x: auto;
  }

  .tabs__actions {
    width: 100%;
    justify-content: space-between;
  }

  .tabs__action {
    width: 48%;
    height: 52px;
    font-size: 1.2rem;
  }
}


#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(224, 230, 240, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 350px;
  max-width: calc(100vw - 32px);
}

.auth-card input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 14px;
  border: 1px solid #e0e6f0;
  border-radius: 10px;
  background: #f8f9fb;
  outline: none;
  box-sizing: border-box;
}

.btn-primary {
  background: linear-gradient(180deg, #3d86e6, #2f6fdd);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(44, 107, 217, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.auth-error {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #a63030;
  min-height: 18px;
}

/* Bot Validity Styles */
.row--invalid {
  background: rgba(224, 88, 88, 0.05);
}
.row--invalid .row__user {
  color: var(--danger);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.status-dot--ok { background: var(--success); }
.status-dot--err { background: var(--danger); }
.status-dot--checking {
  background: var(--muted);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}
