:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #f9fbf8;
  --ink: #1d2520;
  --muted: #65736b;
  --line: #dce4dd;
  --brand: #0f8b78;
  --brand-strong: #0a6b5d;
  --brand-soft: #e2f4ef;
  --amber: #c47b17;
  --amber-soft: #fff2dc;
  --red: #b93c3c;
  --red-soft: #ffe8e8;
  --green: #217a49;
  --green-soft: #e5f5ea;
  --blue: #2c6f9f;
  --blue-soft: #e7f2fa;
  --shadow: 0 18px 45px rgba(31, 43, 36, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

body {
  -webkit-touch-callout: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  user-select: text;
}

select[multiple] {
  min-height: 132px;
  padding: 8px;
}

.check-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

button {
  border: 0;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #1f2d27;
  color: #f7fbf7;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #16a58e;
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #0d1c22;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.brand h1 {
  font-size: 1rem;
  line-height: 1.1;
  margin: 0;
}

.brand span {
  color: #b8c9c1;
  display: block;
  font-size: 0.78rem;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button {
  width: 100%;
  color: #dfe9e4;
  background: transparent;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #8ce2d3;
}

.session-card {
  margin-top: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.session-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #d8ece7;
  color: #0f5e52;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.avatar.large {
  width: 58px;
  height: 58px;
}

.session-user strong,
.user-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-pill,
.status-pill,
.priority-pill,
.type-pill,
.tiny-pill {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.role-pill {
  font-size: 0.72rem;
  padding: 5px 8px;
  background: #edf4ef;
  color: #305445;
}

.sidebar .role-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #dfeee8;
}

.status-pill {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.status-open {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-progress {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.status-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-close {
  color: var(--green);
  background: var(--green-soft);
}

.priority-pill {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.priority-medium {
  color: var(--blue);
  background: var(--blue-soft);
}

.priority-urgent {
  color: var(--amber);
  background: var(--amber-soft);
}

.priority-critical {
  color: var(--red);
  background: var(--red-soft);
}

.type-pill {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.type-client {
  color: var(--blue);
  background: var(--blue-soft);
}

.type-developer {
  color: #5140b8;
  background: #ece9ff;
  border: 1px solid #d5cffd;
}

.developer-alert {
  color: #5140b8;
  background: #ece9ff;
  border: 1px solid #d5cffd;
}

.unread-alert {
  color: white;
  background: var(--red);
}

@keyframes pulse-alert {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(185, 60, 60, 0.36);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(185, 60, 60, 0);
  }
}

.blink-alert {
  animation: pulse-alert 0.9s infinite;
}

.tiny-pill {
  font-size: 0.72rem;
  color: var(--muted);
  background: #eef3ef;
  padding: 4px 8px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.clock-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -8px 0 16px;
  padding: 8px 0;
  background: rgba(245, 247, 244, 0.92);
  backdrop-filter: blur(10px);
}

.digital-clock {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(31, 43, 36, 0.07);
}

.digital-clock span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.digital-clock strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.1;
}

.page-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: #edf3ef;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.btn:hover {
  border-color: #b9c9c0;
}

.btn.primary {
  background: var(--brand);
  color: white;
}

.btn.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn.pos-checklist-action {
  background: var(--blue);
  border-color: #255e87;
  color: #fff;
}

.btn.pos-checklist-action:hover {
  background: #245d85;
  border-color: #1f4f71;
}

.btn.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
}

.btn.small {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 0.82rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #edf3ef;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  outline: 1px solid #b9c9c0;
}

.alert-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid #e5c98f;
  background: #fff8eb;
  color: #684100;
  cursor: pointer;
}

.alert-strip strong {
  display: block;
}

.alert-strip:hover {
  border-color: #d4a74b;
  box-shadow: 0 10px 24px rgba(104, 65, 0, 0.08);
}

.grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.tickets-stack {
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 18px;
}

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

.panel-title {
  margin: 0;
  font-size: 1rem;
}

.panel-body {
  padding: 18px;
}

.stat {
  padding: 16px;
  min-height: 112px;
}

.stat-link {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.stat-link:hover {
  border-color: #9dbdb2;
  transform: translateY(-1px);
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.stat small {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(7, minmax(118px, 0.6fr));
  gap: 10px;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #33443b;
  font-size: 0.82rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #cdd8d0;
  background: white;
  color: var(--ink);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 11px;
  outline: none;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 139, 120, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.assignee-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.assignee-choice {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.assignee-choice:hover {
  border-color: #b8d0c7;
}

.assignee-choice input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.assignee-choice .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

.assignee-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-all {
  grid-column: 1 / -1;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: #b9d8cf;
}

.ticket-settings-form {
  display: grid;
  gap: 12px;
}

.security-section {
  margin-bottom: 20px;
}

.security-form {
  display: grid;
  gap: 14px;
  max-width: 780px;
}

.security-form > button {
  justify-self: start;
}

.recovery-codes {
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.recovery-codes pre {
  white-space: pre-wrap;
  line-height: 1.8;
  letter-spacing: 0;
}

.security-section .audit-list {
  max-height: 420px;
  overflow-y: auto;
}

.ticket-settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-list-scroll {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.ticket-list-scroll .ticket-item {
  min-height: 104px;
}

.ticket-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ticket-item.ticket-client {
  border-left-color: #6aa7c8;
}

.ticket-item.ticket-developer {
  border-left-color: #6b5ce7;
  background: linear-gradient(90deg, #f4f2ff 0, #fff 34%);
}

.ticket-item:hover,
.ticket-item.active {
  transform: translateY(-1px);
  border-color: #9dbdb2;
}

.ticket-item.ticket-developer:hover,
.ticket-item.ticket-developer.active {
  border-color: #7b6df0;
  box-shadow: 0 12px 32px rgba(81, 64, 184, 0.13);
}

.ticket-item h3 {
  margin: 0;
  font-size: 1rem;
}

.ticket-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.ticket-actions {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
}

.pending-badge {
  color: #7b4a00;
  background: #fff1d5;
  border: 1px solid #f2d293;
}

.sla-pill {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.closed-ticket-notice {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #f0c0c0;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
}

.closed-ticket-notice span {
  font-size: 0.9rem;
}

.developer-checklist-gate {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #f2d293;
  background: #fff8eb;
}

.developer-checklist-gate.ready {
  border-color: #b9d8cf;
  background: var(--green-soft);
}

.developer-checklist-gate div {
  display: grid;
  gap: 4px;
}

.developer-checklist-gate strong {
  color: #2f3f36;
}

.developer-checklist-gate span {
  color: var(--muted);
  font-size: 0.9rem;
}

.reopen-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9d8cf;
  border-radius: 8px;
  background: #f0faf6;
}

.detail-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 26px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.detail-head h2 {
  margin: 0;
  font-size: 1.18rem;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.ticket-info-column,
.ticket-work-column {
  min-width: 0;
}

.ticket-detail-developer {
  border-top: 4px solid #6b5ce7;
  background: linear-gradient(180deg, #f8f7ff 0, #fff 120px);
}

.ticket-detail-client {
  border-top: 4px solid #6aa7c8;
}

.key-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kv {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.kv span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kv strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.note-list {
  display: grid;
  gap: 10px;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.activity-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
}

.activity-item summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.activity-item summary span,
.activity-item summary small {
  color: var(--muted);
}

.activity-item summary em {
  color: var(--brand-strong);
  font-style: normal;
  font-weight: 800;
}

.activity-item p {
  margin: 10px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.audit-list,
.attachment-list,
.quick-replies,
.checklist-box,
.checklist-summary {
  display: grid;
  gap: 10px;
}

.audit-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.audit-item span,
.audit-item small,
.attachment-item span {
  color: var(--muted);
}

.audit-item p {
  margin: 5px 0;
  white-space: pre-wrap;
}

.attachment-list {
  margin-top: 12px;
}

.attachment-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: var(--panel-soft);
}

.attachment-item:hover {
  border-color: #9dbdb2;
}

.quick-replies {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.checklist-box {
  margin-top: 14px;
}

.checklist-summary span {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-weight: 800;
}

.checklist-summary .ok {
  color: var(--green);
  background: var(--green-soft);
}

.checklist-summary .missing {
  color: var(--red);
  background: var(--red-soft);
}

.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.note p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.note-meta {
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ticket-image {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: #eef3ef;
  cursor: zoom-in;
  padding: 0;
}

.ticket-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.ticket-work-column .chat-list {
  max-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfb;
  scrollbar-gutter: stable;
}

.chat-focus,
.ticket-detail-focus {
  border-radius: 8px;
  animation: chat-focus-flash 1.1s ease-in-out 2;
}

@keyframes chat-focus-flash {
  0%, 100% {
    background: transparent;
    box-shadow: none;
  }
  45% {
    background: #fff8eb;
    box-shadow: 0 0 0 4px rgba(196, 123, 23, 0.16);
  }
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.chat-message.incoming {
  border-color: #b9d8cf;
  background: #f0faf6;
}

.chat-message.outgoing {
  background: #f8fafc;
}

.chat-message p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  gap: 10px;
}

.chat-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.chat-image {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  background: #eef3ef;
  cursor: zoom-in;
}

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

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
  display: grid;
  gap: 12px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.user-card dt {
  font-weight: 800;
  color: #3f4f45;
}

.user-card dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.user-password-box {
  display: grid;
  gap: 10px;
  border: 1px solid #d8e7df;
  border-radius: 8px;
  background: #f6fbf8;
  padding: 10px;
}

.user-password-box span {
  display: block;
  color: #3f4f45;
  font-size: 0.78rem;
  font-weight: 800;
}

.user-password-box p {
  margin: 0;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-photo-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.user-photo-preview img {
  width: min(100%, 340px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 0 auto;
}

.backup-list {
  display: grid;
  gap: 10px;
}

.backup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.backup-card p {
  color: var(--muted);
  margin: 6px 0 0;
}

.updates-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.update-cleanup-note {
  margin-bottom: 0;
}

.update-folder-list,
.update-file-list {
  display: grid;
  gap: 10px;
}

.update-folder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 13px;
  cursor: pointer;
}

.update-folder-item:hover,
.update-folder-item.active {
  border-color: #78b8aa;
  background: #f1faf7;
}

.update-folder-item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.update-folder-item p {
  color: var(--muted);
  margin: 6px 0 8px;
  overflow-wrap: anywhere;
}

.update-detail-panel {
  min-height: 360px;
}

.update-summary {
  margin-top: 14px;
}

.update-file-list {
  margin-top: 12px;
}

.update-file-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.update-file-icon,
.update-file-item img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--blue-soft);
}

.update-file-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
}

.update-file-item img {
  object-fit: cover;
}

.update-file-main {
  min-width: 0;
}

.update-file-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.update-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.update-stats {
  margin-top: 16px;
}

.update-audit-panel {
  margin-top: 16px;
}

.panel-header.inline {
  padding: 0 0 14px;
  margin-bottom: 12px;
}

.audit-toggle {
  padding: 8px 10px;
  min-width: 230px;
}

.kb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.kb-list {
  display: grid;
  gap: 12px;
}

.kb-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.kb-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.kb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.kb-item h3 {
  margin: 0 0 8px;
}

.kb-item p {
  color: var(--muted);
  margin: 0;
  white-space: pre-wrap;
}

.kb-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.kb-image-wrap {
  position: relative;
  min-width: 0;
}

.kb-image-btn {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef3ef;
  cursor: zoom-in;
  padding: 0;
}

.kb-image-btn:hover {
  outline: 2px solid rgba(15, 139, 120, 0.35);
}

.kb-image-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-image-remove {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  background: rgba(255, 232, 232, 0.95);
  color: var(--red);
  border: 1px solid rgba(185, 60, 60, 0.18);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 8px;
}

.current-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.current-image-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.current-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.current-image-item span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.image-modal {
  width: min(980px, 100%);
}

.image-preview {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: #101714;
}

.pos-checklist-list {
  display: grid;
  gap: 12px;
}

.pos-checklist-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--panel);
}

.pos-checklist-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.pos-checklist-head h3 {
  margin: 0 0 7px;
  font-size: 0.98rem;
}

.pos-checklist-open {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #6b4100;
  font-size: 0.84rem;
  font-weight: 700;
}

.pos-checklist-open.done {
  background: var(--green-soft);
  color: var(--green);
}

.pos-checklist-reminder {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.pos-checklist-signature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #33443b;
  font-size: 0.84rem;
  font-weight: 800;
}

.pos-checklist-admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-checklist-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 96px));
  gap: 8px;
}

.pos-checklist-evidence .kb-image-btn {
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.approval-rejected {
  color: var(--red);
  background: var(--red-soft);
}

.pos-checklist-form {
  display: grid;
  gap: 10px;
}

.pos-checklist-question {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.pos-checklist-question legend {
  padding: 0 4px;
  color: #33443b;
  font-size: 0.86rem;
  font-weight: 800;
}

.pos-checklist-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pos-checklist-options label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #cdd8d0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.pos-checklist-options input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(15, 139, 120, 0.1), transparent 38%),
    linear-gradient(315deg, rgba(196, 123, 23, 0.12), transparent 32%),
    var(--bg);
}

.login-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.login-visual {
  background: #1f2d27;
  color: white;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 520px;
}

.login-logo {
  width: min(320px, 82%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin: 0;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.login-visual h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.login-visual p {
  color: #cbd9d3;
  max-width: 28rem;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.login-stats div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.login-stats strong {
  display: block;
  font-size: 1.4rem;
}

.login-form {
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.login-form h2 {
  margin: 0;
  font-size: 1.6rem;
}

.hint {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}

.message {
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 700;
}

.message.ok {
  background: var(--green-soft);
  color: var(--green);
}

.message.error {
  background: var(--red-soft);
  color: var(--red);
}

.message.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.security-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2d27;
  color: white;
  box-shadow: 0 18px 45px rgba(31, 43, 36, 0.22);
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.security-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 28, 23, 0.48);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal {
  width: min(820px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.modal.small {
  width: min(520px, 100%);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #bdcbc1;
  border-radius: 8px;
  background: var(--panel-soft);
}

.empty-state.compact {
  padding: 12px;
  text-align: left;
}

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

@media (max-width: 1060px) {
  .stats-grid,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col,
  .ticket-detail-grid,
  .updates-grid,
  .kb-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-card {
    margin-top: 0;
  }

  .main {
    padding: 18px;
  }

  .clock-bar {
    justify-content: stretch;
    overflow-x: auto;
  }

  .digital-clock {
    min-width: 124px;
    flex: 1 0 124px;
  }

  .topbar,
  .detail-head,
  .developer-checklist-gate,
  .pos-checklist-signature,
  .update-file-item,
  .alert-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .update-file-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .update-file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: auto;
  }

  .form-grid,
  .key-values,
  .stats-grid,
  .assignee-checklist,
  .pos-checklist-options,
  .filters {
    grid-template-columns: 1fr;
  }

  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .ticket-item {
    grid-template-columns: 1fr;
  }

  .pos-checklist-head {
    grid-template-columns: 1fr;
  }

  .ticket-actions {
    justify-items: start;
  }

  .update-folder-item {
    grid-template-columns: 1fr;
  }

  .activity-item summary {
    grid-template-columns: 1fr;
  }

  .kb-item-head,
  .kb-actions {
    justify-content: flex-start;
  }

  .kb-item-head {
    flex-direction: column;
  }

  .backup-card {
    grid-template-columns: 1fr;
  }

  .login-form,
  .login-visual {
    padding: 22px;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
}
