* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6f9;
  color: #1f2937;
}
nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  background: #1e293b;
  color: #e2e8f0;
}
nav a { color: #cbd5e1; text-decoration: none; }
nav a:hover { color: #fff; }
nav .brand { font-weight: 700; color: #fff; }
nav .spacer { flex: 1; }
nav .who small { color: #94a3b8; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 22px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.search { display: flex; gap: 8px; }
.search input { width: 240px; }
.filters { display: flex; gap: 8px; }
.chip {
  padding: 4px 12px; border-radius: 999px; background: #e2e8f0;
  color: #334155; text-decoration: none; font-size: 13px;
}
.chip.active { background: #1e293b; color: #fff; }
.delete-used { margin-left: auto; }

.profile-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  padding: 10px 12px; background: #fff; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.chip.prof { background: #eff6ff; color: #1d4ed8; }
.chip.prof.active { background: #2563eb; color: #fff; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
td.small, .small { font-size: 12px; color: #64748b; }
td.name { font-weight: 600; }
td.empty { text-align: center; color: #94a3b8; padding: 24px; }
tr.row-used { background: #fafafa; }
tr.row-used td.name { color: #9ca3af; text-decoration: line-through; }
tr.row-disabled td.name { color: #d1d5db; }

code.pw {
  font: 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f1f5f9; padding: 3px 8px; border-radius: 6px;
  user-select: all; cursor: pointer;
}

.badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.used { background: #fef3c7; color: #92400e; }
.badge.free { background: #dcfce7; color: #166534; }

.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-right: 6px; }

.comment-form { display: flex; gap: 4px; }
.comment-form input { font-size: 12px; padding: 4px 6px; min-width: 150px; }
.comment-form button { padding: 4px 8px; }

.chk { display: block; font-weight: 400; font-size: 13px; }
fieldset { border: 1px solid #e2e8f0; border-radius: 8px; }
legend { font-size: 12px; color: #64748b; padding: 0 6px; }
.groups-edit summary { cursor: pointer; color: #2563eb; }
.groups-edit form { padding: 6px 0; display: flex; flex-direction: column; gap: 4px; }

input, select, button {
  font: inherit; padding: 7px 10px; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff;
}
button { cursor: pointer; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e2e8f0; border-color: #cbd5e1; }
.btn-danger { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.btn-link { align-self: center; }

.card {
  background: #fff; padding: 20px; border-radius: 10px; max-width: 480px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 14px;
}
.card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.card input, .card select { font-weight: 400; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; }

.nowrap { white-space: nowrap; }
td.name a { color: inherit; text-decoration: none; border-bottom: 1px dashed #94a3b8; }
td.name a:hover { color: #2563eb; border-bottom-color: #2563eb; }

.stat-cards { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 12px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); text-align: center; min-width: 110px;
}
.stat-value { font-size: 20px; font-weight: 700; }
.stat-label { font-size: 12px; color: #64748b; }

.login-box {
  max-width: 360px; margin: 80px auto; background: #fff; padding: 28px;
  border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.login-box h1 { margin-top: 0; text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.login-box button { background: #2563eb; border-color: #2563eb; color: #fff; }
