:root {
  --primary: #3B7BBF;
  --dark: #1A1A2E;
  --accent: #2ECC71;
  --bg: #e8edf2;
  --text: #555;
  --danger: #C0392B;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--dark);
  color: #fff;
  padding: 24px 0;
}
.sidebar-brand { font-weight: 700; font-size: 18px; color: #fff; padding: 0 24px 24px; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-nav a {
  color: #cfd8ec;
  padding: 12px 24px;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }

.sidebar-section-label {
  padding: 18px 24px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #7c88a6;
}
.sidebar-nav .sidebar-sublink {
  padding: 10px 24px 10px 36px;
  font-size: 13px;
}
.sidebar-sublink-disabled {
  display: block;
  color: #5a6482;
  cursor: default;
}
.sidebar-sublink-disabled:hover {
  background: none;
  color: #5a6482;
  text-decoration: none;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  box-shadow: 0 1px 0 rgba(26, 26, 46, 0.06);
}
.topbar .user-info { font-size: 14px; font-weight: 600; color: var(--dark); }

.content { flex: 1; }

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 24px;
}

.center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(26, 26, 46, 0.12);
  padding: 40px 48px;
}
.card.narrow { max-width: 420px; width: 100%; }

.bar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 1px;
  margin-bottom: 24px;
}

h1 { color: var(--dark); margin: 0 0 8px; font-size: 26px; }
h2 { color: var(--dark); margin: 0 0 16px; font-size: 20px; }
p { margin: 0 0 16px; }

.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(26, 26, 46, 0.08);
  padding: 20px 24px;
  flex: 1;
}
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: #9CA3AF; text-transform: uppercase; letter-spacing: .04em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 204, 113, 0.12);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.meta { margin-top: 24px; font-size: 13px; color: #9CA3AF; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d5dbe3;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--primary); }

button, .btn {
  display: inline-block;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #eee;
  color: var(--text);
}
button.primary, .btn.primary { background: var(--primary); color: #fff; }
button.primary:hover, .btn.primary:hover { background: #326ba8; }
button.danger { background: var(--danger); color: #fff; }
button.small { padding: 6px 12px; font-size: 12px; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 5px; overflow: hidden; box-shadow: 0 6px 18px rgba(26,26,46,0.06); }
table.data th, table.data td { padding: 12px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid #eef1f5; }
table.data th { background: var(--bg); color: var(--dark); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data th.col-time, table.data td.col-time { white-space: nowrap; width: 1%; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: #f7f9fb; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active { background: rgba(46, 204, 113, 0.12); color: var(--accent); }
.badge.inactive { background: rgba(192, 57, 43, 0.1); color: var(--danger); }
.badge.role { background: rgba(59, 123, 191, 0.12); color: var(--primary); }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: rgba(46, 204, 113, 0.12); color: #1e8449; }
.alert-error { background: rgba(192, 57, 43, 0.1); color: var(--danger); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.toolbar form { display: flex; gap: 8px; margin: 0; }
.toolbar input[type="text"] { margin-bottom: 0; min-width: 240px; }

.actions { display: flex; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }

.audit-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.audit-subnav {
  display: flex;
  flex-direction: column;
  width: 180px;
  flex-shrink: 0;
  gap: 4px;
}
.audit-subnav a {
  display: block;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  border-left: 3px solid transparent;
}
.audit-subnav a:hover {
  background: var(--bg);
  text-decoration: none;
}
.audit-subnav a.active {
  background: rgba(59, 123, 191, 0.1);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.audit-report {
  flex: 1;
  min-width: 0;
}
