/* =========================================================
   NHM CRM — Dashboard Design System
   Modern SaaS UI: Sidebar + Topbar + Content
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  /* Brand */
  --primary: #004aad;
  --primary-light: #e8f0ff;
  --primary-dark: #003380;
  --primary-glow: rgba(0, 74, 173, 0.15);
  --accent: #0070f3;

  /* Status */
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #06b6d4;
  --info-light: #ecfeff;

  /* Neutral */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 10px 10px -5px rgba(0, 0, 0, .04);
  --shadow-primary: 0 4px 14px rgba(0, 74, 173, 0.25);

  /* Transition */
  --trans-fast: .15s ease;
  --trans: .25s ease;
  --trans-slow: .4s ease;

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-hover: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --sidebar-bg: #0d1117;
  --topbar-bg: #0d1117;
}

/* Light Mode  */
:root,
[data-theme="light"] {
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --bg-hover: #f6f8fa;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --sidebar-bg: #ffffff;
  --topbar-bg: #ffffff;
}

/* ─── Reset & Base ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Layout Shell ───────────────────────────────────────── */
.nhm-app {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.nhm-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--trans);
  overflow: hidden;
}

.nhm-sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nhm-sidebar__brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.nhm-sidebar__brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nhm-sidebar__brand-name span {
  color: var(--primary);
}

.nhm-sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.nhm-sidebar__nav::-webkit-scrollbar {
  display: none;
}

.nhm-sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nhm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none !important;
  margin-bottom: 2px;
  position: relative;
}

.nhm-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nhm-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nhm-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nhm-nav-item__icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.nhm-nav-item__badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nhm-sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.nhm-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans-fast);
}

.nhm-sidebar__user:hover {
  background: var(--bg-hover);
}

.nhm-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.nhm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nhm-sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.nhm-sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nhm-sidebar__user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── TOPBAR ─────────────────────────────────────────────── */
.nhm-topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 100;
}

.nhm-topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.nhm-topbar__page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nhm-topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.nhm-topbar__breadcrumb span {
  color: var(--text);
  font-weight: 500;
}

.nhm-search-bar {
  position: relative;
  width: 260px;
}

.nhm-search-bar input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  font-family: var(--font);
  transition: all var(--trans-fast);
  outline: none;
}

.nhm-search-bar input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.nhm-search-bar input::placeholder {
  color: var(--text-muted);
}

.nhm-search-bar__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.nhm-topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nhm-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: all var(--trans-fast);
  position: relative;
}

.nhm-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: transparent;
}

.nhm-icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--topbar-bg);
}

/* Theme toggle */
.nhm-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.nhm-theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Topbar avatar */
.nhm-topbar__avatar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--trans-fast);
  position: relative;
}

.nhm-topbar__avatar-wrap:hover {
  background: var(--bg-hover);
}

.nhm-topbar__avatar-wrap .nhm-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.nhm-topbar__user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.nhm-content-wrap {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  flex: 1;
}

.nhm-page {
  padding: 28px 28px;
  max-width: 1600px;
}

.nhm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.nhm-page-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nhm-page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.nhm-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--trans-fast);
}

.nhm-card:hover {
  box-shadow: var(--shadow-sm);
}

.nhm-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.nhm-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.nhm-card__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.nhm-card__body {
  padding: 20px;
}

.nhm-card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ─── KPI STAT CARDS ──────────────────────────────────────── */
.nhm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.nhm-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--trans-fast);
  cursor: default;
}

.nhm-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.nhm-stat-card__icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.nhm-stat-card__icon-wrap.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.nhm-stat-card__icon-wrap.green {
  background: var(--success-light);
  color: var(--success);
}

.nhm-stat-card__icon-wrap.yellow {
  background: var(--warning-light);
  color: var(--warning);
}

.nhm-stat-card__icon-wrap.red {
  background: var(--danger-light);
  color: var(--danger);
}

.nhm-stat-card__icon-wrap.cyan {
  background: var(--info-light);
  color: var(--info);
}

.nhm-stat-card__body {
  flex: 1;
}

.nhm-stat-card__label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nhm-stat-card__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  margin: 4px 0;
  line-height: 1;
}

.nhm-stat-card__trend {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nhm-stat-card__trend.up {
  color: var(--success);
}

.nhm-stat-card__trend.down {
  color: var(--danger);
}

.nhm-stat-card__trend.neutral {
  color: var(--text-muted);
}

/* ─── GRID LAYOUTS ───────────────────────────────────────── */
.nhm-grid {
  display: grid;
  gap: 16px;
}

.nhm-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.nhm-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.nhm-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.nhm-grid-2-1 {
  grid-template-columns: 2fr 1fr;
}

.nhm-grid-1-2 {
  grid-template-columns: 1fr 2fr;
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.nhm-progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 6px 0;
}

.nhm-progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, #0070f3 100%);
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.nhm-progress-bar__fill.success {
  background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

.nhm-progress-bar__fill.warning {
  background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.nhm-progress-bar__fill.danger {
  background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

/* ─── BADGE / STATUS ──────────────────────────────────────── */
.nhm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.nhm-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.nhm-badge--blue {
  background: var(--primary-light);
  color: var(--primary);
}

.nhm-badge--green {
  background: var(--success-light);
  color: var(--success);
}

.nhm-badge--yellow {
  background: var(--warning-light);
  color: #b45309;
}

.nhm-badge--red {
  background: var(--danger-light);
  color: var(--danger);
}

.nhm-badge--cyan {
  background: var(--info-light);
  color: #0e7490;
}

.nhm-badge--gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Status badges specific */
.nhm-badge--on-track {
  background: #ecfdf5;
  color: #059669;
}

.nhm-badge--delay {
  background: #fffbeb;
  color: #b45309;
}

.nhm-badge--done {
  background: #f0f9ff;
  color: #0284c7;
}

.nhm-badge--new {
  background: var(--info-light);
  color: #0e7490;
}

.nhm-badge--consult {
  background: var(--warning-light);
  color: #b45309;
}

.nhm-badge--closed {
  background: var(--success-light);
  color: #059669;
}

.nhm-badge--cancel {
  background: var(--danger-light);
  color: var(--danger);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.nhm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--trans-fast);
  white-space: nowrap;
  text-decoration: none !important;
}

.nhm-btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0063d8 100%);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.nhm-btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 6px 20px rgba(0, 74, 173, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.nhm-btn--secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.nhm-btn--secondary:hover {
  background: var(--bg-hover);
}

.nhm-btn--danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.nhm-btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

.nhm-btn--success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff;
}

.nhm-btn--success:hover {
  opacity: .9;
  transform: translateY(-1px);
  color: #fff;
}

.nhm-btn--sm {
  padding: 5px 10px;
  font-size: 12px;
}

.nhm-btn--lg {
  padding: 11px 24px;
  font-size: 14px;
}

.nhm-btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

.nhm-btn--icon-sm {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 12px;
}

/* ─── TABLES ─────────────────────────────────────────────── */
.nhm-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.nhm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nhm-table thead th {
  padding: 11px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nhm-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--trans-fast);
}

.nhm-table tbody tr:last-child {
  border-bottom: none;
}

.nhm-table tbody tr:hover {
  background: var(--bg-hover);
}

.nhm-table tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.nhm-table td .nhm-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.nhm-form-group {
  margin-bottom: 16px;
}

.nhm-form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.nhm-input,
.nhm-select,
.nhm-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  transition: all var(--trans-fast);
  outline: none;
}

.nhm-input:focus,
.nhm-select:focus,
.nhm-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}

.nhm-input::placeholder,
.nhm-textarea::placeholder {
  color: var(--text-muted);
}

.nhm-textarea {
  resize: vertical;
  min-height: 96px;
}

.nhm-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ─── MODAL ──────────────────────────────────────────────── */
.nhm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.nhm-modal-overlay.active {
  display: flex;
}

.nhm-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(.94) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.nhm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.nhm-modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.nhm-modal__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: all var(--trans-fast);
}

.nhm-modal__close:hover {
  background: var(--bg);
  color: var(--text);
}

.nhm-modal__body {
  padding: 24px;
}

.nhm-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── PROJECT CARD ───────────────────────────────────────── */
.nhm-project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  transition: all var(--trans-fast);
}

.nhm-project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.nhm-project-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nhm-project-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.nhm-project-card__client {
  font-size: 12px;
  color: var(--text-muted);
}

.nhm-project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.nhm-project-card__deadline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nhm-project-card__progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.nhm-project-card__progress-label span {
  font-weight: 600;
  color: var(--primary);
}

.nhm-project-members {
  display: flex;
}

.nhm-project-members .nhm-avatar {
  width: 24px;
  height: 24px;
  font-size: 9px;
  margin-left: -6px;
  border: 2px solid var(--bg-card);
}

.nhm-project-members .nhm-avatar:first-child {
  margin-left: 0;
}

/* ─── ACTIVITY FEED ──────────────────────────────────────── */
.nhm-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nhm-activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nhm-activity-item:last-child {
  border-bottom: none;
}

.nhm-activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nhm-activity-item__body {
  flex: 1;
}

.nhm-activity-item__text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.nhm-activity-item__text strong {
  font-weight: 600;
}

.nhm-activity-item__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─── CALENDAR CARD ──────────────────────────────────────── */
.nhm-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.nhm-cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.nhm-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-fast);
  position: relative;
}

.nhm-cal-day:hover {
  background: var(--bg-hover);
}

.nhm-cal-day.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.nhm-cal-day.has-checkin {
  background: var(--success-light);
  color: var(--success);
}

.nhm-cal-day.late {
  background: var(--warning-light);
  color: var(--warning);
}

.nhm-cal-day.absent {
  background: var(--danger-light);
  color: var(--danger);
}

.nhm-cal-day.weekend {
  color: var(--text-muted);
}

.nhm-cal-day.empty {
  pointer-events: none;
}

/* ─── FILTER BAR ─────────────────────────────────────────── */
.nhm-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.nhm-filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.nhm-filter-tab:hover {
  color: var(--primary);
  border-color: var(--primary-light);
}

.nhm-filter-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
  font-weight: 600;
}

/* ─── KANBAN ──────────────────────────────────────────────── */
.nhm-kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.nhm-kanban-col {
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
}

.nhm-kanban-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nhm-kanban-col__title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nhm-kanban-col__count {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nhm-kanban-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--trans-fast);
  box-shadow: var(--shadow-xs);
}

.nhm-kanban-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-300);
}

.nhm-kanban-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.nhm-kanban-card__phone {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.nhm-kanban-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.nhm-kanban-card__manager {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── TOAST ──────────────────────────────────────────────── */
.nhm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nhm-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--gray-800);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn .3s ease;
  min-width: 280px;
  max-width: 360px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nhm-toast--success {
  background: #065f46;
}

.nhm-toast--error {
  background: #7f1d1d;
}

.nhm-toast--warning {
  background: #78350f;
}

.nhm-toast__icon {
  font-size: 16px;
}

.nhm-toast__msg {
  flex: 1;
}

.nhm-toast__close {
  cursor: pointer;
  opacity: .7;
  font-size: 14px;
}

.nhm-toast__close:hover {
  opacity: 1;
}

/* ─── SKELETON ───────────────────────────────────────────── */
.nhm-skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ─── EMPTY STATE ────────────────────────────────────────── */
.nhm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.nhm-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.nhm-empty__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.nhm-empty__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── CHECK-IN BUTTON ────────────────────────────────────── */
.nhm-checkin-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.nhm-checkin-time {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.nhm-checkin-date {
  font-size: 12px;
  color: var(--text-muted);
}

.nhm-checkin-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.nhm-btn--checkin {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all var(--trans-fast);
}

.nhm-btn--checkin:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, .4);
}

.nhm-btn--checkout {
  background: var(--gray-100);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.nhm-btn--checkout:hover {
  background: var(--gray-200);
}

/* ─── SEARCH IN TABLE ✓ ──────────────────────────────────── */
.nhm-table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.nhm-table-toolbar .nhm-search-bar {
  width: 240px;
}

/* ─── DROPDOWN ───────────────────────────────────────────── */
.nhm-dropdown {
  position: relative;
  display: inline-block;
}

.nhm-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 160px;
  z-index: 500;
  display: none;
}

.nhm-dropdown-menu.open {
  display: block;
  animation: dropIn .15s ease;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nhm-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--trans-fast);
}

.nhm-dropdown-item:hover {
  background: var(--bg-hover);
}

.nhm-dropdown-item.danger {
  color: var(--danger);
}

.nhm-dropdown-item.danger:hover {
  background: var(--danger-light);
}

.nhm-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {

  .nhm-grid-2,
  .nhm-grid-3,
  .nhm-grid-4 {
    grid-template-columns: 1fr;
  }

  .nhm-grid-2-1,
  .nhm-grid-1-2 {
    grid-template-columns: 1fr;
  }

  .nhm-kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nhm-sidebar {
    transform: translateX(-100%);
  }

  .nhm-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .nhm-topbar {
    left: 0;
  }

  .nhm-content-wrap {
    margin-left: 0;
  }

  .nhm-search-bar {
    display: none;
  }

  .nhm-page {
    padding: 16px;
  }

  .nhm-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nhm-form-row {
    grid-template-columns: 1fr;
  }

  .nhm-topbar__page-title {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .nhm-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── SIDEBAR OVERLAY (mobile) ───────────────────────────── */
.nhm-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 150;
  display: none;
}

.nhm-sidebar-overlay.active {
  display: block;
}

/* ─── MENU TOGGLE (mobile) ───────────────────────────────── */
.nhm-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 768px) {
  .nhm-menu-toggle {
    display: flex;
  }
}

.nhm-menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--trans-fast);
}

/* ─── Hide old theme elements ────────────────────────────── */
body .header {
  display: none !important;
}

body .menu-mobile {
  display: none !important;
}

body .js-uptop {
  display: none !important;
}

body>footer {
  display: none !important;
}

#wpadminbar~.nhm-app {
  padding-top: 0;
}

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ─── UTILITY ────────────────────────────────────────────── */
.nhm-flex {
  display: flex;
}

.nhm-items-center {
  align-items: center;
}

.nhm-justify-between {
  justify-content: space-between;
}

.nhm-gap-8 {
  gap: 8px;
}

.nhm-gap-12 {
  gap: 12px;
}

.nhm-gap-16 {
  gap: 16px;
}

.nhm-flex-1 {
  flex: 1;
}

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

.nhm-text-sm {
  font-size: 12px;
}

.nhm-font-bold {
  font-weight: 700;
}

.nhm-mt-4 {
  margin-top: 4px;
}

.nhm-mt-8 {
  margin-top: 8px;
}

.nhm-mt-16 {
  margin-top: 16px;
}

.nhm-mb-16 {
  margin-bottom: 16px;
}

.nhm-mb-24 {
  margin-bottom: 24px;
}

.nhm-w-full {
  width: 100%;
}

.nhm-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

textarea {
  max-width: 100%;
  min-width: 100%;
}

/* ─── ADMIN BAR compatibility ────────────────────────────── */
body.admin-bar .nhm-sidebar,
body.admin-bar .nhm-topbar {
  top: 32px;
}

body.admin-bar .nhm-content-wrap {
  padding-top: calc(var(--topbar-h) + 32px);
}

body.admin-bar .nhm-sidebar {
  height: calc(100vh - 32px);
}

@media (max-width: 782px) {

  body.admin-bar .nhm-sidebar,
  body.admin-bar .nhm-topbar {
    top: 46px;
  }

  body.admin-bar .nhm-content-wrap {
    padding-top: calc(var(--topbar-h) + 46px);
  }

  body.admin-bar .nhm-sidebar {
    height: calc(100vh - 46px);
  }
}

/* ─── FULL-SCREEN LOGIN OVERRIDE ────────────────────────── */
.nhm-content-wrap.is-login {
  margin-left: 0 !important;
  padding-top: 0 !important;
}
.bg-main.is-login {
  padding: 0 !important;
  min-height: 100vh;
  background: transparent !important;
}