html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #1e0f06;
  font-family: 'Nunito', Arial, sans-serif;
  color: #f0dcc0;
  overflow: hidden; /* full app feel */
}
.panel {
  background: #2a1206;
  padding: 28px;
  border-radius: 14px;
  width: 330px;
  box-shadow: 0 0 22px rgba(0,0,0,0.45);
  animation: fadeIn 0.3s ease-out;
}

input {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #3a1a06;
  color: #f0dcc0;
}

button {
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  background: #5a2e08;
  color: #f0dcc0;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: #8b4a10;
}

#error {
  color: #c0392b;
  margin-top: 10px;
  text-align: center;
  min-height: 20px;
}

/* BADGES */
.badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
}

.badge-ceo { background: #d4a96a; color: #1e0f06; font-weight: 700; }
.badge-admin { background: #8b4a10; color: #f0dcc0; }
.badge-staff { background: #bf9668; color: #1e0f06; }

/* FULLSCREEN CHAT */
.chat-container {
  width: 100%;
  height: 100vh;
  background: #2a1206;
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

/* HEADER */
.chat-header {
  padding: 16px 22px;
  border-bottom: 1px solid #3a1a06;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-link,
.logout-link {
  color: #c9a87c;
  text-decoration: none;
  font-size: 13px;
}

.admin-link:hover,
.logout-link:hover {
  text-decoration: underline;
}

#seen-indicator {
  font-size: 12px;
  color: #9e7848;
}

/* MESSAGES AREA */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.message {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #3a1a06;
  border-radius: 12px;
  position: relative;
}

.message-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-user {
  font-weight: bold;
  font-size: 14px;
}

.message-content {
  margin-top: 6px;
  font-size: 15px;
}

.message-text {
  display: inline-block;
  margin-bottom: 6px;
}

.edited-tag {
  font-size: 11px;
  color: #9e7848;
}

/* MEDIA */
.msg-media {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  border-radius: 10px;
}

.img-media,
.video-media {
  max-height: 320px;
  object-fit: cover;
}

/* 3-DOT MENU */
.message-menu {
  position: relative;
}

.menu-btn {
  background: transparent;
  border: none;
  color: #9e7848;
  font-size: 18px;
  padding: 0 6px;
  cursor: pointer;
}

.menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 20px;
  background: #2a1206;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  overflow: hidden;
  z-index: 10;
}

.menu-dropdown button {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  text-align: left;
  font-size: 14px;
}

.menu-dropdown button:hover {
  background: #3a1a06;
}

.menu-dropdown.show {
  display: block;
}

/* INPUT BAR */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid #3a1a06;
  background: #2a1206;
}

#chat-form {
  display: flex;
  gap: 10px;
}

#message-input {
  flex: 1;
  padding: 14px;
  font-size: 15px;
}

#file-input {
  max-width: 160px;
  font-size: 12px;
}

/* ADMIN DASHBOARD */
.admin-container {
  width: 100%;
  height: 100vh;
  background: #2a1206;
  border-radius: 0;
  padding: 20px;
  box-shadow: none;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3a1a06;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.admin-actions {
  margin-bottom: 24px;
}

.admin-form-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.admin-form-row input {
  flex: 1;
}

.admin-note {
  font-size: 13px;
  color: #9e7848;
  margin-top: 8px;
}

.logs-list {
  max-height: 350px;
  overflow-y: auto;
  background: #3a1a06;
  border-radius: 12px;
  padding: 10px;
}

.log-item {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid #4a2008;
}

.log-item:last-child {
  border-bottom: none;
}

.log-time {
  color: #9e7848;
  margin-right: 10px;
}

.auth-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;       
  border: 3px solid #8b4a10;
  object-fit: cover;  
  margin-bottom: 15px;
}

.video-media {
  width: 260px;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 6px;
  background: #000;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #1e0f06;
  font-family: 'Nunito', sans-serif;
}

.auth-box {
  background: #1e0f06;
  padding: 40px 50px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(158, 120, 72, 0.2);
  width: 420px;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
  animation: fadeIn 0.4s ease;
  text-align: center;
}

.auth-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 15px;
}

.auth-box h2 {
  color: #f0dcc0;
  font-size: 28px;
  margin-bottom: 25px;
  font-weight: 600;
}

.auth-box input {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #3a1a06;
  background: #2a1206;
  color: #f0dcc0;
  font-size: 16px;
  transition: 0.2s;
}

.auth-box input:focus {
  border-color: #8b4a10;
  background: #3a1a06;
  outline: none;
}

.auth-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #8b4a10, #5a2e08);
  border: none;
  border-radius: 10px;
  color: #f0dcc0;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.auth-box button:hover {
  background: linear-gradient(135deg, #a05a20, #6b3e1e);
}

.message-timestamp {
  font-size: 12px;
  color: #6b5030;
  margin-left: 10px;
}

.home-header-btn {
  border: none;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.home-header-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}


/* MOBILE */
@media (max-width: 700px) {

.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1e0f06;
  padding: 12px;
  box-sizing: border-box;
  border-top: 1px solid #3a1a06;
  z-index: 9999;
}

#chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#message-input {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  box-sizing: border-box;
}

.file-btn {
  width: 40px;
  height: 40px;
  background: #2a1206;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

button[type="submit"] {
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: 10px;
  white-space: nowrap;
}

.messages {
  padding-bottom: 110px !important;
}

.file-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  overflow: hidden;
}

#file-input {
  font-size: 12px;
  max-width: 120px;
}

#file-name {
  font-size: 0.85rem;
  color: #c9a87c;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100px;
}

  .auth-panel {
    padding: 22px;
    max-width: 100%;
  }

  .auth-panel input,
  .auth-panel button {
    font-size: 1rem;
    padding: 15px;
  }
  .home-header-btn {
    padding: 4px;
    border-radius: 6px;
  }

  .home-header-btn img {
    width: 18px;
    height: 18px;
  }
}