* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Source Sans Pro', Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  background: #1a1a2e;
  min-height: 100vh;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 48px 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.login-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.login-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.login-header p {
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: #04AA6D;
}

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  min-height: 20px;
  text-align: left;
  padding-left: 4px;
}

.btn-login {
  background: #04AA6D;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-login:hover {
  background: #039960;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #888;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #04AA6D;
}

/* ===== ADMIN PANEL ===== */
.admin-topbar {
  background: #16213e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  border-bottom: 1px solid #1a1a40;
}

.admin-logo {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.btn-back:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.btn-logout {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: #c0392b;
}

/* ===== ADMIN BODY ===== */
.admin-body {
  display: flex;
  min-height: calc(100vh - 56px);
}

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: #16213e;
  padding: 24px 0;
}

.admin-sidebar h3 {
  color: #666;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 20px;
  margin-bottom: 12px;
}

.admin-nav-link {
  display: block;
  color: #aaa;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.admin-nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: #fff;
}

.admin-nav-link.active {
  color: #04AA6D;
  border-left-color: #04AA6D;
  background: rgba(4,170,109,0.08);
}

/* ===== ADMIN CONTENT ===== */
.admin-content {
  flex: 1;
  padding: 32px;
  background: #0f3460;
  overflow-y: auto;
}

.section-header {
  margin-bottom: 28px;
}

.section-header h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-header p {
  color: #8899aa;
  font-size: 14px;
}

/* ===== WORD CARDS ===== */
.words-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.word-card {
  background: #16213e;
  border-radius: 10px;
  padding: 20px 24px;
  border: 1px solid #1a1a50;
  transition: border-color 0.2s;
}

.word-card:hover {
  border-color: #04AA6D;
}

.word-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.word-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.word-index {
  background: #04AA6D;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.word-name {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: Consolas, "Courier New", monospace;
  background: rgba(255,255,255,0.06);
  padding: 4px 12px;
  border-radius: 6px;
}

.word-context {
  color: #667;
  font-size: 12px;
  font-style: italic;
}

.word-card-body {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.word-card-body textarea {
  flex: 1;
  background: #0f3460;
  border: 1px solid #1a1a50;
  color: #ddd;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: border-color 0.2s;
}

.word-card-body textarea:focus {
  border-color: #04AA6D;
}

.word-card-body textarea::placeholder {
  color: #445;
}

/* ===== SAVE BAR ===== */
.save-bar {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-save {
  background: #04AA6D;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #039960;
}

.save-status {
  color: #04AA6D;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-status.show {
  opacity: 1;
}

/* ===== SETTINGS ===== */
.settings-card {
  background: #16213e;
  border-radius: 10px;
  padding: 24px;
  border: 1px solid #1a1a50;
  margin-bottom: 20px;
}

.settings-card h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 16px;
}

.settings-card p {
  color: #8899aa;
  font-size: 14px;
  margin-bottom: 12px;
}

.settings-row {
  margin-bottom: 14px;
}

.settings-row label {
  display: block;
  color: #8899aa;
  font-size: 13px;
  margin-bottom: 4px;
}

.settings-row input {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  background: #0f3460;
  border: 1px solid #1a1a50;
  color: #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.settings-row input:focus {
  border-color: #04AA6D;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: #c0392b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-sidebar {
    display: none;
  }

  .admin-content {
    padding: 20px 16px;
  }

  .word-card {
    padding: 16px;
  }

  .word-card-body {
    flex-direction: column;
  }

  .admin-topbar {
    padding: 0 12px;
  }
}

/* ===== MESSAGES ===== */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-empty {
  color: #667;
  font-style: italic;
  font-size: 14px;
}

.msg-card {
  background: #16213e;
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid #1a1a50;
}

.msg-time {
  color: #04AA6D;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.msg-text {
  color: #ddd;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  background: #0f3460;
  padding: 12px 14px;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
}
