/* =============================================
   SHARK CRM - Main Stylesheet
   Navy & White Theme | Bebas Neue + Outfit
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base:        #f0f4f9;
  --bg-sidebar:     #0a1628;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f7faff;
  --bg-input:       #f5f8ff;
  --bg-modal:       #ffffff;

  --accent:         #1a3a6e;
  --accent-dim:     rgba(26, 58, 110, 0.08);
  --accent-mid:     rgba(26, 58, 110, 0.2);
  --accent-bright:  #2255a4;
  --orange:         #f97316;
  --blue:           #3b82f6;
  --green:          #10b981;
  --red:            #ef4444;
  --yellow:         #f59e0b;
  --purple:         #8b5cf6;
  --navy-light:     #e8eef8;

  --text-primary:   #0d1e38;
  --text-secondary: #4a637e;
  --text-muted:     #8fa8c4;

  --border:         rgba(26, 58, 110, 0.1);
  --border-bright:  rgba(26, 58, 110, 0.22);

  --sidebar-w:      240px;
  --header-h:       60px;

  --radius:         10px;
  --radius-lg:      16px;
  --shadow:         0 4px 20px rgba(10, 22, 40, 0.09);
  --shadow-accent:  0 0 0 3px rgba(26, 58, 110, 0.08);

  --font-head:      '', sans-serif;
  --font-body:      '', sans-serif;

  --transition:     0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle dot pattern on base background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(26,58,110,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =============================================
   LAYOUT
   ============================================= */
#app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* =============================================
   SIDEBAR  (stays dark navy for contrast)
   ============================================= */
#sidebar {
  width: var(--sidebar-w);
  background: #2255a4;
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(10,22,40,0.12);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: #ffffff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1;
}

.logo-text span { color: #7eb8f7; }

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 6px;
}

.sidebar-nav { padding: 8px 12px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: #7eb8f7;
  border-radius: 0 4px 4px 0;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: #7eb8f7;
  color: var(--bg-sidebar);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7eb8f7, #4a90d9);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: rgba(255,255,255,0.35); }

.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color var(--transition);
}
.btn-logout:hover { color: #ef4444; }

/* =============================================
   MAIN CONTENT
   ============================================= */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */
#top-header {
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: 0 1px 12px rgba(10,22,40,0.06);
}

.page-title-area { flex: 1; }

.page-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1;
}

.page-breadcrumb {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.btn-icon {
  width: 34px; height: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(10,22,40,0.05);
}

.btn-icon:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  box-shadow: var(--shadow-accent);
}

.reminder-badge { position: relative; }
.reminder-badge .dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* =============================================
   PAGE CONTENT
   ============================================= */
#page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10,22,40,0.13);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
  transform: translate(20px, -20px);
}

.stat-card.teal::after   { background: var(--accent); }
.stat-card.green::after  { background: var(--green); }
.stat-card.red::after    { background: var(--red); }
.stat-card.blue::after   { background: var(--blue); }
.stat-card.orange::after { background: var(--orange); }
.stat-card.purple::after { background: var(--purple); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}

.stat-icon.teal   { background: rgba(26,58,110,0.08);   color: var(--accent); }
.stat-icon.green  { background: rgba(16,185,129,0.1);   color: var(--green); }
.stat-icon.red    { background: rgba(239,68,68,0.1);    color: var(--red); }
.stat-icon.blue   { background: rgba(59,130,246,0.1);   color: var(--blue); }
.stat-icon.orange { background: rgba(249,115,22,0.1);   color: var(--orange); }
.stat-icon.purple { background: rgba(139,92,246,0.1);   color: var(--purple); }

.stat-value {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
  font-weight: 600;
}
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-body);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 4px 16px rgba(26,58,110,0.28);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(10,22,40,0.06);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: rgba(239,68,68,0.08);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-success {
  background: rgba(16,185,129,0.08);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
}
.btn-success:hover { background: var(--green); color: white; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn svg { width: 14px; height: 14px; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-bright);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option {
  background: #ffffff;
  color: var(--text-primary);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   TABLE
   ============================================= */
.table-wrapper { overflow-x: auto; }

table.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.crm-table thead tr {
  border-bottom: 1px solid var(--border);
  background: #f7faff;
}

.crm-table thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.crm-table tbody tr {
  border-bottom: 1px solid rgba(26,58,110,0.05);
  transition: background var(--transition);
}

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

.crm-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

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

/* =============================================
   BADGES / TAGS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-teal   { background: rgba(26,58,110,0.08);  color: var(--accent); }
.badge-green  { background: rgba(16,185,129,0.1);  color: var(--green); }
.badge-red    { background: rgba(239,68,68,0.1);   color: var(--red); }
.badge-blue   { background: rgba(59,130,246,0.1);  color: var(--blue); }
.badge-orange { background: rgba(249,115,22,0.1);  color: var(--orange); }
.badge-yellow { background: rgba(245,158,11,0.1);  color: var(--yellow); }
.badge-purple { background: rgba(139,92,246,0.1);  color: var(--purple); }
.badge-gray   { background: rgba(74,99,126,0.1);   color: var(--text-secondary); }

/* =============================================
   STARS
   ============================================= */
.stars { display: inline-flex; gap: 1px; }
.star { color: #dde3ef; font-size: 13px; }
.star.filled { color: var(--yellow); }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-wrap {
  background: var(--navy-light);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  min-width: 80px;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  box-shadow: 0 24px 64px rgba(10,22,40,0.18);
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7faff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 19px;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  font-size: 18px;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--red); }

.modal-body { padding: 24px; }

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

/* =============================================
   SEARCH / FILTER BAR
   ============================================= */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 15px; height: 15px;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(10,22,40,0.05);
}

.search-wrap input:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* =============================================
   AVATAR
   ============================================= */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  font-size: 12px;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* =============================================
   KANBAN PIPELINE
   ============================================= */
.pipeline-wrap {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 500px;
}

.kanban-col {
  min-width: 260px;
  max-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7faff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-col-name {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.kanban-col-count {
  background: var(--navy-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
}

.kanban-cards {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  overflow-y: auto;
}

.kanban-cards.drag-over {
  background: var(--accent-dim);
  border-radius: var(--radius);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
  box-shadow: 0 1px 6px rgba(10,22,40,0.06);
}

.kanban-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 14px rgba(10,22,40,0.1);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-customer {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-price {
  font-family: var(--font-head);
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* =============================================
   ACTIVITY / TIMELINE
   ============================================= */
.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -22px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

.timeline-dot svg { width: 8px; height: 8px; color: var(--accent); }

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 1px 6px rgba(10,22,40,0.05);
  max-height:95px;
  overflow-y:auto;
}

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

.timeline-author { font-size: 12px; font-weight: 600; color: var(--accent); }
.timeline-time   { font-size: 11px; color: var(--text-muted); }
.timeline-text   { font-size: 13px; color: var(--text-secondary); }

/* =============================================
   REMINDER CARD
   ============================================= */
.reminder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  transition: all var(--transition);
  box-shadow: 0 1px 6px rgba(10,22,40,0.05);
}

.reminder-card:hover { border-color: var(--border-bright); }
.reminder-card.overdue  { border-left: 3px solid var(--red); }
.reminder-card.today    { border-left: 3px solid var(--orange); }
.reminder-card.upcoming { border-left: 3px solid var(--accent); }
.reminder-card.done     { opacity: 0.5; }

.reminder-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.reminder-body { flex: 1; min-width: 0; }
.reminder-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; color: var(--text-primary); }
.reminder-meta  { font-size: 11.5px; color: var(--text-secondary); }
.reminder-actions { display: flex; gap: 6px; align-items: center; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.35;
}

.empty-state p { font-size: 14px; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 28px rgba(10,22,40,0.14);
  font-size: 13px;
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
  border-left: 3px solid var(--accent);
  color: var(--text-primary);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--orange); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   DROPDOWN
   ============================================= */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(10,22,40,0.14);
  z-index: 200;
  display: none;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.dropdown-item:hover { background: var(--accent-dim); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.08); color: var(--red); }
.dropdown-item svg { width: 13px; height: 13px; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px 0;
}

.page-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(10,22,40,0.05);
}

.page-btn:hover, .page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #1a3a6e 50%, #0a1628 100%);
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(126,184,247,0.12), transparent);
  pointer-events: none;
}

.login-card {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo-icon {
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(26,58,110,0.35);
}

.login-logo h1 {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--text-primary);
}

.login-logo h1 span { color: var(--accent-bright); }
.login-logo p { font-size: 12px; color: var(--text-muted); margin-top: 4px; letter-spacing: 1px; }

.login-error {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* =============================================
   DASHBOARD GRID
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* =============================================
   CONTACT CHIP
   ============================================= */
.contact-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
}

.contact-chip .remove {
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
  font-size: 14px;
  line-height: 1;
}
.contact-chip .remove:hover { color: var(--red); }

/* =============================================
   UTILITY
   ============================================= */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Animate in */
.fade-in { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   STAGE PILL
   ============================================= */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  #page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Item type indicator */
.item-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}
.item-type-tag.product { background: rgba(59,130,246,0.1);  color: var(--blue); }
.item-type-tag.service { background: rgba(139,92,246,0.1);  color: var(--purple); }

/* Lead status */
.lead-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.lead-status.open { background: rgba(26,58,110,0.08); color: var(--accent); }
.lead-status.won  { background: rgba(16,185,129,0.1);  color: var(--green); }
.lead-status.lost { background: rgba(239,68,68,0.1);   color: var(--red); }

/* Priority dot */
.priority-dots { display: inline-flex; gap: 2px; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-light); }
.priority-dot.filled { background: var(--yellow); }

/* Shark fin decorative */
.shark-fin {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.04;
  font-size: 80px;
  pointer-events: none;
  user-select: none;
}
/* =============================================
   MOBILE APP-LIKE POLISH - PRO PATCH
   ============================================= */
@media (max-width: 768px) {
  body { background: #f6f8fb; }
  #app-wrapper { min-height: 100vh; }
  #top-header {
    position: sticky;
    top: 0;
    z-index: 80;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid rgba(15,23,42,.08);
    padding: 12px 14px;
  }
  .page-title { font-size: 18px; }
  .page-breadcrumb { display:none; }
  #page-content { padding: 12px; }
  .toolbar {
    position: sticky;
    top: 66px;
    z-index: 50;
    background: rgba(246,248,251,.95);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    gap: 8px !important;
  }
  .toolbar > div { width:100%; }
  .search-wrap { min-width: 100% !important; }
  .btn { min-height: 40px; border-radius: 12px; }
  .btn-sm { min-height: 34px; }
  .card { border-radius: 18px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
  .table-wrapper { overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:16px; }
  .crm-table { min-width: 760px; }
  .modal-overlay { padding: 0; align-items:flex-end; }
  .modal { width:100% !important; max-width:100% !important; max-height:92vh; border-radius:24px 24px 0 0; overflow:auto; }
  .modal-lg { width:100% !important; }
  .form-control, select.form-control, textarea.form-control { min-height: 42px; border-radius: 12px; font-size: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap:10px; }
  .sidebar-user { border-radius: 14px; }
}


/* Unified list footer: count left, pagination center */
.list-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-top:1px solid var(--border);flex-wrap:wrap}
.list-footer .list-count{font-size:12px;color:var(--text-muted);min-width:220px}
.list-footer .pagination{display:flex;justify-content:center;align-items:center;gap:8px;flex:1;flex-wrap:wrap}
.list-footer .pagination a,.list-footer .pagination span{text-decoration:none}
.list-footer .footer-spacer{min-width:220px}
.search-wrap .search-action-btn{position:static!important;margin-left:8px;min-width:auto}
.duplicate-confirm-box{border:1px solid var(--border);background:var(--bg-base);border-radius:12px;padding:14px;margin-top:12px;display:none}
.duplicate-confirm-box.active{display:block}
.label-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;border:1px solid var(--border);font-size:11px;font-weight:600;background:var(--bg-base);color:var(--text-primary)}

/* Standard table footer used under every CRM table */
.card > .list-footer, .table-card-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 16px;
  border-top:1px solid var(--border);
  background:#fff;
  border-radius:0 0 14px 14px;
}
.list-count{font-size:13px;color:var(--text-muted)}
.pagination{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.footer-spacer{display:none}


/* PRO PATCH 2026-06-10 */
#sidebar-toggle{position:fixed;top:18px;left:248px;border:1px solid rgba(15,23,42,.12);background:var(--card-bg,#fff);color:var(--primary,var(--accent));border-radius:14px;width:42px;height:42px;display:flex;align-items:center;justify-content:center;box-shadow:0 10px 30px rgba(15,23,42,.18);cursor:pointer;z-index:9999;font-size:0;line-height:1;transition:left .22s ease,transform .18s ease,background .18s ease,color .18s ease}
#sidebar-toggle:before{content:'';width:20px;height:14px;display:block;background:linear-gradient(currentColor,currentColor) left top/20px 2px no-repeat,linear-gradient(currentColor,currentColor) left center/20px 2px no-repeat,linear-gradient(currentColor,currentColor) left bottom/20px 2px no-repeat;}
#sidebar-toggle:hover{transform:translateY(-1px);background:var(--primary,var(--accent));color:#fff}
#app-wrapper.sidebar-collapsed #sidebar-toggle{left:86px}
#app-wrapper.sidebar-collapsed #sidebar{width:76px;min-width:76px;overflow:visible}
#app-wrapper.sidebar-collapsed #sidebar .logo-text,#app-wrapper.sidebar-collapsed #sidebar .sidebar-section-title,#app-wrapper.sidebar-collapsed #sidebar .nav-item:not(.active) .nav-badge,#app-wrapper.sidebar-collapsed #sidebar .user-info,#app-wrapper.sidebar-collapsed #sidebar .sidebar-user a:not(.btn-logout){display:none!important}
#app-wrapper.sidebar-collapsed #sidebar .nav-item{justify-content:center;padding-left:14px;padding-right:14px;font-size:0}
#app-wrapper.sidebar-collapsed #sidebar .nav-item svg{width:22px;height:22px;margin:0;font-size:16px}
#app-wrapper.sidebar-collapsed #main-content{margin-left:76px}
@media(max-width:900px){#sidebar-toggle{left:14px;top:14px}#app-wrapper.sidebar-collapsed #sidebar-toggle{left:14px}#app-wrapper.sidebar-collapsed #main-content{margin-left:0}}
.scroll-panel{max-height:560px;overflow:auto;padding-right:6px}
.inline-checks{display:flex;flex-wrap:wrap;gap:8px}.inline-checks label{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:999px;padding:6px 10px;background:var(--bg-base)}
.contact-send-btn svg{width:16px;height:16px}.muted-box{background:var(--bg-secondary);border:1px solid var(--border);border-radius:10px;padding:12px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));gap:8px}.calendar-day{min-height:92px;border:1px solid var(--border);border-radius:10px;background:var(--bg-base);padding:8px;cursor:pointer}.calendar-day:hover{outline:2px solid var(--accent)}.calendar-day .num{font-weight:800}.calendar-pill{display:block;margin-top:5px;border-radius:999px;background:var(--accent-light,#eef2ff);padding:2px 6px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.top-account-pill{display:flex;align-items:center;gap:6px;background:#eef6ff;color:#12345a;border:1px solid #dbeafe;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800;white-space:nowrap;}


/* Monzer follow-up UI fixes 2026-06-16 */
#sidebar{position:fixed;}
#sidebar-toggle{position:absolute !important;top:14px !important;right:12px !important;left:auto !important;width:38px !important;height:38px !important;border-radius:12px !important;background:rgba(255,255,255,.12) !important;color:#fff !important;border:1px solid rgba(255,255,255,.22) !important;box-shadow:none !important;z-index:3 !important;}
#sidebar-toggle:hover{background:rgba(255,255,255,.2) !important;transform:none !important;color:#fff !important;}
#app-wrapper.sidebar-collapsed #sidebar-toggle{left:auto !important;right:18px !important;}
.audience-view-search{display:grid;grid-template-columns:2fr 1fr 1fr auto auto;gap:12px;align-items:end;}
.field-label{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px;display:block;}
@media(max-width:900px){.audience-view-search{grid-template-columns:1fr}.top-account-pill{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
.campaign-message-summary{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
.campaign-message-chip{border:1px solid var(--border);background:var(--bg-base);border-radius:12px;padding:12px;min-height:70px;}
.campaign-message-chip strong{display:block;margin-bottom:4px;color:var(--accent);}

/* Monzer 2026-06-16 v3 fixes */
.message-log-page .filter-card-clean{border-radius:18px;box-shadow:0 8px 28px rgba(15,23,42,.06)}
.message-log-page .card-header-clean{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--border,#e6edf7)}
.message-log-table{min-width:1180px;table-layout:fixed}
.message-log-table th,.message-log-table td{vertical-align:top;white-space:normal;line-height:1.45}
.message-log-table .message-cell{max-width:320px;word-break:break-word;color:#0f1f3d}
.message-log-table .mono-cell{font-variant-numeric:tabular-nums;word-break:break-word}
@media(max-width:900px){.message-log-filter{grid-template-columns:1fr!important}.message-log-filter .span-2{grid-column:auto!important}.message-log-table{min-width:980px}}


/* Monzer v4 UI fixes */
#sidebar{position:fixed!important;left:0;top:0;bottom:0;}
#main-content{margin-left:250px;}
#sidebar-toggle{position:absolute!important;top:18px!important;right:14px!important;left:auto!important;width:38px!important;height:38px!important;border-radius:12px!important;background:rgba(255,255,255,.12)!important;color:#fff!important;border:1px solid rgba(255,255,255,.25)!important;box-shadow:none!important;z-index:5!important;}
#app-wrapper.sidebar-collapsed #sidebar-toggle{left:auto!important;right:14px!important;top:72px!important;width:42px!important;height:42px!important;background:rgba(255,255,255,.14)!important;}
#app-wrapper.sidebar-collapsed #sidebar .sidebar-logo{padding-top:16px!important;padding-bottom:70px!important;}
#app-wrapper.sidebar-collapsed #sidebar .logo-icon{margin:0 auto!important;}
.connection-pill{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border-radius:999px;background:#f1f5f9;border:1px solid #dbe4f0;font-size:12px;font-weight:800;color:#143766;white-space:nowrap}
.connection-pill .conn-dot{width:9px;height:9px;border-radius:50%;background:#10b981;box-shadow:0 0 0 4px rgba(16,185,129,.12)}
.connection-pill.issue .conn-dot{background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.12)}
.connection-pill.issue{color:#7f1d1d;background:#fff1f2;border-color:#fecdd3}
.message-log-page .filter-card-clean{padding:14px 16px!important}
.message-log-filter{display:grid!important;grid-template-columns:repeat(4,minmax(180px,1fr))!important;gap:12px 14px!important;align-items:end}
.message-log-filter .span-2{grid-column:auto!important}
.message-log-filter .form-label{font-size:11px;margin-bottom:6px}
.message-log-filter .form-control{min-height:38px!important;height:38px!important;padding:8px 12px!important;font-size:13px!important}
.message-log-filter .btn{padding:9px 14px!important}
.message-log-table th,.message-log-table td{padding:12px 14px!important;vertical-align:top}
.message-log-table{font-size:13px}
.message-cell{max-width:520px;white-space:normal;line-height:1.45;word-break:break-word}
.mono-cell{word-break:break-word;max-width:160px}
.occasions-filter{display:grid!important;grid-template-columns:2fr 1fr 1fr auto!important;gap:12px!important;align-items:end}
.occasions-filter .form-control{height:38px!important;min-height:38px!important;font-size:13px!important}
@media(max-width:900px){#main-content{margin-left:0}.message-log-filter,.occasions-filter{grid-template-columns:1fr!important}.connection-pill span:not(.conn-dot){display:none}}
.report-filter .compact-grid{grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px;align-items:end}.customer-report-page .stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}.customer-report-page .stat-card{background:#fff;border:1px solid var(--border);border-radius:16px;padding:16px;box-shadow:var(--shadow-sm)}.customer-report-page .stat-value{font-size:24px;font-weight:800;color:var(--text)}.customer-report-page .stat-label{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.05em}@media(max-width:900px){.report-filter .compact-grid{grid-template-columns:1fr}}

.btn.is-loading,.btn:disabled,button.is-loading,button:disabled{opacity:.68;cursor:not-allowed;pointer-events:none;}
.btn.is-loading:before,button.is-loading:before{content:"";display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;margin-right:7px;vertical-align:-2px;animation:crmSpin .7s linear infinite;}
@keyframes crmSpin{to{transform:rotate(360deg)}}

/* Multi language / RTL support */
html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] #app-wrapper { direction: rtl; }
html[dir="rtl"] #sidebar { right: 0; left: auto; }
html[dir="rtl"] .sidebar-nav .nav-item svg { margin-left: 10px; margin-right: 0; }
html[dir="rtl"] .header-actions,
html[dir="rtl"] .card-header,
html[dir="rtl"] .table th,
html[dir="rtl"] .table td { direction: rtl; }
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { direction: rtl; text-align: right; }
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="number"] { direction: ltr; text-align: left; }
