/* Reset and basic styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f0f2f5;
  padding: 32px;
  color: #1a1a1a;
  line-height: 1.6;
}

/* Header styling */
header {
  margin-bottom: 40px;
  position: relative;
  padding-top: 64px;
}

.user-avatar-circle {
  position: absolute;
  top: 0;
  right: 48px;
  width: 32px;
  height: 32px;
  background-color: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  z-index: 2;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  color: #1a1a1a;
  padding-top: 16px;
}

.auto-save-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px 16px;
  background-color: #f0f9ff;
  color: #0369a1;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #bae6fd;
}

.auto-save-indicator .material-icons {
  font-size: 18px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.refresh-btn:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.refresh-btn:active {
  transform: rotate(180deg);
}

/* KPI Section */
.kpi-section {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

/* Add this new style to handle hidden items */
.kpi-grid > .kpi-card[style*="display: none"] {
  display: none !important;
  grid-column: unset;
}

.kpi-card {
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  text-align: center;
}

.kpi-label {
  font-size: 0.9rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.kpi-trend {
  font-size: 0.8rem;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  opacity: 0.9;
}

.kpi-trend .material-icons {
  font-size: 16px;
}

.kpi-trend.positive {
  color: #025e19;
}

.kpi-trend.negative {
  color: #d32f2f;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.month-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .month-selector {
    flex-direction: row;
    align-items: center;
  }
}

/* Modern form controls */
.modern-select,
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s;
  background-color: white;
}

.modern-select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button styling */
.primary-button,
button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background-color: #2563eb;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  will-change: transform;
}

.primary-button:hover,
button:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.outline-button {
  padding: 12px 20px;
  border: 2px solid #2563eb;
  border-radius: 12px;
  background-color: transparent;
  color: #2563eb;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.outline-button:hover {
  background-color: rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

/* Client card styling */
.client-card {
  background-color: white;
  border-radius: 16px;
  margin-bottom: 9px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid transparent;
  will-change: transform, border-color;
}

.client-card.collapsed {
  padding: 0;
}

.client-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background-color: white;
  cursor: pointer;
}

.client-summary-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0px;
  position: relative;
}

.client-name-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: unset;
  padding: 0;
}

.client-summary-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-terms-button {
  padding: 6px 12px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background-color: transparent;
  color: #2563eb;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.view-terms-button:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.view-terms-button .material-icons {
  font-size: 16px;
}

.client-details {
  padding: 24px;
  border-top: 1px solid #e5e7eb;
}

.client-details.hidden {
  display: none;
}

/* Status select in summary styling */
.summary-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  min-width: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.summary-status:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Status colors for select */
.status-under-review {
  background-color: #fff3e0;
  color: #e65100;
}

.status-ready-for-billing {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-invoice-sent {
  background-color: #fff8e1;
  color: #ffa000;
}

.status-payment-received {
  background-color: #e3f2fd;
  color: #1565c0;
}

.status-payment-failed {
  background-color: #fee2e2;
  color: #dc2626;
}

.status-on-hold {
  background-color: #fff3e0;
  color: #ff9800;
}

/* Client card status styling */
.client-card[data-status="Under Review"] {
  border-color: #e65100;
}

.client-card[data-status="Ready for Billing"] {
  border-color: #2e7d32;
}

.client-card[data-status="Invoice Sent"] {
  border-color: #ffa000;
}

.client-card[data-status="Payment Received"] {
  border-color: #1565c0;
  background-color: #f8fafc;
}

.client-card[data-status="Payment Failed"] {
  border-color: #dc2626;
  background-color: #fee2e2;
}

.client-card[data-status="On Hold"] {
  border-color: #ff9800;
}

/* Confetti Animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }

}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #2563eb;
  clip-path: polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
  animation: confetti-fall 4s linear forwards;
  z-index: 9999;
}

.confetti:nth-child(2n) {
  background-color: #10b981;
  animation-duration: 3.5s;
}

.confetti:nth-child(3n) {
  background-color: #f59e0b;
  animation-duration: 4.5s;
}

.confetti:nth-child(4n) {
  background-color: #ef4444;
  animation-duration: 5s;
}

/* Section styling */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.info-section {
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  position: relative;
}

/* Full width section */
.full-width-section {
  grid-column: 1 / -1;
}

.full-width-section textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.info-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}

/* Commission table styling */
.commission-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
}

/* Billing calculation table styling */
.billing-calculation-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
}

.billing-calculation-table th {
  background-color: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #64748b;
  font-size: 0.9rem;
}

.billing-calculation-table td {
  padding: 8px;
  vertical-align: middle;
}

.billing-calculation-table .calculation-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  background-color: white;
}

.billing-calculation-table .calculation-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.billing-calculation-table .calculated-amount {
  font-weight: 600;
  color: #2563eb;
  text-align: left;
}



.commission-table th {
  background-color: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #64748b;
  font-size: 0.9rem;
}

.commission-table td {
  padding: 8px;
  vertical-align: middle;
}

.commission-table input[type="date"] {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  width: 100%;
}

.commission-table input[type="date"]:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Terminated client styling */
.terminated {
  position: relative;
  opacity: 0.8;
}

.terminated::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #ef4444;
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

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

  .client-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .client-summary-right {
    width: 100%;
    justify-content: space-between;
  }

  .client-name-section {
    gap: 6px;
  }
}

/* SOP Link section styling */
.sop-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sop-container input {
  flex: 1;
}

.icon-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-button:hover {
  background-color: rgba(37, 99, 235, 0.1);
  transform: translateY(0);
  box-shadow: none;
}

.icon-button:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.icon-button:disabled:hover {
  background: none;
}

/* Status select styling */
.status-select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  background-color: white;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-select option {
  padding: 8px;
}

.month-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background-color: #dc2626;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.danger-button:hover {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.month-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-month-btn {
  background: none;
  border: none;
  padding: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.edit-month-btn:hover {
  background-color: #f1f5f9;
  color: #2563eb;
}

.month-edit-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 10px 15px rgba(0,0,0,0.1);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
}

.month-edit-dialog h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
  color: #1a1a1a;
}

.month-edit-dialog input {
  width: 100%;
  margin-bottom: 16px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.commission-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 0px;
  padding-top:8px;
}

.commission-badge {
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.commission-badge.needs-payment {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffb74d;
}

.commission-badge .material-icons {
  font-size: 14px;
}

.billing-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.billing-type-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  width: fit-content;
}

.billing-type-tag.stripe {
  background-color: #6b21a8;
  color: white;
  border: 1px solid #5b21b6;
}

.billing-type-tag.quickbooks {
  background-color: #15803d;
  color: white;
  border: 1px solid #166534;
}

.billing-type-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Adjust spacing for billing settings */
.billing-type-container .modern-select {
  max-width: 200px;
}

.info-section .primary-button,
.info-section .save-button {
  margin-top: 20px;
}

/* Payment Overdue Badge */
.payment-overdue-badge {
  background-color: #dc2626;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.payment-overdue-badge .material-icons {
  font-size: 14px;
}

/* Update KPI card colors */
.kpi-card.warning {
  background-color: #fff7ed;
}

.kpi-card.warning .kpi-value,
.kpi-card.warning .kpi-label {
  color: #c2410c;
}

.kpi-card.warning.needs-billing {
  background-color: #fef3c7;
}

.kpi-card.warning.needs-billing .kpi-value,
.kpi-card.warning.needs-billing .kpi-label {
  color: #92400e;
}

.kpi-card.warning.purple {
  background-color: #f3e5f5;
}

.kpi-card.warning.purple .kpi-value,
.kpi-card.warning.purple .kpi-label {
  color: #7b1fa2;
}

.kpi-card.alert {
  background-color: #fee2e2;
}

.kpi-card.alert .kpi-value,
.kpi-card.alert .kpi-label {
  color: #dc2626;
}

/* Contract Terms Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 16px;
  max-width: 1200px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: #f1f5f9;
  color: #1a1a1a;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  padding-right: 40px;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Contract Terms Section */
.terms-container {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.terms-textarea {
  flex: 1;
  min-height: 100px;
  resize: vertical;
}

/* Commission KPI styling */
.kpi-card.commission {
  background-color: #f0f9ff;
  text-align: left;
  padding: 16px;
}

.commission-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.commission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: white;
  border-radius: 6px;
  font-size: 0.9rem;
}

.commission-name {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.commission-name:hover {
  opacity: 0.8;
}

.commission-name:hover::after {
  content: "View Commission Details";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1a1a1a;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  margin-bottom: 4px;
  z-index: 1000;
}

.commission-amount {
  font-weight: 600;
  color: #1e40af;
}

/* Add these styles to the existing CSS file */
.commission-badge.needs-payment.referral {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #81c784;
}

.commission-table select.modern-select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  background-color: white;
  cursor: pointer;
}

.commission-table select.modern-select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.client-name-input {
  display: inline;
  width: auto;
  min-width: unset;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 600;
  flex: none;
}

.name-with-billing-type {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  min-width: unset;
  white-space: nowrap;
}

.billing-type-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0;
  cursor: help;
  white-space: nowrap;
  line-height: 1;
}

.billing-type-label.quickbooks {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.billing-type-label.stripe {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.billing-type-label.stripe.stripe-10th {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Login page styling */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f2f5;
  z-index: 1000;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-box h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.login-box p {
  color: #64748b;
  margin-bottom: 24px;
}

.google-signin-btn {
  background-color: white;
  color: #1a1a1a;
  border: 2px solid #e5e7eb;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  transition: all 0.2s;
}

.google-signin-btn:hover {
  background-color: #f8fafc;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.google-signin-btn img {
  width: 18px;
  height: 18px;
}

/* Header modifications for sign out button */
.header-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.header-top h1 {
  grid-column: 2;
  text-align: center;
  margin: 0;
  padding: 0 16px;
}

.sign-out-btn {
  position: absolute;
  top: 40px;
  right: 0;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  width: 128px;
  justify-content: center;
}

.sign-out-btn:hover {
  background-color: #f1f5f9;
  color: #dc2626;
}

.sign-out-btn .material-icons {
  font-size: 18px;
}

/* Add these styles at the end of the file */

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  margin: 24px 0;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.user-details {
  text-align: left;
}

.user-name {
  font-weight: 600;
  color: #1a1a1a;
}

.user-email {
  font-size: 0.9rem;
  color: #64748b;
}

.date-duration-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duration-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 4px;
  padding-top: 4px;
}

.filter-button {
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background-color: white;
  color: #64748b;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-button:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.filter-button.active {
  background-color: #f8fafc;
  border-color: #2563eb;
  color: #2563eb;
}

.filter-button[data-type="stripe"].active {
  background-color: #f0f9ff;
  border-color: #0369a1;
  color: #0369a1;
}

.filter-button[data-type="quickbooks"].active {
  background-color: #dcfce7;
  border-color: #166534;
  color: #166534;
}

/* Breadcrumb container and links */
.breadcrumb-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
}

.breadcrumb-link {
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background-color: white;
  color: #64748b;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.breadcrumb-link:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.breadcrumb-link.active {
  background-color: #f8fafc;
  border-color: #2563eb;
  color: #2563eb;
}

/* Subtle different color borders for Stripe breadcrumbs - white background by default */
.breadcrumb-link[data-filter="stripe-1st"] {
  background-color: white;
  border-color: #fde68a;
  color: #78350f;
}

.breadcrumb-link[data-filter="stripe-1st"]:hover {
  background-color: #fffbeb;
  border-color: #fcd34d;
}

.breadcrumb-link[data-filter="stripe-1st"].active {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}

.breadcrumb-link[data-filter="stripe-10th"] {
  background-color: white;
  border-color: #fecaca;
  color: #991b1b;
}

.breadcrumb-link[data-filter="stripe-10th"]:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

.breadcrumb-link[data-filter="stripe-10th"].active {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Active Users Container */
.active-users-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.active-user-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid white;
}

.active-user-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.active-user-bubble .user-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 6px 12px;
  background-color: #1f2937;
  color: white;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1002;
}

.active-user-bubble .user-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.active-user-bubble:hover .user-tooltip {
  opacity: 1;
}

@media (max-width: 768px) {
  .month-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .month-buttons button {
    width: 100%;
  }
}

.payment-status {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-status .received {
  color: #2e7d32;
}

.payment-status .outstanding {
  color: #d32f2f;
}

/* Screenshots section styling */
.screenshots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.screenshot-item {
  position: relative;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.screenshot-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.screenshot-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-download,
.screenshot-delete {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.screenshot-download {
  top: 8px;
  right: 8px;
  color: #2563eb;
}

.screenshot-delete {
  bottom: 8px;
  right: 8px;
  color: #dc2626;
}

.screenshot-download:hover,
.screenshot-delete:hover {
  transform: scale(1.1);
  background-color: white;
}

.empty-screenshots-message {
  color: #64748b;
  font-style: italic;
  padding: 16px 0;
}

/* New checkered drop zone styling */
.screenshot-drop-zone {
  width: 100%;
  height: 180px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
  background-image: 
    linear-gradient(45deg, #f8fafc 25%, transparent 25%), 
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.screenshot-drop-zone:hover {
  border-color: #2563eb;
  background-color: rgba(37, 99, 235, 0.05);
}

.screenshot-drop-zone.dragover {
  border-color: #2563eb;
  background-color: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.screenshot-plus-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
  background-color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.screenshot-plus-icon .material-icons {
  font-size: 32px;
  margin-bottom: 8px;
}

.screenshot-plus-icon span:last-child {
  font-weight: 500;
}

.screenshot-drop-zone:hover .screenshot-plus-icon {
  color: #2563eb;
  transform: scale(1.05);
}

.screenshot-drop-zone.dragover .screenshot-plus-icon {
  color: #2563eb;
  transform: scale(1.1);
}

/* Admin Panel Styles */
.admin-panel-modal {
  max-width: 1000px;
}

.admin-panel-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 16px;
}

.admin-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.admin-tab.active {
  color: #2563eb;
}

.admin-tab.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2563eb;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-search input {
  flex: 1;
}

.user-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
}

.user-list-table th {
  text-align: left;
  padding: 12px 16px;
  background-color: #f8fafc;
  font-weight: 600;
  color: #64748b;
  font-size: 0.9rem;
}

.user-list-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.user-list-table tr:last-child td {
  border-bottom: none;
}

.admin-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: transparent;
  color: #94a3b8;
  padding: 8px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
  box-shadow: none;
  z-index: 1000;
}

.admin-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #2563eb;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.admin-button .material-icons {
  font-size: 20px;
}

/* Hide the text on smaller screens */
@media (max-width: 768px) {
  .admin-button span:not(.material-icons) {
    display: none;
  }
  
  .admin-button {
    padding: 8px;
  }
}

/* User Edit Modal Styles */
.user-edit-modal {
  max-width: 600px;
}

.user-info {
  margin-bottom: 24px;
  padding: 16px;
  background-color: #f8fafc;
  border-radius: 12px;
}

.permission-section {
  margin-bottom: 24px;
}

.permission-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.assigned-clients-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  background-color: #f8fafc;
  border-radius: 12px;
}

.help-text {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Admin panel specific styles */
.admin-link {
    position: absolute;
    top: 0;
    right: 96px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
    z-index: 2;
    border: 2px solid #2563eb;
}

.admin-link:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.05);
}

.back-button {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-button:hover {
    background: #f1f5f9;
    color: #1a1a1a;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.user-info-cell {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fff7ed;
    color: #c2410c;
}

.icon-button {
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-button:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.icon-button.delete:hover {
    color: #dc2626;
}

/* Update the admin-panel-button styles */
.admin-panel-button {
    position: fixed;  /* Changed from absolute to fixed */
    top: 32px;
    left: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;  /* Increased padding */
    background: #2563eb;  /* Changed default to blue */
    border: none;
    border-radius: 12px;
    color: white;  /* Changed to white text */
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    z-index: 1001;  /* Increased z-index to ensure visibility */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-panel-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.admin-panel-button .material-icons {
    font-size: 20px;
}

/* Add this new style */
.admin-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: transparent;
    color: #94a3b8;
    padding: 8px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    box-shadow: none;
    z-index: 1000;
}

.admin-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #2563eb;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.admin-button .material-icons {
    font-size: 20px;
}

/* Hide the text on smaller screens */
@media (max-width: 768px) {
    .admin-button span:not(.material-icons) {
        display: none;
    }
    
    .admin-button {
        padding: 8px;
    }
}

.permissions-grid {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.commission-details-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
}

.commission-details-table th,
.commission-details-table td {
  padding: 3px 4px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.commission-details-table th {
  background-color: #f8fafc;
  font-weight: 500;
  color: #64748b;
  font-size: 0.9rem;
}

.commission-details-table .status-cell {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.commission-details-table .status-cell.under-review {
  background-color: #fff3e0;
  color: #e65100;
}

.commission-details-table .status-cell.ready-for-billing {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.commission-details-table .status-cell.invoice-sent {
  background-color: #fff8e1;
  color: #ffa000;
}

.commission-details-table .status-cell.payment-pending {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.commission-details-table .status-cell.payment-received {
  background-color: #e3f2fd;
  color: #1565c0;
}

.commission-details-table .status-cell.payment-failed {
  background-color: #fee2e2;
  color: #dc2626;
}

.commission-details-table .paid-row {
  background-color: #f0fdf4;
}

.commission-details-table .paid-row td {
  color: #166534;
}

.commission-details-table .paid-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #22c55e;
}

.commission-total {
  background: #f0f9ff;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  text-align: center;
}

.total-label {
  font-size: 0.9rem;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e40af;
  margin-top: 4px;
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-item .count {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.status-item .count:hover {
  transform: scale(1.1);
}

.status-item .count.status-under-review {
  background-color: #fff3e0;
  color: #e65100;
}

.status-item .count.status-ready-for-billing {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-item .count.status-invoice-sent {
  background-color: #fff8e1;
  color: #ffa000;
}

.status-item .count.status-payment-pending {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.status-item .count.status-payment-received {
  background-color: #e3f2fd;
  color: #1565c0;
}

.status-item .count.status-payment-failed {
  background-color: #fee2e2;
  color: #dc2626;
}

.client-status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.client-status-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.95rem;
}

.client-name {
  font-weight: 500;
  color: #1a1a1a;
}

.client-status {
  color: #64748b;
}

.billing-amount {
  font-weight: 600;
  color: #2563eb;
}

/* Add these styles to the existing CSS file */
.revenue-breakdown {
  margin-top: 8px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.revenue-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #64748b;
}

.revenue-detail .material-icons {
  font-size: 14px;
}

.revenue-detail.received {
  color: #2e7d32;
}

.revenue-detail.received .material-icons {
  color: #2e7d32;
}

.revenue-detail.pending {
  color: #7b1fa2;
}

.revenue-detail.pending .material-icons {
  color: #7b1fa2;
}

.revenue-detail.outstanding {
  color: #d32f2f;
}

.revenue-detail.outstanding .material-icons {
  color: #d32f2f;
}

/* Update the client card styling for Payment Failed */
.client-card[data-status="Payment Failed"] {
  border-color: #dc2626;
  background-color: #fee2e2 !important; /* Using !important to override any other background colors */
}

/* Add styles for the details section when status is Payment Failed */
.client-card[data-status="Payment Failed"] .client-details {
  background-color: #fee2e2;
}

/* Add styles for the summary section when status is Payment Failed */
.client-card[data-status="Payment Failed"] .client-summary {
  background-color: #fee2e2;
}

/* Add styles for the grid sections when status is Payment Failed */
.client-card[data-status="Payment Failed"] .section-grid {
  background-color: #fee2e2;
}

/* Add styles for the info sections when status is Payment Failed */
.client-card[data-status="Payment Failed"] .info-section {
  background-color: #fee2e2;
}

/* Add styles for the status select when Payment Failed is selected */
.status-select.summary-status.status-payment-failed {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
}

/* Add styles for the status badge */
.status-badge.payment-failed {
  background-color: #dc2626;
  color: white;
}

/* Add styles for the status item count */
.status-item .count.status-payment-failed {
  background-color: #dc2626;
  color: white;
}

/* Add styles for the commission details table status cell */
.commission-details-table .status-cell.payment-failed {
  background-color: #dc2626;
  color: white;
}

