/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Nodewave Blue Gradient Colors */
  --blue-light: #4FC3F7;
  --blue-medium: #29B6F6;
  --blue-primary: #0288D1;
  --blue-dark: #0277BD;
  --blue-darker: #01579B;
  
  /* Gradient */
  --gradient-primary: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-primary) 50%, var(--blue-darker) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(79, 195, 247, 0.1) 0%, rgba(1, 87, 155, 0.1) 100%);
  
  /* Status Colors */
  --status-new: #E3F2FD;
  --status-new-text: #1976D2;
  --status-texting: #FFF3E0;
  --status-texting-text: #F57C00;
  --status-meeting: #E8F5E9;
  --status-meeting-text: #388E3C;
  --status-proposal: #F3E5F5;
  --status-proposal-text: #7B1FA2;
  --status-negotiation: #FFF8E1;
  --status-negotiation-text: #FFA000;
  --status-won: #C8E6C9;
  --status-won-text: #2E7D32;
  --status-lost: #FFCDD2;
  --status-lost-text: #C62828;
  
  /* Neutral Colors */
  --bg-primary: #F5F7FA;
  --bg-white: #FFFFFF;
  --text-primary: #212121;
  --text-secondary: #757575;
  --border-color: #E0E0E0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(2, 136, 209, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--gradient-subtle);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-box {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-hover);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--blue-darker);
  margin-bottom: 8px;
}

.login-header .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: var(--gradient-primary);
  color: white;
  padding: 24px 32px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header .logo {
  max-width: 140px;
  height: auto;
}

.header h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.header .subtitle {
  opacity: 0.9;
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
}

.user-name {
  font-weight: 500;
}

.user-role {
  font-size: 12px;
  opacity: 0.9;
}

/* Navigation */
.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-white);
  padding: 8px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.nav-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab:hover {
  background: var(--gradient-subtle);
  color: var(--blue-primary);
}

.nav-tab.active {
  background: var(--gradient-primary);
  color: white;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 300px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--blue-primary);
}

/* Buttons */
button {
  cursor: pointer;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

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

.btn-secondary {
  background: #E9ECEF;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #DEE2E6;
}

.btn-danger {
  background: #DC3545;
  color: white;
}

.btn-danger:hover {
  background: #C82333;
}

.btn-edit {
  background: var(--blue-primary);
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-delete {
  background: #DC3545;
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tab:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.tab.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

/* Table */
.table-container {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #F8F9FA;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 14px;
}

tr:hover {
  background: #F8F9FA;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-new { background: var(--status-new); color: var(--status-new-text); }
.status-texting { background: var(--status-texting); color: var(--status-texting-text); }
.status-meeting { background: var(--status-meeting); color: var(--status-meeting-text); }
.status-proposal { background: var(--status-proposal); color: var(--status-proposal-text); }
.status-negotiation { background: var(--status-negotiation); color: var(--status-negotiation-text); }
.status-won { background: var(--status-won); color: var(--status-won-text); }
.status-lost { background: var(--status-lost); color: var(--status-lost-text); }

/* Empty State */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

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

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-warning {
  border-top: 4px solid #FFC107;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 20px;
  color: var(--blue-darker);
}

.modal-body {
  padding: 24px;
}

.close-btn {
  background: none;
  font-size: 24px;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text-primary);
}

/* Form */
form {
  padding: 24px;
}

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

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

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.error-message {
  background: var(--status-lost);
  color: var(--status-lost-text);
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

/* Multi-step Form */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.step.active .step-number {
  background: var(--gradient-primary);
  border-color: var(--blue-primary);
  color: white;
}

.step.completed .step-number {
  background: var(--status-won);
  border-color: var(--status-won-text);
  color: var(--status-won-text);
}

.step-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.step.active .step-label {
  color: var(--blue-primary);
  font-weight: 500;
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

.step-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

/* Confirmation Page */
.confirmation-summary {
  background: var(--gradient-subtle);
  padding: 24px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.confirmation-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(2, 136, 209, 0.1);
}

.confirmation-item:last-child {
  border-bottom: none;
}

.confirmation-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.confirmation-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.kanban-column {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 500px;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.kanban-title {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-count {
  background: var(--gradient-subtle);
  color: var(--blue-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  cursor: move;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kanban-card.won {
  border-left: 4px solid var(--status-won-text);
}

.kanban-card.lost {
  border-left: 4px solid var(--status-lost-text);
}

.card-company {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-deal-size {
  font-weight: 600;
  color: var(--status-won-text);
  font-size: 14px;
  margin-top: 8px;
}

.card-pic {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 1001;
  box-shadow: var(--shadow-hover);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: var(--status-won-text); }
.toast.error { background: var(--status-lost-text); }
.toast.warning { background: #F57C00; }

/* Actions Column */
.actions-cell {
  display: flex;
  gap: 8px;
}

/* Deal Size */
.deal-size {
  font-weight: 600;
  color: var(--status-won-text);
}

/* Existing Deals List */
#existingDeals {
  margin-top: 16px;
}

.existing-deal-item {
  background: #F8F9FA;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.existing-deal-item strong {
  color: var(--blue-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    flex-direction: column;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 13px;
  }

  th, td {
    padding: 10px 8px;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
