/* ============================================
   VitiTrack Pro — Dashboard Styles
   Theme: Professional Viticulture Dark Mode
   ============================================ */

.dashboard-body {
  background-color: #0c1210;
  color: #e5ece8;
  font-family: var(--font-body);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* ---------- App Layout ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: 270px;
  background: #0f1814;
  border-right: 1px solid rgba(82, 183, 136, 0.14);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(82, 183, 136, 0.08);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  display: inline-block;
  vertical-align: middle;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  background: linear-gradient(135deg, #e9c46a, #d4a373);
  color: #1a2620;
  border-radius: 4px;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 4px;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}

.sidebar-user {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(45, 106, 79, 0.08);
  margin: 1rem 1rem 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(82, 183, 136, 0.12);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d6a4f, #52b788);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 10px rgba(45, 106, 79, 0.4);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.user-role {
  font-size: 0.72rem;
  color: var(--color-accent);
}

.sidebar-nav {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(82, 183, 136, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(45, 106, 79, 0.3);
  color: #b7e4c7;
  font-weight: 600;
  border-left: 3px solid var(--color-primary-lighter);
}

.nav-icon {
  font-size: 1.05rem;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(82, 183, 136, 0.15);
  color: var(--color-accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-badge.badge-warning {
  background: rgba(233, 196, 106, 0.2);
  color: var(--color-accent-gold);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(82, 183, 136, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-accent);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52b788;
  box-shadow: 0 0 8px #52b788;
  display: inline-block;
  animation: pulse-sync 2.5s infinite;
}

@keyframes pulse-sync {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.version-label {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Sidebar User Block */
.sidebar-user-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(22, 36, 28, 0.7);
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.65rem;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-status {
  font-size: 0.68rem;
  color: #74c69d;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-sidebar-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-sidebar-logout:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

/* Topbar User Profile */
.user-topbar-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(20, 34, 26, 0.8);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem 0.3rem 0.5rem;
  font-size: 0.82rem;
}

.user-topbar-avatar {
  font-size: 0.95rem;
}

.user-topbar-name {
  font-weight: 600;
  color: #b7e4c7;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-topbar-logout {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  border-left: 1px solid rgba(82, 183, 136, 0.2);
  margin-left: 0.25rem;
}

.btn-topbar-logout:hover {
  color: #ff6b6b;
}

.btn-topbar-switch {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  border-left: 1px solid rgba(82, 183, 136, 0.2);
  margin-left: 0.25rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-topbar-switch:hover {
  color: var(--color-primary-lighter);
}

.sidebar-backdrop {
  display: none;
  pointer-events: none;
}

.sidebar-backdrop:not(.active) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ---------- Main App & Topbar ---------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: radial-gradient(circle at 80% 20%, rgba(45, 106, 79, 0.07) 0%, transparent 60%);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.1);
  background: rgba(12, 18, 16, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 1.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-glow {
  box-shadow: 0 0 20px rgba(82, 183, 136, 0.4);
  font-weight: 600;
}

.btn-glow:hover {
  box-shadow: 0 0 28px rgba(82, 183, 136, 0.6);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid rgba(82, 183, 136, 0.2);
}

.btn-ghost:hover {
  background: rgba(82, 183, 136, 0.08);
  color: #fff;
}

/* ---------- App Content Area ---------- */
.app-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* Quick Banner */
.quick-banner {
  background: linear-gradient(90deg, rgba(45, 106, 79, 0.25), rgba(17, 25, 22, 0.6));
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: #d1ded6;
}

.quick-banner-icon {
  font-size: 1.3rem;
}

.quick-banner-text {
  flex: 1;
}

.quick-banner-text strong {
  color: #fff;
}

.quick-banner-text em {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 600;
}

.banner-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.banner-dismiss-btn:hover {
  color: #fff;
}

/* ---------- KPI Grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.kpi-card {
  background: linear-gradient(145deg, rgba(20, 31, 26, 0.75), rgba(14, 22, 18, 0.9));
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-primary-lighter), transparent);
  opacity: 0.4;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 183, 136, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.kpi-highlight-warning {
  border-color: rgba(233, 196, 106, 0.3);
}

.kpi-highlight-warning::before {
  background: linear-gradient(90deg, transparent, #e9c46a, transparent);
  opacity: 0.8;
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(82, 183, 136, 0.1);
}

.icon-warning {
  background: rgba(233, 196, 106, 0.12);
}

.icon-emerald {
  background: rgba(45, 106, 79, 0.25);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.kpi-unit {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.value-warning {
  color: #e9c46a;
}

.value-success {
  color: #52b788;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.trend.positive {
  color: #52b788;
  font-weight: 600;
}

.badge-tag {
  background: rgba(82, 183, 136, 0.12);
  color: var(--color-accent);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-pill {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.72rem;
}

.pill-warning {
  background: rgba(233, 196, 106, 0.2);
  color: #e9c46a;
}

/* ---------- Interactive KPI Cards & Quick Actions ---------- */
.kpi-card-clickable {
  cursor: pointer;
  user-select: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
}

.kpi-card-clickable:hover {
  transform: translateY(-4px);
  border-color: rgba(82, 183, 136, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 25px rgba(82, 183, 136, 0.18);
}

.kpi-card-clickable:active {
  transform: translateY(-1px);
}

.kpi-card-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kpi-quick-btn {
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.3);
  color: var(--color-primary-lighter);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.kpi-quick-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 2px 8px rgba(82, 183, 136, 0.3);
}

.kpi-arrow-nav {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.kpi-card-clickable:hover .kpi-arrow-nav {
  color: var(--color-primary-lighter);
  transform: translateX(3px);
}

.badge-interactive {
  cursor: pointer;
  transition: all 0.18s ease;
}

.badge-interactive:hover {
  background: rgba(82, 183, 136, 0.25);
  color: #fff;
  border-color: var(--color-primary-lighter);
}

/* ---------- Banner Quick Links ---------- */
.banner-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(82, 183, 136, 0.2);
  color: var(--color-primary-lighter);
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  margin: 0 0.2rem;
  transition: all 0.18s ease;
  text-decoration: none;
}

.banner-quick-link:hover {
  background: rgba(82, 183, 136, 0.35);
  color: #fff;
  border-color: var(--color-primary-lighter);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(82, 183, 136, 0.25);
}

/* ---------- Clickable Table Headers ---------- */
.th-clickable {
  cursor: pointer;
  user-select: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.th-clickable:hover {
  color: var(--color-primary-lighter) !important;
}

.th-link-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(82, 183, 136, 0.15);
  color: var(--color-primary-lighter);
  border: 1px solid rgba(82, 183, 136, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
  transition: all 0.18s ease;
}

.th-clickable:hover .th-link-badge {
  background: var(--color-primary);
  color: #fff;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

/* ---------- Table Card & Controls ---------- */
.dashboard-table-card {
  margin-top: 2.5rem;
  background: #111a15;
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
  overflow: visible;
  scroll-margin-top: 90px;
}

.table-header-bar {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
  background: rgba(15, 24, 20, 0.7);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.table-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-title-icon {
  font-size: 1.35rem;
}

.table-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.table-count-badge {
  font-size: 0.75rem;
  background: rgba(82, 183, 136, 0.12);
  color: var(--color-accent);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.table-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-controls-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.table-controls-bar .search-box {
  position: relative;
  flex: 1 1 240px;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.search-box input {
  width: 100%;
  background: #16221c;
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

/* Elaborate Filter Dropdown Buttons */
.filter-dropdown-btn-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.select-client-wrap {
  flex: 1 1 220px;
  min-width: 190px;
}

.select-task-wrap {
  flex: 1 1 240px;
  min-width: 210px;
}

.select-date-wrap {
  flex: 1 1 190px;
  min-width: 170px;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #14221a;
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  transition: all var(--transition-fast);
}

.date-range-inputs:focus-within {
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.2);
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

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

.filter-date-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
}

.filter-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(1) saturate(5) hue-rotate(90deg);
  cursor: pointer;
}

.date-range-separator {
  color: var(--color-primary-lighter);
  font-size: 0.72rem;
  font-weight: 700;
}

.filter-dropdown-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, rgba(22, 36, 28, 0.94), rgba(13, 22, 17, 0.98));
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.filter-dropdown-pill:hover {
  border-color: rgba(82, 183, 136, 0.55);
  background: linear-gradient(135deg, rgba(28, 46, 36, 0.96), rgba(16, 27, 21, 0.98));
  box-shadow: 0 4px 14px rgba(82, 183, 136, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.filter-dropdown-btn-wrap.is-active .filter-dropdown-pill {
  border-color: #52b788;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.35), rgba(18, 38, 28, 0.98));
  box-shadow: 0 0 16px rgba(82, 183, 136, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.filter-dropdown-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  line-height: 1;
}

.filter-dropdown-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.filter-dropdown-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(183, 228, 199, 0.7);
  line-height: 1.1;
  pointer-events: none;
}

.filter-dropdown-btn-wrap.is-active .filter-dropdown-label {
  color: #74c69d;
}

.filter-dropdown-body select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 0.15rem 0 0 0;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.filter-dropdown-body select option {
  background: #14221a;
  color: #fff;
  padding: 0.5rem;
}

.filter-dropdown-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(183, 228, 199, 0.6);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
  pointer-events: none;
  margin-left: 0.2rem;
}

.filter-dropdown-pill:hover .filter-dropdown-arrow {
  color: #52b788;
  transform: translateY(1px);
}

.filter-dropdown-btn-wrap.is-active .filter-dropdown-arrow {
  color: #74c69d;
}

button.filter-dropdown-pill {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
}

.filter-dropdown-value {
  width: 100%;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 0.15rem 0 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.25;
  display: block;
}

.filter-dropdown-btn-wrap.is-open {
  z-index: 130;
}

.filter-dropdown-btn-wrap.is-open .filter-dropdown-arrow {
  transform: rotate(180deg);
  color: #52b788;
}

.filter-dropdown-btn-wrap.is-open .filter-dropdown-pill {
  border-color: rgba(82, 183, 136, 0.65);
  box-shadow: 0 0 16px rgba(82, 183, 136, 0.22);
}

/* ==================== MULTI-SELECT DROPDOWNS (ENCOCHES) ==================== */
.filter-multiselect-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 290px;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #16241e 0%, #0e1713 100%);
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(82, 183, 136, 0.15);
  z-index: 125;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: filterMsSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.filter-multiselect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(82, 183, 136, 0.08);
  border-bottom: 1px solid rgba(82, 183, 136, 0.15);
}

.filter-ms-header-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-ms-header-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.filter-ms-count-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  background: rgba(82, 183, 136, 0.2);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.3);
}

.filter-ms-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-ms-action-btn {
  background: transparent;
  border: none;
  color: #52b788;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.filter-ms-action-btn:hover {
  background: rgba(82, 183, 136, 0.15);
  color: #74c69d;
}

.filter-ms-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
}

.filter-ms-search-box {
  position: relative;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
  display: flex;
  align-items: center;
}

.filter-ms-search-icon {
  position: absolute;
  left: 1.1rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.filter-ms-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem 0.4rem 1.8rem;
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
}

.filter-ms-search-input:focus {
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.2);
}

.filter-ms-list {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.filter-ms-category-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #74c69d;
  padding: 0.45rem 0.5rem 0.15rem;
  margin-top: 0.2rem;
  border-top: 1px solid rgba(82, 183, 136, 0.1);
}

.filter-ms-category-title:first-child {
  border-top: none;
  margin-top: 0;
}

.filter-ms-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  font-size: 0.82rem;
  color: #e8f5e9;
}

.filter-ms-item:hover {
  background: rgba(82, 183, 136, 0.12);
}

.filter-ms-item.is-checked {
  background: rgba(82, 183, 136, 0.18);
  font-weight: 600;
}

.filter-ms-cb {
  appearance: auto;
  accent-color: #52b788;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-ms-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.filter-ms-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-ms-item-sub {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-ms-rate-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(82, 183, 136, 0.15);
  color: #74c69d;
  white-space: nowrap;
}

.filter-ms-empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.filter-ms-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(82, 183, 136, 0.15);
  background: rgba(0, 0, 0, 0.18);
}

.btn-ms-new-client {
  width: 100%;
  background: transparent;
  border: 1px dashed rgba(82, 183, 136, 0.35);
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #74c69d;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ms-new-client:hover {
  background: rgba(82, 183, 136, 0.15);
  border-color: #52b788;
  color: #fff;
}

/* Status Segmented Control Buttons */
.status-segmented-control {
  display: flex;
  align-items: center;
  background: rgba(13, 22, 17, 0.95);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.22);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35);
  gap: 3px;
}

.status-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-tab-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.status-tab-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.status-tab-badge.badge-warn {
  background: rgba(235, 94, 40, 0.2);
  color: #f48c06;
  border: 1px solid rgba(235, 94, 40, 0.3);
}

.status-tab-badge.badge-succ {
  background: rgba(82, 183, 136, 0.2);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.3);
}

.status-tab:hover {
  color: #fff;
  background: rgba(82, 183, 136, 0.12);
}

.status-tab.active {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  border-color: rgba(82, 183, 136, 0.4);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(45, 106, 79, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.status-tab.active .status-tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn-reset-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #eb5e28;
  border: 1px dashed rgba(235, 94, 40, 0.45);
  background: rgba(235, 94, 40, 0.08);
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-reset-filters:hover {
  background: rgba(235, 94, 40, 0.2);
  border-color: #eb5e28;
  color: #fff;
  transform: translateY(-1px);
}

/* ---------- Table Layout ---------- */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.interventions-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.interventions-table th {
  padding: 0.9rem 1.25rem;
  background: rgba(14, 22, 18, 0.8);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
  white-space: nowrap;
}

.interventions-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.07);
  vertical-align: middle;
  color: #d8e4dc;
}

.interventions-table tbody tr {
  transition: background-color var(--transition-fast);
}

.interventions-table tbody tr:hover {
  background-color: rgba(82, 183, 136, 0.04);
}

.interventions-table tbody tr.newly-added {
  animation: highlight-row 3s ease-out;
}

@keyframes highlight-row {
  0% { background-color: rgba(82, 183, 136, 0.25); }
  100% { background-color: transparent; }
}

/* Cell Specific Styles */
.cell-datetime {
  display: flex;
  flex-direction: column;
}

.date-main {
  font-weight: 600;
  color: #fff;
}

.time-sub {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.worker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.worker-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #253830;
  color: var(--color-accent);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(82, 183, 136, 0.2);
}

.client-name {
  font-weight: 600;
  color: #fff;
}

.parcel-info {
  display: flex;
  flex-direction: column;
}

.parcel-name {
  color: #e5ece8;
  font-weight: 500;
}

.parcel-details {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.task-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(82, 183, 136, 0.09);
  border: 1px solid rgba(82, 183, 136, 0.16);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 500;
  color: #c0d8cb;
  font-size: 0.8rem;
  white-space: nowrap;
}

.volume-value {
  font-weight: 600;
  color: #fff;
}

.amount-value {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.amount-ttc {
  color: var(--color-accent-light, #74c69d);
}

.kpi-sub-ttc {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Status Badge - Interactive Toggle */
.status-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.status-pill-toggle.status-unbilled {
  background: rgba(233, 196, 106, 0.15);
  color: #e9c46a;
  border-color: rgba(233, 196, 106, 0.35);
}

.status-pill-toggle.status-unbilled:hover {
  background: rgba(233, 196, 106, 0.25);
  transform: scale(1.03);
}

.status-pill-toggle.status-billed {
  background: rgba(82, 183, 136, 0.15);
  color: #52b788;
  border-color: rgba(82, 183, 136, 0.35);
}

.status-pill-toggle.status-billed:hover {
  background: rgba(82, 183, 136, 0.25);
  transform: scale(1.03);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.action-btn {
  background: transparent;
  border: 1px solid rgba(82, 183, 136, 0.15);
  color: var(--color-text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
}

.action-btn:hover {
  background: rgba(82, 183, 136, 0.12);
  color: #fff;
  border-color: rgba(82, 183, 136, 0.3);
}

.action-btn.edit-btn:hover {
  background: rgba(82, 183, 136, 0.22);
  color: var(--color-primary-lighter, #74c69d);
  border-color: rgba(82, 183, 136, 0.45);
}

.action-btn.delete-btn:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
  border-color: rgba(220, 53, 69, 0.4);
}

/* Empty State */
.table-empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.empty-icon {
  font-size: 2.5rem;
}

.table-empty-state h3 {
  font-size: 1.15rem;
  color: #fff;
}

.table-empty-state p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 400px;
}

/* Table Footer */
.table-footer {
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(82, 183, 136, 0.1);
  background: rgba(15, 24, 20, 0.4);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.table-actions-bulk {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay:not(.open) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-overlay.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-dialog {
  width: 100%;
  max-width: 680px;
  background: #111a16;
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(82, 183, 136, 0.15);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-spring);
  height: 90vh;
  height: 90dvh;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  width: 100%;
}

.modal-content > form,
.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  width: 100%;
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-dialog-sm {
  max-width: 520px;
}

.modal-dialog-lg {
  max-width: 860px;
}

.modal-header {
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
  position: relative;
  flex: 0 0 auto;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(82, 183, 136, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid rgba(82, 183, 136, 0.2);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.modal-close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: auto !important;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid rgba(82, 183, 136, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(14, 22, 18, 0.95);
  flex: 0 0 auto;
}

/* Form Styles inside Modal */
.form-row {
  display: flex;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #c9d8d0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.required {
  color: #e9c46a;
}

.select-with-icon,
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  pointer-events: none;
}

.select-with-icon select,
.input-with-icon input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem 0.65rem 2.4rem;
  color: #fff;
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group textarea {
  padding-left: 0.85rem;
  resize: vertical;
}

.select-with-icon select:focus,
.input-with-icon input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.select-with-icon select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.calculated-preview {
  background: rgba(45, 106, 79, 0.2);
  border: 1px dashed rgba(82, 183, 136, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
}

.calculated-preview span {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent-gold);
}

/* Detail Modal Specifics */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-label {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.detail-notes-box {
  grid-column: span 2;
  background: rgba(14, 22, 18, 0.6);
  border: 1px solid rgba(82, 183, 136, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.85rem;
  color: #d1ded6;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #14221b;
  border: 1px solid rgba(82, 183, 136, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 0.88rem;
  pointer-events: auto;
  animation: slide-toast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 380px;
}

.toast-success {
  border-left: 4px solid #52b788;
}

.toast-info {
  border-left: 4px solid #4ea8de;
}

@keyframes slide-toast {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   Mobile Bottom Navigation Bar (Smartphone)
   ============================================ */
.mobile-bottom-nav {
  display: none;
}

.btn-text-mobile {
  display: none;
}

/* ---------- Topbar Responsive Adapters (MacBook 13"/14", Tablets & Laptops) ---------- */
@media (max-width: 1500px) {
  .app-topbar {
    padding: 0.9rem 1.35rem;
    gap: 0.75rem;
  }
  .topbar-actions {
    gap: 0.5rem;
  }
  .theme-mode-pill .seg-text {
    display: none;
  }
  .theme-pill-seg {
    padding: 4px 7px;
  }
  .user-topbar-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 1280px) {
  .app-topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .topbar-actions {
    gap: 0.4rem;
  }
  .topbar-actions .btn-topbar-item.btn-ghost .btn-text-desktop,
  .topbar-actions #btn-export-topbar .btn-text-desktop {
    display: none !important;
  }
  .topbar-actions .btn-topbar-item.btn-ghost .btn-text-mobile,
  .topbar-actions #btn-export-topbar .btn-text-mobile {
    display: inline !important;
  }
  .user-topbar-name {
    display: none !important;
  }
  .user-topbar-profile {
    padding: 3px 6px;
    gap: 0.25rem;
  }
  .user-topbar-profile .btn-topbar-switch .btn-text-desktop,
  .user-topbar-profile .btn-topbar-logout .btn-text-desktop {
    display: none !important;
  }
  .user-topbar-profile .btn-topbar-switch .btn-text-mobile,
  .user-topbar-profile .btn-topbar-logout .btn-text-mobile {
    display: inline !important;
  }
}

@media (max-width: 1050px) {
  .topbar-actions #topbar-add-client-btn .btn-text-desktop {
    display: none !important;
  }
  .topbar-actions #topbar-add-client-btn {
    padding: 0.4rem 0.6rem !important;
    min-width: 34px !important;
  }
  .topbar-actions #btn-open-create-modal {
    padding: 0.45rem 0.75rem !important;
  }
}

/* ---------- Mobile & Responsive Adjustments ---------- */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    z-index: 100;
  }

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

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
  }

  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: rgba(82, 183, 136, 0.1);
    border: 1px solid rgba(82, 183, 136, 0.2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .topbar-actions .btn-ghost,
  .topbar-actions .btn-outline {
    display: none;
  }

  .topbar-actions .btn-secondary:not(#topbar-add-client-btn) {
    display: none;
  }

  .topbar-actions #topbar-add-client-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
  }

  .app-content {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(12, 18, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(82, 183, 136, 0.22);
    z-index: 85;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: space-around;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 6px 4px;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .mobile-nav-icon {
    font-size: 1.22rem;
    line-height: 1;
    margin-bottom: 3px;
    transition: transform 0.2s ease;
  }

  .mobile-nav-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: inherit;
  }

  .mobile-nav-item.active {
    color: #52b788;
  }

  .mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(82, 183, 136, 0.6));
  }

  .mobile-nav-action-center {
    position: relative;
    top: -10px;
    flex: 0 0 64px;
  }

  .mobile-action-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #52b788, #2d6a4f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(82, 183, 136, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border: 2px solid #0c1210;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-nav-action-center:active .mobile-action-circle {
    transform: scale(0.92);
  }

  .mobile-nav-action-center .mobile-nav-label {
    margin-top: 2px;
    color: var(--color-primary-lighter);
  }

  .app-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 12px)) !important;
  }

  .toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom, 12px));
    right: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }

  .btn-text-desktop {
    display: none !important;
  }

  .btn-text-mobile {
    display: inline !important;
  }

  .app-topbar {
    padding: 0.45rem 0.65rem !important;
    gap: 0.35rem !important;
    min-height: 48px !important;
  }

  .topbar-left {
    min-width: 0 !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }

  .mobile-menu-btn {
    padding: 4px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .topbar-title {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-subtitle {
    display: none;
  }

  .topbar-actions {
    gap: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  /* Switch Thème Nuit / Jour ultra-compact pour smartphone */
  .theme-switch-wrapper {
    flex-shrink: 0 !important;
  }

  .theme-mode-pill {
    padding: 2px !important;
    gap: 1px !important;
  }

  .theme-pill-seg {
    padding: 3px 5px !important;
    font-size: 0.8rem !important;
    gap: 0 !important;
  }

  .theme-mode-pill .seg-text {
    display: none !important;
  }

  .theme-pill-seg .seg-icon {
    font-size: 0.85rem !important;
    line-height: 1 !important;
  }

  /* Boutons d'action compacts dans le header */
  .topbar-actions .btn-sm {
    padding: 0.3rem 0.45rem !important;
    font-size: 0.8rem !important;
    min-width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-sm) !important;
  }

  .topbar-actions .btn-icon {
    font-size: 0.88rem !important;
    margin: 0 !important;
  }

  /* Profil, bouton Changer de compte et Déconnexion compacts */
  .user-topbar-profile {
    padding: 2px 4px !important;
    gap: 0.2rem !important;
    display: inline-flex !important;
    align-items: center !important;
    border-radius: var(--radius-sm) !important;
  }

  .user-topbar-avatar {
    font-size: 0.82rem !important;
  }

  .user-topbar-name {
    display: none !important;
  }

  .btn-topbar-logout,
  .btn-topbar-switch {
    font-size: 0.78rem !important;
    padding: 2px 4px !important;
    margin: 0 !important;
    min-width: 22px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
  }

  .topbar-actions #btn-open-create-modal {
    padding: 0.3rem 0.45rem !important;
    font-size: 0.82rem !important;
    min-width: 28px !important;
    height: 28px !important;
  }

  .topbar-actions #btn-open-create-modal .btn-text-mobile {
    display: none !important;
  }
}

@media (max-width: 650px) {
  .app-content {
    padding: 0.9rem 0.75rem;
  }

  .btn-text-desktop {
    display: none;
  }

  .btn-text-mobile {
    display: inline;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.8rem;
  }

  .quick-banner {
    padding: 0.75rem 0.85rem;
    font-size: 0.78rem;
    gap: 0.6rem;
  }

  .table-header-bar {
    padding: 0.9rem;
    gap: 0.85rem;
  }

  .table-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .search-box {
    width: 100%;
    min-width: 100%;
  }

  .select-client-wrap,
  .select-task-wrap,
  .select-date-wrap {
    width: 100%;
    min-width: 100%;
    flex: 1 1 100%;
  }

  .date-range-inputs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    box-sizing: border-box;
  }

  .date-input-group {
    width: 100%;
  }

  .filter-date-input {
    width: 100%;
    min-width: 0;
  }

  .status-segmented-control {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    padding: 3px;
    gap: 2px;
  }

  .status-tab {
    flex: 1;
    min-width: 85px;
    text-align: center;
    justify-content: center;
    padding: 0.42rem 0.35rem;
    font-size: 0.74rem;
  }

  .status-tab-icon {
    display: none;
  }

  .table-responsive {
    border-radius: 0;
    -webkit-overflow-scrolling: touch;
  }

  .interventions-table th {
    padding: 0.7rem 0.75rem;
    font-size: 0.68rem;
  }

  .interventions-table td {
    padding: 0.8rem 0.75rem;
    font-size: 0.8rem;
  }

  .btn-table-action {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  /* Form & Modals for Smartphone */
  .modal-overlay {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    height: 92vh !important;
    height: 92dvh !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    width: 100% !important;
  }

  .modal-content > form,
  .modal-dialog > form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    width: 100% !important;
  }

  .modal-header {
    padding: 0.85rem 1.15rem !important;
    flex: 0 0 auto !important;
    border-bottom: 1px solid rgba(82, 183, 136, 0.15) !important;
  }

  .modal-header-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-subtitle {
    font-size: 0.75rem;
  }

  .modal-close-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 20px)) 1.15rem !important;
    gap: 0.85rem !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  .form-row {
    flex-direction: column;
    gap: 0.8rem;
  }

  /* Prevent automatic iOS Safari zoom when focusing inputs */
  input, select, textarea {
    font-size: 16px !important;
  }

  .modal-footer {
    padding: 0.75rem 1.15rem calc(0.75rem + env(safe-area-inset-bottom, 20px)) 1.15rem !important;
    flex-direction: column-reverse !important;
    gap: 0.5rem !important;
    background: #111a16 !important;
    border-top: 1px solid rgba(82, 183, 136, 0.2) !important;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.55) !important;
    flex: 0 0 auto !important;
    z-index: 10 !important;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .quick-hours-btn {
    flex: 1;
    min-width: 42px;
    height: 38px;
  }

  /* Detail Modal on Smartphone */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .detail-notes-box {
    grid-column: span 1;
  }

  /* Clients View on Smartphone */
  .clients-view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .clients-view-header .btn {
    width: 100%;
    justify-content: center;
  }

  .clients-metrics-bar {
    padding: 0.85rem 1rem;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }

  .clients-metric-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .clients-metric-item .metric-num {
    font-size: 1.2rem;
  }

  .clients-search-wrapper {
    margin-left: 0;
    width: 100%;
    min-width: 100%;
  }

  .client-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .client-card-footer {
    width: 100%;
  }

  .client-card-footer-btns {
    width: 100%;
  }

  /* Prestations View on Smartphone */
  .services-view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .services-view-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .services-view-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .services-metrics-bar {
    padding: 0.85rem 1rem;
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .services-metric-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .services-subnav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .services-tab-buttons {
    width: 100%;
    display: flex;
  }

  .services-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.76rem;
  }

  .services-search-wrapper {
    width: 100%;
    min-width: 100%;
  }

  .services-filter-panel {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .services-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .services-filter-row-header {
    min-width: unset;
  }

  .filter-chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .chip {
    flex-shrink: 0;
  }

  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .service-card {
    padding: 1rem;
  }
}

/* ---------- Clients & Parcelles View Styles ---------- */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: var(--color-primary-lighter);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}

.btn-link-action:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.modal-section-divider {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  border-bottom: 1px dashed rgba(82, 183, 136, 0.2);
  padding-bottom: 0.35rem;
}

.icon-purple {
  background: rgba(157, 78, 221, 0.15);
  color: #c77dff;
}

.clients-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-heading {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

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

.clients-metrics-bar {
  background: rgba(17, 26, 22, 0.8);
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.clients-metric-item {
  display: flex;
  flex-direction: column;
}

.clients-metric-item .metric-num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.clients-metric-item .metric-desc {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clients-search-wrapper {
  margin-left: auto;
  min-width: 280px;
}

.clients-search-wrapper input {
  width: 100%;
  background: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

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

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

@media (max-width: 650px) {
  .clients-grid {
    grid-template-columns: 1fr;
  }
}

.client-card {
  background: linear-gradient(145deg, rgba(20, 31, 26, 0.85), rgba(14, 22, 18, 0.95));
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  min-width: 0;
}

.client-card:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 183, 136, 0.4);
}

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.client-card-header .badge-tag {
  font-size: 0.72rem;
  white-space: nowrap;
}

.client-card-domain {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.domain-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.domain-commune {
  font-size: 0.78rem;
  color: var(--color-accent);
}

.client-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #b7c7be;
  background: rgba(12, 18, 15, 0.5);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.08);
}

.client-meta-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Client Parcels Accordion / Menu Déroulant */
.client-parcels-accordion {
  background: rgba(14, 22, 18, 0.6);
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.client-parcels-accordion[open] {
  border-color: rgba(82, 183, 136, 0.35);
  background: rgba(14, 22, 18, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.parcels-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c7d8ce;
  background: rgba(82, 183, 136, 0.05);
  list-style: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.parcels-accordion-summary::-webkit-details-marker {
  display: none;
}

.parcels-accordion-summary:hover {
  background: rgba(82, 183, 136, 0.12);
  color: #fff;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.summary-surface {
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.74rem;
}

.summary-chevron {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.client-parcels-accordion[open] .summary-chevron {
  transform: rotate(180deg);
  color: var(--color-accent);
}

.parcels-dropdown-content {
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid rgba(82, 183, 136, 0.1);
}

.parcels-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.badge-interventions {
  background: rgba(78, 168, 222, 0.12);
  color: #4ea8de;
  border: 1px solid rgba(78, 168, 222, 0.25);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-view-dossier {
  background: rgba(82, 183, 136, 0.1);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.3);
  font-weight: 600;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-view-dossier:hover {
  background: rgba(82, 183, 136, 0.25);
  color: #fff;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 12px rgba(82, 183, 136, 0.25);
}

/* Dossier Modal Styles */
.dossier-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.dossier-metric-card {
  background: rgba(14, 22, 18, 0.7);
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dossier-metric-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.dossier-metric-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.dossier-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.15);
  padding-bottom: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dossier-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.dossier-tab-btn:hover {
  color: #fff;
  background: rgba(82, 183, 136, 0.08);
}

.dossier-tab-btn.active {
  background: rgba(82, 183, 136, 0.18);
  border-color: rgba(82, 183, 136, 0.35);
  color: #52b788;
}

/* Dossier Filter Bar (Date selector "À partir de quand") */
.dossier-filter-bar {
  background: rgba(14, 22, 18, 0.85);
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dossier-filter-date-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dossier-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0;
  cursor: pointer;
}

.dossier-date-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dossier-date-input {
  background: #111d17;
  border: 1px solid rgba(82, 183, 136, 0.35);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color-scheme: dark;
  transition: all var(--transition-fast);
}

.dossier-date-input:focus {
  outline: none;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.25);
}

.btn-clear-date {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-date:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.dossier-quick-dates {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.quick-dates-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-right: 0.2rem;
}

.dossier-preset-btn {
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.2);
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.dossier-preset-btn:hover {
  background: rgba(82, 183, 136, 0.2);
  color: #fff;
  border-color: rgba(82, 183, 136, 0.45);
}

.dossier-preset-btn.active {
  background: rgba(82, 183, 136, 0.25);
  border-color: var(--color-accent);
  color: #74c69d;
  font-weight: 700;
}

.dossier-filter-indicator {
  width: 100%;
  font-size: 0.74rem;
  color: var(--color-text-secondary);
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(82, 183, 136, 0.15);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dossier-filter-indicator strong {
  color: #74c69d;
}

@media (max-width: 768px) {
  .dossier-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .dossier-metric-card:last-child {
    grid-column: span 2;
  }

  .dossier-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .dossier-filter-date-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    width: 100%;
  }

  .dossier-date-input-wrap {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .dossier-date-input {
    flex: 1;
    min-width: 0;
  }

  .dossier-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }

  .dossier-tab-btn {
    flex: 1;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.6rem 0.75rem;
  }
}

.parcels-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
}

.parcel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.14);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.parcel-item-info {
  display: flex;
  flex-direction: column;
}

.parcel-item-name {
  font-weight: 600;
  color: #fff;
}

.parcel-item-tags {
  font-size: 0.7rem;
  color: var(--color-accent);
}

.btn-delete-parcel {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-delete-parcel:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

.client-card-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-top: 1px solid rgba(82, 183, 136, 0.12);
  padding-top: 0.75rem;
  margin-top: auto;
}

.client-card-footer-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  align-items: stretch;
}

.client-card-footer-btns .btn-view-dossier,
.client-card-footer-btns .btn-client-intervention {
  width: 100%;
  height: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 1;
  margin: 0;
  box-sizing: border-box;
}

.client-card-footer-btns .btn-view-dossier {
  background: rgba(82, 183, 136, 0.12);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.35);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.client-card-footer-btns .btn-view-dossier:hover {
  background: rgba(82, 183, 136, 0.25);
  color: #fff;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 10px rgba(82, 183, 136, 0.25);
}

.client-card-footer-btns .btn-client-intervention {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  color: #ffffff;
  border: 1px solid rgba(82, 183, 136, 0.4);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.client-card-footer-btns .btn-client-intervention:hover {
  box-shadow: 0 0 12px rgba(82, 183, 136, 0.4);
  filter: brightness(1.1);
}

.client-delete-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.82rem;
  padding: 0;
}

.client-delete-btn:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.client-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-icon-edit:hover {
  color: var(--color-accent);
  background: rgba(82, 183, 136, 0.15);
}

.btn-edit-client {
  color: var(--color-accent);
  border-color: rgba(82, 183, 136, 0.35);
  background: rgba(82, 183, 136, 0.08);
}

.btn-edit-client:hover {
  background: rgba(82, 183, 136, 0.2);
  border-color: var(--color-primary-lighter);
  color: #fff;
}

/* ============================================
   Prestations & Travaux à faire Styles
   ============================================ */
.badge-info {
  background: rgba(78, 168, 222, 0.2);
  color: #4ea8de;
}

.services-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.services-view-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.services-view-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.services-metrics-bar {
  background: rgba(17, 26, 22, 0.8);
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.services-metric-item {
  display: flex;
  flex-direction: column;
}

.services-metric-item .metric-num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.services-metric-item .metric-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.services-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
}

.services-tab-buttons {
  display: flex;
  background: #16241e;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.2);
  gap: 4px;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subtab-btn:hover {
  color: #fff;
}

.subtab-btn.active {
  background: #2d6a4f;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.services-search-wrapper {
  position: relative;
  min-width: 280px;
}

.services-search-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.services-search-wrapper input {
  width: 100%;
  background: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  color: #fff;
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}

.services-search-wrapper input:focus {
  outline: none;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

/* Elaborate Prestations Filters (Catégories & Modes de Facturation) */
.services-filter-panel {
  background: linear-gradient(145deg, rgba(20, 34, 26, 0.8), rgba(12, 21, 16, 0.9));
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.services-filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.services-filter-row-header {
  flex-shrink: 0;
  min-width: 175px;
}

.services-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b7e4c7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-filter-chips,
.rate-filter-chips {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(24, 38, 30, 0.9), rgba(14, 23, 18, 0.95));
  border: 1px solid rgba(82, 183, 136, 0.22);
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-body);
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chip:hover {
  border-color: rgba(82, 183, 136, 0.55);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(82, 183, 136, 0.15);
}

.chip.active {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  border-color: #52b788;
  color: #fff;
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(82, 183, 136, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.chip-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.chip-title {
  line-height: 1.2;
}

.chip-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(82, 183, 136, 0.18);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.25);
  line-height: 1;
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Services Dropdown Filter Bar */
.services-filter-dropdowns-bar {
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
}

.services-filter-dropdowns-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 1fr) auto;
  gap: 0.95rem;
  align-items: center;
  width: 100%;
}

.services-filter-dropdowns-grid .filter-dropdown-btn-wrap {
  width: 100%;
}

.services-filter-reset-wrap {
  display: flex;
  align-items: center;
}

/* Category Collapsible Sections (Menus déroulants par catégorie viticole) */
.category-services-accordion {
  background: rgba(18, 32, 24, 0.65);
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-md);
  margin-bottom: 1.35rem;
  overflow: hidden;
  transition: all 0.22s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.category-services-accordion[open] {
  border-color: rgba(82, 183, 136, 0.4);
}

.category-accordion-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, rgba(26, 44, 34, 0.92), rgba(16, 28, 22, 0.96));
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.category-accordion-summary::-webkit-details-marker {
  display: none;
}

.category-accordion-summary:hover {
  background: linear-gradient(135deg, rgba(34, 58, 45, 0.98), rgba(22, 38, 30, 0.98));
  border-color: rgba(82, 183, 136, 0.3);
}

.category-services-accordion[open] .category-accordion-summary {
  border-bottom: 1px solid rgba(82, 183, 136, 0.2);
}

.cat-summary-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cat-summary-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.cat-summary-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

.cat-summary-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(82, 183, 136, 0.18);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.3);
}

.cat-summary-arrow {
  color: #74c69d;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
}

.category-services-accordion[open] .cat-summary-arrow {
  transform: rotate(180deg);
}

.category-services-accordion .services-grid {
  padding: 1.15rem;
}

/* Services Grid & Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.35rem;
}

.service-card {
  background: linear-gradient(145deg, rgba(20, 31, 26, 0.85), rgba(14, 22, 18, 0.95));
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 183, 136, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.service-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.service-cat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(82, 183, 136, 0.12);
  color: var(--color-accent);
}

.service-rate-badge {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(233, 196, 106, 0.15);
  color: #e9c46a;
  border: 1px solid rgba(233, 196, 106, 0.3);
  white-space: nowrap;
}

.service-rate-badge.rate-hourly {
  background: rgba(82, 183, 136, 0.15);
  color: #52b788;
  border-color: rgba(82, 183, 136, 0.3);
}

.service-rate-badge.rate-surface {
  background: rgba(78, 168, 222, 0.15);
  color: #4ea8de;
  border-color: rgba(78, 168, 222, 0.3);
}

.service-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.service-desc {
  font-size: 0.83rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  flex: 1;
}

.service-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border-top: 1px solid rgba(82, 183, 136, 0.1);
  padding-top: 0.75rem;
}

.service-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Planned Works Card */
.planned-works-card {
  background: #111a15;
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.planned-card-header {
  padding: 1.35rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
  background: rgba(15, 24, 20, 0.7);
  flex-wrap: wrap;
  gap: 1rem;
}

.planned-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.planned-card-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}

.badge-planned-status {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(233, 196, 106, 0.15);
  color: #e9c46a;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-convert-work {
  background: rgba(45, 106, 79, 0.5);
  border: 1px solid rgba(82, 183, 136, 0.4);
  color: #fff;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-convert-work:hover {
  background: var(--color-primary);
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 12px rgba(82, 183, 136, 0.3);
}

/* ============================================
   Épuré Form Controls (Nouvelle Prestation)
   ============================================ */
.epure-header-icon {
  background: rgba(82, 183, 136, 0.12);
  color: #52b788;
  border: 1px solid rgba(82, 183, 136, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.epure-input {
  width: 100%;
  background: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  color: #fff;
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.epure-input:focus {
  outline: none;
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

/* Simplified Dropdown Menus (Catégorie viticole & Mode de facturation) */
.form-select-simple {
  width: 100%;
  background-color: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 2.2rem 0.65rem 0.95rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2374c69d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 10px 6px;
  -webkit-appearance: none;
  appearance: none;
}

.form-select-simple:hover {
  border-color: rgba(82, 183, 136, 0.5);
}

.form-select-simple:focus {
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.form-select-simple option {
  background: #14221a;
  color: #fff;
  padding: 0.55rem;
}

/* Input with Unit Suffix */
.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-suffix input {
  width: 100%;
  background: #16241e;
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.65rem 4.5rem 0.65rem 0.95rem;
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-with-suffix input:focus {
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.input-suffix {
  position: absolute;
  right: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  background: rgba(82, 183, 136, 0.12);
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(82, 183, 136, 0.2);
}

/* ==================== MULTI-SÉLECTION DES PARCELLES DANS L'INTERVENTION ==================== */
.parcel-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.parcel-checkbox-list {
  width: 100%;
  background-color: #121f18;
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  max-height: 84px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color var(--transition-fast);
  scrollbar-width: thin;
  scrollbar-color: rgba(82, 183, 136, 0.4) transparent;
}

.parcel-checkbox-list::-webkit-scrollbar {
  width: 4px;
}

.parcel-checkbox-list::-webkit-scrollbar-track {
  background: transparent;
}

.parcel-checkbox-list::-webkit-scrollbar-thumb {
  background: rgba(82, 183, 136, 0.4);
  border-radius: 4px;
}

.parcel-checkbox-list:focus-within {
  border-color: var(--color-primary-lighter);
  box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.15);
}

.parcel-list-empty {
  padding: 0.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-style: italic;
}

.parcel-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(82, 183, 136, 0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.parcel-checkbox-item:hover {
  background: rgba(82, 183, 136, 0.08);
  border-color: rgba(82, 183, 136, 0.35);
}

.parcel-checkbox-item.selected {
  background: rgba(82, 183, 136, 0.16);
  border-color: var(--color-primary-lighter);
}

.parcel-checkbox-item input[type="checkbox"] {
  accent-color: var(--color-primary-lighter);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.parcel-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.parcel-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.parcel-item-name {
  font-weight: 600;
  font-size: 0.78rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.parcel-item-sub {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  line-height: 1.1;
}

.parcel-item-surface-badge {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--color-primary-lighter);
  background: rgba(82, 183, 136, 0.14);
  border: 1px solid rgba(82, 183, 136, 0.25);
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
}

.parcel-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(82, 183, 136, 0.1);
  border: 1px dashed rgba(82, 183, 136, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
}

.parcel-summary-badge {
  font-weight: 600;
  color: #fff;
}

.parcel-summary-surface {
  font-weight: 700;
  color: var(--color-primary-lighter);
}

/* ================================================================
   BOUTON ET CONTRÔLES DE THÈME (JOUR / NUIT)
   ================================================================ */

/* ---------- Topbar Theme Switch Pill ---------- */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.theme-mode-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(18, 32, 25, 0.85);
  border: 1px solid rgba(82, 183, 136, 0.28);
  border-radius: 999px;
  padding: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  gap: 2px;
}

.theme-mode-pill:hover {
  border-color: rgba(82, 183, 136, 0.6);
  box-shadow: 0 0 14px rgba(82, 183, 136, 0.2);
}

.theme-pill-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #8da497;
  transition: all var(--transition-fast);
  line-height: 1;
}

.theme-pill-seg.active {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .theme-mode-pill {
  background: #e4ece7;
  border: 1px solid rgba(45, 106, 79, 0.25);
}

[data-theme="light"] .theme-pill-seg {
  color: #4a6657;
}

[data-theme="light"] .theme-pill-seg.active {
  background: #ffffff;
  color: #1b4332;
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.15);
}

@media (max-width: 650px) {
  .theme-pill-seg {
    padding: 0.3rem 0.45rem;
    font-size: 0.75rem;
  }
}

/* ---------- Sidebar Theme Panel (En haut du menu) ---------- */
.sidebar-theme-panel {
  margin: 0.5rem 1.15rem 1rem 1.15rem;
  padding: 0.75rem 0.85rem;
  background: rgba(82, 183, 136, 0.06);
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar-theme-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8da497;
}

.sidebar-theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: rgba(10, 16, 13, 0.65);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.14);
}

.theme-pill-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #8da497;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-pill-choice:hover {
  color: #ffffff;
}

.theme-pill-choice.active {
  background: #2d6a4f;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .sidebar-theme-panel {
  background: rgba(45, 106, 79, 0.05);
  border-color: rgba(45, 106, 79, 0.18);
}

[data-theme="light"] .sidebar-theme-title {
  color: #4a6657;
}

[data-theme="light"] .sidebar-theme-switch {
  background: #e4ece7;
  border-color: rgba(45, 106, 79, 0.18);
}

[data-theme="light"] .theme-pill-choice {
  color: #4a6657;
}

[data-theme="light"] .theme-pill-choice.active {
  background: #ffffff;
  color: #1b4332;
  box-shadow: 0 2px 6px rgba(27, 67, 50, 0.15);
}


/* ---------- Legacy Sidebar Item Support ---------- */
.sidebar-theme-item {
  margin-top: auto;
  padding: 0.75rem 1rem 1.25rem 1rem;
  border-top: 1px solid rgba(82, 183, 136, 0.1);
}

.sidebar-theme-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.18);
  color: #c0d4c8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-theme-btn:hover {
  background: rgba(82, 183, 136, 0.18);
  color: #ffffff;
}

/* ================================================================
   VITI-LIGHT : THÈME MODE JOUR (SAAS EXECUTIVE CLAIR)
   ================================================================ */
html[data-theme="light"],
body[data-theme="light"],
[data-theme="light"] body,
[data-theme="light"] .dashboard-body {
  background-color: #f3f7f4 !important;
  background: #f3f7f4 !important;
  color: #14241d !important;
}

[data-theme="light"] .app-layout,
[data-theme="light"] .app-main,
[data-theme="light"] .app-content {
  background: #f3f7f4 !important;
  background-color: #f3f7f4 !important;
}

[data-theme="light"] .app-sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(45, 106, 79, 0.12) !important;
  box-shadow: 2px 0 16px rgba(18, 38, 28, 0.03) !important;
}

[data-theme="light"] .sidebar-header {
  border-bottom: 1px solid rgba(45, 106, 79, 0.08) !important;
}

[data-theme="light"] .sidebar-user {
  background: rgba(45, 106, 79, 0.05) !important;
  border: 1px solid rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .user-name {
  color: #14241d !important;
}

[data-theme="light"] .user-role {
  color: #4a6657 !important;
}

[data-theme="light"] .nav-section-title {
  color: #5e7a6d !important;
}

[data-theme="light"] .nav-item {
  color: #3b574a !important;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(45, 106, 79, 0.07) !important;
  color: #14241d !important;
}

[data-theme="light"] .nav-item.active {
  background: rgba(45, 106, 79, 0.12) !important;
  color: #1b4332 !important;
  border-color: rgba(45, 106, 79, 0.25) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .sidebar-footer {
  border-top: 1px solid rgba(45, 106, 79, 0.08) !important;
}

[data-theme="light"] .app-topbar {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.12) !important;
  box-shadow: 0 2px 12px rgba(18, 38, 28, 0.03) !important;
}

[data-theme="light"] .topbar-title {
  color: #14241d !important;
}

[data-theme="light"] .topbar-subtitle {
  color: #4a6657 !important;
}

[data-theme="light"] .mobile-menu-btn span {
  background: #14241d !important;
}

[data-theme="light"] .user-topbar-profile {
  background: rgba(45, 106, 79, 0.06) !important;
  border-color: rgba(45, 106, 79, 0.18) !important;
  color: #14241d !important;
}

[data-theme="light"] .user-topbar-name {
  color: #1b4332 !important;
}

[data-theme="light"] .btn-topbar-logout,
[data-theme="light"] .btn-topbar-switch {
  color: #4a6657 !important;
  border-left-color: rgba(45, 106, 79, 0.18) !important;
}

[data-theme="light"] .btn-topbar-logout:hover {
  color: #d90429 !important;
}

[data-theme="light"] .btn-topbar-switch:hover {
  color: #1b4332 !important;
}

[data-theme="light"] .quick-banner {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(45, 106, 79, 0.16) !important;
  color: #2b4739 !important;
  box-shadow: 0 4px 16px rgba(18, 38, 28, 0.04) !important;
}

[data-theme="light"] .quick-banner-text strong {
  color: #14241d !important;
}

[data-theme="light"] .kpi-card {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(45, 106, 79, 0.14) !important;
  box-shadow: 0 4px 18px rgba(18, 38, 28, 0.04) !important;
}

[data-theme="light"] .kpi-card::before {
  opacity: 0.15 !important;
}

[data-theme="light"] .kpi-title {
  color: #4a6657 !important;
}

[data-theme="light"] .kpi-value {
  color: #14241d !important;
}

[data-theme="light"] .kpi-sub {
  color: #607d6f !important;
}

[data-theme="light"] .kpi-card.kpi-highlight-gold {
  border-color: rgba(212, 163, 115, 0.45) !important;
  background: #fffdf9 !important;
}

[data-theme="light"] .kpi-card.kpi-highlight-gold .kpi-value {
  color: #b07d38 !important;
}

[data-theme="light"] .badge-tag {
  background: rgba(45, 106, 79, 0.08) !important;
  border-color: rgba(45, 106, 79, 0.2) !important;
  color: #244234 !important;
}

[data-theme="light"] .badge-tag.badge-warn {
  background: rgba(212, 163, 115, 0.15) !important;
  border-color: rgba(212, 163, 115, 0.35) !important;
  color: #9c6c2e !important;
}

[data-theme="light"] .badge-tag.badge-succ {
  background: rgba(45, 106, 79, 0.12) !important;
  border-color: rgba(45, 106, 79, 0.28) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .kpi-card-clickable:hover {
  border-color: rgba(45, 106, 79, 0.4) !important;
  box-shadow: 0 10px 25px rgba(20, 36, 29, 0.08) !important;
}

[data-theme="light"] .kpi-card-action-bar {
  border-top-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .kpi-quick-btn {
  background: rgba(45, 106, 79, 0.08) !important;
  border-color: rgba(45, 106, 79, 0.25) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .kpi-quick-btn:hover {
  background: #2d6a4f !important;
  color: #ffffff !important;
}

[data-theme="light"] .kpi-arrow-nav {
  color: #607d6f !important;
}

[data-theme="light"] .kpi-card-clickable:hover .kpi-arrow-nav {
  color: #1b4332 !important;
}

[data-theme="light"] .banner-quick-link {
  background: rgba(45, 106, 79, 0.1) !important;
  border-color: rgba(45, 106, 79, 0.28) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .banner-quick-link:hover {
  background: #2d6a4f !important;
  color: #ffffff !important;
}

[data-theme="light"] .th-clickable:hover {
  color: #1b4332 !important;
}

[data-theme="light"] .th-link-badge {
  background: rgba(45, 106, 79, 0.08) !important;
  border-color: rgba(45, 106, 79, 0.25) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .th-clickable:hover .th-link-badge {
  background: #2d6a4f !important;
  color: #ffffff !important;
}

[data-theme="light"] .dashboard-table-card,
[data-theme="light"] .table-card {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(45, 106, 79, 0.15) !important;
  box-shadow: 0 6px 24px rgba(18, 38, 28, 0.05) !important;
}

[data-theme="light"] .table-header-bar,
[data-theme="light"] .table-header-top,
[data-theme="light"] .table-controls-bar {
  border-bottom: 1px solid rgba(45, 106, 79, 0.1) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
}

[data-theme="light"] .table-title {
  color: #14241d !important;
}

[data-theme="light"] .search-box {
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.18) !important;
}

[data-theme="light"] .search-box input {
  color: #14241d !important;
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.2) !important;
}

[data-theme="light"] .search-box input::placeholder {
  color: #7b9688 !important;
}

[data-theme="light"] .filter-dropdown-pill {
  background: #f8faf9 !important;
  background-image: none !important;
  border: 1px solid rgba(45, 106, 79, 0.2) !important;
  color: #14241d !important;
  box-shadow: none !important;
}

[data-theme="light"] .filter-dropdown-label {
  color: #557062 !important;
}

[data-theme="light"] .filter-dropdown-pill select {
  color: #14241d !important;
}

[data-theme="light"] .filter-dropdown-arrow {
  color: #4a6657 !important;
}

[data-theme="light"] .filter-dropdown-value {
  color: #14241d !important;
}

[data-theme="light"] .filter-multiselect-dropdown {
  background: #ffffff !important;
  border-color: rgba(45, 106, 79, 0.25) !important;
  box-shadow: 0 14px 32px rgba(20, 36, 29, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .filter-multiselect-header {
  background: #f4f8f5 !important;
  border-bottom-color: rgba(45, 106, 79, 0.15) !important;
}

[data-theme="light"] .filter-ms-header-title {
  color: #14241d !important;
}

[data-theme="light"] .filter-ms-count-badge {
  background: rgba(45, 106, 79, 0.12) !important;
  color: #2d6a4f !important;
  border-color: rgba(45, 106, 79, 0.25) !important;
}

[data-theme="light"] .filter-ms-action-btn {
  color: #2d6a4f !important;
}

[data-theme="light"] .filter-ms-action-btn:hover {
  background: rgba(45, 106, 79, 0.1) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .filter-ms-sep {
  color: rgba(0, 0, 0, 0.18) !important;
}

[data-theme="light"] .filter-ms-search-box {
  border-bottom-color: rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .filter-ms-search-input {
  background: #f8faf8 !important;
  border-color: rgba(45, 106, 79, 0.2) !important;
  color: #14241d !important;
}

[data-theme="light"] .filter-ms-category-title {
  color: #2d6a4f !important;
  border-top-color: rgba(45, 106, 79, 0.1) !important;
}

[data-theme="light"] .filter-ms-item {
  color: #14241d !important;
}

[data-theme="light"] .filter-ms-item:hover {
  background: rgba(45, 106, 79, 0.08) !important;
}

[data-theme="light"] .filter-ms-item.is-checked {
  background: rgba(82, 183, 136, 0.16) !important;
  color: #14241d !important;
}

[data-theme="light"] .filter-ms-rate-badge {
  background: rgba(45, 106, 79, 0.1) !important;
  color: #2d6a4f !important;
}

[data-theme="light"] .filter-ms-footer {
  background: #f8faf8 !important;
  border-top-color: rgba(45, 106, 79, 0.15) !important;
}

[data-theme="light"] .btn-ms-new-client {
  border-color: rgba(45, 106, 79, 0.35) !important;
  color: #2d6a4f !important;
}

[data-theme="light"] .btn-ms-new-client:hover {
  background: rgba(45, 106, 79, 0.08) !important;
  border-color: #2d6a4f !important;
}

[data-theme="light"] .date-range-inputs {
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.2) !important;
}

[data-theme="light"] .date-input-label {
  color: #557062 !important;
}

[data-theme="light"] .filter-date-input {
  color: #14241d !important;
  background: transparent !important;
}

[data-theme="light"] .status-segmented-control {
  background: #edf3ef !important;
  border: 1px solid rgba(45, 106, 79, 0.14) !important;
}

[data-theme="light"] .status-tab {
  color: #4a6657 !important;
}

[data-theme="light"] .status-tab:hover {
  color: #14241d !important;
}

[data-theme="light"] .status-tab.active {
  background: #ffffff !important;
  color: #14241d !important;
  box-shadow: 0 2px 8px rgba(18, 38, 28, 0.08) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .status-tab-badge {
  background: rgba(45, 106, 79, 0.1) !important;
  color: #1b4332 !important;
}

[data-theme="light"] .dashboard-table-wrapper,
[data-theme="light"] .table-responsive,
[data-theme="light"] .interventions-table,
[data-theme="light"] .interventions-table tbody {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

[data-theme="light"] .interventions-table th {
  background: #f1f6f3 !important;
  background-color: #f1f6f3 !important;
  color: #244234 !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.14) !important;
}

/* Lignes et cellules des tableaux en Mode Jour */
[data-theme="light"] .interventions-table tbody tr,
[data-theme="light"] .interventions-table tbody tr td,
[data-theme="light"] .interventions-table tr,
[data-theme="light"] .interventions-table td {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #14241d !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.08) !important;
}

[data-theme="light"] .interventions-table tbody tr:hover,
[data-theme="light"] .interventions-table tbody tr:hover td,
[data-theme="light"] .interventions-table tr:hover td {
  background: #f4faf6 !important;
  background-color: #f4faf6 !important;
}

/* Typographie & données des cellules en Mode Jour */
[data-theme="light"] .interventions-table .date-main,
[data-theme="light"] .date-main {
  color: #14241d !important;
  font-weight: 700 !important;
}

[data-theme="light"] .interventions-table .time-sub,
[data-theme="light"] .time-sub,
[data-theme="light"] .date-sub {
  color: #557062 !important;
}

[data-theme="light"] .interventions-table .worker-badge,
[data-theme="light"] .worker-badge {
  color: #14241d !important;
}

[data-theme="light"] .interventions-table .worker-badge span,
[data-theme="light"] .worker-badge span {
  color: #14241d !important;
}

[data-theme="light"] .worker-avatar-mini {
  background: #eef5f1 !important;
  color: #1b4332 !important;
  border: 1px solid rgba(45, 106, 79, 0.25) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .interventions-table .client-name,
[data-theme="light"] .client-name {
  color: #14241d !important;
  font-weight: 700 !important;
}

[data-theme="light"] .interventions-table .parcel-name,
[data-theme="light"] .parcel-name {
  color: #244234 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .parcel-details {
  color: #557062 !important;
}

[data-theme="light"] .interventions-table .task-tag,
[data-theme="light"] .task-tag {
  background: #eef5f1 !important;
  background-color: #eef5f1 !important;
  border: 1px solid rgba(45, 106, 79, 0.22) !important;
  color: #1b4332 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .interventions-table .volume-value,
[data-theme="light"] .volume-value {
  color: #14241d !important;
  font-weight: 600 !important;
}

[data-theme="light"] .interventions-table .amount-value,
[data-theme="light"] .amount-value {
  color: #14241d !important;
  font-weight: 800 !important;
}

[data-theme="light"] .amount-ttc {
  color: #1b6a42 !important;
}

/* Badges de Statut Facturation */
[data-theme="light"] .status-pill-toggle.status-unbilled,
[data-theme="light"] .status-pill-toggle.status-pending {
  background: #fff8e6 !important;
  background-color: #fff8e6 !important;
  color: #9c6c06 !important;
  border: 1px solid rgba(212, 163, 115, 0.5) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .status-pill-toggle.status-unbilled:hover,
[data-theme="light"] .status-pill-toggle.status-pending:hover {
  background: #ffefc4 !important;
  background-color: #ffefc4 !important;
}

[data-theme="light"] .status-pill-toggle.status-billed {
  background: #eaf6ee !important;
  background-color: #eaf6ee !important;
  color: #1b4332 !important;
  border: 1px solid rgba(45, 106, 79, 0.3) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .status-pill-toggle.status-billed:hover {
  background: #dcf0e2 !important;
  background-color: #dcf0e2 !important;
}

/* Boutons d'action dans le tableau */
[data-theme="light"] .action-btn {
  background: #f0f7f3 !important;
  background-color: #f0f7f3 !important;
  border: 1px solid rgba(45, 106, 79, 0.22) !important;
  color: #244234 !important;
}

[data-theme="light"] .action-btn:hover {
  background: #e1efe7 !important;
  background-color: #e1efe7 !important;
  color: #14241d !important;
  border-color: rgba(45, 106, 79, 0.4) !important;
}

[data-theme="light"] .action-btn.edit-btn:hover {
  background: #d8ece0 !important;
  background-color: #d8ece0 !important;
  color: #1b4332 !important;
  border-color: rgba(45, 106, 79, 0.5) !important;
}

[data-theme="light"] .action-btn.delete-btn {
  background: #fff0f0 !important;
  background-color: #fff0f0 !important;
  border: 1px solid #ffd6d6 !important;
  color: #d90429 !important;
}

[data-theme="light"] .action-btn.delete-btn:hover {
  background: #ffe0e0 !important;
  background-color: #ffe0e0 !important;
  border-color: #ffb8b8 !important;
}

/* Pied de tableau */
[data-theme="light"] .table-footer {
  background: #fafcfb !important;
  background-color: #fafcfb !important;
  border-top: 1px solid rgba(45, 106, 79, 0.1) !important;
  color: #557062 !important;
}

[data-theme="light"] .table-legend em {
  color: #1b4332 !important;
}

/* Travaux à faire & Prestations */
[data-theme="light"] .planned-card-header {
  background: #f8faf9 !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .planned-card-title {
  color: #14241d !important;
}

[data-theme="light"] .planned-card-subtitle {
  color: #557062 !important;
}

[data-theme="light"] .btn-convert-work {
  background: #2d6a4f !important;
  background-color: #2d6a4f !important;
  border: 1px solid #1b4332 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

[data-theme="light"] .btn-convert-work:hover {
  background: #1b4332 !important;
  background-color: #1b4332 !important;
}

[data-theme="light"] .badge-planned-status {
  background: #fff8e6 !important;
  color: #9c6c06 !important;
  border: 1px solid rgba(212, 163, 115, 0.4) !important;
}

/* Clients View Light Theme */
[data-theme="light"] .view-heading {
  color: #14241d;
}

[data-theme="light"] .view-subheading {
  color: #4a6657;
}

[data-theme="light"] .clients-metrics-bar {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.14);
  box-shadow: 0 4px 18px rgba(18, 38, 28, 0.04);
}

[data-theme="light"] .clients-metric-item .metric-num {
  color: #14241d;
}

[data-theme="light"] .clients-metric-item .metric-desc {
  color: #607d6f;
}

[data-theme="light"] .clients-search-wrapper input {
  background: #f8faf9;
  border: 1px solid rgba(45, 106, 79, 0.2);
  color: #14241d;
}

[data-theme="light"] .clients-search-wrapper input::placeholder {
  color: #7b9688;
}

[data-theme="light"] .client-card {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(45, 106, 79, 0.16) !important;
  box-shadow: 0 4px 20px rgba(18, 38, 28, 0.05) !important;
}

[data-theme="light"] .client-card:hover {
  border-color: rgba(45, 106, 79, 0.4) !important;
  box-shadow: 0 8px 28px rgba(18, 38, 28, 0.09) !important;
}

/* Nom des structures / domaines viticoles */
[data-theme="light"] .domain-name,
[data-theme="light"] .client-card .domain-name,
[data-theme="light"] .client-card-name,
[data-theme="light"] .client-title-row h3 {
  color: #14241d !important;
  font-weight: 700 !important;
}

[data-theme="light"] .domain-commune,
[data-theme="light"] .client-card .domain-commune,
[data-theme="light"] .client-card-commune {
  color: #2d6a4f !important;
  font-weight: 600 !important;
}

/* Badges d'en-tête de carte client */
[data-theme="light"] .client-card-header .badge-tag {
  background: #eef5f1 !important;
  color: #1b4332 !important;
  border: 1px solid rgba(45, 106, 79, 0.2) !important;
  font-weight: 600 !important;
}

[data-theme="light"] .badge-interventions {
  background: rgba(45, 106, 79, 0.12) !important;
  color: #1b4332 !important;
  border: 1px solid rgba(45, 106, 79, 0.25) !important;
  font-weight: 700 !important;
}

/* Coordonnées & métadonnées du client */
[data-theme="light"] .client-card-meta {
  background: #f4faf6 !important;
  color: #244234 !important;
  border: 1px solid rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .client-card-meta strong {
  color: #14241d !important;
}

[data-theme="light"] .client-meta-line {
  color: #244234 !important;
}

/* Boutons du bas de carte client */
[data-theme="light"] .client-card-footer-btns .btn-client-intervention {
  background: #2d6a4f !important;
  background-color: #2d6a4f !important;
  color: #ffffff !important;
  border: 1px solid #1b4332 !important;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .client-card-footer-btns .btn-client-intervention span {
  color: #ffffff !important;
}

[data-theme="light"] .client-card-footer-btns .btn-client-intervention:hover {
  background: #1b4332 !important;
  background-color: #1b4332 !important;
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.35) !important;
}

[data-theme="light"] .client-card-footer-btns .btn-view-dossier {
  background: #f0f7f3 !important;
  background-color: #f0f7f3 !important;
  color: #1b4332 !important;
  border: 1px solid rgba(45, 106, 79, 0.25) !important;
  font-weight: 600 !important;
}

[data-theme="light"] .client-card-footer-btns .btn-view-dossier span {
  color: #1b4332 !important;
}

[data-theme="light"] .client-card-footer-btns .btn-view-dossier:hover {
  background: #e1efe7 !important;
  color: #0f281e !important;
}

/* Accordéon parcelles associées */
[data-theme="light"] .client-parcels-accordion {
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.16) !important;
}

[data-theme="light"] .client-parcels-accordion[open] {
  background: #ffffff !important;
  border-color: rgba(45, 106, 79, 0.28) !important;
  box-shadow: 0 4px 16px rgba(18, 38, 28, 0.05) !important;
}

[data-theme="light"] .parcels-accordion-summary {
  color: #1b4332 !important;
}

[data-theme="light"] .parcels-dropdown-header {
  background: #eef5f1 !important;
  color: #244234 !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .parcel-item {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(45, 106, 79, 0.08) !important;
}

[data-theme="light"] .parcel-item-name {
  color: #14241d !important;
  font-weight: 600 !important;
}

[data-theme="light"] .parcel-item-tags {
  color: #557062 !important;
}

[data-theme="light"] .client-delete-btn {
  background: #fff0f0 !important;
  border-color: #ffd6d6 !important;
  color: #d90429 !important;
}

[data-theme="light"] .client-delete-btn:hover {
  background: #ffe0e0 !important;
}

/* Modal Dossier Client en Mode Jour */
[data-theme="light"] .client-dossier-modal,
[data-theme="light"] #client-dossier-modal .modal-container {
  background: #ffffff !important;
  color: #14241d !important;
}

[data-theme="light"] #dossier-client-name {
  color: #14241d !important;
}

[data-theme="light"] #dossier-commune-badge {
  background: #eef5f1 !important;
  color: #1b4332 !important;
}

[data-theme="light"] #dossier-client-subtitle {
  color: #557062 !important;
}

[data-theme="light"] .dossier-metric-card {
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.14) !important;
}

[data-theme="light"] .dossier-metric-val {
  color: #14241d !important;
}

[data-theme="light"] .dossier-metric-label {
  color: #557062 !important;
}

[data-theme="light"] .dossier-filter-bar {
  background: #f8faf9 !important;
  border: 1px solid rgba(45, 106, 79, 0.16) !important;
}

[data-theme="light"] .dossier-filter-label {
  color: #244234 !important;
}

[data-theme="light"] .dossier-tab-btn {
  color: #557062 !important;
}

[data-theme="light"] .dossier-tab-btn.active {
  color: #1b4332 !important;
  border-bottom-color: #2d6a4f !important;
}

/* Services View Light Theme */
[data-theme="light"] .services-metrics-bar {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.14);
  box-shadow: 0 4px 18px rgba(18, 38, 28, 0.04);
}

[data-theme="light"] .services-tab-btn {
  background: transparent;
  color: #4a6657;
}

[data-theme="light"] .services-tab-btn.active {
  background: #ffffff;
  color: #14241d;
  box-shadow: 0 2px 8px rgba(18, 38, 28, 0.08);
}

[data-theme="light"] .services-filter-panel {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.12);
}

[data-theme="light"] .services-filter-dropdowns-bar {
  background: #ffffff;
  border-color: rgba(45, 106, 79, 0.16);
  box-shadow: 0 4px 16px rgba(18, 38, 28, 0.04);
}

[data-theme="light"] .category-services-accordion {
  background: #ffffff;
  border-color: rgba(45, 106, 79, 0.16);
  box-shadow: 0 2px 10px rgba(18, 38, 28, 0.04);
}

[data-theme="light"] .category-accordion-summary {
  background: #f7faf8;
}

[data-theme="light"] .category-accordion-summary:hover {
  background: #eef5f1;
}

[data-theme="light"] .cat-summary-title {
  color: #14241d;
}

[data-theme="light"] .cat-summary-badge {
  background: rgba(45, 106, 79, 0.08);
  color: #2d6a4f;
  border-color: rgba(45, 106, 79, 0.2);
}

[data-theme="light"] .cat-summary-arrow {
  color: #2d6a4f;
}

[data-theme="light"] .chip {
  background: #f3f7f4;
  border-color: rgba(45, 106, 79, 0.16);
  color: #3b574a;
}

[data-theme="light"] .chip.active {
  background: #1b4332;
  color: #ffffff;
}

[data-theme="light"] .service-card {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.14);
  box-shadow: 0 4px 18px rgba(18, 38, 28, 0.05);
}

[data-theme="light"] .service-card-title {
  color: #14241d;
}

[data-theme="light"] .service-card-desc {
  color: #4a6657;
}

/* Modals Light Theme */
[data-theme="light"] .modal-dialog {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.16);
  box-shadow: 0 20px 60px rgba(18, 38, 28, 0.18);
}

[data-theme="light"] .modal-header {
  border-bottom: 1px solid rgba(45, 106, 79, 0.1);
  background: #ffffff;
}

[data-theme="light"] .modal-title {
  color: #14241d;
}

[data-theme="light"] .modal-subtitle {
  color: #4a6657;
}

[data-theme="light"] .modal-close-btn {
  background: #f0f5f2;
  color: #4a6657;
}

[data-theme="light"] .modal-close-btn:hover {
  background: #e3ede7;
  color: #14241d;
}

[data-theme="light"] .form-label {
  color: #2b4739;
}

[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #fbfdfc;
  border: 1px solid rgba(45, 106, 79, 0.22);
  color: #14241d;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: #2d6a4f;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

[data-theme="light"] .modal-footer {
  border-top: 1px solid rgba(45, 106, 79, 0.1);
  background: #fafcfb;
}

/* Dossier Client Modal Light Theme */
[data-theme="light"] .dossier-metric-card {
  background: #f6faf7;
  border: 1px solid rgba(45, 106, 79, 0.12);
}

[data-theme="light"] .dossier-metric-label {
  color: #557062;
}

[data-theme="light"] .dossier-metric-val {
  color: #14241d;
}

[data-theme="light"] .dossier-metric-val.value-warning {
  color: #9c6c06;
}

[data-theme="light"] .dossier-metric-val.value-success {
  color: #1b4332;
}

[data-theme="light"] .dossier-filter-bar {
  background: #f2f7f4;
  border: 1px solid rgba(45, 106, 79, 0.12);
}

[data-theme="light"] .dossier-filter-label {
  color: #2b4739;
}

[data-theme="light"] .dossier-date-input {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.22);
  color: #14241d;
}

[data-theme="light"] .dossier-tab-btn {
  color: #4a6657;
  background: #f2f7f4;
  border: 1px solid rgba(45, 106, 79, 0.12);
}

[data-theme="light"] .dossier-tab-btn.active {
  background: #ffffff;
  color: #14241d;
  border-color: rgba(45, 106, 79, 0.25);
  box-shadow: 0 2px 8px rgba(18, 38, 28, 0.06);
}

/* Mobile Bottom Nav Light Theme */
[data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(45, 106, 79, 0.12);
  box-shadow: 0 -4px 20px rgba(18, 38, 28, 0.06);
}

[data-theme="light"] .mobile-nav-item {
  color: #5e7a6d;
}

[data-theme="light"] .mobile-nav-item.active {
  color: #1b4332;
}

[data-theme="light"] .mobile-action-circle {
  border-color: #ffffff;
  box-shadow: 0 4px 18px rgba(45, 106, 79, 0.4);
}

/* ==============================================================================
   Stripe & Subscription Management Styles (Modal 8 & Dashboard)
   ============================================================================== */

.sub-current-card {
  background: rgba(18, 32, 25, 0.85);
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.sub-current-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.sub-current-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #74c69d;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.sub-current-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.sub-current-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #52b788;
  margin-top: 0.2rem;
}

.sub-period {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.sub-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #74c69d;
}

.sub-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52b788;
  box-shadow: 0 0 8px #52b788;
}

.sub-status-pill.warning {
  background: rgba(233, 196, 106, 0.15);
  border-color: rgba(233, 196, 106, 0.35);
  color: #e9c46a;
}
.sub-status-pill.warning .sub-status-dot {
  background: #e9c46a;
  box-shadow: 0 0 8px #e9c46a;
}

.sub-current-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(82, 183, 136, 0.15);
}

.sub-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sub-detail-label {
  font-size: 0.76rem;
  color: var(--color-text-secondary);
}

.sub-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.sub-portal-action {
  padding-top: 0.5rem;
}

.sub-plans-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.sub-section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.sub-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sub-plan-card {
  background: rgba(14, 24, 19, 0.8);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: var(--radius-md);
  padding: 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sub-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 183, 136, 0.45);
}

.sub-plan-card.featured {
  background: rgba(18, 36, 27, 0.95);
  border: 2px solid #52b788;
  box-shadow: 0 4px 20px rgba(82, 183, 136, 0.2);
}

.sub-popular-tag {
  position: absolute;
  top: -10px;
  right: 12px;
  background: linear-gradient(135deg, #52b788, #2d6a4f);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-plan-header h5 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem 0;
}

.sub-plan-target {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  display: block;
  min-height: 28px;
}

.sub-plan-cost {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.5rem;
}

.sub-plan-cost span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.sub-plan-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #c9d8d0;
  flex: 1;
}

.sub-security-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.sub-security-icon {
  font-size: 1.1rem;
}

/* Light Theme overrides for Subscription Modal */
[data-theme="light"] .sub-current-card {
  background: #ffffff;
  border-color: rgba(45, 106, 79, 0.2);
  box-shadow: 0 4px 20px rgba(18, 38, 28, 0.06);
}

[data-theme="light"] .sub-current-title,
[data-theme="light"] .sub-section-title,
[data-theme="light"] .sub-plan-header h5,
[data-theme="light"] .sub-plan-cost,
[data-theme="light"] .sub-detail-value {
  color: #14241d;
}

[data-theme="light"] .sub-plan-card {
  background: #f8faf9;
  border-color: rgba(45, 106, 79, 0.15);
}

[data-theme="light"] .sub-plan-card.featured {
  background: #ffffff;
  border-color: #2d6a4f;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.12);
}

[data-theme="light"] .sub-plan-perks {
  color: #2d4a3e;
}

[data-theme="light"] .sub-security-box {
  background: #f0f6f2;
  border-color: rgba(45, 106, 79, 0.15);
  color: #2d4a3e;
}

@media (max-width: 768px) {
  .sub-plans-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* ================================================================
   SECTION ÉQUIPE & UTILISATEURS DU DOMAINE (DESIGN SYSTEM)
   ================================================================ */

.icon-team,
.icon-blue {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.value-team {
  color: #93c5fd !important;
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Bannière de statistiques de l'équipe */
.team-summary-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  background: rgba(14, 23, 19, 0.7);
  border: 1px solid rgba(82, 183, 136, 0.18);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.team-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  background: rgba(20, 32, 27, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.1);
}

.team-stat-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #60a5fa;
  line-height: 1.1;
}

.team-stat-label {
  font-size: 0.76rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Barre d'outils et recherche équipe */
.team-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.team-search-wrap {
  position: relative;
  flex: 1 1 240px;
}

.team-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
  pointer-events: none;
}

.team-search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  background: rgba(14, 23, 19, 0.85);
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.team-search-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.team-filter-role-wrap {
  flex: 0 0 180px;
}

.team-filter-role-wrap select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: rgba(14, 23, 19, 0.85);
  border: 1px solid rgba(82, 183, 136, 0.22);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

/* Grille des membres de l'équipe */
.team-members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.team-member-card {
  background: linear-gradient(145deg, rgba(20, 31, 26, 0.8), rgba(14, 22, 18, 0.95));
  border: 1px solid rgba(82, 183, 136, 0.16);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.team-member-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.team-member-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.team-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.team-member-title-box {
  flex: 1;
  min-width: 0;
}

.team-member-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.team-member-role-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.team-role-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.role-gerant {
  background: rgba(212, 163, 115, 0.2);
  color: #ffd166;
  border: 1px solid rgba(212, 163, 115, 0.4);
}

.role-chef {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-tractoriste {
  background: rgba(82, 183, 136, 0.2);
  color: #74c69d;
  border: 1px solid rgba(82, 183, 136, 0.4);
}

.role-ouvrier {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.role-saisonnier {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-autre {
  background: rgba(156, 163, 175, 0.2);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.4);
}

.team-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-actif {
  background: #52b788;
  box-shadow: 0 0 6px rgba(82, 183, 136, 0.6);
}

.status-mission {
  background: #60a5fa;
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
}

.status-conge {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.status-inactif {
  background: #6b7280;
}

.team-member-contact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  padding: 0.5rem 0.6rem;
  background: rgba(10, 16, 13, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(82, 183, 136, 0.08);
}

.team-contact-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-contact-link {
  color: #e6f0ea;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.team-contact-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.team-member-certifs {
  font-size: 0.76rem;
  color: #74c69d;
  background: rgba(45, 106, 79, 0.15);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid #52b788;
  line-height: 1.35;
}

.team-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(82, 183, 136, 0.1);
}

.team-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background: rgba(14, 23, 19, 0.6);
  border: 1px dashed rgba(82, 183, 136, 0.25);
  border-radius: var(--radius-md);
}

.team-empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.team-empty-state h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.team-empty-state p {
  font-size: 0.84rem;
  color: var(--color-text-secondary);
  max-width: 440px;
  margin: 0 auto 1.25rem;
  line-height: 1.45;
}

/* Light mode adjustments */
[data-theme="light"] .team-summary-banner {
  background: #ffffff !important;
  border-color: rgba(45, 106, 79, 0.15) !important;
}

[data-theme="light"] .team-summary-stat {
  background: #f3f7f4 !important;
  border-color: rgba(45, 106, 79, 0.12) !important;
}

[data-theme="light"] .team-stat-num {
  color: #2563eb !important;
}

[data-theme="light"] .team-stat-label {
  color: #4a6657 !important;
}

[data-theme="light"] .team-search-input,
[data-theme="light"] .team-filter-role-wrap select {
  background: #ffffff !important;
  border-color: rgba(45, 106, 79, 0.2) !important;
  color: #14241d !important;
}

[data-theme="light"] .team-member-card {
  background: #ffffff !important;
  border-color: rgba(45, 106, 79, 0.14) !important;
  box-shadow: 0 4px 16px rgba(18, 38, 28, 0.04) !important;
}

[data-theme="light"] .team-member-name {
  color: #14241d !important;
}

[data-theme="light"] .team-member-contact {
  background: #f8faf9 !important;
  border-color: rgba(45, 106, 79, 0.1) !important;
}

[data-theme="light"] .team-contact-link {
  color: #14241d !important;
}

[data-theme="light"] .team-contact-link:hover {
  color: #2563eb !important;
}

[data-theme="light"] .team-member-certifs {
  background: #eef6f1 !important;
  color: #1b4332 !important;
  border-left-color: #2d6a4f !important;
}

@media (max-width: 768px) {
  .team-summary-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-members-grid {
    grid-template-columns: 1fr;
  }
  .team-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .team-filter-role-wrap {
    flex: 1 1 100%;
  }
}



