/* Zora CRM Google-Themed CSS */
:root {
  --google-blue: #1a73e8;
  --google-blue-hover: #1557b0;
  --google-blue-light: #e8f0fe;
  --google-red: #ea4335;
  --google-yellow: #fbbc05;
  --google-green: #34a853;
  --google-green-light: #e6f4ea;
  --google-red-light: #fce8e6;
  --google-yellow-light: #fef7e0;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --border-color: #dadce0;
  --sidebar-width: 260px;
  --font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-subtle: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-card: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --transition-speed: 0.2s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animated {
  animation: fadeIn var(--transition-speed) ease-out forwards;
}

/* Auth Pages */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 100%;
  max-width: 450px;
  padding: 40px;
  box-shadow: 0 2px 6px 0 rgba(0,0,0,0.08);
}

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

.google-logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.google-logo span:nth-child(1) { color: var(--google-blue); }
.google-logo span:nth-child(2) { color: var(--google-red); }
.google-logo span:nth-child(3) { color: var(--google-yellow); }
.google-logo span:nth-child(4) { color: var(--google-blue); }
.google-logo span:nth-child(5) { color: var(--google-green); }
.google-logo span:nth-child(6) { color: var(--google-red); }

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  transition: border-color var(--transition-speed);
}

.form-input:focus {
  border-color: var(--google-blue);
  box-shadow: 0 0 0 1px var(--google-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

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

.btn-primary:hover {
  background-color: var(--google-blue-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--google-blue);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--google-blue-light);
}

.btn-block {
  width: 100%;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--google-blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.alert-error {
  background-color: var(--google-red-light);
  color: var(--google-red);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  border: 1px solid rgba(234, 67, 53, 0.2);
}

/* CRM Main Layout */
.crm-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #dadce0 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #bdc1c6;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-item i {
  margin-right: 12px;
  font-size: 16px;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--google-blue-light);
  color: var(--google-blue);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  background-color: white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--google-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

/* Main Workspace */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-main);
}

.top-navbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 400;
}

.content-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Dashboard Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

.stat-title {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 500;
}

/* Toolbar actions */
.view-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.filters-wrapper {
  display: flex;
  gap: 12px;
  flex-grow: 1;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  outline: none;
  background-color: white;
  transition: border-color var(--transition-speed);
}

.search-input:focus {
  border-color: var(--google-blue);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.filter-select {
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: white;
  font-size: 14px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

/* CRM Table */
.table-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(60,64,67,0.1);
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-table th {
  background-color: #f8f9fa;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.crm-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.crm-table tr:hover td {
  background-color: #f8f9fa;
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.badge-open {
  background-color: var(--google-blue-light);
  color: var(--google-blue);
}

.badge-won {
  background-color: var(--google-green-light);
  color: var(--google-green);
}

.badge-lost {
  background-color: var(--google-red-light);
  color: var(--google-red);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8f9fa;
}

/* Timeline/Activities */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--google-blue);
  border: 2px solid white;
}

.timeline-content {
  font-size: 13px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 4px;
}

.timeline-body {
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 4px;
}

/* Task Checkbox and text cross */
.task-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.completed-task-text {
  text-decoration: line-through;
  color: var(--text-secondary);
}

/* Kanban column active states */
.kanban-cards-container.drag-over {
  background-color: rgba(26, 115, 232, 0.05);
  border: 2px dashed var(--google-blue);
  border-radius: 6px;
}

.key-value-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
