/* Spark Agency HR — Team desk (v41): daily reports, issues, requests, messages */
@media screen {
  /* Menu badges */
  .dk-nav button {
    position: relative;
  }
  .dk-nav .dk-nav-label {
    flex: 1;
  }
  .dk-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0a9a9c;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .dk-badge[data-tone="hot"] {
    background: #ef4444;
    animation: dk-pulse 2s ease-in-out infinite;
  }
  .dk-badge[data-tone="warn"] {
    background: #f59e0b;
  }
  @keyframes dk-pulse {
    0%, 100% { box-shadow: 0 0 0 0 #ef444466; }
    50% { box-shadow: 0 0 0 5px #ef444400; }
  }

  .dk-page {
    --dk-teal: #0a9a9c;
    --dk-ink: #0f2a33;
  }
  .dk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .dk-toolbar input[type="search"] {
    flex: 1 1 200px;
    max-width: 320px;
    margin: 0;
  }
  .dk-toolbar > button:last-child {
    margin-left: auto;
  }
  .dk-icon-btn {
    min-width: 40px;
    font-size: 20px;
    line-height: 1;
    padding: 6px 10px;
  }
  .dk-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
  }
  .dk-date input {
    margin: 0;
  }
  .dk-count {
    color: var(--text-2);
  }
  .dk-count b {
    color: var(--dk-ink);
    font-size: 18px;
  }
  .dk-n {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dfe9e8;
    font-size: 11.5px;
    font-weight: 700;
  }
  .dk-empty {
    text-align: center;
    padding: 36px 20px;
  }
  .dk-empty h3 {
    margin: 0 0 6px;
  }
  .dk-empty p {
    margin: 0 auto;
    max-width: 520px;
    color: var(--text-2);
  }
  .dk-pad {
    padding: 14px;
  }

  /* Avatars and chips */
  .dk-avatar {
    --h: 180;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--h) 55% 88%);
    color: hsl(var(--h) 55% 28%);
    font-weight: 800;
    font-size: 14px;
  }
  .dk-avatar.pair {
    background: #e0e7ff;
    color: #3730a3;
  }
  .dk-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef3f2;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .dk-chip.new,
  .dk-chip.st-pending {
    background: #dbeafe;
    color: #1e40af;
  }
  .dk-chip.ok,
  .dk-chip.st-approved,
  .dk-chip.s-resolved {
    background: #d1fae5;
    color: #065f46;
  }
  .dk-chip.warn,
  .dk-chip.s-progress {
    background: #fef3c7;
    color: #92400e;
  }
  .dk-chip.st-rejected,
  .dk-chip.s-open {
    background: #fee2e2;
    color: #991b1b;
  }
  .dk-chip.st-cancelled {
    background: #f1f5f9;
    color: #64748b;
  }
  .dk-reply {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0f7f7;
    border-left: 3px solid var(--dk-teal);
    font-size: 13.5px;
  }

  /* ----- Daily reports (main system) ----- */
  .dk-missing {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }
  .dk-report.missing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px dashed #f0c46b;
    border-radius: 14px;
    background: #fffbeb;
  }
  .dk-report.missing div {
    display: grid;
    gap: 2px;
    justify-items: start;
  }
  .dk-report.missing small {
    color: var(--text-2);
    font-size: 12px;
  }
  .dk-reports {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
    align-items: start;
  }
  .dk-report:not(.missing) {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    border-top: 4px solid #3b82f6;
    background: #fff;
    box-shadow: 0 6px 18px -12px #0f2a3340;
    animation: dk-rise 0.35s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  }
  .dk-report.seen {
    border-top-color: #10b981;
  }
  @keyframes dk-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .dk-report header,
  .dk-request header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: static !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }
  .dk-report header div,
  .dk-request header div {
    display: grid;
    flex: 1;
    min-width: 0;
  }
  .dk-report header small,
  .dk-request header small {
    color: var(--text-2);
    font-size: 12.5px;
  }
  .dk-report-body h4 {
    margin: 8px 0 2px;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 700;
  }
  .dk-report-body p {
    margin: 0;
    line-height: 1.5;
  }
  .dk-problems {
    margin-top: 8px;
    padding: 2px 12px 10px;
    border-radius: 10px;
    background: #fff7ed;
    border-left: 3px solid #f97316;
  }
  .dk-problems h4 {
    color: #c2410c;
  }
  .dk-report footer {
    display: flex;
    gap: 8px;
    position: static !important;
    inset: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 0 0 !important;
    border-top: 1px solid var(--line);
    background: none !important;
  }
  .dk-report footer input {
    flex: 1;
    margin: 0;
    min-width: 0;
  }
  .dk-report footer button {
    margin: 0;
    white-space: nowrap;
  }

  /* ----- Daily report (user) ----- */
  .dk-split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
  .dk-report-form {
    display: grid;
    gap: 10px;
  }
  .dk-report-form textarea {
    width: 100%;
    resize: vertical;
  }
  .dk-form-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .dk-form-head h2 {
    margin: 0;
  }
  .dk-form-head label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
  }
  .dk-form-head select {
    margin: 0;
  }
  .dk-hours input {
    max-width: 140px;
  }
  .dk-report-form > button {
    justify-self: start;
  }
  .dk-sent {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13.5px;
  }
  .dk-history {
    display: grid;
    gap: 10px;
    max-height: 760px;
    overflow: auto;
  }
  .dk-history h2 {
    margin: 0;
  }
  .dk-hist {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .dk-hist header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: static !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }
  .dk-hist p {
    margin: 6px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .dk-hist .dk-reply {
    -webkit-line-clamp: unset;
    display: block;
  }

  /* ----- Issues ----- */
  .dk-issues {
    display: grid;
    gap: 10px;
  }
  .dk-issue {
    padding: 0;
    overflow: hidden;
    border-left: 5px solid #94a3b8;
  }
  .dk-issue.p-urgent { border-left-color: #dc2626; }
  .dk-issue.p-high { border-left-color: #f97316; }
  .dk-issue.p-normal { border-left-color: #3b82f6; }
  .dk-issue.p-low { border-left-color: #94a3b8; }
  .dk-issue.s-resolved {
    border-left-color: #10b981;
    opacity: 0.85;
  }
  .dk-issue-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    text-align: left;
    min-height: 0;
  }
  .dk-issue-head:hover {
    background: #f8fbfb;
  }
  .dk-prio {
    padding: 2px 8px;
    border-radius: 6px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11.5px;
    font-weight: 800;
  }
  .p-urgent .dk-prio { background: #fee2e2; color: #b91c1c; }
  .p-high .dk-prio { background: #ffedd5; color: #c2410c; }
  .p-low .dk-prio { background: #f1f5f9; color: #64748b; }
  .dk-issue-title {
    display: grid;
    min-width: 0;
  }
  .dk-issue-title b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dk-issue-title small,
  .dk-age {
    color: var(--text-2);
    font-size: 12.5px;
  }
  .dk-issue-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
    animation: dk-rise 0.25s ease both;
  }
  .dk-issue-body > p {
    line-height: 1.55;
  }
  .dk-resolution {
    padding: 10px 14px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
  }
  .dk-resolution h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    color: #047857;
  }
  .dk-resolution p {
    margin: 0;
  }
  .dk-resolution small {
    color: var(--text-2);
  }
  .dk-timeline {
    list-style: none;
    margin: 12px 0;
    padding: 0 0 0 16px;
    border-left: 2px solid #dbe7e6;
  }
  .dk-timeline li {
    position: relative;
    margin: 0 0 10px;
  }
  .dk-timeline li::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--dk-teal);
  }
  .dk-timeline small {
    color: var(--text-2);
  }
  .dk-timeline p {
    margin: 2px 0 0;
  }
  .dk-note-form {
    display: flex;
    gap: 8px;
  }
  .dk-note-form input {
    flex: 1;
    margin: 0;
  }
  .dk-note-form button {
    margin: 0;
  }
  .dk-issue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  .dk-issue-actions button {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  /* ----- Requests ----- */
  .dk-requests {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
    align-items: start;
  }
  .dk-request {
    display: grid;
    gap: 6px;
    border-top: 4px solid #3b82f6;
  }
  .dk-request.st-approved { border-top-color: #10b981; }
  .dk-request.st-rejected { border-top-color: #ef4444; }
  .dk-request.st-cancelled { border-top-color: #cbd5e1; opacity: 0.8; }
  .dk-request > p {
    margin: 0;
    line-height: 1.5;
  }
  .dk-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .dk-facts span {
    padding: 3px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    font-weight: 700;
    font-size: 13px;
  }
  .dk-request footer {
    display: flex;
    gap: 8px;
    position: static !important;
    inset: auto !important;
    height: auto !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    background: none !important;
  }
  .dk-request footer:empty {
    display: none;
  }
  .dk-request footer button,
  button.dk-approve {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  button.dk-approve {
    background: #059669;
    border-color: #059669;
    color: #fff;
  }

  /* ----- Messages ----- */
  .dk-chat {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    height: calc(100vh - 170px);
    min-height: 480px;
  }
  .dk-threads,
  .dk-room {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  .dk-threads-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
  }
  .dk-threads-head h2 {
    margin: 0;
    font-size: 18px;
  }
  .dk-threads-head button {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .dk-threads-list {
    flex: 1;
    overflow: auto;
    padding: 6px;
  }
  .dk-thread {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 2px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    box-shadow: none;
    color: inherit;
    text-align: left;
    min-height: 0;
  }
  .dk-thread:hover {
    background: #f3f8f7;
  }
  .dk-thread.active {
    background: #e3f3f2;
  }
  .dk-thread-text {
    display: grid;
    min-width: 0;
  }
  .dk-thread-text b,
  .dk-thread-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dk-thread-text small {
    color: var(--text-2);
    font-size: 12.5px;
  }
  .dk-thread.unread .dk-thread-text small {
    color: var(--dk-ink);
    font-weight: 700;
  }
  .dk-thread-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
  }
  .dk-thread-meta small {
    color: var(--text-2);
    font-size: 11.5px;
  }
  .dk-room-head {
    display: flex !important;
    align-items: center;
    gap: 10px;
    position: static !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--line);
    background: none !important;
    box-shadow: none !important;
  }
  .dk-room-head div {
    display: grid;
  }
  .dk-room-head small {
    color: var(--text-2);
    font-size: 12.5px;
  }
  .dk-back {
    display: none;
    margin: 0;
    padding: 6px 8px;
  }
  .dk-chat-scroll {
    flex: 1;
    overflow: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background:
      radial-gradient(circle at 20% 10%, #f1f8f7 0, transparent 40%),
      radial-gradient(circle at 90% 90%, #f4f6fb 0, transparent 40%),
      #fbfdfd;
  }
  .dk-day-sep {
    display: flex;
    justify-content: center;
    margin: 8px 0;
  }
  .dk-day-sep span {
    padding: 2px 10px;
    border-radius: 999px;
    background: #e8efee;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 700;
  }
  .dk-msg {
    max-width: min(560px, 78%);
    padding: 8px 12px 6px;
    border-radius: 16px 16px 16px 4px;
    background: #fff;
    border: 1px solid #e3ebea;
    align-self: flex-start;
    animation: dk-msg-in 0.22s ease-out both;
  }
  .dk-msg.mine {
    align-self: flex-end;
    border-radius: 16px 16px 4px 16px;
    background: linear-gradient(135deg, #0a9a9c, #0b8486);
    border-color: transparent;
    color: #fff;
  }
  .dk-msg.mine.alt {
    background: #eef2ff;
    border-color: #dfe5fb;
    color: inherit;
  }
  @keyframes dk-msg-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
  .dk-msg p {
    margin: 0;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .dk-msg > small {
    display: block;
    margin-top: 2px;
    text-align: right;
    font-size: 10.5px;
    opacity: 0.7;
  }
  .dk-who {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: #3730a3;
    margin-bottom: 2px;
  }
  .dk-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: #fff;
  }
  .dk-compose textarea {
    flex: 1;
    margin: 0;
    resize: none;
    min-height: 42px;
    max-height: 160px;
    border-radius: 14px;
  }
  .dk-compose button {
    margin: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
  }
  .dk-readonly {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
    color: var(--text-2);
    font-size: 13px;
  }
  .dk-hello {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: auto;
    color: var(--text-2);
    text-align: center;
  }
  .dk-hello.big {
    flex: 1;
    align-content: center;
  }
  .dk-hello svg {
    color: #9fbcbb;
  }

  /* Who can talk matrix */
  dialog.dk-dialog:has(.dk-links) {
    width: min(860px, calc(100vw - 32px));
    max-width: none;
  }
  .dk-matrix {
    border-collapse: separate;
    border-spacing: 0;
  }
  .dk-matrix th,
  .dk-matrix td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid var(--line);
  }
  .dk-matrix tbody th {
    text-align: left;
    white-space: nowrap;
  }
  .dk-matrix thead th span {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 140px;
    white-space: nowrap;
    font-size: 12.5px;
  }
  .dk-matrix td.dk-x {
    background: #f6f8f8;
    color: #c0cccc;
  }
  .dk-cell {
    display: grid;
    place-items: center;
    margin: 0;
    cursor: pointer;
  }
  .dk-cell input {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  @media (max-width: 1000px) {
    .dk-split {
      grid-template-columns: 1fr;
    }
  }
  @media (max-width: 800px) {
    .dk-chat {
      grid-template-columns: 1fr;
      height: calc(100vh - 150px);
    }
    .dk-chat .dk-room {
      display: none;
    }
    .dk-chat.show-chat .dk-threads {
      display: none;
    }
    .dk-chat.show-chat .dk-room {
      display: flex;
    }
    .dk-back {
      display: inline-grid;
    }
    .dk-reports,
    .dk-requests {
      grid-template-columns: 1fr;
    }
    .dk-issue-head {
      grid-template-columns: minmax(0, 1fr) auto;
    }
    .dk-issue-head .dk-prio {
      grid-column: 1 / -1;
      justify-self: start;
    }
    .dk-age {
      display: none;
    }
    .dk-toolbar > button:last-child {
      margin-left: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .dk-page *,
    .dk-badge {
      animation: none !important;
    }
  }
}
@media screen {
  .dk-page small,
  .dk-dialog small,
  .dk-nav small {
    letter-spacing: 0;
  }
}
@media screen {
  .dk-room-head {
    justify-content: flex-start !important;
    text-align: left;
  }
}

/* v42: requests with branch, photos and On hold */
@media screen {
  .dk-req-head {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .dk-req-head > div {
    display: grid;
    flex: 1;
    min-width: 0;
  }
  .dk-req-sub {
    color: var(--text-2, #64748b);
    font-size: 12.5px;
  }
  .dk-req-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  .dk-req-actions:empty {
    display: none;
  }
  .dk-req-actions button {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .dk-request.st-hold {
    border-top-color: #f59e0b;
  }
  .dk-chip.st-hold {
    background: #fef3c7;
    color: #92400e;
  }
  button.dk-hold {
    color: #92400e;
    background: #fef3c7;
  }
  .dk-req-files {
    margin-top: 2px;
  }
}
/* v55 — someone who answers daily reports / requests switches between everyone's and their own */
.dk-mine { margin-bottom: 12px; }
