/* ============================================================
   AlmaSEO Able Pro Shell — Layout CSS  v3 (premium)
   Sidebar, header, content-area, loader, footer.
   Scoped under .pc-* — no Bootstrap overrides at root.
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Layout */
  --pc-sidebar-width: 260px;
  --pc-header-height: 68px;

  /* Sidebar */
  --pc-sidebar-bg: #ffffff;
  --pc-sidebar-color: #1e293b;
  --pc-sidebar-active-color: #4338ca;
  --pc-sidebar-active-bg: rgba(67, 56, 202, 0.08);
  --pc-sidebar-hover-bg: rgba(99, 102, 241, 0.06);
  --pc-sidebar-border: 1px solid #e2e8f0;
  --pc-sidebar-caption-color: #475569;

  /* Header */
  --pc-header-bg: rgba(255, 255, 255, 0.72);
  --pc-header-color: #374151;
  --pc-header-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.03);

  /* Content */
  --pc-content-bg: #f0f3f8;

  /* Motion */
  --pc-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Surfaces */
  --pc-radius: 14px;
  --pc-radius-sm: 10px;
  --pc-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04);
  --pc-shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.04);

  /* Typography */
  --pc-text-primary: #111827;
  --pc-text-secondary: #4a5568;
  --pc-text-muted: #7c8898;
}

/* --- Page Loader --- */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10000;
  pointer-events: none;
}

.page-loader .bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0 2px 2px 0;
  animation: pc-loader 1.4s var(--pc-ease) infinite;
}

@keyframes pc-loader {
  0%   { width: 0; margin-left: 0; }
  50%  { width: 55%; margin-left: 22%; }
  100% { width: 0; margin-left: 100%; }
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.pc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--pc-sidebar-width);
  background: var(--pc-sidebar-bg);
  border-right: var(--pc-sidebar-border);
  z-index: 1025;
  display: flex;
  flex-direction: column;
  transition: width 0.28s var(--pc-ease), box-shadow 0.28s var(--pc-ease);
  overflow: hidden;
}

.pc-sidebar .navbar-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--pc-sidebar-width);
}

/* --- Sidebar Logo --- */
.pc-sidebar .m-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  height: var(--pc-header-height);
  flex-shrink: 0;
  border-bottom: 1px solid #e8ecf2;
  background: #ffffff;
}

.pc-sidebar .m-header .b-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.3px;
  transition: opacity 0.2s var(--pc-ease);
}

.pc-sidebar .m-header .b-brand:hover { opacity: 0.85; }

.pc-sidebar .m-header .b-brand .brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 2px solid rgba(102, 126, 234, 0.22);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  flex-shrink: 0;
}

.pc-sidebar .m-header .b-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.pc-sidebar .m-header .b-brand .brand-alma {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.pc-sidebar .m-header .b-brand .brand-seo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.pc-sidebar .m-header .b-brand .brand-tagline {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
  margin-top: 2px;
}

/* --- Sidebar Scrollable Content --- */
.pc-sidebar .navbar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 24px;
}

/* Subtle scrollbar for sidebar */
.pc-sidebar .navbar-content::-webkit-scrollbar {
  width: 4px;
}
.pc-sidebar .navbar-content::-webkit-scrollbar-track {
  background: transparent;
}
.pc-sidebar .navbar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.pc-sidebar .navbar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* --- Nav List --- */
.pc-sidebar .pc-navbar {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- Caption / Section Label --- */
.pc-sidebar .pc-item.pc-caption {
  padding: 22px 18px 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--pc-sidebar-caption-color);
  pointer-events: none;
}

.pc-sidebar .pc-item.pc-caption:first-child {
  padding-top: 6px;
}

.pc-sidebar .pc-item.pc-caption label {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* --- Nav Item --- */
.pc-sidebar .pc-item {
  position: relative;
}

/* --- Nav Link (parent level) --- */
.pc-sidebar .pc-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin: 2px 10px;
  color: var(--pc-sidebar-color);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: var(--pc-radius-sm);
  transition: color 0.18s var(--pc-ease),
              background 0.18s var(--pc-ease);
  gap: 11px;
  cursor: pointer;
}

.pc-sidebar .pc-link:hover {
  color: var(--pc-sidebar-active-color);
  background: var(--pc-sidebar-hover-bg);
  box-shadow: 0 1px 3px rgba(67, 56, 202, 0.04);
}

/* --- Active State --- */
.pc-sidebar .pc-item.active > .pc-link {
  color: var(--pc-sidebar-active-color);
  background: var(--pc-sidebar-active-bg);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(67, 56, 202, 0.06);
}

.pc-sidebar .pc-item.active > .pc-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: linear-gradient(180deg, #6366f1, #4338ca);
  border-radius: 0 3px 3px 0;
}

/* --- Icon --- */
.pc-sidebar .pc-micon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 15px;
  color: #334155;
  background: rgba(100, 116, 139, 0.10);
  border-radius: 8px;
  transition: all 0.18s var(--pc-ease);
}

.pc-sidebar .pc-link:hover .pc-micon {
  color: var(--pc-sidebar-active-color);
  background: rgba(67, 56, 202, 0.10);
}

.pc-sidebar .pc-item.active > .pc-link .pc-micon {
  color: #fff;
  background: linear-gradient(135deg, #4338ca, #6366f1);
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.2);
}

/* --- Menu Text --- */
.pc-sidebar .pc-mtext {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* --- Chevron Arrow --- */
.pc-sidebar .pc-arrow {
  display: flex;
  align-items: center;
  margin-left: auto;
  font-size: 11px;
  opacity: 0.4;
  transition: transform 0.25s var(--pc-ease), opacity 0.18s var(--pc-ease);
}

.pc-sidebar .pc-link:hover .pc-arrow { opacity: 0.65; }

.pc-sidebar .pc-item.pc-trigger > .pc-link .pc-arrow {
  transform: rotate(90deg);
  opacity: 0.65;
}

/* --- Submenu --- */
.pc-sidebar .pc-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  max-height: 45vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Subtle scrollbar for long submenus */
.pc-sidebar .pc-submenu::-webkit-scrollbar {
  width: 4px;
}

.pc-sidebar .pc-submenu::-webkit-scrollbar-track {
  background: transparent;
}

.pc-sidebar .pc-submenu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.pc-sidebar .pc-submenu::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.pc-sidebar .pc-item.pc-trigger > .pc-submenu {
  display: block;
}

/* Child nav links */
.pc-sidebar .pc-submenu .pc-link {
  padding: 8px 16px 8px 49px;
  margin: 0 10px;
  font-size: 13.5px;
  font-weight: 400;
  color: #6b7a8d;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.pc-sidebar .pc-submenu .pc-link:hover {
  color: var(--pc-sidebar-active-color);
  background: var(--pc-sidebar-hover-bg);
}

.pc-sidebar .pc-submenu .pc-item.active > .pc-link {
  color: var(--pc-sidebar-active-color);
  background: var(--pc-sidebar-active-bg);
  font-weight: 500;
}

.pc-sidebar .pc-submenu .pc-item.active > .pc-link::before {
  display: none;
}

/* Dot indicator for active submenu child */
.pc-sidebar .pc-submenu .pc-item.active > .pc-link::after {
  content: '';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pc-sidebar-active-color);
}

/* Per-site brand color dot in sidebar */
.site-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Active site: brand-colored left border bar */
.pc-sidebar .pc-submenu .pc-item.site-active > .pc-link {
  font-weight: 600;
  border-left: 3px solid var(--site-brand-color, var(--pc-sidebar-active-color));
  padding-left: 46px;
  background: rgba(0,0,0,0.03);
}

/* Override the generic dot with the brand color for active site */
.pc-sidebar .pc-submenu .pc-item.site-active > .pc-link::after {
  display: none;
}

.pc-sidebar .pc-submenu .pc-item.site-active .site-color-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* --- Badge --- */
.pc-sidebar .pc-badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(102, 126, 234, 0.12);
  color: #667eea;
  font-weight: 600;
  margin-left: 6px;
}

/* --- Sidebar Divider --- */
.pc-sidebar .pc-sidebar-divider {
  height: 1px;
  background: #edf0f4;
  margin: 10px 18px;
}

/* --- Sidebar Collapse (desktop) --- */
.pc-sidebar.pc-sidebar-hide {
  width: 0;
  border-right-color: transparent;
}

.pc-sidebar.pc-sidebar-hide ~ .pc-header,
.pc-sidebar.pc-sidebar-hide ~ .pc-container {
  margin-left: 0;
}

.pc-sidebar.pc-sidebar-hide ~ .pc-footer {
  margin-left: 0;
}

/* --- Sidebar Mini Mode (icon-only, 60px) --- */
.pc-sidebar.pc-sidebar-mini {
  width: 60px;
}

.pc-sidebar.pc-sidebar-mini .navbar-wrapper {
  width: 60px;
}

.pc-sidebar.pc-sidebar-mini .m-header .b-brand .brand-text {
  display: none;
}

.pc-sidebar.pc-sidebar-mini .m-header {
  padding: 16px 9px;
  justify-content: center;
}

.pc-sidebar.pc-sidebar-mini .pc-item.pc-caption {
  display: none;
}

.pc-sidebar.pc-sidebar-mini .pc-mtext,
.pc-sidebar.pc-sidebar-mini .pc-arrow,
.pc-sidebar.pc-sidebar-mini .pc-badge {
  display: none;
}

.pc-sidebar.pc-sidebar-mini .pc-link {
  justify-content: center;
  padding: 10px 0;
  margin: 2px 6px;
}

.pc-sidebar.pc-sidebar-mini .pc-micon {
  margin: 0;
}

/* Hide submenus in mini mode */
.pc-sidebar.pc-sidebar-mini .pc-submenu {
  display: none !important;
}

/* Expand mini sidebar on hover */
.pc-sidebar.pc-sidebar-mini:hover {
  width: var(--pc-sidebar-width);
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.1);
}

.pc-sidebar.pc-sidebar-mini:hover .navbar-wrapper {
  width: var(--pc-sidebar-width);
}

.pc-sidebar.pc-sidebar-mini:hover .m-header .b-brand .brand-text {
  display: flex;
}

.pc-sidebar.pc-sidebar-mini:hover .m-header {
  padding: 16px 20px;
  justify-content: flex-start;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-item.pc-caption {
  display: block;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-mtext,
.pc-sidebar.pc-sidebar-mini:hover .pc-arrow,
.pc-sidebar.pc-sidebar-mini:hover .pc-badge {
  display: flex;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-link {
  justify-content: flex-start;
  padding: 10px 16px;
  margin: 2px 10px;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-micon {
  margin: 0;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-sidebar-divider {
  margin: 10px 18px;
}

/* Re-enable submenu dropdown when sidebar is expanded on hover */
.pc-sidebar.pc-sidebar-mini:hover .pc-submenu {
  display: none !important;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-item.pc-trigger > .pc-submenu {
  display: block !important;
}

/* Hide tooltip when sidebar is expanded on hover */
.pc-sidebar.pc-sidebar-mini:hover .pc-item > .pc-link::after {
  display: none;
}

/* Expand mini sidebar on hover */
.pc-sidebar.pc-sidebar-mini:hover {
  width: var(--pc-sidebar-width);
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.1);
}

.pc-sidebar.pc-sidebar-mini:hover .navbar-wrapper {
  width: var(--pc-sidebar-width);
}

.pc-sidebar.pc-sidebar-mini:hover .m-header .b-brand .brand-text {
  display: flex;
}

.pc-sidebar.pc-sidebar-mini:hover .m-header {
  padding: 16px 20px;
  justify-content: flex-start;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-item.pc-caption {
  display: block;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-mtext,
.pc-sidebar.pc-sidebar-mini:hover .pc-arrow,
.pc-sidebar.pc-sidebar-mini:hover .pc-badge {
  display: flex;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-link {
  justify-content: flex-start;
  padding: 10px 16px;
  margin: 2px 10px;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-micon {
  margin: 0;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-sidebar-divider {
  margin: 10px 18px;
}

/* Re-enable submenu dropdown when sidebar is expanded on hover */
.pc-sidebar.pc-sidebar-mini:hover .pc-submenu {
  display: none !important;
}

.pc-sidebar.pc-sidebar-mini:hover .pc-item.pc-trigger > .pc-submenu {
  display: block !important;
}

/* Hide tooltip when sidebar is expanded on hover */
.pc-sidebar.pc-sidebar-mini:hover .pc-item > .pc-link::after {
  display: none;
}

/* Dividers in mini mode */
.pc-sidebar.pc-sidebar-mini .pc-sidebar-divider {
  margin: 10px 8px;
}

/* Shift header/container/footer for mini sidebar */
.pc-sidebar.pc-sidebar-mini ~ .pc-header {
  left: 60px;
}

.pc-sidebar.pc-sidebar-mini ~ .pc-container {
  margin-left: 60px;
}

.pc-sidebar.pc-sidebar-mini ~ .pc-footer {
  margin-left: 60px;
}

/* Tooltip on hover for mini sidebar items */
.pc-sidebar.pc-sidebar-mini .pc-item:not(.pc-caption) > .pc-link {
  position: relative;
}

.pc-sidebar.pc-sidebar-mini .pc-item:not(.pc-caption) > .pc-link::after {
  content: attr(data-mini-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;
  padding: 5px 12px;
  background: #1e293b;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--pc-ease);
  z-index: 1100;
}

.pc-sidebar.pc-sidebar-mini .pc-item:not(.pc-caption) > .pc-link:hover::after {
  opacity: 1;
}


/* --- Mobile Overlay --- */
.pc-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(3px);
  z-index: 1024;
  animation: pc-fade-in 0.22s var(--pc-ease);
}

@keyframes pc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Locked / Upgrade CTA items --- */
.pc-sidebar .pc-link.pc-locked {
  opacity: 0.5;
  cursor: default;
}
.pc-sidebar .pc-link.pc-locked:hover {
  opacity: 0.7;
  background: rgba(107, 114, 128, 0.06);
}
.pc-sidebar .pc-link.pc-locked .badge {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Profile sidebar locked items */
.sidebar-item.sidebar-locked {
  opacity: 0.5;
  cursor: default;
  position: relative;
}
.sidebar-item.sidebar-locked:hover {
  opacity: 0.7;
  background: rgba(107, 114, 128, 0.06);
}
.sidebar-item .tier-badge {
  font-size: 0.6rem;
  font-weight: 500;
  background: #e5e7eb;
  color: #4b5563;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* =============================================================
   HEADER / TOPBAR
   ============================================================= */
.pc-header {
  position: fixed;
  top: 0;
  left: var(--pc-sidebar-width);
  right: 0;
  height: var(--pc-header-height);
  background: var(--pc-header-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(220, 226, 234, 0.55);
  box-shadow: var(--pc-header-shadow);
  z-index: 1024;
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: left 0.28s var(--pc-ease);
}

.pc-sidebar.pc-sidebar-hide ~ .pc-header {
  left: 0;
}

.pc-header .header-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
}

/* Left: hamburger */
.pc-header .me-auto {
  display: flex;
  align-items: center;
}

.pc-header .me-auto .list-unstyled {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Header icon links */
.pc-header .pc-head-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--pc-radius-sm);
  color: var(--pc-header-color);
  text-decoration: none;
  transition: background 0.18s var(--pc-ease), color 0.18s var(--pc-ease);
  position: relative;
  font-size: 18px;
  cursor: pointer;
}

.pc-header .pc-head-link:hover {
  background: rgba(67, 97, 238, 0.08);
  color: var(--pc-sidebar-active-color);
}

.pc-header .pc-h-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 10px;
}

.pc-header .pc-h-dropdown {
  min-width: 300px;
  border: 1px solid #e8ecf1;
  border-radius: var(--pc-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 0;
  margin-top: 8px;
}

/* Desktop hamburger */
.pc-header .pc-sidebar-collapse { display: block; }
/* Mobile hamburger */
.pc-header .pc-sidebar-popup { display: none; }

/* Right side */
.pc-header .ms-auto {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.pc-header .ms-auto .list-unstyled {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 10px;
}

/* User pill */
.pc-header .header-user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 4px 4px;
  background: linear-gradient(135deg, #f8f9fc 0%, #f0f2f7 100%);
  border: 1px solid #dfe3ec;
  border-radius: 28px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--pc-text-primary);
  transition: all 0.18s var(--pc-ease);
}

.pc-header .header-user-info:hover {
  border-color: #c8cedb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, #f4f5fa 0%, #eceef5 100%);
}

.pc-header .header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.2);
}

/* Logout button */
.pc-header .btn-logout {
  background: transparent;
  color: var(--pc-text-muted);
  border: 1px solid #dfe3ea;
  padding: 6px 16px;
  border-radius: var(--pc-radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.18s var(--pc-ease);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.pc-header .btn-logout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* =============================================================
   CONTENT AREA
   ============================================================= */
.pc-container {
  margin-left: var(--pc-sidebar-width);
  min-height: 100vh;
  padding-top: var(--pc-header-height);
  background: var(--pc-content-bg);
  transition: margin-left 0.28s var(--pc-ease);
}

.pc-sidebar.pc-sidebar-hide ~ .pc-container {
  margin-left: 0;
}

.pc-content {
  padding: 28px 28px;
  max-width: 1600px;
}

@media (min-width: 1600px) {
  .pc-content {
    padding: 32px 36px;
  }
}

/* =============================================================
   FOOTER
   ============================================================= */
.pc-footer {
  margin-left: var(--pc-sidebar-width);
  transition: margin-left 0.28s var(--pc-ease);
  border-top: 1px solid #e8ecf1;
  background: #fff;
}

.pc-sidebar.pc-sidebar-hide ~ .pc-footer { margin-left: 0; }

.pc-footer .footer-wrapper {
  padding: 12px 28px;
  font-size: 12.5px;
  color: var(--pc-text-muted);
}

/* =============================================================
   IMPERSONATION BAR
   ============================================================= */
.pc-header.has-impersonation-bar { top: 42px; }
.has-impersonation-bar ~ .pc-container { padding-top: calc(var(--pc-header-height) + 42px); }

/* =============================================================
   CONTENT TYPOGRAPHY (scoped to .pc-content)
   Strong visual hierarchy, premium feel
   ============================================================= */

/* Page title */
.pc-content .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pc-text-primary);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

/* Page subtitle */
.pc-content .page-subtitle {
  font-size: 0.95rem;
  color: var(--pc-text-muted);
  font-weight: 400;
  line-height: 1.5;
}

/* Section header */
.pc-content .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pc-text-primary);
  letter-spacing: -0.15px;
}

/* =============================================================
   CARDS (scoped to .pc-content)
   ============================================================= */
.pc-content .card {
  border: 1px solid #e2e7ef;
  border-radius: var(--pc-radius);
  box-shadow: var(--pc-shadow-card);
  transition: box-shadow 0.22s var(--pc-ease), transform 0.22s var(--pc-ease), border-color 0.22s var(--pc-ease);
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfe 100%);
}

.pc-content .card:hover {
  box-shadow: var(--pc-shadow-card-hover);
  transform: translateY(-2px);
  border-color: #d5dbe6;
}

.pc-content .card-header {
  background: linear-gradient(180deg, #f8f9fc 0%, #f5f6fa 100%);
  border-bottom: 1px solid #edf0f5;
  padding: 16px 22px;
  font-weight: 600;
}

.pc-content .card-body {
  padding: 20px 22px;
}

/* Card headings */
.pc-content .card h5,
.pc-content .card .h5 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pc-text-primary);
  letter-spacing: -0.1px;
}

.pc-content .card h6,
.pc-content .card .h6 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pc-text-secondary);
}

/* =============================================================
   STAT CARDS
   ============================================================= */
.pc-content .stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--pc-text-primary);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.pc-content .stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pc-text-muted);
  margin-top: 2px;
}

/* Icon containers */
.pc-content .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--pc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.pc-content .stat-icon.bg-primary-soft {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(67, 97, 238, 0.05) 100%);
  color: #4361ee;
}
.pc-content .stat-icon.bg-success-soft {
  background: linear-gradient(135deg, rgba(44, 168, 127, 0.12) 0%, rgba(44, 168, 127, 0.05) 100%);
  color: #2ca87f;
}
.pc-content .stat-icon.bg-warning-soft {
  background: linear-gradient(135deg, rgba(229, 138, 0, 0.12) 0%, rgba(229, 138, 0, 0.05) 100%);
  color: #d97706;
}
.pc-content .stat-icon.bg-info-soft {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  color: #6366f1;
}

/* =============================================================
   TABLES
   ============================================================= */
.pc-content .table {
  font-size: 14px;
  color: var(--pc-text-secondary);
}

.pc-content .table thead th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--pc-text-muted);
  border-bottom: 2px solid #edf0f4;
  padding: 12px 18px;
  background: transparent;
}

.pc-content .table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid #f3f5f8;
  vertical-align: middle;
  color: var(--pc-text-secondary);
}

.pc-content .table tbody tr:last-child td {
  border-bottom: none;
}

.pc-content .table-hover tbody tr:hover td {
  background: #f7f9fc;
}

/* =============================================================
   BADGES
   ============================================================= */
.pc-content .badge {
  font-weight: 600;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 6px;
  letter-spacing: 0.15px;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.pc-content .btn {
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--pc-radius-sm);
  transition: all 0.18s var(--pc-ease);
}

.pc-content .btn-primary {
  background: linear-gradient(135deg, #4361ee 0%, #3b50d4 100%);
  border-color: #4361ee;
  box-shadow: 0 2px 6px rgba(67, 97, 238, 0.25);
  color: #fff;
}

.pc-content .btn-primary:hover {
  background: linear-gradient(135deg, #3b50d4 0%, #3345be 100%);
  border-color: #3b50d4;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.3);
  transform: translateY(-1px);
  color: #fff;
}

.pc-content .btn-sm {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}

.pc-content .btn-outline-primary {
  border-color: #c7d2fe;
  color: #4361ee;
  font-weight: 500;
}

.pc-content .btn-outline-primary:hover {
  background: rgba(67, 97, 238, 0.06);
  border-color: #4361ee;
  color: #4361ee;
}

.pc-content .btn-outline-secondary {
  border-color: #dfe3ea;
  color: var(--pc-text-secondary);
  font-weight: 500;
}

.pc-content .btn-outline-secondary:hover {
  background: #f4f6f9;
  border-color: #c8cdd6;
  color: var(--pc-text-primary);
}

/* =============================================================
   DASHBOARD EXPERIENCE COMPONENTS
   Premium AI SEO platform identity
   ============================================================= */

/* --- Hero Welcome Banner --- */
.pc-content .dash-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  border-radius: var(--pc-radius);
  padding: 32px 32px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  border: none;
  box-shadow: 0 4px 20px rgba(30, 27, 75, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pc-content .dash-hero:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(30, 27, 75, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Subtle grid pattern overlay */
.pc-content .dash-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.pc-content .dash-hero .hero-content {
  position: relative;
  z-index: 1;
}

.pc-content .dash-hero .hero-greeting {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.pc-content .dash-hero .hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  margin-bottom: 20px;
  max-width: 520px;
  line-height: 1.5;
}

.pc-content .dash-hero .hero-metrics {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.pc-content .dash-hero .hero-metric {
  display: flex;
  flex-direction: column;
}

.pc-content .dash-hero .hero-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.pc-content .dash-hero .hero-metric-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

/* Hero CTA button */
.pc-content .dash-hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--pc-radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s var(--pc-ease);
}

.pc-content .dash-hero .hero-cta:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

/* --- AI Insight Panel --- */
.pc-content .card-ai {
  border: 1px solid #ddd6fe;
  border-left: 4px solid #6366f1;
  background: linear-gradient(135deg, #fefcff 0%, #f8f6ff 40%, #fcfcfe 100%);
}

.pc-content .card-ai:hover {
  border-color: #c4b5fd;
  border-left-color: #6366f1;
}

.pc-content .card-ai .ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.pc-content .card-ai .ai-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 12px;
  margin: 0 -4px;
  border-radius: var(--pc-radius-sm);
  border-bottom: none;
  transition: background 0.18s var(--pc-ease);
}

.pc-content .card-ai .ai-insight-item:hover {
  background: rgba(99, 102, 241, 0.03);
}

.pc-content .card-ai .ai-insight-item + .ai-insight-item {
  border-top: 1px solid rgba(99, 102, 241, 0.06);
}

.pc-content .card-ai .ai-insight-item:last-child {
  padding-bottom: 14px;
}

.pc-content .card-ai .ai-insight-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pc-content .card-ai .ai-insight-text {
  flex: 1;
  min-width: 0;
}

.pc-content .card-ai .ai-insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--pc-text-primary);
  margin-bottom: 2px;
}

.pc-content .card-ai .ai-insight-desc {
  font-size: 13px;
  color: var(--pc-text-muted);
  line-height: 1.45;
}

/* --- Activity Feed --- */
.pc-content .feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f5f8;
}

.pc-content .feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pc-content .feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.pc-content .feed-dot.dot-success { background: #2ca87f; }
.pc-content .feed-dot.dot-primary { background: #4361ee; }
.pc-content .feed-dot.dot-warning { background: #d97706; }
.pc-content .feed-dot.dot-purple  { background: #7c3aed; }

.pc-content .feed-text {
  font-size: 13.5px;
  color: var(--pc-text-secondary);
  line-height: 1.45;
}

.pc-content .feed-text strong {
  color: var(--pc-text-primary);
  font-weight: 600;
}

.pc-content .feed-time {
  font-size: 12px;
  color: var(--pc-text-muted);
  margin-top: 2px;
}

/* --- Site Health Row --- */
.pc-content .site-health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f3f5f8;
}

.pc-content .site-health-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pc-content .site-health-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--pc-text-primary);
}

.pc-content .site-health-url {
  font-size: 12.5px;
  color: var(--pc-text-muted);
}

.pc-content .site-health-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-content .score-bar {
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background: #edf0f4;
  overflow: hidden;
}

.pc-content .score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--pc-ease);
}

.pc-content .score-bar-fill.score-high { background: #2ca87f; }
.pc-content .score-bar-fill.score-mid  { background: #d97706; }
.pc-content .score-bar-fill.score-low  { background: #dc2626; }

.pc-content .score-value {
  font-size: 13px;
  font-weight: 700;
  min-width: 30px;
  text-align: right;
}

/* --- Next Action Card --- */
.pc-content .card-action {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f6ff 100%);
  border: 1px solid #ddd6fe;
}

.pc-content .card-action:hover {
  border-color: #c4b5fd;
}

.pc-content .action-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7c3aed;
  margin-bottom: 6px;
}

.pc-content .action-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pc-text-primary);
  margin-bottom: 4px;
}

.pc-content .action-desc {
  font-size: 13.5px;
  color: var(--pc-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* --- Alert Item --- */
.pc-content .alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--pc-radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: #92400e;
}

.pc-content .alert-item:last-child { margin-bottom: 0; }

.pc-content .alert-item.alert-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.pc-content .alert-item i {
  font-size: 15px;
  flex-shrink: 0;
}

/* --- Responsive for dashboard components --- */
@media (max-width: 768px) {
  .pc-content .dash-hero {
    padding: 24px 20px 20px;
  }
  .pc-content .dash-hero .hero-greeting {
    font-size: 1.3rem;
  }
  .pc-content .dash-hero .hero-metrics {
    gap: 20px;
  }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .pc-sidebar,
  .pc-sidebar.pc-sidebar-mini,
  .pc-sidebar.pc-sidebar-hide {
    left: calc(-1 * var(--pc-sidebar-width));
    width: var(--pc-sidebar-width) !important;
    transition: left 0.28s var(--pc-ease), box-shadow 0.28s var(--pc-ease);
  }

  /* Force full sidebar appearance on mobile (no mini/icon-only mode) */
  .pc-sidebar .navbar-wrapper { width: var(--pc-sidebar-width) !important; }
  .pc-sidebar .pc-item.pc-caption { display: block !important; }
  .pc-sidebar .pc-mtext,
  .pc-sidebar .pc-arrow,
  .pc-sidebar .pc-badge { display: flex !important; }
  .pc-sidebar .pc-link { justify-content: flex-start !important; padding: 10px 16px !important; margin: 2px 10px !important; }
  .pc-sidebar .m-header .b-brand .brand-text { display: flex !important; }
  .pc-sidebar .m-header { padding: 16px 20px !important; justify-content: flex-start !important; }

  .pc-sidebar.mob-sidebar-active {
    left: 0;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.14);
  }

  .pc-header,
  .pc-sidebar.pc-sidebar-mini ~ .pc-header,
  .pc-sidebar.pc-sidebar-hide ~ .pc-header { left: 0 !important; }

  .pc-container,
  .pc-sidebar.pc-sidebar-mini ~ .pc-container,
  .pc-sidebar.pc-sidebar-hide ~ .pc-container { margin-left: 0 !important; }

  .pc-footer,
  .pc-sidebar.pc-sidebar-mini ~ .pc-footer,
  .pc-sidebar.pc-sidebar-hide ~ .pc-footer { margin-left: 0 !important; }

  .pc-header .pc-sidebar-collapse { display: none; }
  .pc-header .pc-sidebar-popup { display: block; }
}

@media (max-width: 768px) {
  .pc-content { padding: 18px 16px; }
  .pc-header { padding: 0 14px; }
  .pc-header .header-user-info .username-text { display: none; }
  .pc-header .ms-auto .list-unstyled { gap: 8px; }
}

@media (max-width: 480px) {
  .pc-content { padding: 14px 12px; }
  .pc-header .btn-logout span { display: none; }
}
