:root {
  --ink: #e5eef9;
  --muted: #94a3b8;
  --surface: rgba(15, 23, 42, 0.88);
  --surface-strong: #0f172a;
  --border: rgba(148, 163, 184, 0.16);
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
  --accent: #60a5fa;
  --accent-2: #2dd4bf;
}

html {
  font-size: 15px;
}

body {
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Segoe UI", sans-serif;
}

.app-shell,
.auth-shell {
  min-height: 100vh;
  background: linear-gradient(145deg, #060b16 0%, #0b1120 45%, #050814 100%);
}

.app-background {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.16), transparent 30%),
    radial-gradient(circle at right center, rgba(45, 212, 191, 0.12), transparent 28%);
  pointer-events: none;
}

.app-layout {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.94);
  color: #e2e8f0;
  backdrop-filter: blur(18px);
}

.brand-wrap {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 2rem;
}

.brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, #38bdf8, #0ea5e9);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 14px 24px rgba(29, 78, 216, 0.3);
}

.brand-image {
  object-fit: cover;
  border-radius: 0.9rem;
  padding: 0;
}

.brand-mark-large {
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 1.1rem;
  font-size: 1rem;
}

.brand-mark-large {
  width: 3.5rem;
  height: 3.5rem;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-subtitle,
.page-kicker,
.metric-caption,
.metric-label,
.sidebar-footer .small {
  color: rgba(226, 232, 240, 0.72);
}

.page-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.sidebar-nav {
  gap: 0.5rem;
}

.nav-group-label {
  margin-top: 0.25rem;
  margin-bottom: 0.1rem;
  padding: 0 1rem;
  color: rgba(226, 232, 240, 0.55);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.menu-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  font-size: 1rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.role-admin {
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

.role-user {
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}

.role-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.sidebar-nav .nav-link i,
.list-group-item i {
  width: 1.25rem;
  text-align: center;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  color: rgba(226, 232, 240, 0.84);
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.badge-soft {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
}

.main-pane {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1rem 1rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: rgba(148, 163, 184, 0.10);
  color: #e2e8f0;
}

.page-title {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #1d4ed8, #0f766e);
  color: #fff;
  font-weight: 700;
}

.avatar-circle-sm {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.95rem;
}

.user-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.28);
}

.user-avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
}

.content-wrap {
  padding: 1.5rem;
}

.metric-card,
.auth-card {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  background: var(--surface-strong);
  color: var(--ink);
}

.metric-card-primary {
  background: linear-gradient(145deg, #1d4ed8, #2563eb);
  color: #fff;
}

.metric-card-primary .metric-caption,
.metric-card-primary .metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.metric-value {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.metric-caption {
  margin-top: 0.4rem;
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-new {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.status-inprogress {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.status-completed {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.white-space-preline {
  white-space: pre-line;
}

.auth-shell {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-panel {
  position: relative;
  width: min(100%, 980px);
  padding: 1.5rem;
}

.auth-card {
  width: min(100%, 540px);
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.75;
}

.auth-orb-one {
  top: 8%;
  left: 8%;
  width: 18rem;
  height: 18rem;
  background: rgba(29, 78, 216, 0.18);
}

.auth-orb-two {
  right: 8%;
  bottom: 8%;
  width: 20rem;
  height: 20rem;
  background: rgba(15, 118, 110, 0.16);
}

.table > :not(caption) > * > * {
  padding: 1rem 0.85rem;
}

.form-control,
.form-select {
  border-radius: 0.9rem;
  border-color: rgba(148, 163, 184, 0.24);
  background-color: #0b1220;
  color: #e5eef9;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.16);
}

.form-control::placeholder {
  color: #94a3b8;
}

.card,
.list-group-item,
.offcanvas,
.table,
.alert,
.dropdown-menu {
  background-color: #0f172a;
  color: #e5eef9;
  border-color: rgba(148, 163, 184, 0.16);
}

.card-header {
  background-color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background-color: rgba(96, 165, 250, 0.12);
  color: #fff;
}

.table {
  --bs-table-bg: #0f172a;
  --bs-table-striped-bg: #111c30;
  --bs-table-hover-bg: #13203a;
  --bs-table-color: #e5eef9;
}

.table > :not(caption) > * > * {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.btn-light,
.btn-outline-light {
  color: #e5eef9;
  background-color: #1e293b;
  border-color: rgba(148, 163, 184, 0.28);
}

.btn-light:hover,
.btn-outline-light:hover {
  background-color: #243247;
  border-color: rgba(148, 163, 184, 0.42);
  color: #fff;
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(1.2);
}

.text-muted {
  color: var(--muted) !important;
}

.white-space-preline {
  color: #e5eef9;
}

.bg-white,
.bg-light,
.text-dark,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  color: #e5eef9 !important;
}

.bg-white,
.bg-light,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  background-color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

@media (max-width: 991.98px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    margin-inline: 0.75rem;
  }

  .content-wrap {
    padding: 1rem 0.75rem 1.5rem;
  }
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.user-avatar {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent);
  color: white;
  font-weight: 600;
}

/* Small avatar variant */
.avatar-circle-sm { width: 28px; height: 28px; font-size: 0.85rem; }
