/* CRM Styles */

.crm-container {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.crm-header h2 {
  margin: 0;
  font-size: 24px;
}

.add-btn {
  padding: 10px 20px;
  background: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.add-btn:hover {
  background: #333;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.crm-table th {
  background: #f8f9fa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e1e8ed;
  font-size: 14px;
}

.crm-table td {
  padding: 12px;
  border-bottom: 1px solid #e1e8ed;
  font-size: 14px;
}

.crm-table tr:hover {
  background: #f8f9fa;
}

.crm-table tr.overdue {
  background: #fff3cd;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.new { background: #e3f2fd; color: #1976d2; }
.status-badge.contacted { background: #f3e5f5; color: #7b1fa2; }
.status-badge.qualified { background: #e8f5e9; color: #388e3c; }
.status-badge.proposal { background: #fff3e0; color: #f57c00; }
.status-badge.negotiation { background: #fce4ec; color: #c2185b; }
.status-badge.won { background: #c8e6c9; color: #2e7d32; }
.status-badge.lost { background: #ffcdd2; color: #c62828; }
.status-badge.converted { background: #c8e6c9; color: #2e7d32; }

.status-badge.pending { background: #fff3e0; color: #f57c00; }
.status-badge.in_progress { background: #e3f2fd; color: #1976d2; }
.status-badge.completed { background: #c8e6c9; color: #2e7d32; }

.status-badge.active { background: #c8e6c9; color: #2e7d32; }
.status-badge.inactive { background: #ffcdd2; color: #c62828; }

.priority-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.priority-badge.low { background: #e8f5e9; color: #388e3c; }
.priority-badge.medium { background: #fff3e0; color: #f57c00; }
.priority-badge.high { background: #ffcdd2; color: #c62828; }

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.role-badge.admin { background: #000; color: white; }
.role-badge.manager { background: #e3f2fd; color: #1976d2; }

.event-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: #f3e5f5;
  color: #7b1fa2;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  transition: transform 0.2s;
}

.btn-icon:hover {
  transform: scale(1.2);
}

/* Modal improvements */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e1e8ed;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #000;
}

.modal-content form {
  padding: 20px 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #000;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #000;
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e1e8ed;
}

.btn-primary {
  padding: 10px 20px;
  background: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  padding: 10px 20px;
  background: white;
  color: #000;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #000;
}


/* Calendar Styles */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.calendar-nav-btn {
  padding: 8px 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.calendar-nav-btn:hover {
  background: #333;
}

.calendar-grid {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e1e8ed;
}

.calendar-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 2px solid #e1e8ed;
}

.calendar-day-name {
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e1e8ed;
}

.calendar-day {
  background: white;
  min-height: 100px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-day:hover {
  background: #f8f9fa;
}

.calendar-day.empty {
  background: #fafafa;
  cursor: default;
}

.calendar-day.today {
  background: #e3f2fd;
}

.calendar-day.today:hover {
  background: #bbdefb;
}

.calendar-day-number {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}

.calendar-day.today .calendar-day-number {
  background: #000;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-event {
  background: #000;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event-more {
  font-size: 11px;
  color: #666;
  padding: 2px 6px;
  font-weight: 600;
}

/* Day Events Modal */
.day-event-item {
  padding: 15px;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

.day-event-time {
  font-size: 12px;
  color: #666;
  font-weight: 600;
  margin-bottom: 5px;
}

.day-event-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin-bottom: 5px;
}

.day-event-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.day-event-location {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.day-event-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.day-event-actions button {
  padding: 6px 12px;
  background: #000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.day-event-actions button:hover {
  background: #333;
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
    padding: 4px;
  }
  
  .calendar-day-number {
    font-size: 12px;
  }
  
  .calendar-event {
    font-size: 10px;
    padding: 1px 4px;
  }
}


/* Dashboard Styles */
.dashboard-container {
  padding: 30px;
}

.dashboard-container h2 {
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dashboard-stat-card.alert {
  background: #fff3cd;
  border-left: 4px solid #ff9800;
}

.stat-icon {
  font-size: 40px;
  line-height: 1;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #000;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.dashboard-section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.view-all-link {
  color: #000;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.view-all-link:hover {
  opacity: 0.7;
}

.dashboard-list {
  padding: 10px;
}

.dashboard-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.dashboard-item:hover {
  background: #f8f9fa;
}

.dashboard-item.highlight {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.dashboard-item.overdue {
  background: #ffebee;
  border-left: 4px solid #f44336;
}

.dashboard-item.success {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.dashboard-item-icon {
  font-size: 24px;
  line-height: 1;
}

.dashboard-item-content {
  flex: 1;
}

.dashboard-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin-bottom: 4px;
}

.dashboard-item-meta {
  font-size: 13px;
  color: #666;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-stat-card {
    padding: 20px;
  }
  
  .stat-value {
    font-size: 28px;
  }
}


/* Project Styles */
.project-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: #e3f2fd;
  color: #1976d2;
}

.status-badge.project-planning { background: #fff3e0; color: #f57c00; }
.status-badge.project-in_progress { background: #e3f2fd; color: #1976d2; }
.status-badge.project-review { background: #f3e5f5; color: #7b1fa2; }
.status-badge.project-completed { background: #c8e6c9; color: #2e7d32; }
.status-badge.project-on_hold { background: #ffecb3; color: #ff8f00; }
.status-badge.project-cancelled { background: #ffcdd2; color: #c62828; }

.priority-badge.urgent { background: #d32f2f; color: white; }

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: #000;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.form-row {
  margin-bottom: 15px;
}


/* Outstanding Balances Styles */
.balance-pending {
  background: #ff9800;
  color: white;
}

.balance-partial {
  background: #2196f3;
  color: white;
}

.balance-paid {
  background: #4caf50;
  color: white;
}

.balance-overdue {
  background: #d32f2f;
  color: white;
}

.balance-cancelled {
  background: #9e9e9e;
  color: white;
}

.balances-stats {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
