/* =========================================================================
   v2 visual refresh — calmer surfaces, clearer hierarchy, profile identity
   ========================================================================= */

:root {
  --panel-3: #0f1420;
  --ring: rgba(79, 140, 255, .30);
}

body { background: #080a0f; }

/* --- sidebar ------------------------------------------------------------- */
.sidebar { background: #0a0d14; border-right-color: #171c27; padding: 20px 12px 14px; }
.brand { padding: 2px 10px 22px; }
.brand-name { font-size: 17px; letter-spacing: -.015em; }

.sidebar nav { gap: 3px; }
.nav-item {
  padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 500;
  color: #8b95a8; transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: #11161f; color: #e6eaf2; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79,140,255,.16), rgba(79,140,255,.05));
  color: #fff; box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item .ico { width: 17px; font-size: 12px; color: #5d6678; }
.nav-item.active .ico { color: #8fb4ff; }

/* --- profile block ------------------------------------------------------- */
.sidebar-foot { border-top: 1px solid #171c27; padding-top: 12px; }
.profile {
  display: flex; align-items: center; gap: 11px; padding: 8px 9px;
  border-radius: 11px; transition: background .12s ease;
}
.profile:hover { background: #11161f; text-decoration: none; }
.profile-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.profile-name {
  font-size: 13px; font-weight: 600; color: #eef1f7;
  max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  background: linear-gradient(160deg, #1b2230, #121826);
  border: 1px solid #232c3d; color: #5c6577; font-size: 16px; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-q { font-size: 15px; color: #6b7689; }

button.btn.signout, .btn.signout {
  width: 100%; justify-content: center; margin-top: 8px; background: #10151e;
  border-color: #1f2735; color: #9aa5b8; font-weight: 500;
}
.btn.signout:hover { color: #fff; border-color: #2c3648; }

/* --- role badges --------------------------------------------------------- */
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.role-badge .glyph { font-size: 10px; line-height: 1; }
.role-badge.admin {
  background: linear-gradient(135deg, #ff8a00, #ff2d55);
  color: #fff; border-color: rgba(255, 120, 40, .55);
  box-shadow: 0 0 10px rgba(255, 90, 20, .28), inset 0 1px 0 rgba(255,255,255,.25);
}
.role-badge.user {
  background: linear-gradient(135deg, #8b5cf6, #5b6cff);
  color: #fff; border-color: rgba(139, 92, 246, .5);
  box-shadow: 0 0 10px rgba(124, 92, 246, .22);
}
.role-badge.sub {
  background: linear-gradient(135deg, #0ea5a3, #0b84c4);
  color: #fff; border-color: rgba(20, 184, 166, .45);
  box-shadow: 0 0 10px rgba(20, 184, 166, .18);
}

/* --- cards / tables ------------------------------------------------------ */
.card { background: #0d111a; border-color: #1a2130; border-radius: 14px; }
.card-head { padding: 14px 18px; border-bottom-color: #1a2130; background: none; }
.card-head h2 { font-size: 14px; letter-spacing: -.01em; }
.card-body { padding: 18px; }
.table-wrap { border-radius: 12px; }
th {
  background: #0b0f17; font-size: 10px; letter-spacing: .09em;
  color: #61697a; padding: 11px 14px; border-bottom-color: #1a2130;
}
td { padding: 12px 14px; border-bottom-color: #151b26; }
tbody tr:hover td { background: #0f1520; }

/* --- buttons / inputs ---------------------------------------------------- */
.btn { border-radius: 9px; border-color: #202a3a; background: #121926; font-weight: 500; }
.btn:hover { background: #16202f; border-color: #2a3446; }
.btn.primary { background: linear-gradient(180deg, #5b93ff, #3f79ee); border-color: #3f79ee; font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.icon { background: #101722; border-color: #1e2736; color: #8f9ab0; }
.btn.icon:hover { color: #fff; background: #16202f; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=url], select, textarea {
  background: #0a0f18; border-color: #1f2735; border-radius: 9px;
}
input:focus, select:focus, textarea:focus { border-color: #3f79ee; box-shadow: 0 0 0 3px var(--ring); }

.badge { font-size: 10px; letter-spacing: .04em; padding: 3px 9px; }
.badge.ok { background: rgba(35,201,139,.14); }
.stat { background: #0f1520; border-color: #1a2130; border-radius: 12px; }
.stat-value { font-size: 21px; }
.stat-label { font-size: 10px; letter-spacing: .09em; }

/* --- tables: aligned numeric/centre columns ------------------------------ */
td .btn-row { flex-wrap: nowrap; }
table.compact td { vertical-align: middle; }

/* --- login --------------------------------------------------------------- */
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.login { max-width: 400px; }
.login-head { text-align: center; margin-bottom: 4px; }
.login-head .brand-name { font-size: 26px; letter-spacing: -.03em; }
.login .card { margin-top: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.login .card-body { padding: 22px; }
.login .field { margin-bottom: 16px; }
.login .btn.primary { height: 40px; font-size: 13.5px; }

/* --- page header --------------------------------------------------------- */
.topbar { margin-bottom: 20px; }
.topbar h1 { font-size: 19px; letter-spacing: -.02em; }
.topbar-actions { gap: 8px; }

@media (max-width: 760px) {
  .sidebar { padding: 10px; }
  .profile-meta { display: none; }
  .btn.signout { display: none; }
}
