* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans'; background:#f6f7fb; color:#222; }
a { color: #0a58ca; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px; }
.header { background: #fff; border-bottom: 1px solid #e7e9ee; }
.header .container { display:flex; align-items:center; gap:20px; }
.header .brand { font-weight: 700; }
.nav a { margin-right: 14px; }
.card { background: #fff; border: 1px solid #e7e9ee; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.btn { display:inline-block; padding:8px 14px; border-radius: 10px; background:#0a58ca; color:#fff; border:0; cursor:pointer; }
.btn.secondary { background:#6c757d; }
.input, select, textarea { width:100%; padding:10px 12px; border:1px solid #d9dce3; border-radius:10px; }
.grid { display:grid; gap:12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom:1px solid #eceff3; padding:10px; text-align:left; }
.flash { padding:10px 12px; border-radius:10px; margin-bottom:12px; }
.flash.ok { background:#e7f7ee; color:#1e7e34; }
.flash.err { background:#fdeeee; color:#b02a37; }
.small { color:#666; font-size: 12px; }

/* Chat styles - Modern clean design */
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  margin-bottom: 8px;
}

.chat-message-wrapper-own {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message-wrapper-other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-message {
  position: relative;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  word-wrap: break-word;
  max-width: 100%;
  display: inline-block;
}

.chat-message-own {
  background: #0a58ca;
  color: #fff;
}

.chat-message-other {
  background: #fff;
  color: #1a1a1a;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}

.chat-message-header strong {
  font-weight: 600;
  color: #5288c1;
}

.chat-role {
  color: #707579;
  font-size: 12px;
  font-weight: 400;
}

.chat-time {
  color: #707579;
  font-size: 11px;
}

.chat-message-text {
  color: #000;
  line-height: 1.4;
  word-wrap: break-word;
  font-size: 15px;
}

#chat-message:disabled,
#chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Unread badge */
.unread-badge {
  display: none;
  background: #0a58ca;
  color: white;
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(10,88,202,0.3);
}

.unread-badge:not([style*="display: none"]) {
  display: inline-block !important;
}
