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

/* ══════════════════════════════════
   CSS VARIABLES — DARK (default)
══════════════════════════════════ */
:root {
  --bg:        #0d0f14;
  --surface:   #141720;
  --surface2:  #1c2030;
  --border:    #252a3a;
  --accent:    #e84e1b;
  --accent2:   #f07843;
  --blue:      #3a7bd5;
  --green:     #27ae60;
  --yellow:    #f39c12;
  --purple:    #8e44ad;
  --red:       #e74c3c;
  --text:      #e8eaf0;
  --text2:     #8a90a4;
  --nav-h:     60px;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

/* ══════════════════════════════════
   CSS VARIABLES — LIGHT MODE
══════════════════════════════════ */
body.light {
  --bg:       #f0f2f7;
  --surface:  #ffffff;
  --surface2: #f5f7fb;
  --border:   #dde1ec;
  --accent:   #e84e1b;
  --accent2:  #f07843;
  --blue:     #3a7bd5;
  --green:    #27ae60;
  --yellow:   #f39c12;
  --purple:   #8e44ad;
  --red:      #e74c3c;
  --text:     #1a1a2e;
  --text2:    #5a6170;
  --shadow:   0 4px 24px rgba(0,0,0,0.08);
}

/* ══════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════ */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--nav-h);
}

a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════
   NAVBAR
══════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.nav-brand {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-right: 32px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover { background: var(--surface2); color: var(--text); }

.nav-link.active {
  background: rgba(232,78,27,0.12);
  color: var(--accent);
}

.nav-link .icon { font-size: 16px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: white;
  cursor: pointer;
  border: 2px solid var(--border);
}

.btn-logout {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ══════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════ */
.page {
  padding: 28px 28px;
  max-width: 1600px;
  margin: 0 auto;
}

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

.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { opacity: 0.85; }

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--accent));
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 28px;
  opacity: 0.15;
}

/* ══════════════════════════════════
   TABLES
══════════════════════════════════ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

thead th {
  background: var(--surface2);
  color: var(--text2);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

tbody td select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}

/* ══════════════════════════════════
   STATUS BADGES
══════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-Submitted   { background: rgba(58,123,213,0.15);  color: #3a7bd5; }
.badge-InProgress  { background: rgba(142,68,173,0.15);  color: #a05ccc; }
.badge-FollowUp    { background: rgba(243,156,18,0.15);  color: #f39c12; }
.badge-Updates     { background: rgba(52,152,219,0.15);  color: #3498db; }
.badge-Appointment { background: rgba(26,188,156,0.15);  color: #1abc9c; }
.badge-Completed   { background: rgba(39,174,96,0.15);   color: #27ae60; }
.badge-Cancelled   { background: rgba(231,76,60,0.15);   color: #e74c3c; }

/* ══════════════════════════════════
   KANBAN
══════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  flex: 0 0 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 400px;
}

.kanban-col-header {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--col-color, var(--border));
  color: var(--col-color, var(--text2));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-col-header .count {
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text2);
}

.k-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}

.k-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232,78,27,0.2);
}

.k-card:active { cursor: grabbing; opacity: 0.7; }

.k-card.drag-over { outline: 2px dashed var(--accent); }

.k-card .card-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text);
}

.k-card .card-meta {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.7;
}

.k-card .card-id {
  font-size: 10px;
  color: var(--text2);
  opacity: 0.5;
  margin-bottom: 6px;
  font-family: monospace;
}

.k-card select {
  width: 100%;
  margin-top: 8px;
  padding: 5px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
}

.k-card .btn-cancel-card {
  width: 100%;
  margin-top: 6px;
  padding: 5px;
  border: 1px solid var(--red);
  border-radius: 5px;
  background: transparent;
  color: var(--red);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.k-card .btn-cancel-card:hover { background: var(--red); color: white; }

.kanban-col.drag-over { background: rgba(232,78,27,0.05); outline: 2px dashed var(--accent); }

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

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap input {
  padding: 8px 12px 8px 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text2); }

.search-wrap .si {
  position: absolute;
  left: 10px;
  font-size: 14px;
  color: var(--text2);
  pointer-events: none;
}

.btn-view {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
}

.btn-view.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-view:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════
   FORMS
══════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text2); }

.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; }

/* ══════════════════════════════════
   MODAL
══════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { border-color: var(--red); color: var(--red); }

.modal-body { padding: 24px; }

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

/* ══════════════════════════════════
   MAP
══════════════════════════════════ */
#jobMap {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  z-index: 1;
}

/* ══════════════════════════════════
   SECTION GROUPS (grouped list)
══════════════════════════════════ */
.status-group {
  margin-bottom: 28px;
}

.status-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.status-group-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-group-count {
  background: var(--surface2);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text2);
}

/* ══════════════════════════════════
   EMPTY STATE
══════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text2);
}

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

/* ══════════════════════════════════
   TECH SUGGESTION BANNER
══════════════════════════════════ */
.tech-suggestion {
  background: rgba(39,174,96,0.1);
  border: 1px solid rgba(39,174,96,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green);
  margin-bottom: 12px;
  display: none;
}

.tech-suggestion.show { display: block; }

/* ══════════════════════════════════
   NOTIFICATION BELL
══════════════════════════════════ */
.notif-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.notif-bell:hover { border-color: var(--accent); color: var(--accent); }

.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notif-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

#notifList {
  overflow-y: auto;
  max-height: 400px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-unread { background: rgba(232,78,27,0.04); }
.notif-read   { opacity: 0.7; }

.notif-icon-wrap { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

.notif-body { flex: 1; min-width: 0; }

.notif-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.notif-meta {
  font-size: 11px;
  color: var(--text2);
}

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ══════════════════════════════════
   CHAT PAGE
══════════════════════════════════ */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - var(--nav-h) - 56px);
}

.chat-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text2);
}

.chat-tech-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.chat-tech-item:hover    { background: var(--surface2); }
.chat-tech-item.active   { background: rgba(232,78,27,0.08); border-left: 3px solid var(--accent); }
.chat-tech-item:last-child { border-bottom: none; }

.chat-tech-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
}

.chat-tech-info { flex: 1; min-width: 0; }
.chat-tech-name { font-size: 14px; font-weight: 600; color: var(--text); }
.chat-tech-preview { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-unread-badge {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Chat window */
.chat-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-window-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-window-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.chat-window-sub {
  font-size: 12px;
  color: var(--text2);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}

.msg-bubble.from-tech {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
}

.msg-bubble.from-dispatch {
  background: var(--accent);
  color: white;
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
}

.msg-sender {
  font-size: 10px;
  color: var(--text2);
  margin-bottom: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msg-bubble.from-dispatch .msg-sender { color: rgba(255,255,255,0.7); }

.msg-time {
  font-size: 10px;
  color: var(--text2);
  margin-top: 3px;
  text-align: right;
}

.msg-bubble.from-dispatch .msg-time { color: rgba(255,255,255,0.6); }

.msg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  margin-top: 6px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.msg-file:hover { opacity: 0.8; }

/* Chat input */
.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-file-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text2);
}

.chat-file-preview.show { display: flex; }

.chat-file-preview button {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  margin-left: auto;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.chat-input-row textarea:focus { border-color: var(--accent); }
.chat-input-row textarea::placeholder { color: var(--text2); }

.chat-attach-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-attach-btn:hover { border-color: var(--accent); color: var(--accent); }

.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--accent2); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  gap: 12px;
}

.chat-empty-icon { font-size: 48px; }

@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { height: 200px; }
  .chat-window  { height: 500px; }
}

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links .nav-link span { display: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .kanban-board { gap: 12px; }
  .kanban-col { flex: 0 0 200px; }
}

@media (max-width: 600px) {
  body { padding-top: var(--nav-h); }
  .page { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-col { flex: 0 0 85vw; }
  .modal { max-height: 95vh; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap input { width: 100%; }
}
