/* ─────────────────────────────────────────
   THE KITCHEN PASS CRM — Stylesheet
   ───────────────────────────────────────── */

:root {
  --green-deep:  #054030;
  --green-mid:   #0F6E56;
  --green-light: #1D9E75;
  --green-pale:  #E1F5EE;
  --green-mint:  #9FE1CB;
  --cream:       #F7F4EF;
  --bg:          #F5F4F0;
  --white:       #FFFFFF;
  --ink:         #1A1A18;
  --ink-mid:     #444441;
  --ink-light:   #888780;
  --border:      rgba(15,110,86,0.12);
  --border-gray: #E5E4E0;
  --shadow:      0 2px 12px rgba(5,64,48,0.08);
  --sidebar-w:   220px;
  --topbar-h:    60px;
  --radius:      10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; display: flex; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--green-deep);
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(157,225,203,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-name {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: white;
  line-height: 1.1;
}
.sidebar-sub { font-size: 10px; color: var(--green-mint); letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: all 0.18s;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: rgba(157,225,203,0.18); color: white; }
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.nav-item.nav-disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 6px 0; }
.coming-badge {
  margin-left: auto;
  font-size: 9px;
  background: rgba(157,225,203,0.2);
  color: var(--green-mint);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-user { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(157,225,203,0.2);
  color: var(--green-mint);
  font-size: 11px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.45); }
.logout-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; background: none;
  transition: all 0.18s;
}
.logout-btn:hover { background: rgba(255,255,255,0.08); color: white; }

/* ── MAIN ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border-gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.view-title { font-size: 18px; font-weight: 500; color: var(--ink); }
.btn-primary {
  background: var(--green-mid);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost {
  background: none;
  border: 1px solid var(--border-gray);
  color: var(--ink-mid);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.btn-ghost:hover { border-color: var(--green-mid); color: var(--green-mid); }

/* ── VIEWS ── */
.view { flex: 1; overflow-y: auto; padding: 24px; }
.hidden { display: none !important; }

/* ── METRICS ── */
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.metric-card.highlight {
  background: var(--green-deep);
  border-color: var(--green-deep);
}
.metric-num {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  color: var(--green-mid);
  line-height: 1;
  margin-bottom: 4px;
}
.metric-card.highlight .metric-num { color: var(--green-mint); }
.metric-label { font-size: 12px; color: var(--ink-light); }
.metric-card.highlight .metric-label { color: rgba(255,255,255,0.5); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  padding: 18px;
}
.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dash-card-header h3 { font-size: 14px; font-weight: 500; }
.dash-card-header a { font-size: 12px; color: var(--green-mid); text-decoration: none; }

/* ── KANBAN ── */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, 220px);
  gap: 12px;
  height: 100%;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 20px;
}
.kanban-col {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.kanban-col-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kanban-count {
  font-size: 11px;
  background: var(--bg);
  color: var(--ink-light);
  border-radius: 10px;
  padding: 1px 7px;
}
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.18s;
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card-name { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 3px; }
.kanban-card-meta { font-size: 11px; color: var(--ink-light); }
.kanban-add-btn {
  width: 100%;
  padding: 6px;
  border: 1px dashed var(--border-gray);
  border-radius: 6px;
  background: none;
  color: var(--ink-light);
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.18s;
}
.kanban-add-btn:hover { border-color: var(--green-mid); color: var(--green-mid); }

/* ── TABLE ── */
.toolbar { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.search-input, .filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: var(--white);
  transition: border-color 0.18s;
}
.search-input { width: 280px; }
.search-input:focus, .filter-select:focus { border-color: var(--green-mid); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  background: var(--bg);
  border-bottom: 1px solid var(--border-gray);
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-gray);
  font-size: 13px;
  color: var(--ink);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafaf8; }
.data-table .action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid var(--border-gray);
  background: none;
  cursor: pointer;
  color: var(--ink-mid);
  font-family: inherit;
  margin-left: 4px;
}
.data-table .action-btn:hover { border-color: var(--green-mid); color: var(--green-mid); }
.data-table .action-btn.danger:hover { border-color: #cc3333; color: #cc3333; }

/* ── STATUS PILLS ── */
.status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}
.status-prospect { background: #f0f0e8; color: #666; }
.status-member { background: var(--green-pale); color: var(--green-mid); }
.status-declined { background: #fff0f0; color: #cc3333; }
.status-contacted { background: #e8f0ff; color: #3355cc; }
.status-pitched { background: #fff8e0; color: #996600; }
.status-negotiating { background: #f0e8ff; color: #6633cc; }
.status-past { background: var(--bg); color: var(--ink-light); }

/* ── LOGS ── */
.log-list, .activity-list { display: flex; flex-direction: column; gap: 0; }
.log-entry {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-gray);
  align-items: flex-start;
}
.log-entry:last-child { border-bottom: none; }
.log-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.log-icon.call   { background: #e8f0ff; }
.log-icon.email  { background: #fff8e0; }
.log-icon.meeting { background: var(--green-pale); }
.log-icon.tour   { background: #f0e8ff; }
.log-icon.note   { background: var(--bg); }
.log-body { flex: 1; min-width: 0; }
.log-restaurant { font-size: 13px; font-weight: 500; color: var(--ink); }
.log-notes { font-size: 12px; color: var(--ink-mid); margin-top: 2px; line-height: 1.5; }
.log-meta { font-size: 11px; color: var(--ink-light); margin-top: 4px; }

/* ── TASKS ── */
.task-list-full { display: flex; flex-direction: column; gap: 0; }
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-gray);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-gray);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.task-check.done { background: var(--green-mid); border-color: var(--green-mid); }
.task-title { flex: 1; font-size: 13px; color: var(--ink); }
.task-title.done { text-decoration: line-through; color: var(--ink-light); }
.task-due { font-size: 11px; color: var(--ink-light); }
.task-due.overdue { color: #cc3333; }
.task-delete { color: var(--ink-light); background: none; border: none; cursor: pointer; padding: 4px; opacity: 0; transition: opacity 0.18s; }
.task-item:hover .task-delete { opacity: 1; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,64,48,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: 14px;
  width: 90%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 0;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 16px; font-weight: 500; }
.modal-close-btn {
  background: none; border: none; font-size: 16px;
  color: var(--ink-light); cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: background 0.18s;
}
.modal-close-btn:hover { background: var(--bg); }
form { padding: 0 24px 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-mid); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--white); outline: none;
  transition: border-color 0.18s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(15,110,86,0.07); }
.form-group textarea { resize: vertical; min-height: 80px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--ink-light);
  font-size: 13px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,110,86,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,110,86,0.4); }
