/* --- Shared Card Grid for Good + Bad Deeds --- */
.jw-deed-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Card box styling */
.jw-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Title */
.jw-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Meta / badges */
.jw-card-meta {
    margin-bottom: 10px;
}
.jw-cat-badge {
    display: inline-block;
    background: #eef3ff;
    color: #333;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    margin-right: 5px;
}

/* Buttons row */
.jw-card-actions {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

/* Modal Wrapper */
#jw-deed-start-modal {
    position: fixed;
    z-index: 999999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    display: none;
}

/* Dim background */
#jw-deed-start-modal .jw-modal-overlay {
    background: rgba(0,0,0,0.55);
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
}

/* Modal box */
#jw-deed-start-modal .jw-modal-content {
    position: absolute;
    top: 5%; left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 720px;
    max-height: 90%;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Close button */
#jw-deed-start-modal .jw-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    float: right;
    cursor: pointer;
}

.jw-loading {
    text-align: center;
    padding: 20px;
    opacity: 0.8;
}


/* ---------------------------
   General Card Layout
--------------------------- */
.jw-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e2e2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ---------------------------
   Card Title + Meta
--------------------------- */
.jw-card-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #041E36; /* blue */
  margin-bottom: 4px;
}

.jw-card-meta {
  font-size: 11px;
  color: #555;
  margin-bottom: 8px;
}


/* ---------------------------
   Badges
--------------------------- */
.jw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.jw-badge {
  font-size: 0.75em;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 500;
  line-height: 1.4;
  display: inline-block;
  color: #fff;
}

.jw-badge-green { background: #003823; }  /* Primary green */
.jw-badge-blue  { background: #041E36; }  /* Blue */
.jw-badge-gold  { background: #533100; }  /* Gold */
.jw-badge-crimson { background: #531A00; } /* Crimson */

/* ---------------------------
   Card Excerpt
--------------------------- */
.jw-card-excerpt {
  font-size: 0.85em;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ---------------------------
   Stats Bar
--------------------------- */
.jw-statsbar {
  display: flex;
  justify-content: space-between;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.jw-stat {
  flex: 1;
  text-align: center;
}

.jw-stat-number {
  font-weight: 600;
  font-size: 1em;
  color: #041E36;
}

.jw-stat-emoji {
  font-size: 1.1em;
  margin: 2px 0;
}

.jw-stat-label {
  font-size: 0.7em;
  color: #666;
}

/* ---------------------------
   Actions
--------------------------- */
.jw-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jw-card-actions .button {
  flex: 1;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

/* Primary (Start button) */
.jw-card-actions .button-start {
  background: #003823;
  color: #fff;
  border: none;
}

.jw-card-actions .button-start:hover {
  background: #041E36;
}

/* Secondary (View button) */
.jw-card-actions .button-view {
  background: transparent;
  border: 1px solid #003823;
  color: #003823;
}

.jw-card-actions .button-view:hover {
  background: #003823;
  color: #fff;
}

/* ---------------------------
   List View
--------------------------- */
.jw-deed-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.jw-deed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.jw-deed-title {
  font-weight: 600;
  color: #041E36;
  text-decoration: none;
}

.jw-deed-title:hover {
  text-decoration: underline;
}

.jw-deed-meta {
  font-size: 0.8em;
  color: #666;
  margin-top: 2px;
}

.jw-deed-item .button-start {
  background: #003823;
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.85em;
}


/* =========================
   LAYOUT: Cards Grid
   ========================= */
.jw-deed-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
}
@media (max-width: 1200px) {
  .jw-deed-cards { grid-template-columns: repeat(3, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .jw-deed-cards { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .jw-deed-cards { grid-template-columns: 1fr; }
}

/* =========================
   FILTER BAR
   ========================= */
.jw-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px 0;
}
.jw-filter-bar label {
  font-size: 0.85em;
  color: #041E36;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jw-filter-bar select,
.jw-filter-bar input[type="search"] {
  padding: 6px 10px;
  font-size: 0.9em;
  border: 1px solid #ccd1d5;
  border-radius: 8px;
  min-width: 180px;
}
.jw-filter-bar .button,
.jw-filter-bar .button.button-toggle {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9em;
  border: 1px solid #003823;
  color: #003823;
  background: #fff;
}
.jw-filter-bar .button:hover,
.jw-filter-bar .button.button-toggle:hover {
  background: #003823;
  color: #fff;
}
@media (max-width: 768px) {
  .jw-filter-bar { flex-direction: column; align-items: stretch; }
  .jw-filter-bar select,
  .jw-filter-bar input[type="search"] { min-width: 100%; }
}

/* =========================
   CARD META: category badges + info line
   ========================= */
/* reuse your badge system for cat/subcat */
.jw-catline { margin-bottom: 6px; }
.jw-catline .jw-badge { margin-right: 6px; }
.jw-cat-badge    
{ 
	background: #dcedfd;
    color: #041E36;
    border-radius: 10px;
    font-size: 9px;
    padding: 2px 5px;
}
} 

/* blue */
.jw-subcat-badge { background: #533100; } /* gold */
.jw-metaline {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 10px;
}

/* =========================
   STATS (no emojis)
   ========================= */
.jw-stat-emoji { display: none !important; }
.jw-statsbar {
  display: flex;
  justify-content: space-between;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
}
.jw-stat-number { font-size: 0.95em; color: #041E36; }
.jw-stat-label  { font-size: 0.72em; color: #666; }

/* =========================
   ACTIONS: slimmer buttons
   ========================= */
.jw-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.jw-card-actions .button {
  flex: 1;
  border-radius: 6px;
  padding: 8px 10px;   /* slimmer */
  font-size: 0.85em;   /* slimmer */
  font-weight: 600;
}
.jw-card-actions .button-start {
    background: #d6feef;
    color: #003823;
    border: 1px solid #003823;
}
.jw-card-actions .button-start:hover { background: #003823; color:#fff; }
.jw-card-actions .button-view {
    background: #fff3ee;
    border: 1px solid #531A00;
    color: #531A00;
}
.jw-card-actions .button-view:hover { background: #531A00; color: #fff; }

/* =========================
   REFERENCE toggle + content
   ========================= */
.jw-ref-toggle {
  display: inline-block;
  margin: 6px 0 0;
  font-size: 0.85em;
  color: #003823;
  text-decoration: underline;
  cursor: pointer;
}
.jw-card-ref {
  display: none;
  font-size: 0.85em;
  color: #444;
  line-height: 1.45;
  margin-top: 8px;
}
.jw-card-ref.open { display: block; }

/* =========================
   LIST VIEW tweaks to match style
   ========================= */
.jw-deed-item { gap: 12px; }
.jw-deed-item .jw-badges { margin-top: 6px; }
.jw-deed-item .button-start {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85em;
}

/* =========================================
   Brand palette (optional helpers)
========================================= */
:root{
  --jw-green: #003823;
  --jw-blue:  #041E36;
  --jw-gold:  #533100;
  --jw-crimson:#531A00;
  --jw-bg:    #fff;
  --jw-muted: #666;
  --jw-border:#ccd1d5;
  --jw-soft:  #f6f8f9;
  --jw-focus: rgba(0,56,35,0.18);
}

/* =========================================
   Create forms shell
========================================= */
.jw-create-deed{
  background: var(--jw-bg);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 16px;
  margin-bottom: 24px;
}
.jw-create-deed > h3{
  margin: 0 0 12px 0;
  color: var(--jw-blue);
  font-weight: 700;
  letter-spacing: .2px;
}

/* =========================================
   Table → clean, responsive layout
   (keeps your <table> markup)
========================================= */
.jw-create-deed .form-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px; /* row gap */
}
.jw-create-deed .form-table tr{
  background: #fff;
}
.jw-create-deed .form-table th{
  width: 240px;
  vertical-align: top;
  padding: 6px 12px 0 0;
  font-weight: 600;
  color: var(--jw-blue);
  line-height: 1.3;
}
.jw-create-deed .form-table td{
  padding: 0;
}

/* Mobile: stack label above field */
@media (max-width: 768px){
  .jw-create-deed .form-table th{
    display:block;
    width:auto;
    padding:0 0 6px 0;
  }
  .jw-create-deed .form-table td{
    display:block;
  }
}

/* =========================================
   Inputs, selects, textareas
========================================= */
.jw-create-deed input[type="text"],
.jw-create-deed input[type="number"],
.jw-create-deed input[type="time"],
.jw-create-deed input[type="date"],
.jw-create-deed input[type="search"],
.jw-create-deed select,
.jw-create-deed textarea{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid var(--jw-border);
  border-radius: 8px;
  font-size: 0.95em;
  line-height: 1.4;
  background: #fff;
  color: #222;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.jw-create-deed .regular-text{
  max-width: 520px; /* keep WP class in check */
}
.jw-create-deed textarea.large-text{
  max-width: 100%;
  min-height: 110px;
}
.jw-create-deed select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--jw-blue) 50%),
    linear-gradient(135deg, var(--jw-blue) 50%, transparent 50%),
    linear-gradient(to right, #fff, #fff);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 2.2em) 0.4em;
  background-size: 6px 6px, 6px 6px, 1px 2em;
  background-repeat: no-repeat;
  padding-right: 2.2em;
}

.jw-create-deed input:focus,
.jw-create-deed select:focus,
.jw-create-deed textarea:focus{
  outline: none;
  border-color: var(--jw-green);
  box-shadow: 0 0 0 3px var(--jw-focus);
}

.jw-create-deed .description{
  font-size: 0.85em;
  color: var(--jw-muted);
  margin: 6px 0 0;
}

/* Small inline width helpers already present in markup remain respected */

/* =========================================
   Section toggles (the conditional rows)
========================================= */
.jw-kf, .jw-bad-kind{
  transition: opacity .18s ease, height .18s ease;
}
.jw-kf[style*="display:none"],
.jw-bad-kind[style*="display:none"]{
  opacity: 0.0;
}

/* =========================================
   Repeater rows & icon buttons (+ / –)
========================================= */
.jw-row{
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
/* compact icon buttons */
.button.jw-occ-add-front,
.button.jw-occ-del-front,
.button.jw-month-del,
.button.jw-anchor-add-front,
.button.jw-anchor-del-front,
.button.jw-ts-add{
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
  font-weight: 700;
  font-size: 0.95em;
  border: 1px solid var(--jw-green);
  background: #fff;
  color: var(--jw-green);
}
.button.jw-occ-del-front,
.button.jw-month-del,
.button.jw-anchor-del-front{
  border-color: #d33;
  color: #d33;
}
.button.jw-occ-add-front:hover,
.button.jw-anchor-add-front:hover,
.button.jw-ts-add:hover{
  background: var(--jw-green);
  color: #fff;
}
.button.jw-occ-del-front:hover,
.button.jw-month-del:hover,
.button.jw-anchor-del-front:hover{
  background: #d33; color:#fff;
}

/* Inputs inside JW rows */
.jw-row input[type="text"],
.jw-row input[type="time"],
.jw-row select{
  max-width: 240px;
}

/* =========================================
   Weekday chips (works for existing labels and JS-generated)
   - Uses :has() for native check state if available
========================================= */
#jw-avoid-weekdays label,
#jw-limit-weekdays label,
.jw-per-weekly-front td label,
.jw-cb-weekly-front td label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 8px 4px 0;
  padding: 6px 10px;
  border: 1px solid var(--jw-border);
  border-radius: 999px;
  font-size: 0.9em;
  cursor: pointer;
  color: #222;
  user-select: none;
}
#jw-avoid-weekdays label:hover,
#jw-limit-weekdays label:hover,
.jw-per-weekly-front td label:hover,
.jw-cb-weekly-front td label:hover{
  border-color: var(--jw-green);
}
#jw-avoid-weekdays label:has(input:checked),
#jw-limit-weekdays label:has(input:checked),
.jw-per-weekly-front td label:has(input:checked),
.jw-cb-weekly-front td label:has(input:checked){
  background: var(--jw-green);
  color: #fff;
  border-color: var(--jw-green);
}

/* Hide native checkbox (still accessible) */
#jw-avoid-weekdays input[type="checkbox"],
#jw-limit-weekdays input[type="checkbox"],
.jw-per-weekly-front td input[type="checkbox"],
.jw-cb-weekly-front td input[type="checkbox"]{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   Monthly day/time rows (bad deed builders)
========================================= */
#jw-avoid-monthdays .jw-row,
#jw-limit-monthdays .jw-row{
  background: var(--jw-soft);
  border-radius: 10px;
  padding: 10px;
}
#jw-avoid-monthdays select,
#jw-limit-monthdays select{
  max-width: 120px;
}
#jw-avoid-monthdays input[type="time"],
#jw-limit-monthdays input[type="time"]{
  max-width: 160px;
}

/* =========================================
   Primary submit buttons at form bottom
========================================= */
.jw-create-deed .button.button-primary{
  background: var(--jw-green);
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 200px;
}
.jw-create-deed .button.button-primary:hover{
  background: var(--jw-blue);
}

/* =========================================
   Notices (if you use jw-notice jw-err/jw-ok)
========================================= */
.jw-notice{ margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px; }
.jw-notice.jw-err{ background:#fff3f3; color:#9b1c1c; border:1px solid #f0c9c9; }
.jw-notice.jw-ok{ background:#f3fff6; color:#1e7a3b; border:1px solid #bfe3cd; }


/* Status stripe on cards */
.jw-card.jw-status-done     { border-left: 4px solid var(--jw-green, #003823); }
.jw-card.jw-status-pending  { border-left: 4px solid var(--jw-blue,  #041E36); }
.jw-card.jw-status-overdue  { border-left: 4px solid var(--jw-crimson, #531A00); }

/* Occurrence buttons use outline style (less bulky) */
.jw-card .jw-complete-occ.button { 
  /* already gets .button-view outline styles */
  white-space: nowrap;
}

/* Keep grid consistent with library */
.jw-deed-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
}
@media (max-width: 1200px) { .jw-deed-cards { grid-template-columns: repeat(3, minmax(260px, 1fr)); } }
@media (max-width: 900px)  { .jw-deed-cards { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
@media (max-width: 640px)  { .jw-deed-cards { grid-template-columns: 1fr; } }

/* Category/Subcategory badges (reuse your badge style) */
.jw-cat-badge    { 
	background: #041E36;
	color: #dcedfd;
} 
.jw-subcat-badge { background: #533100; } /* gold */

/* Meta second line spacing */
.jw-metaline { margin-bottom: 10px; }






