/* =========================================================
   BASE WRAPPER
========================================================= */

.hw-budget-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}


/* =========================================================
   TIMELINE
========================================================= */

.hw-timeline {
    margin-bottom: 20px;
}

.hw-timeline-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hw-arrow {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.hw-current-period {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hw-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ddd;
}

.hw-status.active {
    background: #22c55e;
    color: #fff;
}

.hw-status.locked {
    background: #ef4444;
    color: #fff;
}

.hw-start-btn {
    padding: 6px 12px;
    border: none;
    background: #000;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.hw-overdue-warning {
    margin-top: 10px;
    font-size: 12px;
    color: #ef4444;
}


/* =========================================================
   VIEW TOGGLE (MONTH / WEEK)
========================================================= */

.hw-view-toggle {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.hw-view-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    cursor: pointer;
}

.hw-view-btn.active {
    background: #000;
    color: #fff;
}


/* =========================================================
   WEEK NAVIGATION
========================================================= */

.hw-view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hw-view-toggle button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #222;
  color: #fff;
}

.hw-view-toggle button.active {
  background: #3fb762;
}

#hw-week-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hw-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0px 0 8px;
  padding: 8px 10px;
  border-radius: 5px;
  background: #f4e7ff7a !important;
  color: #101010;;
}

.hw-week-title {
  font-size: 14px;
  font-weight: 700;
}

.hw-week-range {
  font-size: 12px;
  opacity: .8;
}


/* =========================================================
   ZBB ITEMS (CORE)
========================================================= */

#zbb-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zbb-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eee;
}

.zbb-row input,
.zbb-row select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.zbb-running-total {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

/*==========================================================
  VAULT SAVINGS
  ========================================================= */
  .zbb-vault-block {
    display: grid;
}

/* =========================================================
   DELETE BUTTON
========================================================= */

.zbb-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}


/* =========================================================
   ADD ITEM BUTTON
========================================================= */

#add-zbb-item {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #000;
    color: #fff;
    border: none;
    width: 100%;
    cursor: pointer;
}


/* =========================================================
   SUMMARY
========================================================= */

.hw-zbb-summary {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.hw-zbb-summary div {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 14px;
}

#sum-left-est.positive {
    color: #22c55e;
}

#sum-left-est.negative {
    color: #ef4444;
}

#sum-left-est.zero {
    color: #999;
}

/* =========================================================
   INCOME ROWS (BASIC)
========================================================= */

#zbb-income-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* =========================
   MOBILE ONLY VISIBILITY
========================= */
/* =========================
   MOBILE ONLY (FORCE)
========================= */

#hw-mobile-ships {
  display: none !important;
}


@media (max-width: 768px) {

  #hw-mobile-ships {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
  }



}

/* ===================================================
   MOBILE SHIPS VIEW
=================================================== */

@media (max-width: 767px) {

  #zbb-items {
    display: none;
  }

  #hw-mobile-ships {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* ===================================================
     SHIP CARD
  =================================================== */

  .hw-ship {
    background: #d0beff24;
    border-radius: 14px;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .hw-ship:hover {
    transform: translateY(-2px);
  }

  .hw-ship-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
  }

  .hw-ship-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
  }

  .hw-ship-meta .done {
    color: #15803d;
    font-weight: 600;
  }

  .hw-ship-meta .pending {
    color: #b91c1c;
    font-weight: 600;
  }
}

/* ==========================================================
=========================================================
========================================================= */

.hw-ship-item {
  padding: 9px 9px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 0px;
  border: 1px solid #e9bcff4a;
  transition: background 0.2s ease;
}

.hw-ship-item:hover {
  background: #eff6ff;
}

.hw-ship-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 4px; /* Space before status */
}

.hw-ship-day {
  text-align: left;
  font-weight: 600;
}

.hw-ship-name {
  text-align: center;
  flex: 1; /* Center and grow */
font-weight: 600;
    font-size: 14px;
}

.hw-ship-amount {
  text-align: right;
}

.hw-ship-status {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  text-align: right; /* Align status to the right, under amount */
	letter-spacing: 0.04em;
}

.hw-ship-status.done {
  color: #166534; /* Green for done */
}

.hw-ship-status.pending {
  color: #991b1b; /* Red for pending */
}

/* =========================
   MODAL CARD (LIKE OLD UI)
========================= */

/* =========================
   MOBILE EDIT MODE (ONLY)
========================= */

@media (max-width: 768px) {

  /* PUSH MODAL TO BOTTOM */
  #hw-global-modal.hw-modal-mobile {
    display: flex;
    align-items: flex-end;
  }

  /* MODAL BOX = FULL WIDTH SHEET */
  #hw-global-modal.hw-modal-mobile .hw-modal-box {

    width: 100%;
    max-width: 100%;

    border-radius: 16px 16px 0 0;

    margin-bottom: 40px;
    padding: 0;

    /* smooth slide */
    transform: translateY(100%);
    transition: transform 0.25s ease;
  }

  /* OPEN STATE */
  #hw-global-modal.hw-modal-mobile.active .hw-modal-box {
    transform: translateY(0);
  }

}

/* =========================
   FIX DOUBLE MODAL (BUDGET ONLY)
========================= */

@media (max-width: 768px){

  /* When budget modal is active */
  /*#hw-global-modal .hw-mobile-edit {

    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    background: #fff;
    border-radius: 20px 20px 0 0;

    max-height: 90vh;
    overflow-y: auto;

    padding-bottom: 40px;

    transform: translateY(100%);
    transition: transform 0.25s ease;

    z-index: 10001;
  }*/

  #hw-global-modal .hw-mobile-edit {

  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.hw-mobile-edit-content {
  max-height: 60vh;
  overflow-y: auto;
}

  /* Slide up */
  #hw-global-modal.active .hw-mobile-edit {
    transform: translateY(0);
  }

  /* 🔥 CRITICAL FIX — REMOVE CENTER MODAL EFFECT */
  #hw-global-modal .hw-mobile-edit ~ .hw-modal-close {
    display: none !important;
  }

  #hw-global-modal .hw-mobile-edit {
    box-shadow: 0 -20px 40px rgba(0,0,0,0.15);
  }
}
/* =========================
   HEADER FIX (BUDGET MODAL)
========================= */

#hw-global-modal .hw-mobile-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 16px 16px 10px;
  border-bottom: 1px solid #eee;

  font-size: 16px;
  font-weight: 700;
}

.hw-mobile-edit-header strong {
  font-size: 15px;
}

.hw-mobile-close {
  opacity: 0.6;
}

.hw-mobile-close:hover {
  opacity: 1;
}

/* =========================
   CLOSE BUTTON FIX
========================= */

#hw-global-modal .hw-mobile-edit .hw-modal-close {
  display: none; /* hide old one */
}

/* 🔥 CREATE NEW CLOSE BUTTON STYLE */

.hw-mobile-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

#hw-global-modal .hw-mobile-edit .zbb-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;

  background: #b9b8ff40;
  border-radius: 16px;
  padding: 16px;
}

/* =========================
   FIELD BEHAVIOR
========================= */

/* Description full width */
#hw-global-modal .hw-mobile-edit .zbb-field:first-child {
  grid-column: 1 / -1;
}

/* Keep 2 columns for others */
#hw-global-modal .hw-mobile-edit .zbb-field {
  display: flex;
  flex-direction: column;
}

/* =========================
   LABEL STYLE
========================= */

#hw-global-modal .hw-mobile-edit label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

/* =========================
   INPUT STYLE
========================= */

#hw-global-modal .hw-mobile-edit input,
#hw-global-modal .hw-mobile-edit select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: #fff;
}

/* =========================
   HIDE DESKTOP ELEMENTS
========================= */

#hw-global-modal .hw-mobile-edit .zbb-type,
#hw-global-modal .hw-mobile-edit .zbb-running-total,
#hw-global-modal .hw-mobile-edit .zbb-delete,
#hw-global-modal .hw-mobile-edit .zbb-row-actions {
  display: none !important;
}

#hw-global-modal .hw-mobile-edit-actions {
  display: flex;
  gap: 10px;
  padding: 12px;
}

#hw-global-modal .hw-mobile-edit-actions button {
  flex: 1;
}

/* =========================
   MOBILE ACTION BAR
========================= */

.hw-mobile-edit-actions {
  position: sticky;
  bottom: 0;

  display: flex;
  gap: 10px;

  padding: 14px 16px 20px;
  background: #fff;

  border-top: 1px solid #eee;
  z-index: 5;
}

/* =========================
   BASE BUTTON
========================= */

.hw-mobile-edit-actions button {
  flex: 1;

  border: none;
  border-radius: 12px;

  padding: 12px;
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* =========================
   DONE BUTTON
========================= */

.hw-mobile-edit-actions .hw-confirm-btn {
  background: rgb(213, 248, 226);
  color: #374151;
}

/* ACTIVE = already DONE */
.hw-confirm-btn.active {
  background: #297c38;
  color: #ffffff;
}

/* =========================
   RECURRING BUTTON
========================= */

button.zbb-action-btn.hw-recurring-btn {
  background: #b9b8ff40;
  color: #374151;
}

/* ACTIVE = recurring ON */
button.zbb-action-btn.hw-recurring-btn.active {
  background: #7d069b;
  color: #ffffff;
}

/* =========================
   DELETE BUTTON
========================= */

.hw-modal-delete {
  background: #fee2e2;
  color: #b91c1c;
}

/* =========================
   TAP FEEDBACK
========================= */

.hw-mobile-edit-actions button:active {
  transform: scale(0.97);
}


/* =========================================
   NOTE SYSTEM
========================================= */


/* =========================
   NOTE BUTTON (DESKTOP)
========================= */

.hw-item-note-btn {
  position: relative;

  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 10px;

  background: #f3f4f6;
  cursor: pointer;

  transition: all 0.2s ease;

  margin-left: 75%; /* keep your layout for now */
}

.hw-item-note-btn svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

.hw-item-note-btn:hover {
  background: #e5e7eb;
}

/* ACTIVE */
.hw-item-note-btn.has-note {
  background: rgba(63, 183, 98, 0.12);
}

.hw-item-note-btn.has-note svg {
  color: #3fb762;
}

.hw-item-note-btn.has-note::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;

  width: 6px;
  height: 6px;

  background: #3fb762;
  border-radius: 50%;
}


/* =========================
   NOTE MODAL (MODE)
========================= */

#hw-global-modal.hw-modal-note .hw-modal-box {
  width: 100%;
  max-width: 420px;

  padding: 18px;
  border-radius: 20px;

  background: #ffffff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}


/* =========================
   NOTE MODAL CONTENT
========================= */

#hw-global-modal.hw-modal-note .hw-note-modal {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;

  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* HEADER */
#hw-global-modal.hw-modal-note .hw-note-header {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

/* TEXTAREA */
#hw-global-modal.hw-modal-note #hw-note-text {
  width: 100%;
  min-height: 140px;

  border: none;
  outline: none;
  resize: none;

  font-size: 16px;
  line-height: 1.6;

  color: #111827;
  background: transparent;

  padding: 4px 0;
}

#hw-global-modal.hw-modal-note #hw-note-text::placeholder {
  color: #9ca3af;
}

/* ACTIONS */
#hw-global-modal.hw-modal-note .hw-note-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

/* BUTTONS */
#hw-global-modal.hw-modal-note .hw-note-actions button {
  flex: 1;
  height: 44px;

  border-radius: 14px;
  border: none;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

/* CANCEL */
#hw-global-modal.hw-modal-note .hw-note-cancel {
  background: #f3f4f6;
  color: #374151;
}

/* SAVE */
#hw-global-modal.hw-modal-note .hw-note-save {
  background: #770686;
  color: #ffffff;
}


/* =========================
   MOBILE HEADER (SHIPS MODAL)
========================= */

.hw-mobile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hw-mobile-header-left strong {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.hw-mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* MOBILE NOTE BUTTON */
.hw-mobile-note {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  border: none;

  background: #f3f4f6;
  cursor: pointer;
}

.hw-mobile-note svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

.hw-mobile-note:active {
  background: #e5e7eb;
}


/* =========================
   MOBILE (BOTTOM SHEET)
========================= */

@media (max-width: 768px) {

  #hw-global-modal.hw-modal-note {
    display: flex;
    align-items: flex-end;
  }

  #hw-global-modal.hw-modal-note .hw-modal-box {
    width: 100%;
    max-width: 100%;
    margin-bottom: 40px;
    padding: 12px;

    border-radius: 20px 20px 0 0;
  }

}

/* =========================
   SHIP NOTE ICON
========================= */

.hw-ship-note-icon {
  width: 16px;
  height: 16px;
  color: #3fb762; /* 🔥 same green */
  opacity: 0.9;
}

.hw-ship-note-icon svg {
  width: 14px;
  height: 14px;
}


/* ============================
  TIMELINE VIEW 
  ========================== */

.hw-timeline-income {
    margin-bottom: 10px;
    padding: 20px;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #e0e7ff;
    display: flex;
    justify-content: space-between;
    color: #000;
    font-weight: 800;
    font-size: 13px;
    transition: background 0.2s ease;
}

.hw-timeline-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px 140px 120px 200px;
  align-items: center;
  gap: 10px;

  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

/* columns */
.hw-tl-day {
  color: #6b7280;
}

.hw-tl-name {
  font-weight: 500;
}

.hw-tl-estimate {
  text-align: right;
}

.hw-tl-status.done {
  color: #16a34a;
}

.hw-tl-status.pending {
  color: #b72400;
}

.hw-tl-actions {
  display: flex;
  gap: 6px;
}

/* =========================
   TIMELINE ACTIONS
========================= */

.hw-tl-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.hw-tl-actions button {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* hover */
.hw-tl-actions button:hover {
  background: #f3f4f6;
}

/* specific buttons */

.hw-tl-actions button:nth-child(1) {
    color: #fff;
    background: #1e1a1a;
}

.hw-tl-actions button:nth-child(2) {
    color: #fff;
    background: #13912f;
}

.hw-tl-actions button:nth-child(3) {
    color: #fff;
    background: #dc2626;
}

.hw-tl-actions button:nth-child(4) { /* Note */
  color: #6b7280;
}

button.hw-tl-note.has-note {
    color: #29c30e;
}

.hw-timeline-week {
    font-size: 12px;
    font-weight: 800;
    color: #101010;
    margin-top: 0px;
    margin-bottom: 4px;
    text-transform: uppercase;
    background: #f4e7ff7a;
    padding: 8px;
    text-align: left;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

/* =========================
   NOTE BUTTON STATE
========================= */

.hw-tl-note {
  position: relative;
  color: #6b7280;
}

/* active (has note) */
.hw-tl-note.has-note {
  color: #29c30e;
}

/* small dot indicator */
.hw-note-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
  background: #29c30e;
  border-radius: 50%;
}
.zbb-credit-block {
  display: contents;
}

.zbb-type.credit {
    color: #076028;
}
.zbb-credit-block .zbb-type.credit {
    color: #076028;
}