/* ===== TOPBAR ===== */
.topbar {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.topbar-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem 0.15rem;
}

.topbar-user {
  position: absolute;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-user-name {
  color: rgba(255,255,255,0.85);
  font-size: var(--text-sm);
  font-weight: 500;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.topbar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.25);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: white;
  letter-spacing: 0.3px;
}

/* ===== TABS ===== */
.topbar-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.25rem 1.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.topbar-tabs-inner {
  display: flex;
  gap: 0.25rem;
}
.report-bar {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  padding: 0 0.25rem;
}

.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  border: none;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.report-pill-team {
  background: rgba(16, 185, 129, 0.18);
  color: rgba(255,255,255,0.95);
}

.report-pill-team:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.report-pill-self {
  background: rgba(99, 102, 241, 0.18);
  color: rgba(255,255,255,0.95);
}

.report-pill-self:hover {
  background: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
}

.report-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.report-pill:disabled:hover {
  background: none;
  box-shadow: none;
}

.topbar-tabs::-webkit-scrollbar { display: none; }

.nav-separator {
  display: none;
}

.hamburger-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-toggle.is-active span:nth-child(2) { opacity: 0; }
.hamburger-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
  .hamburger-toggle { display: flex; }
  .topbar-tabs-inner .tab-link { display: none; }
  .topbar-tabs-inner.is-open {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--green-700);
    flex-direction: column;
    padding: 0.5rem 1rem;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    gap: 0;
  }
  .topbar-tabs-inner.is-open .tab-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border-bottom: none;
  }
  .topbar-tabs-inner.is-open .tab-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
  }
  .topbar-tabs-inner.is-open .hamburger-toggle { display: flex; }
}

.tab-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 3px solid transparent;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-link:hover {
  color: white;
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.tab-link.active {
  color: var(--green-800);
  background: var(--surface);
  border-bottom: 3px solid var(--green-500);
  transform: translateY(0);
  font-weight: 700;
}

.tab-link i { margin-right: 0.3rem; vertical-align: middle; }

/* ===== SEARCH BAR IN TOPBAR ===== */
.topbar-search {
  flex: 1;
  max-width: 280px;
  margin: 0 1rem;
}

.topbar-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search-input {
  width: 100%;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: all 0.2s ease;
  outline: none;
}

.topbar-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.topbar-search-input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}

/* ===== THEME TOGGLE IN TOPBAR ===== */
.topbar-theme-btn {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.topbar-theme-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.05);
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.page-header-glow {
  background: linear-gradient(135deg, var(--green-50) 0%, var(--surface) 100%);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-header-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--green-800);
  margin: 0;
  line-height: 1.2;
}

.page-header-btn {
  flex-shrink: 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat-item {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--green-700);
  min-width: 1.2em;
  text-align: center;
  animation: fadeInScale 0.4s ease both;
}

.stat-value:nth-child(1) { animation-delay: 0s; }
.stat-value:nth-child(2) { animation-delay: 0.08s; }
.stat-value:nth-child(3) { animation-delay: 0.16s; }

/* ===== PRIORITY DOT ===== */
.priority-dot {
  position: absolute;
  top: 0.75rem;
  right: 2.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid transparent;
}

.priority-dot.is-medium {
  background: var(--amber-500);
  border-color: var(--amber-500);
}

.priority-dot.is-high {
  background: var(--rose-600);
  border-color: var(--rose-600);
  animation: pulse-shadow-red 1.5s ease-in-out infinite;
}

.priority-pill {
  position: absolute;
  top: 0.65rem;
  right: 2.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}
.priority-pill.is-high {
  background: var(--rose-100);
  color: var(--rose-800);
}
.priority-pill.is-medium {
  background: var(--amber-100);
  color: var(--amber-700);
}



/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  left: var(--x);
  width: 8px;
  height: 8px;
  background: var(--color);
  border-radius: 2px;
  animation: confettiFall 2.5s ease-in var(--delay) forwards;
  opacity: 0;
}



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

.skeleton-card {
  height: 120px;
  margin-bottom: 0.65rem;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 0.5rem;
}

.skeleton-line:last-child {
  width: 60%;
}



/* ===== LAYOUT ===== */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* ===== STATUS SECTIONS ===== */
.status-section {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  animation: slideUp 0.35s ease both;
}

.status-section:nth-child(1) { animation-delay: 0s; }
.status-section:nth-child(2) { animation-delay: 0.08s; }
.status-section:nth-child(3) { animation-delay: 0.16s; }

.status-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.status-section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--green-200), transparent);
}

.status-section-icon {
  font-size: var(--text-base);
  display: flex;
  color: var(--green-600);
}

.status-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--green-800);
  letter-spacing: 0.2px;
}

.status-section-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  padding: 0 0.65rem;
  animation: fadeInScale 0.3s ease;
}

.status-section-count.is-new { background: var(--gray-400); }
.status-section-count.is-in-progress { background: var(--green-500); }
.status-section-count.is-pending { background: var(--amber-500); }

.status-section-body {
  padding: 0.85rem 1.25rem 1.25rem;
}

.bacheca .status-section-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
}

/* ===== JOB CARDS ===== */
.job-card {
  background: var(--gray-50);
  border-radius: 0.625rem;
  padding: 1rem 1rem 1rem 1.1rem;
  margin-bottom: 0.65rem;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: fadeInUp 0.35s ease both;
  position: relative;
  will-change: transform;
}

.job-card:hover {
  box-shadow: var(--shadow-md), var(--shadow-green);
  border-color: var(--green-200);
  transform: translateY(-2px);
}

.job-card:last-child { margin-bottom: 0; }

.job-card.is-leaving {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

.job-card.is-new { border-left-color: #9ca3af; }
.job-card.is-in-progress {
  border-left-color: var(--green-500);
  animation: cardPulse 2.5s ease-in-out infinite;
}
.job-card.is-pending { border-left-color: var(--amber-500); }

.job-card-client {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.4rem;
  padding-right: 1.8rem;
}

/* Shared client badge (history, wiki, etc.) */
.job-client {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.job-card-desc {
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.job-card-desc::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.2em;
  background: linear-gradient(transparent, var(--gray-50));
  pointer-events: none;
  opacity: 0.7;
}

.job-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.job-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.job-card-actions {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.job-card-note {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: var(--green-50);
  border-radius: 0.25rem;
  border-left: 3px solid var(--green-200);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--gray-400);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.status-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-badge.is-new { background: var(--gray-100); color: var(--gray-600); }
.status-badge.is-new .status-badge-dot { background: var(--gray-400); }
.status-badge.is-in-progress { background: var(--green-100); color: var(--green-800); }
.status-badge.is-in-progress .status-badge-dot { background: var(--green-500); }
.status-badge.is-pending { background: var(--amber-100); color: var(--amber-700); }
.status-badge.is-pending .status-badge-dot { background: var(--amber-500); }
.status-badge.is-done { background: var(--green-100); color: var(--green-800); }
.status-badge.is-done .status-badge-dot { background: var(--green-600); }



/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toast-in 0.35s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-success {
  background: var(--green-100);
  color: var(--green-800);
  border: 1.5px solid var(--green-200);
}

.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fca5a5;
}

[data-theme="dark"] .toast-error {
  background: #450a0a;
  color: #fca5a5;
  border-color: #991b1b;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: var(--text-xl);
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  line-height: 1;
  padding: 0 0.25rem;
}

.toast-close:hover { opacity: 1; }

.toast-undo-btn {
  display:inline-block;margin-left:0.75rem;
  background:var(--green-600);color:#fff;
  border:none;border-radius:0.375rem;
  padding:0.15rem 0.6rem;
  font-size:var(--text-sm);font-weight:600;
  cursor:pointer;transition:background 0.15s;
  vertical-align:middle;
  line-height:1.5;
}
.toast-undo-btn:hover { background:var(--green-700); }

.undo-banner {
  display:flex;align-items:center;justify-content:space-between;
  gap:0.75rem;padding:0.75rem 1rem;
  background:var(--green-100);border:1.5px solid var(--green-200);
  border-radius:0.75rem;margin-bottom:1rem;
  font-size:var(--text-sm);font-weight:600;
  color:var(--green-800);
}
.undo-banner-actions {
  display:flex;align-items:center;gap:0.25rem;flex-shrink:0;
}

main {
  padding-bottom: 0;
}



/* ===== ACTION BUTTONS ===== */
.action-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 0.375rem;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.action-btn:hover { transform: translateY(-1px); }
.action-btn:active { transform: translateY(0) scale(0.96); }

.btn-start {
  background: var(--green-100);
  color: var(--green-800);
}
.btn-start:hover { background: var(--green-200); }

.btn-pause {
  background: var(--amber-100);
  color: var(--amber-700);
}
.btn-pause:hover { background: #fde68a; }

.btn-complete {
  background: var(--rose-100);
  color: var(--rose-800);
}
.btn-complete:hover { background: #fca5a5; }

.btn-delete {
  background: none;
  color: var(--gray-400);
  font-size: var(--text-sm);
  padding: 0.25rem 0.35rem;
  border: none;
}
.btn-delete:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--green-600);
  color: white;
  border: none;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  gap: 0.5rem;
  padding: 0 1.5rem;
  animation: slideUp 0.4s ease 0.2s both, float 3s ease-in-out 1s infinite;
}

.fab-icon {
  display: flex;
  align-items: center;
  font-size: var(--text-xl);
  font-weight: 300;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-label {
  white-space: nowrap;
  font-size: var(--text-sm);
}

.fab:hover {
  background: var(--green-700);
  box-shadow: 0 6px 24px rgba(5, 150, 105, 0.6);
  transform: translateX(-50%) translateY(-3px) scale(1.02);
  animation: none;
}

.fab:hover .fab-icon {
  transform: rotate(90deg) scale(1.1);
}

.fab:active {
  transform: translateX(-50%) translateY(0) scale(0.97);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  background: var(--modal-overlay);
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--surface);
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-lg {
  max-width: 720px !important;
}





.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--green-800);
}

.modal-close {
  cursor: pointer;
  font-size: var(--text-2xl);
  color: var(--gray-400);
  line-height: 1;
}

.modal-close:hover { color: var(--gray-600); }

.modal-body {
  margin-bottom: 1.5rem;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: var(--text-sm);
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}

.form-group select:hover,
.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--gray-400);
}

/* ===== RESULT MODAL (email send outcome) ===== */
.modal-result {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-result-content {
  max-width: 420px !important;
  text-align: center;
  padding: 2.5rem 2rem !important;
}

.modal-result-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.modal-result-icon.result-success {
  color: var(--green-600);
}
.modal-result-icon.result-error {
  color: var(--rose-500);
}
.modal-result-message {
  margin: 0;
  font-size: var(--text-base);
  color: var(--gray-600);
  line-height: 1.5;
}

/* ===== SMTP TEST IN SETTINGS ===== */
.smtp-test-ok {
  color: var(--green-600);
  font-weight: 600;
}
.smtp-test-err {
  color: var(--rose-500);
  font-weight: 500;
}


/* ===== BUTTONS ===== */
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--green-600);
  color: white;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-primary:hover {
  background: var(--green-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: var(--surface);
  color: var(--gray-600);
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.97);
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid #fca5a5;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-danger:hover {
  background: #fca5a5;
  border-color: #991b1b;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xl);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.2s;
  line-height: 1;
}
.btn-icon:hover {
  background: #fee2e2;
}

/* ===== HISTORY ===== */
.history-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.history-header {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--green-200);
}

.quick-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--gray-100);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.quick-filter:hover {
  background: var(--primary);
  color: white;
}
.quick-filter.active {
  background: var(--primary);
  color: white;
}

.filter-form {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.filter-grid .form-group { margin-bottom: 0; }
.filter-grid label { font-size: var(--text-xs); }

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 1.25rem;
}

.filter-actions .btn-primary,
.filter-actions .btn-secondary {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.table-wrap { overflow-x: auto; }

.job-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.job-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.job-table th:first-child { border-radius: 0; }
.job-table th:last-child { border-radius: 0; }

.job-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: middle;
}

.job-table tbody tr {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.job-table tbody tr:hover {
  background: var(--green-50);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.job-table tbody tr:active {
  background: var(--green-100);
}
.job-table tbody tr:nth-child(even of :not(.job-note-row)) {
  background: var(--gray-50);
}
.job-table tbody tr:nth-child(even of :not(.job-note-row)):hover {
  background: var(--green-50);
}
.job-table tbody tr.row-selected {
  background: var(--green-100) !important;
  box-shadow: inset 3px 0 0 0 var(--green-500);
}

/* Left accent bar on main rows — connects to note row */
.job-table tbody tr td:first-child {
  box-shadow: inset 3px 0 0 0 transparent;
  transition: box-shadow 0.2s ease;
}

.job-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 0 var(--green-300);
}

/* Remove bottom border between main row and its note row */
.job-table tbody tr:has(+ .job-note-row) td {
  border-bottom: none;
}

.cell-date {
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.cell-note { text-align: center; }

.note-dot { cursor: help; }

.job-note-row td {
  padding: 0.4rem 1rem 0.8rem calc(1rem + 6px) !important;
  font-size: var(--text-sm);
  color: var(--gray-500);
  line-height: 1.4;
  border-top: none !important;
  border-bottom: 2px solid var(--gray-200) !important;
  background: var(--gray-50);
  cursor: pointer;
  box-shadow: inset 3px 0 0 0 var(--green-200);
  transition: background 0.2s ease;
}

.job-note-row:hover td {
  background: var(--green-50);
}

.job-note-row .note-label {
  font-weight: 600;
  color: var(--gray-400);
  margin-right: 0.4rem;
}

/* ===== PAGINATION ===== */
.pagination-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.pagination-info {
  font-weight: 600;
}
.pagination-controls {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pagination-btn:hover {
  border-color: var(--green-400);
  background: var(--green-50);
  color: var(--green-700);
}
.pagination-current {
  border-color: var(--green-600);
  background: var(--green-600);
  color: #fff;
  font-weight: 700;
}
.pagination-ellipsis {
  padding: 0 0.3rem;
  color: var(--gray-400);
}

/* ===== HISTORY ITEMS ===== */
.history-item {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--gray-300);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover { box-shadow: var(--shadow-lg), var(--shadow-green); transform: translateY(-1px); }
.history-item-completed { border-left-color: var(--green-500); }

.history-client {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-900);
}

.history-description {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-top: 0.5rem;
}

.history-meta {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.history-time-spent {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--green-600);
  margin-top: 0.5rem;
}

.history-notes {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-300);
}

/* ===== SETTINGS ===== */
.settings-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.settings-header {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--green-200);
}

.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-300);
}

.settings-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.settings-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.settings-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.settings-info {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-300);
  font-size: var(--text-sm);
}

.settings-info-row:last-child { border-bottom: none; }

.settings-info-label {
  font-weight: 600;
  color: var(--gray-600);
}

.settings-op-badge {
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: var(--text-sm);
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.settings-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.settings-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: middle;
}

.settings-role-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: var(--green-100); color: var(--green-800); }
.role-user { background: var(--gray-300); color: var(--gray-700); }

.settings-op-select {
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: var(--text-sm);
  max-width: 160px;
}

.btn-icon-sm {
  background: none;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: var(--text-sm);
  line-height: 1;
  transition: all 0.15s;
  color: var(--gray-600);
}

.btn-icon-sm:hover {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-700);
}

.btn-icon-danger:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}



/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.theme-toggle input {
  display: none;
}

.theme-toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--gray-300);
  border-radius: 11px;
  position: relative;
  transition: background 0.25s;
}

.theme-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
}

.theme-toggle input:checked + .theme-toggle-slider {
  background: var(--green-600);
}

.theme-toggle input:checked + .theme-toggle-slider::after {
  transform: translateX(18px);
}

#themeLabel {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== DARK MODE FORM ELEMENTS ===== */
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
  color: #f3f4f6;
  background: #1f2937;
}
[data-theme="dark"] .form-group select option {
  background: #1f2937;
  color: #f3f4f6;
}
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px #064e3b;
}
[data-theme="dark"] .settings-op-select {
  color: #f3f4f6;
  background: #1f2937;
}


/* ===== WIKI ===== */
.wiki-content h1, .wiki-content h2, .wiki-content h3 {
  color: var(--green-800);
  margin: 1.5rem 0 0.75rem;
  font-weight: 700;
}
.wiki-content h1 { font-size: var(--text-xl); }
.wiki-content h2 { font-size: var(--text-lg); }
.wiki-content h3 { font-size: var(--text-base); }
.wiki-content p { margin-bottom: 0.75rem; }
.wiki-content ul, .wiki-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.wiki-content li { margin-bottom: 0.25rem; }
.wiki-content blockquote {
  border-left: 4px solid var(--green-200);
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
  background: var(--green-50);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--gray-600);
  font-style: italic;
}
.wiki-content pre {
  background: var(--gray-100);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-size: var(--text-sm);
  border: 1px solid var(--gray-300);
  margin: 0.75rem 0;
}
.wiki-content code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: var(--text-sm);
}
.wiki-content pre code {
  background: none;
  padding: 0;
}
.wiki-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  border: 1px solid var(--gray-300);
}
.wiki-content a { color: var(--green-600); font-weight: 600; }
.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: var(--text-sm);
}
.wiki-content th, .wiki-content td {
  border: 1px solid var(--gray-300);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.wiki-content th {
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
}

/* ===== QUILL DARK MODE OVERRIDES ===== */
[data-theme="dark"] .ql-toolbar {
  background: #1f2937;
  border-color: #4b5563;
}
[data-theme="dark"] .ql-container {
  background: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}
[data-theme="dark"] .ql-stroke { stroke: #f3f4f6; }
[data-theme="dark"] .ql-fill { fill: #f3f4f6; }
[data-theme="dark"] .ql-picker-options { background: #1f2937; color: #f3f4f6; }
[data-theme="dark"] .ql-editor.ql-blank::before { color: #6b7280; }

/* ===== ALPINE.JS CLOCK ===== */


/* ===== LUCIDE ICONS ===== */
.lucide { vertical-align: middle; }

/* Checkbox Sigla */
.sigla-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--green-600);
  cursor: pointer;
}

/* Input Sigla */
.sigla-input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.3rem;
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sigla-input:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px var(--green-100);
}

/* Sigla table */
.sigla-table th {
  font-size: var(--text-xs);
  padding: 0.45rem 0.4rem;
  white-space: nowrap;
}
.sigla-table td {
  padding: 0.35rem 0.3rem;
  vertical-align: middle;
}

/* Sigla cell comparison backgrounds */
.sigla-cell {
  background: transparent;
  transition: background 0.2s;
}
.sigla-cell-ok {
  background: var(--green-100);
}
.sigla-cell-mismatch {
  background: #fee2e2;
}
.sigla-cell-excluded {
  background: var(--gray-100);
}

/* ===== ERROR PAGES ===== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 2rem;
}
.error-code {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--green-500);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.error-message {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}
.error-desc {
  color: var(--gray-500);
  margin-bottom: 2rem;
  max-width: 400px;
}

/* Dark mode overrides for sigla cells */
[data-theme="dark"] .sigla-cell-ok {
  background: #064e3b;
}
[data-theme="dark"] .sigla-cell-mismatch {
  background: #7f1d1d;
}
[data-theme="dark"] .sigla-cell-excluded {
  background: #374151;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  background: var(--green-800);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.04) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,0.02) 40px, rgba(255,255,255,0.02) 41px);
}
.login-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 0 1.5rem;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-500), var(--amber-500));
}
.login-brand {
  text-align: center;
  margin-bottom: var(--space-8);
}
.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 4px 8px rgba(45, 106, 79, 0.2));
}
.login-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--green-800);
  margin: 0 0 var(--space-1);
}
.login-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}
.login-error {
  background: var(--rose-100);
  color: var(--rose-800);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.login-form .form-group {
  margin-bottom: 0;
}
.login-submit {
  justify-content: center;
  width: 100%;
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-6);
}

/* ===== SEGRETERIA NOTES ===== */
.segreteria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .segreteria-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .segreteria-grid { grid-template-columns: 1fr; }
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, border-left-color 0.2s;
  border-left: 4px solid var(--gray-300);
  position: relative;
  animation: slideUp 0.3s ease both;
}
.note-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.note-card--alta { border-left-color: var(--rose-500); }
.note-card--media { border-left-color: var(--amber-500); }
.note-card--bassa { border-left-color: var(--gray-400); }

.note-card--cat-scadenze { border-left-color: #ef4444; }
.note-card--cat-materiale { border-left-color: #f59e0b; }
.note-card--cat-fatturare { border-left-color: #10b981; }
.note-card--cat-generali { border-left-color: #3b82f6; }

.note-card-cat-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.note-card-client {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.note-card-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.note-card-date {
  white-space: nowrap;
}

.note-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== CALENDARIO ===== */
.cal-container {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}
.cal-container .fc {
  font-size: var(--text-sm);
}
.cal-container .fc .fc-toolbar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.cal-container .fc .fc-button-primary {
  background: var(--primary);
  border-color: var(--primary);
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: 0.375rem;
  font-weight: 600;
  transition: background 0.15s;
}
.cal-container .fc .fc-button-primary:hover {
  background: var(--primary-dark);
}
.cal-container .fc .fc-button-primary.fc-button-active {
  background: var(--primary-dark);
}
.cal-container .fc .fc-prev-button,
.cal-container .fc .fc-next-button {
  font-size: 1.3rem;
  padding: 0.15rem 0.6rem;
  line-height: 1;
}
.cal-container .fc .fc-prev-button .fc-icon,
.cal-container .fc .fc-next-button .fc-icon {
  display: none;
}
.cal-container .fc .fc-daygrid-day {
  cursor: pointer;
}
.cal-container .fc .fc-daygrid-day:hover {
  background: var(--gray-50);
}
[data-theme="dark"] .cal-container .fc .fc-daygrid-day:hover {
  background: var(--gray-800);
}
.cal-container .fc .fc-day-today {
  background: var(--green-50) !important;
}
[data-theme="dark"] .cal-container .fc .fc-day-today {
  background: rgba(16, 185, 129, 0.1) !important;
}
.cal-container .fc .fc-event {
  border-radius: var(--radius-sm);
  padding: 1px 4px;
  font-size: var(--text-xs);
  cursor: pointer;
  border: none;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.cal-legend-filter {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.cal-legend-filter:hover { opacity: 0.75; }
.cal-legend-filter.is-off { opacity: 0.35; text-decoration: line-through; }

/* ===== LOADING SPINNER ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}/* ===== KEYFRAMES ===== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-shadow {
  0%, 100% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(5, 150, 105, 0.7); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes cardPulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  50% { box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 3px rgba(16, 185, 129, 0.15); }
}

@keyframes cardGlow {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06); }
  50% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.1), 0 2px 4px rgba(0,0,0,0.06); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

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

@keyframes pulse-shadow-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(225, 29, 72, 0); }
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.5); }
}

@media (max-width: 600px) {
  .topbar-tabs {
    justify-content: flex-start;
    padding: 0.2rem 1rem 0;
  }
  .tab-link {
    padding: 0.4rem 0.8rem;
    font-size: var(--text-xs);
  }
  .tab-link i { margin-right: 0.2rem; }
}

@media (max-width: 768px) {
  .job-card-desc {
    -webkit-line-clamp: 2;
  }
  .action-btn .label {
    display: none;
  }
}

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

@media (max-width: 600px) {
  .modal-content {
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUpModal 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
  }
  .modal-lg { max-width: 100% !important; }
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 600px) {
  .modal-result-content {
    position: static !important;
    margin: auto !important;
    width: 90% !important;
    max-width: 420px !important;
    border-radius: var(--radius) !important;
    animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
  .modal-lg { max-width: 95% !important; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
  .topbar-title { font-size: var(--text-base); }
  .topbar-logo { width: 36px; height: 36px; }
  .topbar-inner { padding: 0.4rem 0.5rem 0.1rem; gap: 0.5rem; }
  .topbar-user-name { display: none; }
  .topbar-user { right: 0.5rem; }
  .topbar-search { display: none; }
  .topbar-theme-btn { width: 28px; height: 28px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page-header-title { font-size: var(--text-lg); }
  .page-header-btn { width: 100%; justify-content: center; }
  .stats-row { gap: 0.75rem; }
  .stat-item { font-size: var(--text-xs); }
  .status-section-header { padding: 0.8rem 1rem; }
  .status-section-body { padding: 0.65rem 1rem 1rem; grid-template-columns: 1fr; }
  .job-card { padding: 0.9rem; }
  .fab { display: flex; bottom: 6.5rem; right: 1rem; left: auto; transform: none; min-width: 48px; height: 48px; padding: 0; border-radius: 50%; box-shadow: 0 4px 16px rgba(5, 150, 105, 0.5); }
  .fab .fab-label { display: none; }
  .fab .fab-icon { font-size: var(--text-xl); }
  .fab:hover { transform: translateY(-3px) scale(1.05); animation: none; }
  .fab:active { transform: translateY(0) scale(0.95); }
  .modal-content { padding: 1.5rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .status-section-header::after { left: 1rem; right: 1rem; }
}

/* ===== PAGE-SPECIAL WIDTH ===== */
.container.container-search {
  max-width: 100%;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

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

/* ===== BULK ACTIONS ===== */
.bulk-bar {
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:0.75rem;
  padding:0.75rem 1rem;
  background:var(--green-100);border:1.5px solid var(--green-200);
  border-radius:0.75rem;margin-bottom:1rem;
  font-size:var(--text-sm);
}
.bulk-bar-info {
  display:flex;align-items:center;gap:0.75rem;flex-wrap:wrap;
}
.bulk-bar-count {
  font-weight:700;color:var(--green-800);
}
.bulk-bar-link {
  background:none;border:none;cursor:pointer;
  font-size:var(--text-sm);color:var(--green-700);
  display:inline-flex;align-items:center;gap:0.25rem;
  padding:0;text-decoration:underline;
}
.bulk-bar-link:hover { color:var(--green-900); }
.bulk-bar-actions {
  display:flex;align-items:center;gap:0.4rem;flex-wrap:wrap;
}
.bulk-bar-select {
  padding:0.3rem 0.5rem;border:1.5px solid var(--green-300);
  border-radius:0.375rem;font-size:var(--text-sm);
  background:var(--surface);color:var(--text);cursor:pointer;
}
.bulk-bar-divider {
  width:1px;height:1.5rem;background:var(--green-300);
}
.page-header-actions .btn-secondary.is-active {
  background:var(--green-600);color:#fff;border-color:var(--green-600);
}
.job-card {
  position:relative;  /* needed for absolute checkbox positioning */
}
.bulk-checkbox { display:none; }
.is-selecting .bulk-checkbox { display:block; }
