/* ==========================================================================
   Softvirtue Technologies — Admin Design System
   Bootstrap 5.3 + Custom Premium SaaS UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables
   -------------------------------------------------------------------------- */
:root {
  --sidebar-w:           260px;
  --sidebar-collapsed-w: 70px;
  --topbar-h:            64px;

  /* Brand */
  --primary:         #6366f1;
  --primary-hover:   #4f52d9;
  --primary-light:   #eef0fb;
  --primary-soft:    rgba(99, 102, 241, 0.12);

  /* Status */
  --success:       #10b981;
  --success-soft:  rgba(16, 185, 129, 0.12);
  --warning:       #f59e0b;
  --warning-soft:  rgba(245, 158, 11, 0.12);
  --danger:        #ef4444;
  --danger-soft:   rgba(239, 68, 68, 0.12);
  --info:          #3b82f6;
  --info-soft:     rgba(59, 130, 246, 0.12);

  /* Neutrals */
  --bg:             #f4f6fb;
  --card-bg:        #ffffff;
  --border:         #e8ecf4;
  --text-primary:   #1e293b;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Sidebar */
  --sidebar-bg:       #0f172a;
  --sidebar-bg2:      #1e1b4b;
  --sidebar-text:     rgba(255, 255, 255, 0.55);
  --sidebar-text-hover: rgba(255, 255, 255, 0.85);
  --sidebar-active-bg: rgba(99, 102, 241, 0.18);
  --sidebar-active-text: #ffffff;
  --sidebar-border:   rgba(255, 255, 255, 0.07);
  --sidebar-section:  rgba(255, 255, 255, 0.25);

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow:    0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition: all 0.22s ease;
  --transition-fast: all 0.14s ease;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.admin-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   3. Sidebar
   -------------------------------------------------------------------------- */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(160deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width 0.28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text {
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  letter-spacing: -0.2px;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: var(--transition), max-width 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover { color: #fff; background: var(--sidebar-active-bg); }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-list { list-style: none; padding: 0; margin: 0; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-section);
  padding: 14px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.nav-item { margin-bottom: 2px; }

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-link-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active .nav-link-item {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  font-weight: 500;
}

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

.nav-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 13.5px;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: opacity 0.28s ease, max-width 0.28s cubic-bezier(.4,0,.2,1);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.user-details {
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: opacity 0.28s ease, max-width 0.28s cubic-bezier(.4,0,.2,1);
}

.user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   4. Collapsed Sidebar
   -------------------------------------------------------------------------- */
body.sidebar-collapsed .admin-sidebar { width: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .admin-main    { margin-left: var(--sidebar-collapsed-w); }

/* Slide text out of flow (max-width → 0 removes layout width while opacity fades) */
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .user-details {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* Collapse section labels so they occupy zero vertical space */
body.sidebar-collapsed .nav-section-label {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Centre icon in nav item — gap:0 removes the flex gap between icon and hidden label */
body.sidebar-collapsed .nav-link-item {
  justify-content: center;
  padding: 10px;
  gap: 0;
}

/* Header: stack brand icon + toggle button vertically, both stay visible */
body.sidebar-collapsed .sidebar-header {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
  height: auto;
  gap: 4px;
}
body.sidebar-collapsed .sidebar-brand     { gap: 0; }

/* Footer: centre the avatar */
body.sidebar-collapsed .sidebar-user-info { justify-content: center; gap: 0; }

/* --------------------------------------------------------------------------
   5. Main Wrapper
   -------------------------------------------------------------------------- */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s cubic-bezier(.4,0,.2,1);
}

.admin-content {
  padding: 24px;
  flex: 1;
}

/* --------------------------------------------------------------------------
   6. Topbar / Navbar
   -------------------------------------------------------------------------- */
.admin-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1030;
  box-shadow: var(--shadow-xs);
  gap: 16px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.topbar-hamburger:hover { background: var(--bg); color: var(--text-primary); }

.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; }

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.breadcrumb-sep { color: var(--text-muted); font-size: 12px; }
.breadcrumb-sub { font-size: 14px; color: var(--text-secondary); }

/* Search */
.topbar-search {
  position: relative;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 240px;
  padding: 7px 14px 7px 36px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.search-input::placeholder { color: var(--text-muted); }

/* Topbar icon buttons */
.topbar-icon-btn {
  position: relative;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* Topbar user btn */
.topbar-user-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
  display: flex; align-items: center;
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-user-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.topbar-avatar {
  width: 28px; height: 28px;
  background: var(--primary-soft);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--primary);
}

/* Notification Dropdown */
.notif-dropdown {
  width: 340px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.notif-list { padding: 6px 0; max-height: 280px; overflow-y: auto; margin: 0; list-style: none; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

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

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-text { font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-footer { padding: 10px 16px; border-top: 1px solid var(--border); background: #fafbfc; }

/* User Dropdown */
.admin-user-dropdown {
  min-width: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
}

.admin-user-dropdown .dropdown-item {
  font-size: 13.5px;
  padding: 8px 16px;
  color: var(--text-secondary);
  border-radius: 0;
}

.admin-user-dropdown .dropdown-item:hover { background: var(--bg); color: var(--text-primary); }

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px 24px;
  transition: box-shadow 0.2s ease;
}

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

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: default;
}

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

.stat-icon-wrap {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card--primary .stat-icon-wrap { background: var(--primary-soft); color: var(--primary); }
.stat-card--success .stat-icon-wrap { background: var(--success-soft); color: var(--success); }
.stat-card--warning .stat-icon-wrap { background: var(--warning-soft); color: var(--warning); }
.stat-card--danger  .stat-icon-wrap { background: var(--danger-soft);  color: var(--danger);  }
.stat-card--info    .stat-icon-wrap { background: var(--info-soft);    color: var(--info);    }

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

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

/* Skeleton loading */
.skeleton-load .stat-value,
.skeleton-load .stat-label {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 4px;
  color: transparent;
  min-width: 60px;
}

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

/* --------------------------------------------------------------------------
   8. Dashboard Sections
   -------------------------------------------------------------------------- */

/* Greeting */
.dash-greeting { padding: 4px 0; }
.greeting-text { font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* Task List */
.task-list { padding: 4px 0; }
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.task-item:last-child { border-bottom: none; }
.task-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* Activity List */
.activity-list { padding: 4px 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.activity-desc { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Background soft colors for activity icons */
.bg-success-soft { background: var(--success-soft); }
.bg-info-soft    { background: var(--info-soft); }
.bg-danger-soft  { background: var(--danger-soft); }

/* Deadline List */
.deadline-list { padding: 4px 0; }
.deadline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.deadline-item:last-child { border-bottom: none; }
.deadline-type {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.task-type    { background: var(--warning-soft); color: var(--warning); }
.project-type { background: var(--primary-soft); color: var(--primary); }
.deadline-info { flex: 1; min-width: 0; }
.deadline-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-meta  { font-size: 11.5px; color: var(--text-muted); }
.deadline-date  { font-size: 12px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; flex-shrink: 0; }

/* Payment List */
.payment-list { padding: 4px 0; }
.payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.payment-item:last-child { border-bottom: none; }
.payment-number { font-size: 13.5px; font-weight: 600; color: var(--primary); }
.payment-client { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.payment-amount { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */
.table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table thead th {
  background: #fafbfd;
  border-bottom: 1.5px solid var(--border);
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
}

.admin-table thead th:first-child { border-radius: var(--radius-lg) 0 0 0; padding-left: 20px; }
.admin-table thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; padding-right: 20px; }

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafbfd; }
.admin-table tbody tr.row-overdue { background: rgba(239, 68, 68, 0.03); }

.admin-table td {
  padding: 13px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table td:first-child { padding-left: 20px; }
.admin-table td:last-child  { padding-right: 20px; }

.sortable { cursor: pointer; }
.sortable:hover { color: var(--primary); }
.sort-icon { opacity: 0.4; margin-left: 4px; font-size: 11px; }
.sortable:hover .sort-icon { opacity: 1; }

/* Action buttons in tables */
.btn-table-icon {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-left: 4px;
}

.btn-table-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-table-icon.text-danger:hover {
  border-color: var(--danger);
  color: #fff !important;
  background: var(--danger);
}

/* Table pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

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

.pagination-btns {
  display: flex;
  gap: 4px;
}

.pagination-btns .page-btn {
  min-width: 32px; height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btns .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btns .page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination-btns .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   10. Module Toolbar
   -------------------------------------------------------------------------- */
.module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .bi-search {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-box-input {
  width: 240px;
  padding: 8px 14px 8px 34px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
}

.search-box-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.filter-select {
  width: auto;
  padding: 8px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* --------------------------------------------------------------------------
   11. Buttons
   -------------------------------------------------------------------------- */
.btn-admin-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-admin-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.35); color: #fff; }
.btn-admin-primary:active { transform: translateY(0); }

.btn-admin-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-admin-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

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

/* --------------------------------------------------------------------------
   12. Badges
   -------------------------------------------------------------------------- */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
}

.badge-primary   { background: var(--primary-soft); color: var(--primary); }
.badge-success   { background: var(--success-soft);  color: var(--success); }
.badge-warning   { background: var(--warning-soft);  color: #d97706; }
.badge-danger    { background: var(--danger-soft);   color: var(--danger); }
.badge-info      { background: var(--info-soft);     color: var(--info); }
.badge-secondary { background: #f1f5f9;              color: #64748b; }

.badge-pill { padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-soft-primary { background: var(--primary-soft); color: var(--primary); }

/* Priority badges */
.badge-priority {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-priority-low    { background: var(--success-soft); color: var(--success); }
.badge-priority-medium { background: var(--warning-soft); color: #d97706; }
.badge-priority-high   { background: var(--danger-soft);  color: var(--danger); }
.badge-priority-urgent { background: var(--danger);       color: #fff; }

/* Avatar circle */
.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   13. Forms
   -------------------------------------------------------------------------- */
.form-label-admin {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-control-admin {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
}

.form-control-admin:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control-admin::placeholder { color: var(--text-muted); }
.form-control-admin.is-invalid,
.form-control.is-invalid { border-color: var(--danger); }

.form-error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error-msg.visible { display: block; }

/* --------------------------------------------------------------------------
   14. Modals
   -------------------------------------------------------------------------- */
.admin-modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.admin-modal-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}

.admin-modal-header .modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-admin {
  opacity: 0.5;
  transition: var(--transition-fast);
}

.btn-close-admin:hover { opacity: 1; }

.admin-modal-footer {
  background: #fafbfc;
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  gap: 10px;
}

.modal-loader .spinner-ring { margin: 0 auto; }

/* Delete modal */
.delete-icon-wrap {
  width: 58px; height: 58px;
  background: var(--danger-soft);
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--danger);
}

/* Confirm modal */
.confirm-icon-wrap {
  width: 58px; height: 58px;
  background: var(--primary-soft);
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   15. Toast Notifications
   -------------------------------------------------------------------------- */
.admin-toast {
  min-width: 280px;
  max-width: 360px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  animation: toastSlideIn 0.3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

.admin-toast.hiding { animation: toastSlideOut 0.3s ease forwards; }

@keyframes toastSlideOut {
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast-error   .toast-icon { background: var(--danger-soft);  color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast-info    .toast-icon { background: var(--info-soft);    color: var(--info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }

.toast-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 14px; cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.toast-close:hover { color: var(--text-primary); }

/* --------------------------------------------------------------------------
   16. Spinner
   -------------------------------------------------------------------------- */
.spinner-ring {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.table-loading { padding: 40px 0; }

/* --------------------------------------------------------------------------
   17. Settings Page
   -------------------------------------------------------------------------- */
.settings-info-list {
  list-style: none;
  padding: 0; margin: 0;
}

.settings-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.settings-info-list li:last-child { border-bottom: none; }
.settings-info-list li span:first-child { color: var(--text-muted); }
.settings-info-list li span:last-child { font-weight: 500; color: var(--text-primary); }

/* --------------------------------------------------------------------------
   18. Sidebar Overlay (mobile)
   -------------------------------------------------------------------------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1039;
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   19. FAB Button
   -------------------------------------------------------------------------- */
.fab-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1000;
}

.fab-btn:hover { background: var(--primary-hover); transform: scale(1.08); }

/* --------------------------------------------------------------------------
   21. Page Header
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   22. Utility Classes
   -------------------------------------------------------------------------- */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.link-hover { text-decoration: none; transition: color 0.14s ease; }
.link-hover:hover { color: var(--primary) !important; text-decoration: underline; }

/* --------------------------------------------------------------------------
   23. Status / Type Badges
   -------------------------------------------------------------------------- */
.badge-active {
  background: var(--success-soft);
  color: var(--success);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-business {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

/* badge variants used in tables/profiles */
.badge-warning  { background: var(--warning-soft); color: #d97706; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-primary  { background: var(--primary-soft);  color: var(--primary); padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-success  { background: var(--success-soft);  color: var(--success); padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-danger   { background: var(--danger-soft);   color: var(--danger);  padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-secondary { background: #f1f5f9; color: #64748b; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-info     { background: var(--info-soft);     color: var(--info);    padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }

/* --------------------------------------------------------------------------
   24. Table Action Buttons
   -------------------------------------------------------------------------- */
.action-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

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

/* --------------------------------------------------------------------------
   25. View Toggle (Table / Grid)
   -------------------------------------------------------------------------- */
.view-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-toggle-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.view-toggle-btn:hover:not(.active) { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   26. Client Avatar (initials circle)
   -------------------------------------------------------------------------- */
.client-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   27. Client Grid Cards
   -------------------------------------------------------------------------- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.client-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
}

.client-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.client-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  gap: 8px;
}

.client-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.client-card-person {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.client-card-body {
  padding: 0 16px 12px;
  flex: 1;
}

.client-card-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card-meta i { color: var(--text-muted); flex-shrink: 0; }

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.client-stat {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.client-card-actions {
  display: flex;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   28. Contact Quick Buttons (on cards)
   -------------------------------------------------------------------------- */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  color: var(--text-secondary);
}

.btn-call:hover  { border-color: var(--info);    background: var(--info-soft);    color: var(--info); }
.btn-wa:hover    { border-color: #25d366;         background: #e8fdf0;             color: #25d366; }
.btn-email:hover { border-color: var(--primary);  background: var(--primary-light);color: var(--primary); }
.btn-edit:hover  { border-color: var(--warning);  background: var(--warning-soft); color: var(--warning); }

/* --------------------------------------------------------------------------
   29. Client Profile Page
   -------------------------------------------------------------------------- */
.btn-admin-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-secondary);
  font-size: 16px;
  text-decoration: none;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-admin-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.client-profile-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

.client-profile-avatar-lg {
  width: 72px; height: 72px;
  border-radius: 18px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.client-profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.client-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.client-profile-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-profile-meta i { color: var(--text-muted); }

.client-internal-note {
  padding: 8px 12px;
  background: #fefce8;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #713f12;
  border: 1px solid #fde68a;
}

/* --- Profile Stats Cards --- */
.profile-stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: var(--transition-fast);
}

.profile-stat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.profile-stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* --- Profile Tabs --- */
.client-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.client-tabs-nav::-webkit-scrollbar { display: none; }

.client-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
  font-family: inherit;
}

.client-tab-btn:hover { color: var(--text-secondary); }

.client-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   30. Activity Timeline
   -------------------------------------------------------------------------- */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}

.activity-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 28px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}

.activity-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  flex-shrink: 0;
  margin-top: 3px;
}

.activity-body { flex: 1; min-width: 0; }

.activity-desc {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.5;
}

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

/* --------------------------------------------------------------------------
   31. Client Notes
   -------------------------------------------------------------------------- */
.client-note-item {
  background: #fafbfc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: var(--transition-fast);
}

.client-note-item:hover { border-color: var(--primary); }

.client-note-body {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.client-note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.btn-note-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 5px;
  transition: var(--transition-fast);
}

.btn-note-delete:hover { color: var(--danger); background: var(--danger-soft); }

.note-add-area { border-top: 1px solid var(--border); padding-top: 16px; }

/* --------------------------------------------------------------------------
   32. Project Listing — Stat Cards
   -------------------------------------------------------------------------- */
.proj-stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.proj-stat-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }

.proj-stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.proj-stat-body {}
.proj-stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.proj-stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   33. Project Grid Cards
   -------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.project-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-xs);
}

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

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 12px;
  gap: 10px;
}

.project-card-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.project-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.project-card-client {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-card-body { padding: 0 18px 12px; flex: 1; }

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.project-card-meta span { display: flex; align-items: center; gap: 4px; }

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* --------------------------------------------------------------------------
   34. Status Pills (projects)
   -------------------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pending     { background: #fef3c7; color: #92400e; }
.status-in_progress { background: var(--primary-soft); color: var(--primary); }
.status-completed   { background: var(--success-soft); color: var(--success); }
.status-on_hold     { background: #f1f5f9; color: #64748b; }
.status-cancelled   { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------------------
   35. Priority Badges (projects)
   -------------------------------------------------------------------------- */
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.priority-low     { background: #f1f5f9; color: #64748b; }
.priority-medium  { background: var(--primary-soft); color: var(--primary); }
.priority-high    { background: var(--warning-soft); color: #d97706; }
.priority-urgent  { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------------------
   36. Progress Bars (mini — used in cards and tables)
   -------------------------------------------------------------------------- */
.proj-mini-progress {
  width: 100%;
  height: 5px;
  background: #e8ecf4;
  border-radius: 99px;
  overflow: hidden;
}

.proj-mini-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
  background: var(--primary);
}

/* --------------------------------------------------------------------------
   37. Tech Stack Tags
   -------------------------------------------------------------------------- */
.tech-tag {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
  margin-bottom: 3px;
}

.tech-stack-row { display: flex; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   38. Skeleton Loaders (Projects & Clients)
   -------------------------------------------------------------------------- */
.skeleton-block {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.project-card-skeleton,
.client-card-skeleton {
  border-radius: 16px;
  overflow: hidden;
}

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

/* --------------------------------------------------------------------------
   39. Deadline Chip
   -------------------------------------------------------------------------- */
.deadline-chip { font-size: 12.5px; }

/* --------------------------------------------------------------------------
   40. Project Detail Header
   -------------------------------------------------------------------------- */
.proj-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.proj-detail-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.proj-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proj-code-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
}

.proj-detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.proj-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.proj-detail-meta span { display: flex; align-items: center; gap: 5px; }
.proj-detail-meta i { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   41. Project Progress Card (show page)
   -------------------------------------------------------------------------- */
.proj-progress-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  height: 100%;
}

.proj-progress-pct {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.proj-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: #e8ecf4;
  border-radius: 99px;
  overflow: hidden;
}

.proj-progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width 0.5s ease;
}

.btn-xs { padding: 3px 8px; font-size: 12px; }

/* --------------------------------------------------------------------------
   42. Kanban Board
   -------------------------------------------------------------------------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  min-height: 400px;
}

.kanban-column {
  background: #f4f6fb;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.col-backlog    { border-top: 3px solid #6366f1; }
.col-inprogress { border-top: 3px solid #f59e0b; }
.col-testing    { border-top: 3px solid #3b82f6; }
.col-done       { border-top: 3px solid #10b981; }

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.kanban-col-count {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.kanban-add-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.kanban-add-btn:hover { background: var(--primary-soft); color: var(--primary); }

.kanban-col-body {
  padding: 6px 10px 10px;
  flex: 1;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   43. Kanban Cards
   -------------------------------------------------------------------------- */
.kanban-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: grab;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.kanban-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.kanban-card:active { cursor: grabbing; }

.kanban-card-priority-bar {
  height: 3px;
  width: 100%;
}

.kanban-card-body { padding: 12px 12px 8px; }

.kanban-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.kanban-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.kanban-priority { display: flex; align-items: center; gap: 4px; font-weight: 500; }

.kanban-hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-mini-progress {
  flex: 1;
  height: 4px;
  background: #e8ecf4;
  border-radius: 99px;
  overflow: hidden;
}

.kanban-mini-progress > div {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 4px;
}

.kanban-edit-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-edit-btn:hover { color: var(--primary); background: var(--primary-light); }

.kanban-delete-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  transition: var(--transition-fast);
}

.kanban-delete-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* Drag states */
.kanban-ghost { opacity: 0.4; }
.kanban-drag  { box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important; transform: rotate(2deg) !important; }

/* --------------------------------------------------------------------------
   44. Kanban Header Row
   -------------------------------------------------------------------------- */
.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   45. Overview Tab Helpers
   -------------------------------------------------------------------------- */
.overview-field-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.task-count-box {
  background: #f4f6fb;
  border-radius: var(--radius);
  padding: 14px 8px;
}

.tcb-val { font-size: 22px; font-weight: 800; line-height: 1; }
.tcb-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.billing-overview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.billing-overview-row:last-child { border-bottom: none; }

/* --------------------------------------------------------------------------
   46. File Upload UI
   -------------------------------------------------------------------------- */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.file-item:hover { border-color: var(--primary); }

.file-icon {
  width: 40px; height: 40px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.file-body { flex: 1; min-width: 0; }
.file-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { margin-top: 2px; }
.file-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   47. Activity Dot Variants
   -------------------------------------------------------------------------- */
.activity-dot-created      { background: var(--success); border-color: var(--success); }
.activity-dot-updated      { background: var(--primary); border-color: var(--primary); }
.activity-dot-deleted      { background: var(--danger);  border-color: var(--danger);  }
.activity-dot-task_added   { background: var(--info);    border-color: var(--info);    }
.activity-dot-task_moved   { background: #f59e0b;        border-color: #f59e0b;        }
.activity-dot-task_deleted { background: var(--danger);  border-color: var(--danger);  }
.activity-dot-note_added   { background: #8b5cf6;        border-color: #8b5cf6;        }
.activity-dot-file_uploaded{ background: var(--success); border-color: var(--success); }
.activity-dot-file_deleted { background: var(--danger);  border-color: var(--danger);  }
.activity-dot-status_change{ background: #f59e0b;        border-color: #f59e0b;        }
.activity-dot-progress     { background: var(--info);    border-color: var(--info);    }

/* --------------------------------------------------------------------------
   49. Task Show Page
   -------------------------------------------------------------------------- */
.task-section-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 16px !important;
}

.task-description-box {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-detail-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

/* --------------------------------------------------------------------------
   50. Access Control
   -------------------------------------------------------------------------- */
.access-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.access-flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.access-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.access-step-title {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.access-step-copy {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 2px;
}

.access-flow-line {
  height: 1.5px;
  background: var(--border);
  border-radius: 99px;
}

.access-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.access-tab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.access-tab:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.access-tab.active {
  color: #fff;
  background: var(--primary);
}

.access-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.access-role-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  transition: var(--transition-fast);
}

.access-role-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.access-role-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.access-role-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.access-role-card p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.access-role-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-soft);
  color: var(--success);
  font-size: 18px;
  flex-shrink: 0;
}

.access-role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12.5px;
  margin: 14px 0 12px;
}

.access-role-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.access-module-row,
.access-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-module-row { margin-bottom: 16px; }

.access-module-chip,
.access-role-pill,
.access-muted-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.access-module-chip {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.access-module-chip b {
  color: var(--text-primary);
  font-weight: 800;
}

.access-role-pill {
  background: var(--primary-soft);
  color: var(--primary);
}

.access-muted-pill {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.access-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.access-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.access-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.access-code {
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  white-space: nowrap;
}

.access-inline-note {
  color: var(--text-muted);
  font-size: 12.5px;
  padding-top: 8px;
}

.access-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.access-check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  background: #fff;
  transition: var(--transition-fast);
}

.access-check-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.access-check-card input {
  margin-top: 3px;
  flex-shrink: 0;
}

.access-check-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.access-check-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.access-modal-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.access-permission-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.access-permission-group {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.access-permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 13px;
}

.access-permission-options {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.access-permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 2px;
}

.access-permission-option:hover { color: var(--text-primary); }

@media (max-width: 767.98px) {
  .access-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .access-flow-line { display: none; }

  .access-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .access-tab { justify-content: center; }

  .access-card-actions { flex-direction: column; }

  .access-permission-matrix { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   48. Kanban Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .proj-detail-header { flex-direction: column; }
  .proj-detail-name   { font-size: 18px; }
}

/* --------------------------------------------------------------------------
   20. Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }

  .admin-main { margin-left: 0 !important; }

  .topbar-hamburger { display: flex !important; }

  .sidebar-toggle-btn { display: none; }

  body.sidebar-mobile-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-mobile-open .sidebar-overlay { display: block; }

  .admin-content { padding: 16px; }

  .search-box-input { width: 180px; }

  .module-toolbar { flex-direction: column; align-items: flex-start; }

  .topbar-search { display: none !important; }

  .stat-card { flex-direction: column; text-align: center; padding: 16px 12px; }
  .stat-icon-wrap { margin: 0 auto; }
}

@media (max-width: 575.98px) {
  .admin-content { padding: 12px; }

  .stat-value { font-size: 18px; }

  .search-box-input { width: 150px; }

  .admin-table { font-size: 12.5px; }
  .admin-table td, .admin-table th { padding: 10px 12px; }

  .notif-dropdown { width: 300px; }
}
