/* Shared widgets: meta items, status badges, empty/error states, skeletons. */

/* line-height matches the 14px icon so text and icon share a box and center
   together — otherwise the extra leading drops the icon below the text. */
.meta-item { display: inline-flex; align-items: center; gap: 4px; line-height: 14px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-progress { color: #bb6a00; background: #fdf4e3; }
.badge-done { color: #18794e; background: #e7f5ee; }
.badge-blocked { color: #cd2b41; background: #fdecef; }
.badge-info { color: #3a5bd9; background: #eef1fd; }
.badge-neutral { color: #5a5f6e; background: #f0f1f4; }

/* Empty / error states */
.state-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; }
.state-empty .ico-lg { color: var(--border-strong); }
.state-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.state-sub { font-size: 12.5px; color: var(--text-3); }

.state-error { display: flex; gap: 12px; align-items: flex-start; margin: 10px; padding: 14px 16px; background: #fdecef; border: 1px solid #f6d2d8; border-radius: var(--r-md); }
.state-error .ico { color: #cd2b41; margin-top: 1px; }
.state-error .state-title { color: #a51d30; }
.state-error .state-sub { color: #b04a57; word-break: break-word; }

/* Skeletons */
.skel { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel-line { height: 12px; }
.skel-line-lg { height: 24px; }
.skel-bar { height: 5px; border-radius: 999px; }
.skel-block { height: 64px; border-radius: var(--r-md); }
.w40 { width: 40%; }
.w60 { width: 60%; }
.w80 { width: 80%; }
.skel-card { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 13px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.detail-skel { display: flex; flex-direction: column; gap: 14px; padding: 24px 28px; }

/* Sync button */
.sync-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease; }
.sync-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.sync-btn:disabled { opacity: 0.6; cursor: default; }
.sync-btn .ico, .sync-btn .ico svg { width: 15px; height: 15px; }
.sync-label { line-height: 15px; }
.sync-btn.is-busy .ico svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Topbar search (shown only when a project is selected) */
.search-box { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease; }
.search-box[hidden] { display: none; }
.search-box:focus-within { border-color: var(--accent); }
/* Active filter: a persistent accent cue (accent border + 1px inset ring ≈ the
   active task card's 2px ring) plus a soft accent fill, so it's clear the list is
   filtered even when the field is not focused — mirrors .card.is-active. */
.search-box.is-filtering { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.search-box .ico, .search-box .ico svg { width: 15px; height: 15px; color: var(--text-3); }
.search-box.is-filtering .ico, .search-box.is-filtering .ico svg { color: var(--accent); }
.search-input { width: 180px; min-width: 0; font: inherit; font-size: 13px; color: var(--text); background: none; border: 0; outline: none; padding: 0; }
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 80vw; padding: 10px 16px; font-size: 13px; border-radius: var(--r-md); box-shadow: var(--shadow-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.toast-error { background: #fdecef; border-color: #f6d2d8; color: #a51d30; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(20, 22, 35, 0.32); padding: 20px; }
.modal-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 18px 20px; }
.modal-head { display: flex; align-items: center; gap: 8px; }
.modal-head .ico { color: #cd2b41; }
.modal-title { font-size: 15px; font-weight: 650; }
.modal-sub { margin: 8px 0 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.modal-list { list-style: none; margin: 0 0 16px; padding: 0; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.modal-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.modal-item-name { font-size: 13px; font-weight: 600; }
.modal-item-path { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); background: none; border: 0; padding: 0; word-break: break-all; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn { height: 32px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 550; border-radius: var(--r-md); border: 1px solid var(--border); cursor: pointer; }
.btn-ghost { background: var(--surface); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #cd2b41; border-color: #cd2b41; color: #fff; }
.btn-danger:hover { background: #b5243a; }
