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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #222;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1.5rem;
  background: #1a1a2e;
  color: #fff;
}
nav a { color: #ccc; text-decoration: none; }
nav a:hover { color: #fff; }
.spacer { flex: 1; }
.user-info { color: #aaa; font-size: .85rem; }
.btn-link { background: none; border: none; color: #ccc; cursor: pointer; font-size: 14px; }
.btn-link:hover { color: #fff; }

main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

h1 { font-size: 1.4rem; margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
thead { background: #f0f0f0; }
th, td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid #e8e8e8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.row-inactive td { opacity: .55; }
.muted { color: #999; font-size: .85rem; }

.inline-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.inline-form input { padding: .4rem .7rem; border: 1px solid #ccc; border-radius: 4px; flex: 1; max-width: 320px; }

details.create-form { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: .8rem 1rem; margin-bottom: 1rem; }
details.create-form summary { cursor: pointer; font-weight: 600; color: #333; }
details.create-form form { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; margin-top: .8rem; }
details.create-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: #555; }
details.create-form input, details.create-form select {
  padding: .4rem .6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; min-width: 160px;
}

button[type="submit"], button {
  padding: .4rem .9rem; border: none; border-radius: 4px;
  background: #2563eb; color: #fff; cursor: pointer; font-size: 14px;
}
button:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; }
.btn-warning:hover { background: #b45309; }
.btn-success { background: #16a34a; }
.btn-success:hover { background: #15803d; }

.alert { padding: .6rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.actions { white-space: nowrap; }
details.action-menu { display: inline-block; position: relative; }
details.action-menu summary { cursor: pointer; list-style: none; padding: .3rem .6rem; border: 1px solid #ddd; border-radius: 4px; }
details.action-menu .action-panel {
  position: absolute; right: 0; top: 2rem; background: #fff;
  border: 1px solid #ddd; border-radius: 6px; padding: .8rem;
  z-index: 100; min-width: 240px; box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: flex; flex-direction: column; gap: .6rem;
}
details.action-menu form { display: flex; gap: .4rem; align-items: center; }
details.action-menu input { flex: 1; padding: .35rem .5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }

code { background: #f0f0f0; padding: .1rem .4rem; border-radius: 3px; font-size: .85rem; }

/* Login page */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.12); width: 360px; }
.login-box h1 { text-align: center; margin-bottom: .2rem; }
.login-box .subtitle { text-align: center; color: #888; font-size: .85rem; margin-bottom: 1.2rem; }
.login-box form { display: flex; flex-direction: column; gap: .8rem; }
.login-box label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: #555; }
.login-box input { padding: .5rem .7rem; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.login-box button { padding: .6rem; margin-top: .3rem; }
