html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #181920;
  color: #e6e6e6;
  height: 100%;
}

.container {
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px 20px;
  background: #23272f;
  min-height: 60px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.username {
  color: #e6e6e6;
  font-size: 15px;
  white-space: nowrap;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  letter-spacing: 2px;
  font-weight: 600;
}

.user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-badge {
  background: #f59e0b;
  color: #000;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Buttons */
.btn {
  background: #393;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  outline: none;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover {
  background: #4a4;
}

.btn-primary {
  background: #4e8cff;
}

.btn-primary:hover {
  background: #3a7bef;
}

.btn-secondary {
  background: #555;
}

.btn-secondary:hover {
  background: #666;
}

.btn-clean {
  background: #6366f1;
}

.btn-clean:hover {
  background: #4f46e5;
}

.btn-restore {
  background: #f59e0b;
}

.btn-restore:hover {
  background: #d97706;
}

/* Auth page */
.auth-main {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.auth-panel {
  background: #23272f;
  border-radius: 12px;
  padding: 40px;
  min-width: 350px;
}

.auth-panel h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 25px;
}

.auth-panel form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-panel input {
  padding: 12px 18px;
  border-radius: 6px;
  border: none;
  font-size: 16px;
  background: #353a44;
  color: #fff;
}

.auth-panel input:focus {
  outline: 2px solid #4e8cff;
}

.error-message {
  background: #d32f2f;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  text-align: center;
}

#error-container {
  margin-top: 0;
}

/* Logs page */
.logs-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
}

#log-select {
  min-width: 200px;
  max-width: 350px;
  background: #353a44;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

#log-select:focus {
  outline: 2px solid #4e8cff;
}

#search-input {
  background: #353a44;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  width: 200px;
  outline: none;
  flex-shrink: 0;
}

#search-input:focus {
  outline: 2px solid #4e8cff;
}

.log-window {
  flex: 1 1 auto;
  background: #23272f;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#log-info {
  margin-bottom: 10px;
  color: #888;
  font-size: 14px;
  height: 20px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#editor-container {
  flex: 1 1 auto;
  border-radius: 8px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #181920;
}

#editor-container.loaded {
  visibility: visible;
}

/* Admin page */
.admin-section {
  margin-bottom: 30px;
}

.admin-section h2 {
  margin-bottom: 15px;
  margin-top: 0;
  color: #e6e6e6;
  font-size: 1.4em;
}

.admin-table {
  width: 100%;
  background: #23272f;
  border-radius: 8px;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table thead {
  background: #2c323d;
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  color: #a0a0a0;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 12px 16px;
  border-top: 1px solid #2c323d;
  color: #e6e6e6;
  font-size: 14px;
}

.admin-table code {
  background: #353a44;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #4e8cff;
}

.admin-table .loading,
.admin-table .no-data {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #23272f;
  padding: 30px;
  border-radius: 12px;
  min-width: 400px;
  max-width: 600px;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #e6e6e6;
}

.modal-content p {
  margin-bottom: 20px;
  color: #c0c0c0;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.invite-url-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.invite-url-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  background: #353a44;
  color: #fff;
  font-family: 'Courier New', monospace;
}

.invite-url-input:focus {
  outline: 2px solid #4e8cff;
}
