* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #1f2430;
}
.topnav {
  background: #1f2430;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topnav a { color: #cfd3dc; text-decoration: none; font-size: 14px; }
.topnav a:hover { color: #fff; }
.topnav .brand { font-weight: 700; color: #fff; font-size: 16px; margin-right: auto; }
.btn-primary-nav {
  background: #4f7dff; color: #fff !important; padding: 6px 12px; border-radius: 6px;
}

.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }

.flash {
  background: #e6f4ea; border: 1px solid #b7dfc0; color: #205125;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px;
}

h1 { font-size: 22px; margin-bottom: 8px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.stats-row { display: flex; gap: 16px; margin: 16px 0 24px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 16px 24px; flex: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-card.stat-warning { border-left: 4px solid #e0a12e; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: #6b7280; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.table th { background: #fafafa; color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.table a { color: #4f7dff; text-decoration: none; }

.filter-row { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-row input, .filter-row select { padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; }

.badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; }
.badge-active { background: #e6f0ff; color: #2957c9; }
.badge-vip { background: #fff2d9; color: #a9660a; }
.badge-inactive { background: #eee; color: #777; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; margin: 2px 4px 2px 0;
}
.tag-remove { border: none; background: none; cursor: pointer; font-weight: bold; color: inherit; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-card { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.form-card label { font-size: 12px; color: #6b7280; margin-top: 6px; }
.form-card input, .form-card select, .form-card textarea {
  padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}

.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

.btn-primary, .btn-small {
  border: none; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-primary { background: #4f7dff; color: #fff; padding: 9px 18px; margin-top: 10px; align-self: flex-start; }
.btn-small { background: #eef1f6; color: #333; padding: 6px 12px; font-size: 13px; }

.reminder-row, .note-row, .msg-row {
  padding: 8px 0; border-bottom: 1px solid #f0f0f0;
  display: flex; justify-content: space-between; align-items: center; font-size: 14px;
}
.reminder-row.overdue { color: #b3261e; font-weight: 600; }
.reminder-row.done { color: #999; text-decoration: line-through; }
.done-label { font-size: 12px; color: #2a9d4a; }

.note-row { flex-direction: column; align-items: flex-start; }
.note-time { font-size: 11px; color: #999; margin-top: 2px; }

.msg-row { flex-direction: column; align-items: flex-start; gap: 2px; }
.msg-out { background: #f4f8ff; padding: 8px; border-radius: 6px; }
.msg-in { background: #fff8ea; padding: 8px; border-radius: 6px; }
.msg-dir { font-size: 11px; color: #6b7280; text-transform: uppercase; }
.msg-time { font-size: 11px; color: #aaa; }

.empty { color: #888; font-size: 14px; }
