/* ==========================================================================
   PVS360 SolarERP - Zoho Books Integration & Stock Audit Styling
   Crisp Modern Light Theme (Clean, Luxury, Apple/Vercel-Grade Precision)
   ========================================================================== */

:root {
  --zoho-primary: #0284c7;
  --zoho-primary-hover: #0369a1;
  --zoho-accent: #0ea5e9;
  --zoho-success: #10b981;
  --zoho-warning: #f59e0b;
  --zoho-danger: #ef4444;
  --zoho-bg-window: #ffffff;
  --zoho-bg-header: #f8fafc;
  --zoho-bg-body: #f1f5f9;
  --zoho-bg-card: #ffffff;
  --zoho-border-subtle: #e2e8f0;
  --zoho-border-card: #e2e8f0;
  --zoho-text-primary: #0f172a;
  --zoho-text-secondary: #475569;
  --zoho-text-muted: #64748b;
}

/* Floating Launcher Badge */
#pvs-zoho-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  animation: pvsZohoFadeIn 0.3s ease-out;
}

@keyframes pvsZohoFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pvs-zoho-launch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 0 15px rgba(2, 132, 199, 0.12);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.pvs-zoho-launch-btn:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.15), 0 0 20px rgba(14, 165, 233, 0.25);
  background: #f8fafc;
}

.pvs-zoho-logo-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.35);
}

.pvs-zoho-counter {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pvsZohoPulse 2s infinite;
}

@keyframes pvsZohoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Modal Overlay & Container */
#pvs-zoho-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#pvs-zoho-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pvs-zoho-window {
  width: 100%;
  max-width: 1220px;
  height: 90vh;
  max-height: 880px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 1px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #0f172a;
  transform: translateY(15px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#pvs-zoho-modal-overlay.active .pvs-zoho-window {
  transform: translateY(0) scale(1);
}

/* Header */
.pvs-zoho-header {
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pvs-zoho-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pvs-zoho-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.pvs-zoho-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
}

.pvs-zoho-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pvs-zoho-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.pvs-zoho-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pvs-zoho-btn-close {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.pvs-zoho-btn-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Tabs Bar */
.pvs-zoho-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  gap: 8px;
  flex-shrink: 0;
}

.pvs-zoho-tab {
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.pvs-zoho-tab:hover {
  color: #0f172a;
  background: #f8fafc;
}

.pvs-zoho-tab.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
  font-weight: 700;
  background: transparent;
}

.pvs-zoho-tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 800;
}

/* Tab Content Area */
.pvs-zoho-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f1f5f9;
}

/* Alert Banner */
.pvs-zoho-banner {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #0369a1;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.08);
}

.pvs-zoho-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Control Bar */
.pvs-zoho-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.pvs-zoho-filter-group {
  display: flex;
  gap: 6px;
  background: #ffffff;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pvs-zoho-filter-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pvs-zoho-filter-btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

.pvs-zoho-filter-btn.active {
  background: #0284c7;
  color: #ffffff;
}

.pvs-zoho-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pvs-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.pvs-btn-primary {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}
.pvs-btn-primary:hover {
  background: #0369a1;
}

.pvs-btn-success {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.pvs-btn-success:hover {
  background: #059669;
}

.pvs-btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}
.pvs-btn-danger:hover {
  background: #dc2626;
}

.pvs-btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pvs-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Staging Cards Grid */
.pvs-zoho-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.pvs-zoho-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pvs-zoho-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08);
}

.pvs-zoho-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pvs-zoho-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pvs-badge-invoice {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.pvs-badge-receipt {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pvs-badge-contractor {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pvs-zoho-card-amount {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.pvs-zoho-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #0f172a;
}

.pvs-zoho-card-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.pvs-zoho-card-meta strong {
  color: #334155;
}

.pvs-zoho-card-target-box {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 8px;
}

.pvs-zoho-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-top: 6px;
}

/* Stock Audit Table */
.pvs-zoho-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pvs-zoho-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.pvs-zoho-table th {
  background: #f8fafc;
  padding: 12px 16px;
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
}

.pvs-zoho-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.pvs-zoho-table tr:hover td {
  background: #f8fafc;
}

.pvs-status-pill {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pvs-status-matched {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pvs-status-variance {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Light Card Panels for History / Triggers */
.pvs-zoho-panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pvs-zoho-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 8px;
}

/* PDF Preview Modal */
#pvs-zoho-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.pvs-zoho-pdf-container {
  width: 100%;
  max-width: 900px;
  height: 85vh;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #cbd5e1;
}

.pvs-zoho-pdf-header {
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0f172a;
}
