/* LinkGuard App Shell (v12)
   Structural layout + a few component helpers.
   Visual tokens live in theme.css.
*/

/* ---- Shell ---- */
body {
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(182,134,255,0.20), transparent 62%),
    radial-gradient(900px 520px at 78% 12%, rgba(255,210,143,0.18), transparent 60%),
    radial-gradient(1000px 700px at 60% 70%, rgba(86,220,255,0.12), transparent 55%),
    linear-gradient(180deg, #2A2B33 0%, #15161C 55%, #101116 100%);
}

.app-sidebar {
  width: 268px;
  background: linear-gradient(180deg, var(--lg-sidebar), var(--lg-sidebar-2));
  border-right: 1px solid rgba(255,255,255,0.06);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  /* Keep sidebar clean: scrolling happens inside .lg-nav (with hidden scrollbar) */
  overflow: hidden;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18,18,22,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--lg-border);
}

.app-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18,18,22,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--lg-border);
  padding: 10px 12px;
}

main.container-fluid {
  padding-left: 20px;
  padding-right: 20px;
}

@media (min-width: 768px) {
  .app-main {
    margin-left: 268px;
  }
}

@media (max-width: 767px) {
  main.container-fluid {
    padding-bottom: 92px;
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ---- Auth shell ---- */
.auth-shell {
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(79,70,229,0.18), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(20,184,166,0.14), transparent 55%),
    var(--lg-bg);
  min-height: 100vh;
}

/* ---- Sidebar ---- */

.lg-sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.lg-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* Hide scrollbar (keep scroll support) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lg-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.lg-sidebar-footer {
  margin-top: auto;
}

/* ---- Dashboard helpers ---- */
.stat-tile {
  padding: 6px 2px;
}
.stat-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lg-muted);
  font-weight: 800;
}
.stat-value {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.lg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 12px 18px;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--lg-primary), var(--lg-accent));
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 14px 30px rgba(91,95,239,0.25);
}

.lg-brand .brand-name {
  color: #fff;
  font-weight: 700;
  line-height: 1.1;
}

.lg-brand .brand-meta {
  color: var(--lg-sidebar-muted);
  font-size: 12px;
}

.lg-nav {
  padding: 6px 12px 12px 12px;
}

.lg-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--lg-sidebar-text);
  font-weight: 600;
}

.lg-nav-link i {
  font-size: 18px;
  width: 22px;
  opacity: .9;
}

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

.lg-nav-link.active {
  background: rgba(91,95,239,0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(91,95,239,0.28);
}

.lg-sidebar-footer {
  padding: 12px 16px 16px 16px;
}

.lg-sidebar-footer .btn {
  border-color: rgba(255,255,255,0.18) !important;
  color: rgba(255,255,255,0.85) !important;
}

.lg-sidebar-footer .btn:hover {
  background: rgba(255,255,255,0.10) !important;
}

/* ---- Topbar ---- */
.lg-topbar {
  padding: 14px 18px;
}

.lg-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ---- Dashboard hero ---- */
.dash-hero {
  border-radius: var(--lg-radius);
  background:
    radial-gradient(900px 260px at 0% 0%, rgba(91,95,239,0.20), transparent 55%),
    radial-gradient(700px 260px at 100% 20%, rgba(20,184,166,0.14), transparent 55%),
    rgba(18,18,22,0.60);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.dash-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lg-muted);
}

.dash-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Cards & tables ---- */
.card {
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius);
  box-shadow: var(--lg-shadow-sm);
}

.card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--lg-border);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--lg-muted);
  border-bottom: 1px solid var(--lg-border);
}

/* ---- Metric cards ---- */
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 220px at 15% 0%, rgba(var(--_tint-rgb), 0.18), transparent 60%);
  pointer-events: none;
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--_tint-rgb), 0.18);
  color: rgb(var(--_tint-rgb));
}

.metric-label {
  font-size: 12px;
  color: var(--lg-muted);
  font-weight: 600;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-sub {
  font-size: 12px;
  color: var(--lg-muted);
}

.metric-broken { --_tint-rgb: 239, 68, 68; }
.metric-new    { --_tint-rgb: 91, 95, 239; }
.metric-chain  { --_tint-rgb: 0, 194, 255; }
.metric-5xx    { --_tint-rgb: 245, 158, 11; }

/* ---- Bottom nav ---- */
.bottomnav-inner {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}

.bottomnav-item {
  text-decoration: none;
  color: var(--lg-text);
  font-weight: 700;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(91,95,239,0.10);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bottomnav-item i {
  font-size: 16px;
}

.bottomnav-item.active {
  background: linear-gradient(135deg, rgba(79,70,229,0.18), rgba(0,194,255,0.14));
  box-shadow: inset 0 0 0 1px rgba(91,95,239,0.22);
}

/* Small helper for pill badges */
.badge-soft {
  background: rgba(15,23,42,0.06);
  color: var(--lg-text);
  border: 1px solid var(--lg-border);
  border-radius: 999px;
  font-weight: 700;
  padding: 6px 10px;
}

/* =============================
   v18.7 Shell & Navigation Polish
   ============================= */

/* Constrain content a bit on large screens for a more premium look */
@media (min-width: 1200px) {
  main.container-fluid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Brand name mapping (sidebar markup uses lg-brand-name/sub) */
.lg-brand-name {
  color: #fff;
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.lg-brand-sub {
  color: var(--lg-sidebar-muted);
  font-size: 12px;
}

.lg-brand-sub .badge-soft {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.88);
}

/* Sidebar section label */
.lg-nav-sep {
  margin: 14px 10px 6px 10px;
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--lg-sidebar-muted);
  font-weight: 800;
}

/* Sidebar user block */
.lg-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 10px;
}

.lg-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 800;
}

.lg-user-meta {
  min-width: 0;
}

.lg-user-email {
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 185px;
}

.lg-user-role {
  color: var(--lg-sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Nav active indicator */
.lg-nav-link.active {
  position: relative;
}

.lg-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20,184,166,0.9), rgba(79,70,229,0.9));
}

/* Topbar spacing */
.lg-topbar {
  padding: 14px 16px;
}



/* Bottomnav dark theme */
.app-bottomnav .bottomnav-item{
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.08);
}
.app-bottomnav .bottomnav-item.active{
  background: linear-gradient(135deg, rgba(182,134,255,0.22), rgba(86,220,255,0.14));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}


/* Main content transparency */
.app-main main.container-fluid{
  background: transparent;
}

/* Social auth buttons */
.btn-social{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:700;
  border-color: rgba(255,255,255,0.14);
}
.btn-social:hover{
  border-color: rgba(255,255,255,0.24);
}
.btn-social-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
}
