* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6f8;
  color: #1a1d23;
}

.auth-screen {
  max-width: 380px;
  margin: 10vh auto;
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.auth-screen h1 { font-size: 20px; margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.auth-form input { padding: 9px 10px; border: 1px solid #d6d9de; border-radius: 6px; font-size: 14px; }
.auth-toggle { margin-top: 16px; font-size: 13px; }
.hint { font-size: 12px; color: #777; }

button {
  background: #1a1d23;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: #34383f; }
#assign-cancel, #cancel-edit, #back-to-list, #logout-btn {
  background: #e8e9ec;
  color: #1a1d23;
}
#assign-cancel:hover, #cancel-edit:hover, #back-to-list:hover, #logout-btn:hover { background: #d8dade; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #1a1d23;
  color: #cfd2d8;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar .brand { font-weight: 600; color: #fff; padding: 0 16px 16px; font-size: 15px; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #7a7e88; padding: 12px 16px 4px; }
.nav-link { display: block; padding: 7px 16px; color: #cfd2d8; text-decoration: none; font-size: 13.5px; }
.nav-link:hover { background: #262a32; }
.nav-link.active { background: #2f3440; color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid #2a2e36; }
.whoami { font-size: 11px; color: #9297a0; margin-bottom: 8px; word-break: break-all; }

.content { flex: 1; padding: 28px 36px; overflow-x: auto; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.content-header h2 { margin: 0; font-size: 19px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.data-table th, .data-table td { text-align: left; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid #eef0f2; }
.data-table th { background: #fafbfc; color: #666; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.data-table .row-actions a { margin-right: 12px; font-size: 13px; }
.data-table .empty { color: #999; text-align: center; padding: 24px; }

.edit-form { max-width: 640px; background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: #444; }
.field input[type=text], .field input[type=number], .field input[type=date], .field select, .field textarea {
  padding: 8px 10px; border: 1px solid #d6d9de; border-radius: 6px; font-size: 13.5px; font-family: inherit;
}
.checkbox-field label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-field input { width: auto; }

.extra-specs { border-top: 1px solid #eee; padding-top: 14px; margin-top: 6px; }
.extra-spec-row { display: flex; gap: 8px; margin-bottom: 6px; }
.extra-spec-row input { flex: 1; padding: 7px 9px; border: 1px solid #d6d9de; border-radius: 6px; font-size: 13px; }
.extra-spec-row button { background: #e8e9ec; color: #1a1d23; padding: 4px 10px; }

.history-list { max-width: 700px; }
.history-entry { background: #fff; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-meta { display: flex; gap: 12px; font-size: 13px; color: #555; align-items: center; }
.history-op { font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.history-op-INSERT { background: #dff5e1; color: #1e7a34; }
.history-op-UPDATE { background: #e1ecfb; color: #1a5cb3; }
.history-op-DELETE { background: #fbe1e1; color: #b31a1a; }
.history-entry button { font-size: 12px; padding: 6px 10px; }

.role-chip { display: inline-block; background: #eef0f3; border-radius: 12px; padding: 3px 10px; font-size: 12px; margin: 2px 4px 2px 0; }
.role-chip a { color: #b31a1a; margin-left: 6px; text-decoration: none; font-weight: 700; }

.assign-form { max-width: 420px; background: #fff; padding: 20px; border-radius: 8px; margin-top: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 12px; }
.assign-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #444; }
.assign-form select { padding: 8px; border: 1px solid #d6d9de; border-radius: 6px; }
.assign-form button { align-self: flex-start; }

.error { color: #b31a1a; font-size: 13px; min-height: 16px; }
.loading { color: #777; padding: 20px 0; }
