:root {
  --bg: #060f25;
  --sidebar: #08142f;
  --card: #0f2248;
  --border: #1f3767;
  --text: #eef3ff;
  --muted: #8fa7d0;
  --blue: #2f77ff;
  --green: #59d47e;
  --orange: #f3a953;
  --violet: #907dff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1100px 650px at 75% -15%, #18376f, transparent), var(--bg);
  color: var(--text);
  font-size: 16px;
}
.screen { max-width: 780px; margin: 0 auto; padding: 1.5rem; }
.screen[hidden], .workspace[hidden], .panel[hidden] { display: none !important; }

html {
  color-scheme: dark;
  scrollbar-color: #2f4f8a #060f25;
}

body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track {
  background: #060f25;
}

body::-webkit-scrollbar-thumb {
  background: #2f4f8a;
  border-radius: 5px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal__box {
  width: 100%;
  max-width: 520px;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.card {
  background: linear-gradient(180deg, #112a59, #0d2148);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}
.card--narrow { max-width: 360px; margin: 2rem auto; }
.card--login { text-align: center; padding-top: 1.5rem; }
.brand-logo { display: block; max-width: 280px; width: 100%; margin: 0 auto 1rem; }
.field { display: block; margin-bottom: 0.75rem; text-align: left; }
.field span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #071939;
  color: var(--text);
  padding: 0.62rem 0.75rem;
}
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #071939;
  color: var(--text);
  padding: 0.62rem 0.75rem;
  font-family: inherit;
}
#employeeIdInput, #phoneInput, #pinInput { text-align: center; font-size: 1.05rem; }
#pinInput { letter-spacing: 0.14em; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.56rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-chip { background: #0a1f47; color: var(--text); border: 1px solid var(--border); padding: 0.42rem 0.7rem; }
.btn-block { width: 100%; }
.muted { color: var(--muted); margin: 0.2rem 0 0; }
.err { color: #ff7f95; }
.ok { color: #6ee7b7; margin-top: 0.75rem; }
.cab-notify-card { margin-top: 1rem; }
.footer-links { margin-top: 1rem; font-size: 0.9rem; }
.footer-links a { color: #7ea3ff; text-decoration: none; }

.workspace {
  display: grid;
  grid-template-columns: 246px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #06142f, #081028);
  border-right: 1px solid #132a55;
  padding: 0.95rem 0.95rem 1.2rem;
}
.sidebar__brand {
  font-size: 1.32rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-mark-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar__nav { display: grid; gap: 0.45rem; }
.nav-tab {
  position: relative;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #d5e3ff;
  padding: 0.66rem 0.78rem;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.nav-ico {
  width: 16px;
  text-align: center;
  opacity: 0.9;
}
.nav-tab--active {
  background: linear-gradient(180deg, #2554a8, #1a3f87);
  border-color: #3a6ec2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.nav-tab--soon {
  opacity: 0.8;
}
.sidebar__footer { margin-top: 1rem; padding: 0.75rem; border: 1px solid #20365f; border-radius: 12px; }
.sidebar__footer-title {
  margin: 0 0 0.2rem;
  font-weight: 700;
}
.phone-mock {
  margin-top: 0.6rem;
  height: 120px;
  border-radius: 12px;
  background: radial-gradient(120px 80px at 30% 20%, #1a4f9b, transparent), linear-gradient(135deg, #112a59, #0a1b3d);
  border: 1px solid #214985;
}

.main { padding: 1rem 1.1rem 1.6rem; }
.main {
  max-width: 1280px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 56px;
}
.emp-head { display: flex; gap: 0.75rem; align-items: center; }
.emp-photo {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid #2e4f88;
}
.header__actions { display: flex; gap: 0.6rem; align-items: center; }
.status-badge { margin: 0.3rem 0 0; font-size: 0.88rem; font-weight: 600; }
.status-badge--on { color: var(--green); }
.status-badge--off { color: var(--muted); }

.filters { margin-bottom: 0.85rem; }
.filters__row { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.field--inline input { min-width: 9rem; }
.presets { margin-top: 0.55rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}
.stat__label { display: block; color: var(--muted); font-size: 0.83rem; margin-bottom: 0.35rem; }
.stat__value { font-size: 2.05rem; font-weight: 700; color: var(--green); line-height: 1.05; }
.stat__sub { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.stat__value--blue { color: #7ebbff; }
.stat__value--green { color: var(--green); }
.stat__value--violet { color: #a89dff; }
.stat__value--orange { color: var(--orange); }
.summary--prod {
  margin-top: 0.8rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.content-grid > .card {
  min-height: 300px;
}
.section-title { margin: 0 0 0.6rem; font-size: 1.06rem; font-weight: 700; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.shifts-list ul { margin: 0; padding-left: 1rem; }
.shifts-list li { margin-bottom: 0.42rem; }
.deviation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.52rem; }
.deviation-item { background: #0a1d42; border: 1px solid #24457f; border-radius: 10px; padding: 0.55rem; }
.deviation-label { display: block; color: var(--muted); font-size: 0.76rem; margin-bottom: 0.2rem; }
.deviation-value { font-size: 1.06rem; }
.deviation-value--under { color: #ff8686; }
.deviation-value--over { color: var(--green); }

.bottom-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.85rem; }
.bottom-grid > .card {
  min-height: 210px;
}
.balance { font-size: 2rem; font-weight: 700; margin: 0.2rem 0; }
.balance--bonus { color: var(--green); }
.balance--pay { color: var(--blue); }
.balance--advance { color: var(--orange); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid #213d71; padding: 0.56rem 0.42rem; text-align: left; }
.table th { color: var(--muted); font-size: 0.78rem; }
.tx-issue { color: #ff9aa8; }
.tx-repay { color: var(--green); }
.visit-rows {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.visit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #203e72;
  padding-bottom: 0.35rem;
}
.visit-row strong {
  font-size: 2rem;
  font-weight: 700;
  color: var(--green);
}
.visit-state {
  border: 1px solid #2d5e4d;
  background: rgba(40, 118, 77, 0.2);
  color: var(--green);
  padding: 0.52rem 0.7rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}
.schedule-plan {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.45rem;
}
.schedule-plan__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #24457f;
  border-radius: 10px;
  padding: 0.55rem;
  background: #0a1d42;
}
.plan-status {
  color: #c7d3eb;
  font-size: 0.85rem;
}
.plan-status--on {
  color: var(--green);
}
.mini-bar {
  margin-top: 0.45rem;
  height: 6px;
  border-radius: 6px;
  background: #182f5b;
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3a8fff, #62c3ff);
}
.mini-bar--warn i {
  background: linear-gradient(90deg, #ff7b7b, #ffb08a);
}
.feed-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.2rem;
}
.feed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.feed-row em {
  font-style: normal;
}
.st-ok { color: var(--green); }
.st-warn { color: #ffd473; }
.st-bad { color: #ff8fa2; }
.card-link {
  margin-top: 0.8rem;
  color: #a8bde8;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-messenger.card {
  padding: 0;
}

.chat-messenger {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  height: calc(100vh - 9.25rem);
  max-height: calc(100vh - 9.25rem);
  min-height: 22rem;
  padding: 0;
  overflow: hidden;
}

.chat-messenger__sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: rgba(6, 15, 38, 0.35);
  color-scheme: dark;
}

.chat-messenger__sidebar-head,
.chat-messenger__search,
.chat-sidebar__pinned,
.cab-chat-self {
  flex-shrink: 0;
}

.chat-sidebar__pinned {
  border-bottom: 1px solid rgba(58, 110, 194, 0.2);
}

.chat-messenger__sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem 0.55rem;
}

.chat-messenger__sidebar-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.chat-messenger__search {
  padding: 0 0.9rem 0.65rem;
  margin: 0;
}

.chat-messenger__search input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #071939;
  color: var(--text);
  font-size: 0.92rem;
}

.chat-conversations {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.55rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #2f4f8a #0a1d42;
}

.chat-conversations::-webkit-scrollbar {
  width: 8px;
}

.chat-conversations::-webkit-scrollbar-track {
  background: #0a1d42;
  border-radius: 4px;
}

.chat-conversations::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3a6ec2, #2f4f8a);
  border-radius: 4px;
  border: 2px solid #0a1d42;
}

.chat-conversations::-webkit-scrollbar-thumb:hover {
  background: #5a9dff;
}

#cabChatPeersList {
  min-height: min-content;
}

.chat-dept {
  margin-bottom: 0.35rem;
}

.chat-dept__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0.5rem 0.35rem 0.15rem;
}

.chat-dept__head .chat-dept__title {
  margin: 0;
}

.chat-dept__title {
  margin: 0.5rem 0.35rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #8fa7d0);
}

.chat-system-msg {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0;
  font-size: 0.72rem;
  color: var(--muted, #8fa7d0);
  text-align: center;
}

.chat-group-member-pick {
  max-height: 14rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.chat-group-member-pick__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
}

.chat-dept__list .chat-conv:last-child {
  border-bottom: none;
}

.chat-dept__empty {
  padding: 0.5rem 0.75rem;
  margin: 0;
}

.chat-conv {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: none;
  border-bottom: 1px solid rgba(58, 110, 194, 0.2);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.chat-conv:hover,
.chat-conv--active {
  background: rgba(58, 110, 194, 0.18);
}

.chat-conv--unread {
  background: rgba(90, 157, 255, 0.14);
  border-left: 3px solid #5a9dff;
}

.chat-conv--unread strong {
  color: #eef3ff;
  font-weight: 700;
}

.chat-conv__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e53935;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 1.5px solid #08142f;
  box-sizing: border-box;
}

.nav-unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e53935;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.chat-conv__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(90, 157, 255, 0.35);
  flex-shrink: 0;
}

.chat-conv__avatar--ph {
  display: grid;
  place-items: center;
  background: rgba(12, 32, 72, 0.95);
  color: #9eb8e8;
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-conv__avatar--hr {
  background: linear-gradient(135deg, #2f77ff, #5a9dff);
  color: #fff;
  font-size: 0.78rem;
}

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

.chat-conv strong {
  display: block;
}

.chat-conv__id {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.05rem;
}

.chat-conv__preview {
  display: block;
  font-size: 0.78rem;
  color: #a8bee8;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cab-chat-self {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border);
  background: rgba(47, 119, 255, 0.06);
  margin-top: auto;
}

.cab-chat-self__info {
  min-width: 0;
}

.cab-chat-self__info strong {
  display: block;
  font-size: 0.92rem;
}

.chat-messenger__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(4, 12, 32, 0.25);
}

.chat-messenger__thread-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chat-thread__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(90, 157, 255, 0.45);
  flex-shrink: 0;
}

.chat-thread__avatar--ph {
  display: grid;
  place-items: center;
  background: rgba(12, 32, 72, 0.95);
  color: #9eb8e8;
  font-weight: 700;
  font-size: 1rem;
}

.chat-thread__avatar--hr {
  background: linear-gradient(135deg, #2f77ff, #5a9dff);
  color: #fff;
  font-size: 0.82rem;
}

.chat-thread__info {
  min-width: 0;
}

.chat-messenger__thread-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-thread__id {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.chat-messenger__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: #2f4f8a #0a1d42;
}

.chat-messenger__messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messenger__messages::-webkit-scrollbar-track {
  background: #0a1d42;
  border-radius: 4px;
}

.chat-messenger__messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3a6ec2, #2f4f8a);
  border-radius: 4px;
  border: 2px solid #0a1d42;
}

.chat-messenger__messages::-webkit-scrollbar-thumb:hover {
  background: #5a9dff;
}

.chat-messenger__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.45rem;
}

.chat-messenger__empty[hidden],
.chat-messenger__messages[hidden] {
  display: none;
}

.chat-messenger__empty-icon {
  font-size: 2.4rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.chat-messenger__empty h3 {
  margin: 0;
  font-size: 1.15rem;
}

.chat-messenger__composer {
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(6, 15, 38, 0.55);
}

.chat-messenger__composer input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #071939;
  color: var(--text);
  font-size: 0.95rem;
}

.chat-messenger__composer input::placeholder {
  color: var(--muted);
}

.chat-messenger__composer input:focus {
  outline: none;
  border-color: rgba(90, 157, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(47, 119, 255, 0.15);
}

.chat-messenger__composer .btn-primary {
  flex-shrink: 0;
}

.chat-messenger__composer .chat-composer__emoji-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-messenger__composer .chat-composer__btn {
  width: 2.15rem;
  height: 2.15rem;
  border: none;
  border-radius: 50%;
  background: rgba(58, 110, 194, 0.22);
  color: #c8dcff;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chat-messenger__composer .chat-composer__btn:hover {
  background: rgba(58, 110, 194, 0.38);
}

.chat-messenger__composer .chat-emoji-picker {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  width: min(18.5rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(58, 110, 194, 0.45);
  background: #0a1f47;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.chat-emoji-picker__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.15rem;
  max-height: 11rem;
  overflow-y: auto;
}

.chat-emoji-picker__item {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.3rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.chat-emoji-picker__item:hover {
  background: rgba(58, 110, 194, 0.28);
}

.chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.84rem;
}

.chat-msg--admin {
  align-self: flex-start;
  background: rgba(12, 32, 72, 0.9);
  border: 1px solid #2f4f8a;
}

.chat-msg--employee {
  align-self: flex-end;
  background: rgba(47, 119, 255, 0.35);
  border: 1px solid rgba(90, 157, 255, 0.45);
}

.chat-msg__meta {
  display: block;
  font-size: 0.72rem;
  color: #9eb8e8;
  margin-bottom: 0.2rem;
}

.chat-msg__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-messenger__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.9rem 0.55rem;
}

.chat-filter {
  border: 1px solid rgba(58, 110, 194, 0.35);
  background: rgba(8, 20, 48, 0.5);
  color: #a8bee8;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.chat-filter--active {
  background: rgba(58, 110, 194, 0.35);
  color: #e8f1ff;
  border-color: #4d7fd4;
}

.chat-messenger__title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-messenger__unread-total {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.chat-thread__back {
  display: none;
  border: none;
  background: rgba(58, 110, 194, 0.2);
  color: #c8dcff;
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  cursor: pointer;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.chat-date-sep {
  display: flex;
  justify-content: center;
  margin: 0.55rem 0;
}

.chat-date-sep span {
  font-size: 0.72rem;
  color: #9eb8e8;
  background: rgba(12, 32, 72, 0.75);
  border: 1px solid rgba(58, 110, 194, 0.25);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
}

.chat-bubble-row {
  display: flex;
  width: 100%;
}

.chat-bubble-row--out {
  justify-content: flex-end;
}

.chat-bubble-row--in {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(78%, 28rem);
  padding: 0.38rem 0.55rem 0.3rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.chat-bubble--out {
  background: linear-gradient(135deg, rgba(45, 95, 180, 0.95), rgba(58, 110, 194, 0.85));
  border-bottom-right-radius: 4px;
  color: #f0f6ff;
}

.chat-bubble--in {
  background: rgba(12, 32, 72, 0.92);
  border: 1px solid rgba(47, 79, 138, 0.65);
  border-bottom-left-radius: 4px;
  color: #e8f1ff;
}

.chat-bubble__sender {
  font-size: 0.72rem;
  color: #9eb8e8;
  margin-bottom: 0.15rem;
}

.chat-bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.15rem;
}

.chat-bubble__footer time {
  font-size: 0.66rem;
  opacity: 0.75;
}


.chat-bubble__reply {
  border-left: 3px solid rgba(99, 140, 255, 0.55);
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  opacity: 0.9;
}
.chat-bubble__reply strong { display: block; font-weight: 600; }
.chat-bubble__attach {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: #9ec5ff;
}
.chat-bubble__attach--img img {
  max-width: min(240px, 100%);
  border-radius: 10px;
  display: block;
}
.chat-bubble__actions {
  opacity: 0;
  transition: opacity 0.15s;
  align-self: center;
}
.chat-bubble-row:hover .chat-bubble__actions { opacity: 1; }
.chat-bubble__actions button {
  border: none;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  border-radius: 8px;
  width: 1.6rem;
  height: 1.6rem;
  cursor: pointer;
}
.chat-bubble__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.chat-reaction {
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  cursor: pointer;
  color: inherit;
}
.chat-reaction--mine { background: rgba(59, 130, 246, 0.35); }
.chat-reaction-menu {
  display: flex;
  gap: 0.15rem;
  margin-top: 0.2rem;
}
.chat-reaction-menu button {
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  font-size: 1rem;
}
.chat-bubble--highlight {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.55);
}
.chat-composer__draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}
.chat-composer__draft-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-composer__draft-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
}
.chat-composer__input {
  flex: 1;
  min-height: 2.4rem;
  max-height: 7rem;
  resize: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: inherit;
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.chat-composer__btn {
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  font-size: 1.1rem;
}
.chat-thread__search-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.chat-thread__search {
  width: min(11rem, 32vw);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: inherit;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}
.chat-thread__search-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  color: #94a3b8;
}
.chat-thread__search-nav button {
  border: none;
  background: rgba(255,255,255,0.08);
  color: inherit;
  border-radius: 6px;
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
}
.chat-messenger__typing {
  padding: 0 1rem 0.25rem;
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 900px) {
  .chat-messenger {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    height: calc(100vh - 9.25rem);
    max-height: calc(100vh - 9.25rem);
  }
  .chat-messenger__sidebar {
    border-right: none;
    border-bottom: none;
    max-height: none;
    min-height: 0;
  }
  .chat-messenger--thread .chat-messenger__sidebar {
    display: none;
  }
  .chat-messenger--thread .chat-messenger__main {
    grid-row: 1 / -1;
  }
  .chat-messenger:not(.chat-messenger--thread) .chat-messenger__main {
    display: none;
  }
  .chat-thread__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chat-conversations {
    flex: 1;
    min-height: 0;
  }
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid #132a55; }
  .main { max-width: none; }
}
@media (max-width: 760px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .content-grid, .bottom-grid { grid-template-columns: 1fr; }
}

.cab-tasks-filter {
  max-width: 200px;
  min-width: 140px;
}

.cab-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cab-tasks-section-title {
  margin: 8px 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted, #94a3b8);
}

.cab-tasks-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.cab-tasks-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.cab-tasks-section-head span,
.cab-tasks-history summary span {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
  font-size: 0.75rem;
  text-align: center;
}

.cab-task {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.cab-task--current {
  padding: 18px;
  border: 2px solid rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0.02));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.10);
}

.cab-task--queue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px;
}

.cab-task--queue .cab-task__head,
.cab-task--queue .cab-task__meta {
  grid-column: 1;
}

.cab-task--queue .cab-task__actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.cab-task--queue .cab-task__status {
  display: none;
}

.cab-task__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cab-task__job {
  margin: 0 0 4px;
  color: #1d4ed8;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.cab-task__progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.cab-task__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.cab-task--pool {
  border-color: #fdba74;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.12) 0%, rgba(255, 255, 255, 0.02) 70%);
}

.cab-task__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cab-task__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.cab-task__status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.cab-task__status--todo {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.cab-task__status--doing {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.cab-task__status--done {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.cab-task__status--pool {
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
}

.cab-task__status--cancelled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.cab-task__desc,
.cab-task__meta {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.cab-task__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cab-task__batches {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.cab-task__batches-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.cab-task__batches-head strong {
  color: var(--blue);
  font-weight: 800;
}

.cab-task__batch-list {
  display: grid;
  gap: 8px;
}

.cab-task__batch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(47, 119, 255, 0.45);
  background: rgba(47, 119, 255, 0.16);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.cab-task__batch:hover:not(:disabled) {
  background: rgba(47, 119, 255, 0.24);
}

.cab-task__batch:disabled {
  opacity: 0.75;
  cursor: default;
}

.cab-task__batch--done {
  border-color: rgba(89, 212, 126, 0.45);
  background: rgba(89, 212, 126, 0.12);
}

.cab-task__batch--running {
  border-color: rgba(243, 169, 83, 0.55);
  background: rgba(243, 169, 83, 0.16);
}

.cab-task__batch-title {
  font-weight: 700;
  font-size: 1rem;
}

.cab-task__batch-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

.cab-task__batch-timer {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cab-tasks-history {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.cab-tasks-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 650;
}

.cab-tasks-history__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.cab-mat-code-row {
  display: flex;
  gap: 8px;
}

.cab-mat-code-row .field__input {
  flex: 1;
}

.cab-mat-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0.85rem 0 1rem;
  padding: 4px;
  border-radius: 12px;
  background: rgba(7, 25, 57, 0.85);
  border: 1px solid var(--border);
}

.cab-mat-mode__btn {
  border: 0;
  border-radius: 9px;
  padding: 0.62rem 0.75rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cab-mat-mode__btn.is-active[data-mat-mode="take"] {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.cab-mat-mode__btn.is-active[data-mat-mode="return"] {
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #042f1e;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.cab-mat-desc {
  margin: 0 0 1rem;
}

.cab-mat.is-return .btn-primary {
  background: linear-gradient(180deg, #34d399, #059669);
  color: #042f1e;
}

.cab-mat-resolved {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.08);
}

.cab-mat-resolved__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.45rem;
}

.cab-mat-scanner {
  margin-top: 1rem;
}

.cab-mat-scanner__view {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 0.75rem;
  overflow: hidden;
  border-radius: 12px;
}

.cab-mat-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cab-mat-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(7, 25, 57, 0.55);
}

.cab-mat-item__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cab-mat-item__badge--take {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.cab-mat-item__badge--return {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.cab-mat-item__title {
  margin: 0;
  font-weight: 650;
  color: var(--text);
}

.cab-mat-item__meta {
  margin: 0.28rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.cab-mat-item__qty {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.cab-mat-item__qty--take { color: #93c5fd; }
.cab-mat-item__qty--return { color: #6ee7b7; }

.cab-mat-item__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.cab-mat-item__actions .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .cab-mat-item {
    grid-template-columns: auto 1fr;
  }
  .cab-mat-item__qty {
    grid-column: 2;
    text-align: left;
    margin-top: 0.15rem;
  }
}

.cab-mat-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  max-width: min(92vw, 28rem);
  transform: translateX(-50%) translateY(120%);
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.cab-mat-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 600px) {
  .cab-task--queue {
    grid-template-columns: 1fr;
  }

  .cab-task--queue .cab-task__actions {
    grid-column: 1;
    grid-row: auto;
  }

  .cab-task--queue .cab-task__actions .btn {
    width: 100%;
  }
}
