/* ==========================================================================
   JMOS — Views: Dashboard Brief, Kanban Boards, Pipeline, Finance & Services
   ========================================================================== */

/* Dashboard Morning Brief Hero */
.brief {
  position: relative;
  background: linear-gradient(120deg, var(--red-bright), var(--red-deep) 92%);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 34px;
  overflow: visible;
}

.brief .tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #FFD9D5;
  font-weight: 600;
  margin-bottom: 9px;
}

.brief .tag .d {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.brief h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.brief p {
  font-size: 14.5px;
  line-height: 1.62;
  max-width: 760px;
  color: #FFEDEB;
}

.brief p b {
  color: #fff;
  font-weight: 600;
}

.brief p .u {
  border-bottom: 2px solid rgba(255, 255, 255, .5);
}

.drip {
  position: absolute;
  bottom: -13px;
  width: 7px;
  background: var(--red-deep);
  border-radius: 0 0 6px 6px;
}

.drip::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red-deep);
}

/* Kanban Board (Pipeline & Tasks) */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 960px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bcol {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 120px;
}

.bcol h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 4px 10px;
  display: flex;
  justify-content: space-between;
}

.tcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  margin-bottom: 8px;
}

.tcard .tn {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}

.tcard .tf {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.tcard .tf .av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 9px;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

.tcard .tf .who {
  font-size: 11px;
  color: var(--muted);
}

/* Sales Pipeline Component */
.pipe {
  padding: 6px 17px 16px;
}

.stage-bar {
  display: flex;
  gap: 5px;
  margin: 6px 0 14px;
}

.stage-bar .s {
  flex: 1;
  text-align: center;
}

.stage-bar .s .n {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 600;
}

.stage-bar .s .l {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

.stage-bar .s .track {
  height: 4px;
  border-radius: 20px;
  margin-top: 8px;
  background: var(--line);
}

.deal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.deal .logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--red-deep);
  flex: none;
}

.deal .info {
  flex: 1;
  min-width: 0;
}

.deal .info .n {
  font-size: 13px;
  font-weight: 500;
}

.deal .info .v {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.won-btn {
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  transition: .15s;
}

.won-btn:hover {
  background: var(--red-deep);
}

.won-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 13px 17px;
  background: var(--red-soft);
  border-top: 1px solid var(--red-line);
}

.flow .lead {
  font-size: 10.5px;
  color: var(--red-deep);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}

.flow .step {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--red-deep);
  background: #fff;
  border: 1px solid var(--red-line);
  border-radius: 20px;
  padding: 4px 10px;
}

.flow .arr {
  color: var(--red);
  font-family: 'IBM Plex Mono', monospace;
}

/* Services Recipes Grid */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.svc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow);
}

.svc h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
}

.svc h3 .ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--red-soft);
  display: grid;
  place-items: center;
  color: var(--red);
  flex: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 13px;
}

.svc .stages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0;
}

.svc .stage {
  font-size: 10.5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 9px;
  color: #4A4340;
}

.svc .stage.arrow {
  border: none;
  background: none;
  color: var(--faint);
  padding: 3px 1px;
}

.svc .deliver {
  font-size: 12px;
  color: var(--muted);
}

.svc .deliver b {
  color: var(--ink);
  font-weight: 600;
}

/* Finance Overview Grid */
.fin-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.balcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.balcard h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.balrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.balrow .lbl2 {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.balrow .lbl2 .dt {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.balrow.total {
  border-bottom: none;
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 14px;
}

.balrow.total .lbl2 {
  color: var(--ink);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
}

.balrow.total .mono {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.balrow .mono {
  font-weight: 500;
}

.finnote {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.finnote svg {
  width: 14px;
  height: 14px;
  stroke: var(--green);
  stroke-width: 2;
  fill: none;
  flex: none;
}

.fin-stats {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
}

.fstat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fstat .l {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.fstat .v {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  margin-top: 5px;
}

/* ==========================================================================
   Operations & Google Calendar Widget Styles
   ========================================================================== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-head-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0 8px;
}

.cal-day {
  min-height: 38px;
  padding: 4px 2px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: background .12s, border-color .12s;
  border: 1px solid transparent;
}

.cal-day:hover {
  background: var(--paper);
}

.cal-day .dnum {
  font-size: 12px;
  font-weight: 500;
}

.cal-day.today {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
  border-color: var(--red-line);
}

.cal-day.selected {
  border-color: var(--red);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--red);
}

.cal-day.other-month {
  color: var(--faint);
  opacity: .35;
}

.cal-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}

.cal-more {
  font-size: 9px;
  color: var(--muted);
  line-height: 1;
}

.icon-btn-sm {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 4px;
  line-height: 1;
}

.icon-btn-sm:hover {
  background: var(--line);
  color: var(--ink);
}

/* ==========================================================================
   Dedicated Operations Calendar Page Styles
   ========================================================================== */
.cal-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cal-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cal-pill:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--paper);
}

.cal-pill.active {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  font-weight: 600;
}

.cal-pill.active .dot-indicator {
  background: #ffffff !important;
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.full-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.full-cal-day {
  min-height: 84px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s ease;
}

.full-cal-day:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
}

.full-cal-day.today {
  border-color: var(--red);
  background: var(--red-soft);
}

.full-cal-day.today .dnum {
  color: var(--red);
  font-weight: 700;
}

.full-cal-day.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-line);
}

.full-cal-day.other-month {
  opacity: 0.35;
  background: transparent;
}

.full-cal-day .dnum {
  font-size: 12.5px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
  margin-bottom: 4px;
}

.full-cal-events-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}

.full-cal-event-pill {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.full-cal-event-pill:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

[data-open-detail] {
  cursor: pointer;
}

.full-cal-event-pill.meeting {
  background: var(--red-soft);
  color: var(--red);
}

.full-cal-event-pill.shoot {
  background: var(--amber-soft);
  color: var(--amber);
}

.full-cal-event-pill.deadline {
  background: var(--green-soft);
  color: var(--green);
}

.full-cal-event-pill.invoice {
  background: rgba(43, 110, 138, 0.15);
  color: #2B6E8A;
}

.full-cal-more {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 600;
  padding-left: 2px;
}

@media (max-width: 1024px) {
  .full-cal-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Settings & Integrations View Styles
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 6px;
}

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

/* ==========================================================================
   Team Chat & Direct Messaging Hub Styles
   ========================================================================== */
.chat-nav-badge {
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1.4;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 175px);
  min-height: 520px;
  max-height: 820px;
}

.chat-dir-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  height: 100%;
}

.chat-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.chat-search-wrap svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.chat-search-wrap input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.chat-search-wrap input:focus {
  border-color: var(--red);
  background: var(--surface);
}

.chat-dir-scroll {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.chat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.chat-add-btn {
  border: none;
  background: var(--paper);
  color: var(--muted);
  border-radius: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s;
}

.chat-add-btn:hover {
  background: var(--red-soft);
  color: var(--red);
}

.chat-count-pill {
  font-size: 10px;
  background: var(--paper);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.chat-threads-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  border: 1px solid transparent;
}

.chat-item:hover {
  background: var(--paper);
}

.chat-item.active {
  background: var(--red-soft);
  border-color: var(--red-line);
}

.chat-item.active .chat-item-name {
  color: var(--red);
  font-weight: 700;
}

.chat-item-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.chat-item-last {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.chat-unread-badge {
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Right Pane: Message Stream & Composer */
.chat-conv-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.chat-conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.chat-thread-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.chat-active-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.chat-active-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}

.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
}

.chat-msg-row {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.chat-msg-row.msg-align-left {
  align-self: flex-start;
}

.chat-msg-row.msg-align-right {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 4px;
}

.chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.chat-msg-meta.right {
  justify-content: flex-end;
}

.chat-msg-author {
  font-weight: 600;
  color: var(--ink);
}

.chat-msg-time {
  font-size: 10.5px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble.bubble-them {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 3px;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.bubble-me {
  background: var(--red);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 6px rgba(197, 37, 35, 0.25);
}

.chat-bubble-text {
  white-space: pre-wrap;
}

.chat-attachment-chip {
  margin-top: 6px;
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.chat-composer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}

.chat-composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.chat-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
}

.chat-tool-btn svg {
  width: 17px;
  height: 17px;
  stroke: var(--ink);
  stroke-width: 1.8;
  fill: none;
}

.chat-tool-btn:hover,
.chat-tool-btn.active {
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
  border-color: var(--line-strong, #473833);
  color: var(--ink);
}

/* Attachment Staging Area */
.chat-staging-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  margin-bottom: 10px;
}

.chat-staging-preview {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.chat-staging-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-staging-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-staging-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-staging-size {
  font-size: 10.5px;
  color: var(--muted);
}

.chat-staging-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(197, 37, 35, 0.12);
  color: var(--red);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-staging-remove:hover {
  background: var(--red);
  color: #fff;
}

/* Floating Emoji Picker */
.chat-emoji-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 18px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 38px -8px rgba(0, 0, 0, 0.35);
  z-index: 100;
  overflow: hidden;
}

.chat-emoji-header {
  padding: 8px 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.chat-emoji-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.chat-emoji-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.emoji-btn:hover {
  background: var(--surface-2, rgba(255, 255, 255, 0.1));
  transform: scale(1.15);
}

/* Image & File Attachments in Message Bubble */
.chat-img-attachment {
  display: block;
  margin-top: 6px;
  max-width: 280px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-img-attachment img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.chat-img-attachment:hover img {
  transform: scale(1.02);
}

.chat-file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.chat-file-attachment svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.chat-file-attachment a.download-link {
  color: #4285f4;
  text-decoration: underline;
  font-size: 11px;
  margin-top: 2px;
  display: inline-block;
}

.chat-composer-inner {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-composer textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 13px;
  color: var(--ink);
  resize: none;
  min-height: 42px;
  max-height: 120px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.chat-composer textarea:focus {
  border-color: var(--red);
  background: var(--surface);
}

.chat-composer .btn {
  padding: 9px 16px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  height: 42px;
}

.chat-composer-hints {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .chat-dir-card {
    max-height: 280px;
  }
  .chat-conv-card {
    height: 520px;
  }
}

/* ==========================================================================
   Attendee Picker (Team Members, Clients & Guests) in Event Modal
   ========================================================================== */
.attendee-chips-wrap {
  min-height: 44px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  transition: border-color .15s ease;
}

.attendee-chips-wrap:focus-within {
  border-color: var(--red);
}

.attendee-chips-empty {
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 6px;
  font-style: italic;
}

.attendee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 5px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  animation: chipPopIn .15s ease-out;
}

@keyframes chipPopIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

.attendee-chip-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.attendee-chip-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.attendee-chip-tag.team {
  background: rgba(37,99,235,0.15);
  color: #3b82f6;
}

.attendee-chip-tag.client {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}

.attendee-chip-tag.guest {
  background: rgba(16,185,129,0.15);
  color: #10b981;
}

.attendee-chip-del {
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: color .15s;
}

.attendee-chip-del:hover {
  color: var(--red);
}

.attendee-team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 115px;
  overflow-y: auto;
  padding: 3px 0;
}

.attendee-team-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted-strong, #cfc6c3);
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.attendee-team-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.attendee-team-pill.selected {
  background: rgba(197, 37, 35, 0.12);
  border-color: var(--red);
  color: var(--ink);
  font-weight: 600;
}

.attendee-team-pill-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}

.attendee-team-pill-check {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  display: none;
}

.attendee-team-pill.selected .attendee-team-pill-check {
  display: inline;
}

/* ==========================================================================
   Quick Action Cards & Table Actions (Add, Delete, Manage)
   ========================================================================== */
.action-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  text-decoration: none;
}

.action-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.action-card:active {
  transform: translateY(0);
}

.action-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.action-card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.action-card-icon.tint-red {
  background: rgba(197, 37, 35, 0.15);
  color: var(--red);
}

.action-card-icon.tint-blue {
  background: rgba(43, 110, 138, 0.15);
  color: #2B6E8A;
}

.action-card-icon.tint-green {
  background: rgba(28, 122, 78, 0.15);
  color: var(--green);
}

.action-card-icon.tint-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.action-card-icon.tint-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.action-card-content {
  flex: 1;
  min-width: 0;
}

.action-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.action-card-arr {
  color: var(--muted);
  font-size: 15px;
  transition: transform .18s ease, color .18s ease;
  flex-shrink: 0;
}

.action-card:hover .action-card-arr {
  color: var(--ink);
  transform: translateX(3px);
}

/* Row Action Buttons in Tables */
.row-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.row-action-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted-strong, #cfc6c3);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.row-action-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.row-action-btn.danger {
  color: var(--red);
  border-color: rgba(197, 37, 35, 0.25);
  background: rgba(197, 37, 35, 0.05);
}

.row-action-btn.danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.row-action-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Pipeline Deal Modal Stage Stepper */
.deal-stage-stepper {
  display: flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin: 10px 0 18px;
  overflow-x: auto;
}
.stage-step-btn {
  flex: 1;
  min-width: 85px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.stage-step-btn:hover {
  background: var(--surface);
  color: var(--ink);
}
.stage-step-btn.active {
  background: var(--surface);
  color: var(--red);
  border-color: var(--line-strong);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.stage-step-btn.won.active {
  background: var(--red-soft);
  color: var(--red-deep);
  border-color: var(--red);
}

/* Kanban Deal Card Pointer */
.tcard {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* ---------- Dark Mode View Overrides ---------- */
[data-theme="dark"] .search input {
  color: var(--ink);
}

[data-theme="dark"] .search input::placeholder {
  color: var(--faint);
}

[data-theme="dark"] .rolebanner {
  background: rgba(251,191,36,.08);
  border-color: rgba(251,191,36,.2);
  color: var(--amber);
}

[data-theme="dark"] .settings-grid {
  gap: 18px;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

[data-theme="dark"] input::placeholder {
  color: var(--faint);
}

[data-theme="dark"] .mbg {
  background: rgba(0, 0, 0, .7);
}

[data-theme="dark"] .mbox {
  background: var(--surface);
}

[data-theme="dark"] ::selection {
  background: rgba(224,66,64,.3);
}
