/* ── Dashboard ───────────────────────────────────────────── */

.app-root {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--white); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo {
  font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; color: var(--ink);
}
.sidebar-logo-mark {
  width: 28px; height: 28px; background: var(--blue); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-section-label {
  font-size: 0.7rem; font-weight: 600; color: var(--ink-4);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 10px; margin: 16px 0 6px;
}
.sidebar-section-label:first-child { margin-top: 4px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 450; color: var(--ink-3);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
  text-decoration: none; margin-bottom: 2px;
}
.sidebar-item:hover { background: var(--bg); color: var(--ink); }
.sidebar-item.active {
  background: var(--blue-light); color: var(--blue); font-weight: 500;
}
.sidebar-item svg { flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto; background: var(--blue); color: #fff;
  border-radius: var(--r-full); font-size: 0.7rem; font-weight: 600;
  padding: 1px 7px; min-width: 20px; text-align: center;
}
.sidebar-footer {
  padding: 14px 10px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background var(--dur-fast);
  text-decoration: none;
}
.sidebar-user:hover { background: var(--bg); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.sidebar-user-email { font-size: 0.75rem; color: var(--ink-4); }

/* Main content */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  height: 60px; border-bottom: 1px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 10;
}
.app-topbar-title { font-size: 0.9375rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.app-content { padding: 32px; flex: 1; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 24px;
  transition: all var(--dur-mid) var(--ease);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.stat-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; width: 100%;
}
.stat-label { font-size: 0.8125rem; color: var(--ink-3); font-weight: 600; letter-spacing: -0.01em; }
.stat-icon {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.stat-sub   { font-size: 0.75rem; color: var(--ink-4); margin-top: 6px; }

/* Welcome */
.welcome-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: var(--r-xl); padding: 36px 40px;
  color: #fff; margin-bottom: 32px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden; position: relative;
  box-shadow: 0 10px 25px -5px rgba(37,99,235,0.25), 0 8px 10px -6px rgba(37,99,235,0.2);
  border: 1px solid rgba(255,255,255,0.1);
}
.welcome-card::before {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px;
  background: rgba(255,255,255,0.07); border-radius: 50%;
  pointer-events: none;
}
.welcome-card::after {
  content: '';
  position: absolute; right: 40px; bottom: -80px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05); border-radius: 50%;
  pointer-events: none;
}
.welcome-text { position: relative; z-index: 1; }
.welcome-text h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.welcome-text p  { font-size: 0.9375rem; opacity: 0.85; max-width: 480px; line-height: 1.5; }
.welcome-cta { position: relative; z-index: 1; }
.welcome-cta .btn--primary { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25); color: #fff; backdrop-filter: blur(8px); }
.welcome-cta .btn--primary:hover { background: rgba(255,255,255,0.28); transform: translateY(-1px); }

/* Waving hand micro-animation */
@keyframes wave-hand {
  0% { transform: rotate( 0.0deg) }
  10% { transform: rotate(14.0deg) }
  20% { transform: rotate(-8.0deg) }
  30% { transform: rotate(14.0deg) }
  40% { transform: rotate(-4.0deg) }
  50% { transform: rotate(10.0deg) }
  60% { transform: rotate( 0.0deg) }
  100% { transform: rotate( 0.0deg) }
}
.wave-emoji {
  display: inline-block;
  animation: wave-hand 2.5s infinite;
  transform-origin: 70% 70%;
}

/* Section heading */
.section-heading {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.section-heading h3 { font-size: 0.9375rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }

/* Signatures grid */
.sigs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sig-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
  transition: all var(--dur-mid) var(--ease);
}
.sig-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--ink-5); }
.sig-card-preview {
  height: 100px; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 2.4rem; color: var(--ink-2); overflow: hidden;
}
.sig-card-body { padding: 14px 16px; }
.sig-card-name  { font-size: 0.875rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.sig-card-meta  { font-size: 0.75rem; color: var(--ink-4); display: flex; align-items: center; justify-content: space-between; }
.sig-card-style { background: var(--bg-2); color: var(--ink-3); font-size: 0.7rem; font-weight: 500; padding: 2px 8px; border-radius: var(--r-full); }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty-state-icon {
  width: 60px; height: 60px; background: var(--bg-2); border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center; color: var(--ink-4);
}
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.empty-state p  { font-size: 0.875rem; color: var(--ink-3); max-width: 300px; }

/* Mobile nav (bottom bar) */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.95); border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.mobile-nav-inner { display: flex; justify-content: space-around; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 16px; border-radius: var(--r-md); text-decoration: none;
  transition: all var(--dur-fast) var(--ease); color: var(--ink-3);
  font-size: 0.65rem; font-weight: 500;
}
.mobile-nav-item:hover, .mobile-nav-item.active { color: var(--blue); }
.mobile-nav-item.active svg { background: var(--blue-light); border-radius: var(--r-sm); }

/* Dropdown menu */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: 6px; z-index: 999;
  animation: scale-in 0.15s var(--ease-spring) both;
  transform-origin: top right;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 0.875rem; color: var(--ink-2); cursor: pointer;
  transition: all var(--dur-fast) var(--ease); text-decoration: none;
}
.dropdown-item:hover { background: var(--bg); color: var(--ink); }
.dropdown-item--danger { color: #dc2626; }
.dropdown-item--danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Responsive dashboard */
@media (max-width: 1024px) {
  .app-root { grid-template-columns: 200px 1fr; }
}
@media (max-width: 768px) {
  .app-root { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .app-content { padding: 20px 16px 90px; }
  .app-topbar { padding: 0 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .welcome-card { flex-direction: column; align-items: flex-start; gap: 20px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
