/* ==========================================================================
   Elegent CRM - Material UI Inspired Design System
   ========================================================================== */

/* Color Tokens & Variables */
:root {
  --primary-main: #11705f;
  /* Orange */
  --primary-light: #FFF4EA;
  /* Cream */
  --primary-dark: #CC7221;

  --secondary-main: #27D095;
  /* Caribbean Green */
  --secondary-light: #D4F6EA;
  --secondary-dark: #1FA677;

  --success-main: #4caf50;
  --success-light: #e8f5e9;
  --success-dark: #2e7d32;

  --info-main: #67CADF;
  /* Downy */
  --info-light: #E1F4F9;
  --info-dark: #52A2B2;

  --warning-main: #f57c00;
  --warning-light: #fff3e0;
  --warning-dark: #e65100;

  --error-main: #F54F5F;
  /* Watermelon */
  --error-light: #FDDCDF;
  --error-dark: #C43F4C;

  --background-default: #E6F4EF;

  /* Cream background */
  --background-paper: #ffffff;

  --text-primary: #050F24;
  /* Dark Navy-Black */
  --text-secondary: #6F757E;
  /* Smoke */
  --text-disabled: #CCCDCD;

  --divider: #E1E1E1;
  --action-hover: #F5F5F5;
  --action-selected: rgba(255, 142, 41, 0.08);

  --font-family-body: 'Poppins', sans-serif;
  --font-family-display: 'IBM Plex Sans', sans-serif;

  --sidebar-width: 278px;
  --topbar-height: 96px;
  /* 12 spacing units */

  --shadow-1: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
  --shadow-2: 0px 4px 10px 2px rgba(0, 0, 0, 0.1);
  --shadow-4: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  --shadow-8: 0px 0px 5px 0px rgba(0, 0, 0, 0.15);
  --shadow-16: 0px 8px 24px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--background-default);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-display);
  font-weight: 600;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: var(--primary-main);
}

/* App Shell Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

/* Topbar Styles */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--topbar-height);
  background-color: var(--background-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  z-index: 1100;
}

@media (min-width: 1200px) {
  .topbar {
    left: var(--sidebar-width);
  }
}

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

.menu-toggle {
  display: flex;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 50%;
}

.menu-toggle:hover {
  background-color: var(--action-hover);
}

@media (min-width: 1200px) {
  .menu-toggle {
    display: none;
  }
}

.topbar-search {
  max-width: 250px;
  width: 100%;
  margin: 0 24px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: white;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
  color: var(--text-secondary);
  transition: border-color 0.2s, background-color 0.2s;
  cursor: text;
}

.search-box:focus-within {
  border-color: var(--primary-main);
  background-color: var(--background-paper);
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-title-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
  font-weight: 400;
}

@media (max-width: 768px) {
  .header-subtitle {
    display: none;
  }
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--success-light);
  color: var(--success-main);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-main);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.6;
  }

  100% {
    transform: scale(0.9);
    opacity: 1;
  }
}

.user-select-header select {
  background:white;
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.icon-button:hover {
  background-color: var(--action-hover);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--error-main);
  color: #fff;
  font-size: 0.65rem;
  font-weight: bold;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
}

.avatar-button {
  border: none;
  background-color: var(--primary-main);
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  background-color: var(--background-paper);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-right: none;
  overflow: hidden;
  transition: transform 0.3s, top 0.3s, left 0.3s, width 0.3s, border-radius 0.3s, box-shadow 0.3s;
}

.sidebar-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  display: none;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: 0;
  border-top: 1px solid var(--divider);
}

@media (min-width: 1200px) {
  .sidebar {
    top: 30px;
    bottom: 30px;
    left: 30px;
    width: 235px;
    /* width 218px floating card */
    border-radius: 20px;
    box-shadow: var(--shadow-4);
  }
}

@media (max-width: 1199px) {
  .sidebar {
    top: 0;
    bottom: 0;
    left: 0;
    width: 278px;
    border-radius: 0;
    box-shadow: var(--shadow-8);
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1150;
}

@media (max-width: 1199px) {
  .sidebar.open+.sidebar-backdrop {
    display: block;
  }
}

.sidebar-brand {
  min-height: 72px;
  height: auto;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--divider);
}

.sidebar-brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
}

.sidebar-brand-text-only .sidebar-brand-link {
  gap: 2px;
}

.sidebar-brand-label {
  font-family: var(--font-family-heading, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  color: var(--primary-main);
  word-break: break-word;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.sidebar-brand-icon {
  font-size: 1.75rem;
  color: var(--primary-main);
  margin-bottom: 4px;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 180px;
  max-height: 80px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.sidebar-menu {
  list-style: none;
  padding: 10px 10px;
}

.sidebar-item {
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.sidebar-link:hover {
  background-color: var(--action-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background-color: var(--primary-main);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-link.active .iconify {
  color: #ffffff;
}

.sidebar-link .iconify {
  font-size: 22px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link.logout-link {
  color: var(--primary-main);
}

.sidebar-link.logout-link:hover {
  background-color: rgba(27, 177, 167, 0.12);
  color: var(--primary-main);
}

.sidebar-link.logout-link .iconify,
.sidebar-link.logout-link span {
  color: var(--primary-main);
}

/* Content Area Layout */
.main-content {
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
  padding: calc(var(--topbar-height) + 24px) 30px 24px;
  display: flex;
  flex-direction: column;
  transition: padding-left 0.3s;
}

@media (min-width: 1200px) {
  .main-content {
    padding-left: calc(var(--sidebar-width) + 30px);
    padding-right: 30px;
  }
}

.content-inner {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2px;
}

.projects-header-btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.projects-header-btn-group .btn {
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 30px;
  /* Pill shaped buttons */
  padding: 10px 24px;
  font-family: var(--font-family-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: none;
  outline: none;
  text-transform: none;
}

.btn-primary {
  background-color: var(--primary-main);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: none;
}

.btn-primary:disabled {
  background-color: var(--text-disabled);
  color: var(--background-paper);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-outlined {
  background: transparent;
  color: var(--primary-main);
  border: 1px solid var(--primary-main);
}

.btn-outlined:hover {
  background-color: rgba(255, 142, 41, 0.04);
  border-color: var(--primary-main);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--divider);
}

.btn-secondary:hover {
  background-color: var(--action-hover);
  color: var(--text-primary);
}

.btn-small {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-icon:hover {
  background-color: var(--action-hover);
}

.btn-icon-error {
  color: var(--error-main);
}

.btn-icon-error:hover {
  background-color: var(--error-light);
}

/* Dashboard Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

/* Card Styles */
.card {
  background-color: var(--background-paper);
  border-radius: 20px;
  /* theme.shape.borderRadius * 5 = 20px */
  padding: 20px;
  /* theme.spacing(2.5) = 20px */
  border: none;
  /* no border */
  box-shadow: var(--shadow-8);
  /* 0px 0px 5px 0px rgba(0, 0, 0, 0.15) */
  display: flex;
  flex-direction: column;
}

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

.metric-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-val {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 4px;
}

.metric-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.metric-avatar.primary {
  background-color: var(--primary-light);
  color: var(--primary-main);
}

.metric-avatar.success {
  background-color: var(--success-light);
  color: var(--success-main);
}

.metric-avatar.warning {
  background-color: var(--warning-light);
  color: var(--warning-main);
}

.metric-avatar.info {
  background-color: var(--info-light);
  color: var(--info-main);
}

.metric-avatar.secondary {
  background-color: var(--secondary-light);
  color: var(--secondary-main);
}

.metric-avatar.error {
  background-color: var(--error-light);
  color: var(--error-main);
}

/* Activity Form Panels */
.activity-form-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Chip outlined colour variants */
.chip-primary.chip-outlined {
  background: transparent;
  border: 1px solid var(--primary-main);
  color: var(--primary-main);
}

.chip-secondary.chip-outlined {
  background: transparent;
  border: 1px solid var(--secondary-main);
  color: var(--secondary-main);
}

.chip-success.chip-outlined {
  background: transparent;
  border: 1px solid var(--success-main);
  color: var(--success-main);
}

.chip-warning.chip-outlined {
  background: transparent;
  border: 1px solid var(--warning-main);
  color: var(--warning-main);
}

.chip-error.chip-outlined {
  background: transparent;
  border: 1px solid var(--error-main);
  color: var(--error-main);
}

.chip-info.chip-outlined {
  background: transparent;
  border: 1px solid var(--info-main);
  color: var(--info-main);
}

.metric-caption {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 16px;
  display: block;
}

/* Charts Grid Layout */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .charts-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.chart-card {
  height: 420px;
  display: flex;
  flex-direction: column;
}

.chart-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.chart-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.chart-container {
  flex-grow: 1;
  min-height: 0;
  position: relative;
}

/* ---- Sales Funnel Horizontal Bar Chart ---- */
.funnel-card {
  height: auto;
  min-height: 420px;
}

.funnel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.funnel-live-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1.5px solid var(--divider);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  margin-top: 2px;
}

.funnel-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-grow: 1;
  position: relative;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.funnel-row-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 100px;
  text-align: right;
  flex-shrink: 0;
}

.funnel-row-track {
  flex-grow: 1;
  height: 38px;
  background-color: var(--action-hover);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-row-track:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.funnel-row-fill {
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  min-width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
  white-space: nowrap;
  overflow: hidden;
}

.funnel-row-value {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
  transition: opacity 0.4s ease;
}

/* Dashboard Lists Grid */
.feeds-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .feeds-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feed-card {
  min-height: 340px;
}

.feed-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.feed-card p.subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Divided Feed List */
.feed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
  gap: 16px;
}

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

.feed-item:first-child {
  padding-top: 8px;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.feed-avatar.primary {
  background-color: var(--primary-light);
  color: var(--primary-main);
}

.feed-avatar.secondary {
  background-color: var(--secondary-light);
  color: var(--secondary-main);
}

.feed-avatar.info {
  background-color: var(--info-light);
  color: var(--info-main);
}

.feed-avatar.warning {
  background-color: var(--warning-light);
  color: var(--warning-main);
}

.feed-body {
  flex-grow: 1;
}

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

.feed-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.feed-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.feed-details strong {
  color: var(--text-primary);
  font-weight: 500;
}

.feed-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Standings list specific styles */
.rank-badge {
  font-size: 1rem;
  font-weight: 700;
  width: 24px;
  color: var(--text-secondary);
}

.rank-item-1 .rank-badge {
  color: var(--warning-main);
}

.standings-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-main);
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.rank-item-1 .standings-avatar {
  background-color: var(--warning-light);
  color: var(--warning-main);
}

.rank-item-2 .standings-avatar {
  background-color: var(--divider);
  color: var(--text-secondary);
}

.standings-scores {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Chips / Badges */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

.chip-primary {
  background-color: var(--primary-light);
  color: var(--primary-main);
}

.chip-secondary {
  background-color: var(--secondary-light);
  color: var(--secondary-main);
}

.chip-success {
  background-color: var(--success-light);
  color: var(--success-main);
}

.chip-info {
  background-color: var(--info-light);
  color: var(--info-main);
}

.chip-warning {
  background-color: var(--warning-light);
  color: var(--warning-main);
}

.chip-error {
  background-color: var(--error-light);
  color: var(--error-main);
}

.chip-default {
  background-color: var(--action-hover);
  color: var(--text-secondary);
}

.lead-warmth-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  line-height: 1.3;
  vertical-align: middle;
}

.chip-outlined {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-secondary);
}

/* Tabs Panel */
.tabs-container {
  border-bottom: 1px solid var(--divider);
  display: flex;
  margin-bottom: 24px;
  gap: 16px;
}

.tab {
  background: none;
  border: none;
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px 8px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  outline: none;
}

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

.tab.active {
  color: var(--primary-main);
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-main);
}

.tab-badge {
  background-color: var(--primary-main);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.tab-badge-warning {
  background-color: var(--warning-main);
}

/* Activities page toolbar */
.activities-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--divider);
}

.activities-tabs {
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0;
  flex-wrap: wrap;
}

.activities-tabs .tab {
  white-space: nowrap;
  margin-bottom: -1px;
}

.activities-tabs .tab.active::after {
  bottom: -1px;
  z-index: 1;
}

.activities-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.activity-date-filter {
  background: var(--background-paper);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 280px;
  box-shadow: var(--shadow-1);
}

.activity-date-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.activity-date-filter-label .iconify {
  font-size: 1rem;
  color: var(--primary-main);
}

.activity-date-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-date-input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--background-default);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.activity-date-input:focus {
  outline: none;
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(27, 177, 167, 0.15);
}

.activity-date-today-btn {
  border-color: var(--primary-main) !important;
  color: var(--primary-main) !important;
}

.activity-date-clear-btn {
  color: var(--text-secondary) !important;
}

.activity-date-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-height: 1.1em;
}

.activity-date-hint.is-active {
  color: var(--primary-dark);
  font-weight: 500;
}

.activity-type-chips {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.activity-type-chips .chip {
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
}

/* Tables / Lists */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card-header {
  padding: 24px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--divider);
  font-size: 0.88rem;
}

.table th {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.leads-select-col input[type="checkbox"],
.lead-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-main);
}

.leads-created-col {
  white-space: nowrap;
}

/* Leads table: column visibility per tab */
.leads-data-table.leads-tab-pool .leads-status-col {
  display: none;
}

.leads-data-table.leads-tab-assigned .leads-phone-col,
.leads-data-table.leads-tab-assigned .leads-created-col {
  display: none;
}

.leads-source-col {
  white-space: nowrap;
}

.leads-source-col .chip {
  white-space: nowrap;
}

.activities-scheduled-col {
  white-space: nowrap;
}

.activities-compact-table th,
.activities-compact-table td {
  padding: 15px 20px;
  vertical-align: middle;
  line-height: 1.45;
}

.activities-compact-table tbody tr {
  min-height: 52px;
}

.activities-type-cell,
.activities-lead-cell,
.activities-agent-cell,
.activities-status-cell,
.activities-actions-col {
  white-space: nowrap;
}

.activities-type-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.activities-type-icon {
  font-size: 1.1rem;
  opacity: 0.75;
  flex-shrink: 0;
}

.activities-type-chip,
.activities-status-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  line-height: 1.3;
}

.activities-lead-cell {
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activities-agent-cell {
  font-weight: 500;
  font-size: 0.88rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activities-covering-tag {
  color: var(--warning-main);
  font-size: 0.75rem;
  margin-left: 2px;
}

.activities-actions-col {
  text-align: right;
  width: 120px;
}

.activities-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-act-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.btn-act-icon .iconify {
  font-size: 1.2rem;
}

.btn-act-complete {
  color: var(--success-main);
}

.btn-act-complete:hover {
  background: var(--success-light);
}

.btn-act-cancel {
  color: var(--error-main);
}

.btn-act-cancel:hover {
  background: var(--error-light);
}

.btn-act-info {
  color: var(--primary-main);
}

.btn-act-info:hover {
  background: var(--primary-light);
}

.activity-detail-panel {
  max-width: 480px;
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.activity-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.activity-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-detail-notes-block {
  border-top: 1px solid var(--divider);
  padding-top: 14px;
}

.activity-detail-notes {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-lead-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table tbody tr {
  transition: background-color 0.15s;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.table-empty {
  padding: 64px;
  text-align: center;
  color: var(--text-secondary);
}

/* Modal Dialog */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s;
}

.modal-panel {
  background-color: var(--background-paper);
  border-radius: 16px;
  box-shadow: var(--shadow-16);
  max-width: 480px;
  width: calc(100% - 32px);
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  animation: modal-scale 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-scale {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

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

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

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 50%;
}

.modal-close:hover {
  background-color: var(--action-hover);
}

.modal-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Right Detail Drawer */
.drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1400;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  max-width: 600px;
  background-color: var(--background-paper);
  box-shadow: var(--shadow-16);
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: drawer-slide 0.25s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes drawer-slide {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

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

.drawer-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.drawer-header p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 50%;
}

.drawer-close:hover {
  background-color: var(--action-hover);
}

.drawer-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.drawer-col {
  flex: 1;
  min-width: 120px;
}

.drawer-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.drawer-val {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Form Fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="datetime-local"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  outline: none;
  background-color: var(--background-paper);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

/* ══ Profile modal (#modal-user-profile) ══════════════════ */
#modal-user-profile .profile-modal-panel {
  max-width: 580px;
  border: 1px solid var(--divider);
  box-shadow: 0 12px 40px rgba(17, 112, 95, 0.15);
  overflow: hidden;
}

#modal-user-profile .profile-modal-content {
  max-height: 72vh;
  gap: 0;
  padding: 0;
  overflow-y: auto;
}

#modal-user-profile .profile-modal-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 24px;
  background: linear-gradient(145deg, var(--primary-light) 0%, var(--background-paper) 55%);
  border-bottom: 1px solid var(--divider);
}

#modal-user-profile .profile-modal-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

#modal-user-profile .profile-modal-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  cursor: pointer;
  flex-shrink: 0;
}

#modal-user-profile .profile-modal-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 700;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 6px 20px rgba(17, 112, 95, 0.28);
}

#modal-user-profile .profile-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

#modal-user-profile .profile-modal-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

#modal-user-profile .profile-modal-avatar-edit .iconify {
  font-size: 15px;
}

#modal-user-profile .profile-modal-name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

#modal-user-profile .profile-modal-role {
  margin: 8px 0 0;
  display: flex;
  justify-content: center;
}

#modal-user-profile .profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 24px;
}

#modal-user-profile .profile-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

#modal-user-profile .profile-grid-full {
  grid-column: 1 / -1;
  margin: 0;
}

#modal-user-profile .profile-modal-grid-dob {
  row-gap: 12px;
}

#modal-user-profile .profile-dob-field {
  margin: 0;
}

#modal-user-profile .profile-dob-field .att-date-field {
  width: 100%;
  min-width: 0;
  flex: none;
}

#modal-user-profile .profile-dob-field .att-date-control,
#modal-user-profile .profile-dob-field .att-date-control-profile {
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 36px 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--divider);
  background: var(--background-paper);
  box-sizing: border-box;
  gap: 8px;
}

#modal-user-profile .profile-dob-field .att-date-text {
  flex-direction: row;
  gap: 0;
}

#modal-user-profile .profile-dob-field .att-date-control:hover,
#modal-user-profile .profile-dob-field .att-date-control-profile:hover {
  border-color: rgba(17, 112, 95, 0.45);
}

#modal-user-profile .profile-dob-field .att-date-control:focus-within,
#modal-user-profile .profile-dob-field .att-date-control.is-active,
#modal-user-profile .profile-dob-field .att-date-control-profile:focus-within,
#modal-user-profile .profile-dob-field .att-date-control-profile.is-active {
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.12);
}

#modal-user-profile .profile-dob-field .att-date-icon {
  font-size: 1.1rem;
}

#modal-user-profile .profile-dob-field .att-date-display {
  font-size: 0.92rem;
  line-height: 1.2;
}

#modal-user-profile .form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

#modal-user-profile .form-field input[type="text"],
#modal-user-profile .form-field input[type="email"],
#modal-user-profile .form-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--divider);
  border-radius: 10px;
  font-family: var(--font-family-body);
  font-size: 0.92rem;
  background: var(--background-paper);
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
}

#modal-user-profile .form-field input:focus,
#modal-user-profile .form-field select:focus {
  outline: none;
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.12);
}

#modal-user-profile .profile-input-readonly {
  background: var(--action-hover) !important;
  cursor: not-allowed;
  color: var(--text-secondary) !important;
}

/* Change password */
#modal-user-profile .profile-password-section {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

#modal-user-profile .profile-password-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--divider);
  border-radius: 11px;
  background: linear-gradient(125deg, rgba(17, 112, 95, 0.08) 0%, var(--background-paper) 100%);
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

#modal-user-profile .profile-password-toggle:hover {
  border-color: var(--primary-main);
  box-shadow: 0 3px 12px rgba(17, 112, 95, 0.12);
}

#modal-user-profile .profile-password-toggle.is-open {
  border-color: var(--primary-main);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.1);
}

#modal-user-profile .profile-password-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#modal-user-profile .profile-password-toggle-left .iconify {
  font-size: 1.25rem;
  color: var(--primary-main);
}

#modal-user-profile .profile-password-chevron {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

#modal-user-profile .profile-password-toggle.is-open .profile-password-chevron {
  transform: rotate(180deg);
  color: var(--primary-main);
}

#modal-user-profile .profile-password-panel {
  margin-top: 12px;
  padding: 18px;
  border: 1.5px solid var(--divider);
  border-radius: 12px;
  background: var(--background-default);
}

#modal-user-profile .profile-password-hint {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary-main);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

#modal-user-profile .profile-pw-wrap {
  position: relative;
}

#modal-user-profile .profile-pw-wrap input[type="password"],
#modal-user-profile .profile-pw-wrap input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 44px 10px 14px;
  border: 1.5px solid var(--divider);
  border-radius: 10px;
  font-family: var(--font-family-body);
  font-size: 0.92rem;
  background: var(--background-paper);
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
}

#modal-user-profile .profile-pw-wrap input:focus {
  outline: none;
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.12);
}

#modal-user-profile .profile-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#modal-user-profile .profile-pw-toggle:hover {
  background: var(--action-hover);
  color: var(--primary-main);
}

#modal-user-profile .profile-pw-toggle .iconify {
  font-size: 1.15rem;
}

#modal-user-profile .profile-password-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

#modal-user-profile .profile-password-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}

#modal-user-profile .profile-password-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  padding: 11px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(17, 112, 95, 0.28);
}

#modal-user-profile .profile-password-submit:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(17, 112, 95, 0.34);
}

#modal-user-profile .profile-password-submit .iconify {
  font-size: 1.15rem;
}

#modal-user-profile .profile-modal-actions {
  padding: 14px 24px 18px;
  background: var(--background-default);
  border-top: 1px solid var(--divider);
}

@media (max-width: 576px) {
  #modal-user-profile .profile-modal-grid,
  #modal-user-profile .profile-password-grid {
    grid-template-columns: 1fr;
  }

  #modal-user-profile .profile-modal-body {
    padding: 16px 18px 20px;
  }

  #modal-user-profile .profile-password-submit {
    width: 100%;
  }
}

.form-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

@media (max-width: 576px) {
  .form-row {
    flex-direction: column;
  }
}

.grant-access-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grant-access-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.grant-access-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-main);
}

.grant-access-item:hover {
  background-color: var(--action-hover);
}

/* Detail Contact Info Panel */
.details-summary-card {
  background-color: var(--background-default);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-summary-card .drawer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.details-summary-card .drawer-col {
  min-width: 0;
}

.details-summary-title {
  font-size: 0.88rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.activity-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.timeline-card {
  background-color: var(--background-paper);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 16px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.timeline-notes {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.timeline-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--divider);
  padding-top: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Snackbar Alert System */
.snackbar {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: #323232;
  color: #fff;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-8);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateY(120px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.snackbar.show {
  transform: translateY(0);
}

.snackbar.success {
  background-color: var(--success-dark);
}

.snackbar.error {
  background-color: var(--error-dark);
}

.snackbar.info {
  background-color: var(--info-dark);
}

.snackbar.warning {
  background-color: var(--warning-dark);
}

/* Quick Filters Panels */
.filters-panel {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters-panel .form-field {
  max-width: 200px;
  width: 100%;
}

/* Projects grid and card classes */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.project-card-loc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.project-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-grow: 1;
  margin-bottom: 16px;
}

.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}

.project-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-main);
}

.project-config {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Auth Layout styling */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background-default);
  padding: 16px;
}

.auth-card {
  max-width: 420px;
  width: 100%;
  background-color: var(--background-paper);
  border-radius: 16px;
  padding: 40px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-4);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header {
  text-align: center;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 12px;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.auth-footer a {
  font-weight: 600;
}

/* Toggle settings style */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.switch-control:last-child {
  border-bottom: none;
}

.switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.switch-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.switch-btn {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch-btn input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-disabled);
  transition: .4s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch-btn input:checked+.switch-slider {
  background-color: var(--primary-main);
}

.switch-btn input:checked+.switch-slider:before {
  transform: translateX(24px);
}

/* Sidebar Logout Link Overrides */
.logout-link {
  background-color: var(--background-paper);
  color: var(--primary-main);
  transition: all 0.2s ease-in-out;
}

.logout-link:hover {
  background-color: var(--primary-main) !important;
}

.logout-link:hover span {
  color: #ffffff !important;
}

.logout-link:hover .iconify {
  color: #ffffff !important;
}

/* ---- Funnel Chart Tooltip Styles ---- */
.funnel-tooltip {
  position: absolute;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-family: var(--font-family-body);
  color: var(--text-primary);
  box-shadow: var(--shadow-16);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  line-height: 1.4;
}

.funnel-tooltip-title {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.funnel-tooltip-body {
  display: flex;
  align-items: center;
  gap: 6px;
}

.funnel-tooltip-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.funnel-tooltip-label {
  color: var(--text-primary);
}

.funnel-tooltip-value {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 4px;
}

/* ============================================================
   Lead Importer — Dropzone & Mapping Wizard Styles
   ============================================================ */

.import-dropzone {
  border: 2px dashed var(--divider);
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  background-color: var(--background-default);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.import-dropzone:hover {
  border-color: var(--primary-main);
  background-color: rgba(17, 112, 95, 0.04);
}

.import-dropzone.dragover {
  border-color: var(--primary-main);
  background-color: rgba(17, 112, 95, 0.08);
  transform: scale(1.015);
  box-shadow: 0 0 0 4px rgba(17, 112, 95, 0.12);
}

.import-dropzone.file-loaded {
  border-color: var(--success-main);
  background-color: var(--success-light);
}

.import-dropzone-icon {
  font-size: 48px;
  color: var(--primary-main);
  opacity: 0.7;
  margin-bottom: 4px;
}

.import-dropzone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.import-dropzone-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* File status pill */
.import-file-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--background-default);
  border-radius: 8px;
}

/* Mapping grid: 2 columns */
.import-mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .import-mapping-grid {
    grid-template-columns: 1fr;
  }
}

/* Project-required guidance modal (lead import) */
.project-required-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 152, 0, 0.12);
  color: var(--warning-main, #e65100);
  flex-shrink: 0;
}

.project-required-icon .iconify {
  font-size: 24px;
}

.project-required-message {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.project-required-detail {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.35);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 120px;
  overflow-y: auto;
}

.project-required-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.project-required-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.project-required-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-main);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.project-required-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.project-required-actions .btn {
  text-decoration: none;
}

@media (max-width: 560px) {
  .project-required-actions {
    flex-direction: column;
  }

  .project-required-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.import-source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.import-source-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 20px 18px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--background-paper);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.import-source-card:hover {
  border-color: var(--primary-main);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.import-source-card-icon {
  font-size: 1.8rem;
  color: var(--primary-main);
}

.import-source-card strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.import-source-card span:last-child {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

@media (max-width: 560px) {
  .import-source-grid {
    grid-template-columns: 1fr;
  }
}

/* Leaderboard layout */
.leaderboard-main-section {
  margin-bottom: 24px;
}

.leaderboard-formula-section {
  margin-top: 0;
}

/* Leaderboard scoring formula */
.leaderboard-formula-card {
  padding: 24px;
}

.leaderboard-formula-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.leaderboard-formula-header p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.leaderboard-formula-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.leaderboard-formula-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--background-default);
}

.leaderboard-formula-icon {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

.leaderboard-formula-item-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.leaderboard-formula-item-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
  min-height: 2.4em;
}

.leaderboard-formula-points {
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: auto;
}

.leaderboard-formula-points.primary { color: var(--primary-main); }
.leaderboard-formula-points.warning { color: var(--warning-main); }
.leaderboard-formula-points.secondary { color: var(--secondary-main); }
.leaderboard-formula-points.success { color: var(--success-main); }
.leaderboard-formula-points.info { color: var(--info-main); }

.leaderboard-formula-note {
  margin-top: 20px;
  background-color: var(--primary-light);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--primary-main);
  display: flex;
  gap: 8px;
  align-items: center;
}

.leaderboard-formula-note .iconify {
  font-size: 1.2rem;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .leaderboard-formula-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .leaderboard-formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Attendance */
.attendance-punch-card {
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-main);
}

.attendance-punch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.attendance-punch-times {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.attendance-time-block {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--background-default);
  border: 1px solid var(--divider);
}

.attendance-time-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.attendance-punch-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Attendance log + filters ───────────────────────────── */
.attendance-log-card {
  margin-bottom: 20px;
}

.attendance-log-card .table-card-header .attendance-filter-sub {
  margin-top: 4px;
}

.attendance-log-filters {
  border-bottom: 1px solid var(--divider);
}

.attendance-filter-card {
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--divider);
  box-shadow: 0 4px 18px rgba(17, 112, 95, 0.07);
}

.attendance-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: var(--background-paper);
  border-bottom: 1px solid var(--divider);
}

.attendance-filter-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.attendance-filter-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-main);
  color: #fff;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(17, 112, 95, 0.28);
}

.attendance-filter-heading {
  margin: 0 0 4px;
  font-size: 1.06rem;
  font-weight: 700;
}

.attendance-filter-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.attendance-filter-badge {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--background-paper);
  border: 1px solid var(--divider);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-main);
  white-space: nowrap;
}

.attendance-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: var(--background-default);
  border-bottom: 1px solid var(--divider);
}

.attendance-toolbar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.attendance-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  gap: 2px;
  border-radius: 12px;
  background: var(--background-paper);
  border: 1px solid var(--divider);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.attendance-segment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-family-body);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.attendance-segment .iconify { font-size: 1.05rem; }

.attendance-segment:hover {
  color: var(--primary-main);
  background: var(--primary-light);
}

.attendance-segment.active {
  background: var(--primary-main);
  color: #fff;
  box-shadow: 0 2px 8px rgba(17, 112, 95, 0.3);
}

.attendance-segment-today.active {
  background: #2e7d32;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.32);
}

.attendance-filter-body {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-end;
  padding: 20px 22px;
}

.attendance-panel-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.attendance-range-panel { flex: 1 1 340px; }

.attendance-range-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.attendance-range-connector {
  display: flex;
  align-items: center;
  padding-bottom: 14px;
  color: var(--primary-main);
  font-size: 1.2rem;
  opacity: 0.7;
}

/* Custom date field */
.att-date-field {
  flex: 1 1 160px;
  min-width: 155px;
  cursor: pointer;
}

.att-date-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.att-date-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 36px 8px 12px;
  border-radius: 11px;
  border: 1.5px solid var(--divider);
  background: var(--background-paper);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  overflow: hidden;
}

.att-date-control:hover {
  border-color: rgba(17, 112, 95, 0.45);
  background: #fff;
}

.att-date-control:focus-within,
.att-date-control.is-active {
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.14);
  background: #fff;
}

.att-date-icon {
  font-size: 1.25rem;
  color: var(--primary-main);
  flex-shrink: 0;
  pointer-events: none;
}

.att-date-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  pointer-events: none;
}

.att-date-display {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-date-display.is-placeholder {
  color: var(--text-secondary);
  font-weight: 500;
}

.att-date-hint {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.att-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
  z-index: 1;
}

.att-date-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Custom select in filter */
.attendance-employee-panel {
  flex: 0 1 240px;
  min-width: 200px;
}

.att-select-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 36px 0 12px;
  border-radius: 11px;
  border: 1.5px solid var(--divider);
  background: var(--background-paper);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.att-select-control:focus-within {
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.14);
}

.att-select-icon {
  font-size: 1.2rem;
  color: var(--primary-main);
  margin-right: 8px;
  flex-shrink: 0;
}

.att-select-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family-body);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  padding: 14px 0;
  appearance: none;
  -webkit-appearance: none;
}

.attendance-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.att-btn-apply,
.att-btn-reset {
  min-width: 110px;
  justify-content: center;
}

@media (max-width: 768px) {
  .attendance-filter-body {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .att-btn-apply,
  .att-btn-reset {
    flex: 1;
  }

  .attendance-segmented {
    width: 100%;
  }

  .attendance-segment {
    flex: 1;
    justify-content: center;
    padding: 9px 8px;
    font-size: 0.76rem;
  }

  .attendance-range-row {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-range-connector {
    display: none;
  }
}

/* ── Leave request + list panel ─────────────────────────── */
.leave-request-card,
.leave-list-card {
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--divider);
  box-shadow: 0 4px 18px rgba(17, 112, 95, 0.07);
}

.leave-request-header,
.leave-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: var(--background-paper);
  border-bottom: 1px solid var(--divider);
}

.leave-request-brand,
.leave-list-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.leave-request-icon-wrap,
.leave-list-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-main);
  color: #fff;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(17, 112, 95, 0.28);
}

.leave-request-heading,
.leave-list-heading {
  margin: 0 0 4px;
  font-size: 1.06rem;
  font-weight: 700;
}

.leave-request-sub,
.leave-list-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.leave-duration-badge,
.leave-filter-count {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--background-paper);
  border: 1px solid var(--divider);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-main);
  white-space: nowrap;
}

.leave-list-table {
  border-top: 1px solid var(--divider);
  background: var(--background-paper);
}

.leave-list-table .table th:first-child,
.leave-list-table .table td:first-child {
  padding-left: 22px;
}

.leave-list-table .table th:last-child,
.leave-list-table .table td:last-child {
  padding-right: 22px;
}

.leave-request-body {
  padding: 20px 22px;
}

.leave-range-panel { margin-bottom: 18px; }

.leave-range-panel-compact { margin-bottom: 0; }

.leave-panel-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.leave-range-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.leave-range-connector {
  display: flex;
  align-items: center;
  padding-bottom: 14px;
  color: var(--primary-main);
  font-size: 1.2rem;
  opacity: 0.7;
}

.leave-range-summary {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.leave-reason-panel { margin-bottom: 18px; }

.leave-reason-wrap {
  position: relative;
}

.leave-reason-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
}

.leave-reason-wrap textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px 12px 42px;
  border-radius: 11px;
  border: 1.5px solid var(--divider);
  background: var(--background-paper);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.leave-reason-wrap textarea:focus {
  outline: none;
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(17, 112, 95, 0.12);
}

.leave-request-actions {
  display: flex;
  justify-content: flex-end;
}

/* Compact single-line filter bar */
.leave-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 10px 18px;
  background: var(--background-default);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: thin;
}

.leave-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.leave-filter-inline-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.leave-filter-divider {
  width: 1px;
  height: 28px;
  background: var(--divider);
  flex-shrink: 0;
}

.leave-filter-date-sep {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0.55;
  user-select: none;
}

.leave-segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 4px;
  gap: 2px;
  border-radius: 12px;
  background: var(--background-paper);
  border: 1px solid var(--divider);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.leave-segmented-compact {
  padding: 2px;
  border-radius: 8px;
}

.leave-segment {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-family-body);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}

.leave-segmented-compact .leave-segment {
  padding: 5px 10px;
  font-size: 0.74rem;
  border-radius: 6px;
}

.leave-segment:hover {
  color: var(--primary-main);
  background: var(--primary-light);
}

.leave-segment.active {
  background: var(--primary-main);
  color: #fff;
  box-shadow: 0 2px 8px rgba(17, 112, 95, 0.3);
}

.leave-filter-group-dates {
  gap: 6px;
}

.leave-filter-date {
  min-width: 0;
  flex: 0 0 auto;
}

.att-date-field-compact {
  flex: 0 0 auto;
  min-width: 118px;
  max-width: 148px;
}

.att-date-control-compact {
  min-height: 36px;
  padding: 4px 26px 4px 8px;
  border-radius: 8px;
  gap: 6px;
}

.att-date-control-compact .att-date-icon {
  font-size: 1rem;
}

.att-date-control-compact .att-date-display {
  font-size: 0.76rem;
  font-weight: 600;
}

.att-date-control-compact .att-date-chevron {
  right: 8px;
  font-size: 0.95rem;
}

.leave-filter-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.leave-filter-actions-compact .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 0.76rem;
  min-width: 0;
  border-radius: 8px;
}

.leave-filter-actions-compact .btn .iconify {
  font-size: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .leave-filter-bar {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .leave-filter-divider {
    display: none;
  }

  .leave-filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .leave-filter-btn-text {
    display: none;
  }

  .leave-filter-actions-compact .btn {
    padding: 7px 9px;
  }

  .att-date-field-compact {
    min-width: 104px;
    max-width: 130px;
  }

  .leave-segmented-compact .leave-segment {
    padding: 5px 7px;
    font-size: 0.7rem;
  }
}

/* ========== Performance Feedback ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feedback-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.feedback-period-tabs {
  display: inline-flex;
  gap: 8px;
}

.feedback-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feedback-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.feedback-stat-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.feedback-stat-card strong {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.feedback-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.feedback-card {
  padding: 22px 24px 24px;
}

.feedback-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.feedback-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  flex-shrink: 0;
}

.feedback-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feedback-card-title {
  flex: 1;
  min-width: 0;
}

.feedback-card-title h2 {
  margin: 0;
  font-size: 1.15rem;
}

.feedback-card-title p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.feedback-summary {
  margin: 0 0 16px;
  line-height: 1.55;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.feedback-metrics-caption {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.feedback-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.feedback-metrics > div {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.feedback-metrics span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.feedback-metrics strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.feedback-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.feedback-columns h3,
.feedback-tips h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}

.feedback-columns ul,
.feedback-tips ol {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.feedback-columns li,
.feedback-tips li {
  margin-bottom: 6px;
}

.feedback-tips {
  background: linear-gradient(135deg, rgba(0, 109, 91, 0.06), rgba(0, 109, 91, 0.02));
  border: 1px solid rgba(0, 109, 91, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
}

@media (max-width: 900px) {
  .feedback-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .feedback-summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .feedback-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-card-header {
    flex-wrap: wrap;
  }
}

.feedback-coach-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: var(--background-paper);
}

.feedback-coach-note h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-note-meta {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.feedback-note-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.feedback-note-input:focus {
  outline: none;
  border-color: var(--primary-main);
  background: #fff;
}

.feedback-note-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.feedback-coach-note-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.feedback-coach-note-readonly {
  background: linear-gradient(135deg, rgba(63, 81, 181, 0.06), rgba(63, 81, 181, 0.02));
  border-color: rgba(63, 81, 181, 0.18);
}

@media print {
  .sidebar,
  .topbar,
  .app-footer,
  .feedback-page-header,
  .feedback-summary-strip,
  .feedback-note-actions,
  .btn {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .feedback-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd;
  }

  .feedback-note-input {
    border: none;
    background: transparent;
    padding: 0;
  }
}
