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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f6f8;
  color: #333;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 360px;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 22px;
}

.form-item { margin-bottom: 16px; }

.form-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
}

.form-item input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-item input:focus { border-color: #667eea; }

.btn-primary {
  width: 100%;
  padding: 10px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: #5568d3; }

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo { font-size: 18px; font-weight: 600; color: #333; }

.user-info { font-size: 14px; color: #666; display: flex; align-items: center; gap: 12px; }

.btn-link {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  font-size: 14px;
}

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

.toolbar {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.input-search {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  width: 200px;
  outline: none;
}

.input-search:focus { border-color: #667eea; }

.input-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.btn-secondary {
  padding: 8px 16px;
  background: #fff;
  color: #555;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: #667eea; color: #667eea; }

.stats { font-size: 13px; color: #999; display: flex; gap: 16px; }

.message-list {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.message-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.message-item:hover { background: #fafbfc; }

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

.msg-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.msg-sender {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.msg-time {
  font-size: 12px;
  color: #999;
}

.msg-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 8px;
  word-break: break-all;
}

.msg-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
  flex-wrap: wrap;
}

.msg-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-code {
  background: #fff7e6;
  color: #fa8c16;
  border: 1px solid #ffd591;
}

.tag-carrier {
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}

.tag-location {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.tag-service {
  background: #f0f0f0;
  color: #666;
  border: 1px solid #d9d9d9;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
}

.pagination span { font-size: 14px; color: #666; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

@media (max-width: 600px) {
  .input-search { width: 140px; }
  .msg-header { flex-direction: column; gap: 4px; }
}
