* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
  background: #0e1013;
  color: #e5e7eb;
  min-height: 100%;
  line-height: 1.5;
}

a { color: #d49061; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: #1a1d22;
  border: 1px solid #272b31;
  border-radius: 12px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

h1 { margin: 0 0 6px 0; font-size: 28px; letter-spacing: -0.3px; }
h2 { margin: 0 0 20px 0; font-size: 16px; font-weight: 500; color: #9ca3af; }

label { display: block; margin-bottom: 8px; color: #9ca3af; font-size: 14px; }
input[type=text],
input[type=password] {
  width: 100%;
  padding: 12px 14px;
  background: #0e1013;
  border: 1px solid #272b31;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
input:focus { border-color: #d49061; }

button {
  background: #d49061;
  color: #0e1013;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s, opacity .15s;
  font-family: inherit;
}
button:hover { background: #e0a076; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary { background: #272b31; color: #e5e7eb; }
button.secondary:hover { background: #343940; }

button.danger { background: #7a3030; color: #fee2e2; }
button.danger:hover { background: #933a3a; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

.error {
  background: #3a1e1e;
  border: 1px solid #7a3030;
  color: #fecaca;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.success {
  background: #1e3a28;
  border: 1px solid #2f6b40;
  color: #b8e8c8;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Админ-шапка */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #1a1d22;
  background: #0e1013;
}
.app-header .brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.app-header .sub {
  font-size: 13px;
  color: #6b7280;
  margin-left: 10px;
}

/* Список комнат */
.rooms-list { display: grid; gap: 14px; margin-top: 16px; }

.room-card {
  background: #1a1d22;
  border: 1px solid #272b31;
  border-radius: 12px;
  padding: 18px 20px;
}
.room-card.inactive { opacity: 0.55; }

.room-name {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.status-dot.on { background: #7bd88f; box-shadow: 0 0 8px rgba(123, 216, 143, 0.5); }
.status-dot.off { background: #6b7280; }

.room-meta {
  color: #9ca3af;
  font-size: 13px;
  margin-top: 4px;
}

.room-url {
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  background: #0e1013;
  border: 1px solid #272b31;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 10px;
  word-break: break-all;
  color: #c9d1d9;
  user-select: all;
}

.room-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.create-form {
  background: #1a1d22;
  border: 1px solid #272b31;
  border-radius: 12px;
  padding: 18px 20px;
}
.create-form .row { gap: 12px; }
.create-form input { flex: 1; min-width: 200px; }

/* Комната (встреча) */
.setup-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.setup-card { max-width: 460px; width: 100%; }
.setup-card .room-info {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 20px;
}

.meet-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.meet-header {
  padding: 10px 18px;
  background: #0e1013;
  border-bottom: 1px solid #1a1d22;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meet-title { font-size: 15px; font-weight: 600; }

.e2ee-badge {
  font-size: 12px;
  color: #7bd88f;
  background: rgba(123, 216, 143, 0.1);
  border: 1px solid rgba(123, 216, 143, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.participants-grid {
  flex: 1;
  display: grid;
  gap: 8px;
  padding: 8px;
  background: #08090b;
  min-height: 0;
  /* grid-template-columns / rows задаются JS'ом в room.js */
}

.participant {
  position: relative;
  background: #1a1d22;
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.participant .video-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e1013;
}
.participant video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.participant .name-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.participant .no-video {
  color: #6b7280;
  font-size: 13px;
}

.controls {
  padding: 14px;
  background: #0e1013;
  border-top: 1px solid #1a1d22;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.controls button { min-width: 160px; }
