/* Packet / Capsule program (Story 2378). Rides on picasso-base.css tokens. */

.pk-shell { display: flex; flex-direction: column; min-height: 100vh; }

.ct-header { position: relative; }
.ct-header .ct-sub { color: #b9b3d6; font-size: 13px; margin-top: 2px; }

.pk-view { padding: 14px 16px 40px; max-width: 1000px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* ---- buttons ---- */
.pk-btn { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 8px; border: 1px solid #cfc9e6;
    background: #fff; color: #2f2a52; cursor: pointer; }
.pk-btn:hover { background: #f3f1fb; }
.pk-btn.primary { background: #2f2a52; color: #fff; border-color: #2f2a52; }
.pk-btn.primary:hover { background: #423b73; }
.pk-btn.ghost { border-color: transparent; background: transparent; }
.pk-btn.danger { color: #b3261e; border-color: #e6c4c1; }
.pk-btn.danger:hover { background: #fbeceb; }
.pk-btn.small { padding: 5px 10px; font-size: 13px; }

/* ---- list ---- */
.pk-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pk-filter { min-width: 180px; }
.pk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pk-card { border: 1px solid #e3dff3; border-radius: 12px; padding: 14px; background: #fff; cursor: pointer;
    transition: box-shadow .12s, transform .12s; position: relative; }
.pk-card:hover { box-shadow: 0 4px 16px rgba(47,42,82,.14); transform: translateY(-1px); }
.pk-card .pk-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #7a72a8; }
.pk-card h3 { margin: 4px 0 8px; font-size: 17px; color: #201c3a; }
.pk-card .pk-cardmeta { font-size: 12px; color: #8a84a6; margin-bottom: 10px; }
.pk-card .pk-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-chip { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #f0edfb; color: #4a4276; }
.pk-chip.warn { background: #fff4e0; color: #8a5a00; }
.pk-star { position: absolute; top: 12px; right: 12px; color: #d9b100; font-size: 16px; }
.pk-empty { text-align: center; color: #8a84a6; padding: 40px 10px; font-style: italic; }

/* ---- detail ---- */
.pk-detailhead { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.pk-detailtitle { flex: 1 1 300px; min-width: 0; }
.pk-detailtitle .pk-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #7a72a8; }
.pk-detailtitle h2 { margin: 2px 0 4px; font-size: 22px; color: #201c3a; word-break: break-word; }
.pk-detailmeta { font-size: 13px; color: #8a84a6; }
.pk-detailactions { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-detailactions .pk-btn.on { background: #fff7d6; border-color: #e6d488; color: #7a5c00; }

/* ---- tabs ---- */
.pk-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e3dff3; margin-bottom: 16px; overflow-x: auto; }
.pk-tab { font: inherit; font-size: 14px; padding: 9px 14px; border: none; background: none; cursor: pointer;
    color: #6b6493; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.pk-tab.active { color: #2f2a52; font-weight: 600; border-bottom-color: #2f2a52; }
.pk-badge { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; padding: 0 5px;
    border-radius: 10px; background: #ece8f9; color: #5a5285; margin-left: 2px; }

.pk-panel { display: none; }
.pk-panel.active { display: block; }
.pk-panelbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pk-panelhint { font-size: 13px; color: #8a84a6; }

/* ---- overview ---- */
.pk-overview-summary { white-space: pre-wrap; background: #f7f6fb; border-left: 4px solid #2f2a52;
    padding: 12px 14px; border-radius: 0 8px 8px 0; margin: 10px 0; line-height: 1.55; }
.pk-field { margin: 8px 0; }
.pk-field .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #8a84a6; display: block; }
.pk-field .val { font-size: 15px; color: #221e3d; }

/* ---- generic list rows ---- */
.pk-list { display: flex; flex-direction: column; gap: 8px; }
.pk-row { border: 1px solid #e7e3f4; border-radius: 10px; padding: 10px 12px; background: #fff; }
.pk-row .pk-rowtop { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pk-row .pk-rowtitle { font-weight: 600; color: #221e3d; }
.pk-row .pk-rowsub { font-size: 12px; color: #8a84a6; }
.pk-row .pk-rowbody { margin-top: 4px; white-space: pre-wrap; color: #3a3555; font-size: 14px; }
.pk-row .pk-rowacts { display: flex; gap: 6px; }
.pk-linkbtn { font-size: 13px; color: #6a4bb3; background: none; border: none; cursor: pointer; padding: 2px 4px; }
.pk-linkbtn:hover { text-decoration: underline; }
.pk-linkbtn.del { color: #b3261e; }

/* ---- pending (collapsible, saved) ---- */
.pk-pending { display: flex; flex-direction: column; gap: 8px; }
.pk-pi { border: 1px solid #e7e3f4; border-left: 4px solid #c9a227; border-radius: 10px; background: #fffdf6; overflow: hidden; }
.pk-pi.status-InProgress { border-left-color: #1565c0; background: #f5f9ff; }
.pk-pi.status-Done { border-left-color: #2e7d32; background: #f4faf4; }
.pk-pi.status-NA { border-left-color: #9aa0a6; background: #f6f6f7; }
.pk-pi-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; }
.pk-pi-caret { transition: transform .12s; color: #8a84a6; font-size: 12px; flex: 0 0 auto; }
.pk-pi.collapsed .pk-pi-caret { transform: rotate(-90deg); }
.pk-pi-title { flex: 1 1 auto; font-weight: 600; color: #221e3d; min-width: 0; }
/* Story 5757: done is never struck through. A quieter title and a mark instead. */
.pk-pi.status-Done .pk-pi-title, .pk-pi.status-NA .pk-pi-title { color: #6b6685; font-weight: 500; }
.pk-pi.status-Done .pk-pi-title::before { content: "\2713  "; color: #2E7D32; font-weight: 700; }
.pk-pi.status-NA .pk-pi-title::before { content: "N/A  "; color: #6b6685; font-size: 11px; font-weight: 700; }
.pk-pi-status { font-size: 11px; padding: 2px 8px; border-radius: 12px; background: #eee; color: #444; flex: 0 0 auto; }
.pk-prio { font-size: 11px; flex: 0 0 auto; }
.pk-prio.p1 { color: #b3261e; }
.pk-pi-body { padding: 0 12px 12px 32px; }
.pk-pi.collapsed .pk-pi-body { display: none; }
.pk-pi-detail { white-space: pre-wrap; color: #3a3555; font-size: 14px; margin-bottom: 8px; }
.pk-pi-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- modal ---- */
.pk-modalback { position: fixed; inset: 0; background: rgba(20,16,40,.45); display: flex; align-items: center;
    justify-content: center; padding: 16px; z-index: 1000; }
.pk-modal { background: #fff; border-radius: 14px; padding: 18px 18px 14px; width: 100%; max-width: 460px;
    box-shadow: 0 12px 40px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.pk-modal h3 { margin: 0 0 12px; color: #201c3a; }
.pk-modal label { display: block; font-size: 13px; color: #6b6493; margin: 10px 0 3px; }
.pk-modal input[type=text], .pk-modal textarea, .pk-modal select, .pk-modal input[type=datetime-local] {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px;
    border: 1px solid #cfc9e6; border-radius: 8px; }
.pk-modal textarea { min-height: 90px; resize: vertical; }
.pk-modalfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 560px) {
    .pk-detailactions { width: 100%; }
    .pk-cards { grid-template-columns: 1fr; }
}
