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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.muted {
  color: #65676b;
  font-size: 0.9rem;
}

.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  margin-bottom: 4px;
}

.subtitle {
  color: #65676b;
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 12px 0 4px;
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1877f2;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

textarea {
  resize: vertical;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(0.92);
}

.btn.primary {
  background: #1877f2;
  color: #fff;
}

.btn.danger {
  background: #e41e3f;
  color: #fff;
}

.btn.ghost {
  background: #e4e6eb;
  color: #050505;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn.full {
  width: 100%;
  margin-top: 16px;
}

.error {
  background: #ffebe9;
  border: 1px solid #ffc2c9;
  color: #c0392b;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.notice {
  background: #fff8e1;
  border: 1px solid #ffe08a;
  color: #8a6d00;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.topbar {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
}

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

.topbar-right a {
  color: #1877f2;
  text-decoration: none;
  font-weight: 600;
}

.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 140px;
}

.inline-form .btn {
  flex: 0 0 auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e4e6eb;
}

.data-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #65676b;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge.admin {
  background: #e7f3ff;
  color: #1877f2;
}

.badge.user {
  background: #e9ebee;
  color: #444;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal {
  width: 100%;
  max-width: 420px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-error {
  margin-top: 10px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  border: 1px solid #e4e6eb;
  border-radius: 8px;
  padding: 14px 16px;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-title {
  font-weight: 700;
}

.item-content {
  margin-top: 6px;
  white-space: pre-wrap;
  color: #333;
}

.item-time {
  margin-top: 8px;
}

.tts-actions {
  margin-top: 14px;
}

.tts-result {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tts-result audio {
  flex: 1;
  min-width: 220px;
}
