
/* =========================================================
   RESET & BASE
========================================================= */
.twb-board,
.twb-board * {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #f5f5f5;
}

/* =========================================================
   BOARD HEADER (LIGHTER THAN CARDS)
========================================================= */
.twb-board-header {
  background: #000;
  color: #fff;
  padding: 16px 24px;
}

.twb-board-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.twb-board-top h1 {
  font-size: 22px;
  font-weight: 800;
}

.twb-board-top .accent {
  color: #f1c40f;
}

.twb-board-actions button {
  background: #FACC15;          /* yellow */
  border: 2px solid #FACC15;
  color: #fff;
  padding: 6px 14px;
  margin-left: 10px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.twb-board-actions button:hover {
  background: #EAB308;          /* darker yellow */
  transform: translateY(-1px);
}


/* STATE PILLS */
.twb-board-states {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.twb-board-states .state {
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  opacity: 0.6;
}

.twb-board-states .state.active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

/* FILTERS */
.twb-board-filters {
  display: flex;
  gap: 12px;
}

.twb-board-filters select,
.twb-board-filters input {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
}

.filter-btn {
  padding: 8px 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* =========================================================
   CARD RAIL
========================================================= */
.twb-card-rail-wrapper {
  position: relative;
  overflow: hidden;          /* 🔒 NO SCROLL EVER */
  padding: 24px;
    max-width: 1592px;
  margin: 0 auto;
}

/* EXACTLY 4 CARDS VISIBLE */
.twb-card-rail-viewport {
  overflow: hidden;
  width: calc((380px * 4) + (24px * 3));
}


.rail-arrow {
  background: transparent;
  border: 2px solid #000;
  font-size: 20px;
  padding: 6px 12px;
  cursor: pointer;
}

.twb-card-rail {
  display: flex;
  gap: 24px;
  transition: transform 0.35s ease;
}
/* =========================================================
   CARD BASE (HEAVY, DENSE)
========================================================= */
.twb-card {
  background: #fff;
  width: 380px;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
  overflow: hidden;
}

/* =========================================================
   COVER (VISUAL HOOK)
========================================================= */
.twb-card-cover {
  height: 110px;
  background: linear-gradient(135deg, #ddd, #bbb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #555;
}

/* =========================================================
   CARD HEADER (DECISION ZONE)
========================================================= */
.twb-card-header {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  align-items: center;
}

.twb-card-header .job-id {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* STATE vs TIME DOMINANCE */
.badge.editing {
  background: #d81b60;
  color: #fff;
}

.badge.timer {
  background: #b00020;
  color: #fff;
  font-size: 14px;
}

/* =========================================================
   METADATA (COMPRESSED RECEIPT)
========================================================= */
.twb-card-details {
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
}

.twb-card-details div {
  margin-bottom: 4px;
}

/* =========================================================
   PICTURE COUNTS (QUIET INFO)
========================================================= */
.twb-card-pictures {
  display: flex;
  gap: 10px;
  padding: 8px 16px;
}

.pic-box {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: center;
  border-radius: 6px;
  font-size: 12px;
  width: 80px;
}

.pic-box .num {
  font-size: 16px;
  font-weight: 800;
}

/* =========================================================
   EDITABLE ZONES (EXPANDED)
========================================================= */
.twb-card-field {
  padding: 12px 16px;
}

.twb-card-field label {
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.twb-card-field input,
.twb-card-field select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #aaa;
}

/* ROOM IMAGE */
.twb-card-room-image {
  height: 90px;
  margin: 8px 16px;
  border-radius: 8px;
  background: #e0e0e0;
}

/* =========================================================
   EDITORS (CLEAR, IMPORTANT)
========================================================= */
.twb-card-editors {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}

.twb-card-editors select {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
}

/* =========================================================
   PAYMENTS (NEUTRAL, BOTTOM-WEIGHTED)
========================================================= */
.twb-card-payments {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.payment-box {
  flex: 1;
  border: 2px dashed #bbb;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  font-size: 13px;
}

.payment-box .title {
  font-weight: 700;
  margin-bottom: 6px;
}

/* =========================================================
   LOCKED STATE (PHYSICAL FEEL)
========================================================= */
.locked {
  opacity: 0.6;
  pointer-events: none;
}

/* =========================
   STATE COLORS
========================= */

.badge.waiting {
  background: #E9D5FF;
  color: #6B21A8;
}

.badge.editing {
  background: #E11D48;
  color: #FFFFFF;
}

.badge.qc {
  background: #FB923C;
  color: #FFFFFF;
}

.badge.ready {
  background: #84CC16;
  color: #FFFFFF;
}

.badge.delivered {
  background: #22C55E;
  color: #FFFFFF;
}

/* =========================
   TIME / URGENCY
========================= */

.badge.timer.safe {
  background: #22C55E;
  color: #FFFFFF;
}

.badge.timer.warning {
  background: #FB923C;
  color: #FFFFFF;
}

.badge.timer.critical {
  background: #B00020;
  color: #FFFFFF;
}

/* =========================
   TOP STATE TABS – COLOR SYSTEM
========================= */

.twb-board-states .state {
  color: #fff;
  border: 2px solid transparent;
  transition: opacity 0.2s ease;
}

/* WAITING */
.twb-board-states .state.waiting {
  background: #E9D5FF;
  color: #6B21A8;
}

/* EDITING */
.twb-board-states .state.editing {
  background: #E11D48;
}

/* QC */
.twb-board-states .state.qc {
  background: #FB923C;
}

/* READY */
.twb-board-states .state.ready {
  background: #84CC16;
  color: #FFFFFF;
}

/* DELIVERED */
.twb-board-states .state.delivered {
  background: #22C55E;
  color: #FFFFFF;
}

/* ACTIVE STATE */
.twb-board-states .state.active {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

/* INACTIVE */
.twb-board-states .state:not(.active) {
  opacity: 0.35;
}

/* =========================
   GLOBAL DUE FILTER (LEFT OF STATES)
========================= */

.due-dropdown {
  position: relative;
}

.due-btn {
  background: #0A2540; /* dark blue */
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Dropdown menu */
.due-menu {
  position: absolute;
  top: 42px;
  left: 0;
  background: #0A2540;
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 170px;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.due-option {
  background: transparent;
  color: #fff;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}

.due-option:hover {
  background: rgba(255,255,255,0.15);
}

/* Open state */
.due-dropdown.open .due-menu {
  display: flex;
}

/* =========================
   MONTH SELECTOR (HEADER DROPDOWN)
========================= */

.month-dropdown {
  position: relative;
}

.month-btn {
  background: #2563EB;          /* blue */
  color: #fff;
  border: 2px solid #2563EB;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}



/* Dropdown menu */
.month-menu {
  position: absolute;
  top: 44px;
  left: 0;
  background: #111;
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.month-option {
  background: transparent;
  color: #fff;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}

.month-option:hover {
  background: rgba(255,255,255,0.15);
}

/* Open state */
.month-dropdown.open .month-menu {
  display: flex;
}

/* =========================
   LOCKED vs EDITABLE HONESTY
========================= */

/* Locked elements: visually dead */
.locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(30%);
}

/* Inputs & selects */
.twb-card input,
.twb-card select,
.twb-card button {
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

/* Editable hover */
.twb-card input:not([readonly]):hover,
.twb-card select:not([disabled]):hover {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

/* Editable focus */
.twb-card input:not([readonly]):focus,
.twb-card select:not([disabled]):focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(225,29,72,0.35); /* editing accent */
}

/* Disabled inputs look dead */
.twb-card input[readonly],
.twb-card select[disabled] {
  background: #f1f1f1;
  color: #777;
  cursor: not-allowed;
}

/* Upload boxes */
.payment-box {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.payment-box:hover {
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

/* Locked upload boxes */
.locked .payment-box {
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* =========================
   CARD RAIL UX
========================= */

.twb-card-rail {
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
}

.twb-card-rail::-webkit-scrollbar {
  display: none; /* Chrome */
}

.twb-card {
  scroll-snap-align: start;
}

/* Arrows feel intentional */
.rail-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 900;
  background: #000;
  color: #fff;
}

.rail-arrow:hover {
  background: #333;
}

/* =========================
   STATE ADVANCE ACTION
========================= */

.twb-card-action {
  padding: 16px;
  border-top: 1px solid #eee;
}

.state-action {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

/* Hover honesty */
.state-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* =========================
   QC ACTIONS
========================= */

.qc-actions {
  display: flex;
  gap: 10px;
}

.state-action.ready {
  background: #22C55E;
  color: #064E3B;
}

.state-action.back {
  background: #DC2626;
  color: #fff;
}

/* SEND BACK REASON */
.qc-reason {
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.qc-reason textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: none;
  font-weight: 600;
}

.qc-reason button {
  margin-top: 8px;
  width: 100%;
  background: #DC2626;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}


/* =========================
   STATE COLORS (TARGET STATE)
========================= */

/* Editing → QC */
.state-action.qc {
  background: #FB923C;
  color: #FFFFFF;
}

/* QC → Ready */
.state-action.ready {
  background: #84CC16;
  color: #14532D;
}

/* Ready → Delivered */
.state-action.delivered {
  background: #22C55E;
  color: #064E3B;
}

/* =========================
   CARD STATE BORDER
========================= */

.twb-card {
  border: 3px solid transparent;
}

/* WAITING */
.twb-card.state-waiting {
  border-color: #E9D5FF;
}

/* EDITING */
.twb-card.state-editing {
  border-color: #E11D48;
}

/* QUALITY CONTROL */
.twb-card.state-qc {
  border-color: #FB923C;
}

/* READY TO DELIVER */
.twb-card.state-ready {
  border-color: #84CC16;
}

/* DELIVERED */
.twb-card.state-delivered {
  border-color: #22C55E;
}

.twb-card {
  transition: border-color 0.15s ease;
}

/* =========================
   CARD DETAILS (RECEIPT STYLE)
========================= */

.twb-card-details {
  padding: 8px 16px;
  font-size: 15px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.detail-row .label {
  font-weight: 980;
  color: #222;
  font-size: 14px;
}

.detail-row .value {
  color: #444;
  text-align: right;
  max-width: 60%;
}

/* =========================
   PICTURES ROW
========================= */

.twb-card-pictures-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}

.pictures-label {
  font-weight: 700;
  font-size: 15px;
  color: #222;
}

.pictures-values {
  display: flex;
  gap: 8px;
}

.pic-box {
  width: 56px;              /* slightly narrower */
  padding: 3px 2px;         /* ↓ vertical padding */
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  font-size: 11px;
}

.pic-box .num {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  line-height: 1;           /* 🔑 this kills extra height */
  margin-bottom: 2px;       /* minimal spacing */
}

/* =========================
   SEARCH BUTTON
========================= */

.filter-btn {
  background: #2563EB;      /* solid blue */
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.filter-btn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.filter-btn:active {
  transform: translateY(0);
}

/* =========================
   EDITABLE PICTURE INPUTS
========================= */

.pic-box.editable {
  padding: 4px 4px 6px;
  cursor: text;
}

/* Input itself */
.pic-input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 0;
}

/* Remove number arrows */
.pic-input::-webkit-outer-spin-button,
.pic-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pic-input {
  -moz-appearance: textfield;
}

/* Hover = editable */
.pic-box.editable:hover {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

/* Focus = active edit */
.pic-box.editable:focus-within {
  box-shadow: 0 0 0 3px rgba(225,29,72,0.35); /* editing accent */
  border-color: #E11D48;
}

/* Input focus cleanup */
.pic-input:focus {
  outline: none;
}

/* =========================
   COVER UPLOAD – TWO STATES
========================= */

.editable-cover {
  position: relative;
  height: 110px;
  background: #e0e0e0;
  border-radius: 0;
  overflow: hidden;
}

/* Hide input but keep it clickable */
.cover-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

/* UPLOAD BUTTON (before image) */
.cover-upload-btn {
  position: absolute;
  inset: 0;
  border: 2px dashed #999;
  background: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 800;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.editable-cover.no-image:hover .cover-upload-btn {
  background: rgba(0,0,0,0.05);
  border-color: #555;
}

.editable-cover.no-image {
  cursor: pointer;
}


/* Uploaded image */
.editable-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HOVER OVERLAY — ONLY AFTER IMAGE */
.editable-cover.has-image::after {
  content: "Change cover";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.editable-cover.has-image:hover::after {
  opacity: 1;
}

/* Hide upload button once image exists */
.editable-cover.has-image .cover-upload-btn {
  display: none;
}

/* =========================
   PROOF OF PAYMENT (POP)
========================= */

.editable-pop {
  position: relative;
  flex: 1;
  border: 2px dashed #bbb;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
}

/* Hide file input */
.pop-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

/* Title */
.pop-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Upload button (before file) */
.pop-upload-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  color: #444;
  cursor: pointer;
}

/* Hover feedback before upload */
.editable-pop.no-file:hover {
  background: #f0f0f0;
  border-color: #888;
}

/* Preview image */
.editable-pop img {
  width: 100%;
  max-height: 80px;
  object-fit: contain;
}

/* Hover overlay AFTER upload */
.editable-pop.has-file::after {
  content: "Re-upload";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 10px;
}

.editable-pop.has-file:hover::after {
  opacity: 1;
}

/* Hide upload button once file exists */
.editable-pop.has-file .pop-upload-btn {
  display: none;
}

/* =========================
   POP STATUS
========================= */

.pop-status {
  text-align: center;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 700;
}

.pop-status.unverified {
  color: #DC2626; /* red */
}

/* =========================
   PAYMENT COLUMN
========================= */

.payment-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* =========================
   LOCKED PAYMENT (BALANCE)
========================= */

.payment-box.locked {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================
   UPLOADED STATE
========================= */

.editable-pop.uploaded {
  border-style: solid;
  border-color: #22C55E;
  background: #ECFDF5;
}

.editable-pop.uploaded .pop-upload-btn {
  background: #22C55E;
  color: #064E3B;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* =========================
   POP STATUS TEXT
========================= */

.pop-status {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.pop-status.unverified {
  color: #DC2626;
}

/* =========================
   POP PREVIEW MODAL
========================= */

.pop-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.pop-preview-modal.hidden {
  display: none;
}

.pop-preview-content {
  position: relative;
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 90%;
}

.pop-preview-content img {
  max-width: 100%;
  max-height: 80vh;
}

/* Reupload button */
.pop-reupload {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #2563EB;
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
}

/* PDF label inside box */
.pop-pdf-label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}

/* Modal previews */
.preview-image,
.preview-pdf {
  display: none;
  max-width: 100%;
  max-height: 80vh;
}

.preview-pdf {
  width: 80vw;
  height: 80vh;
  border: none;
}

/* ROOM PREVIEW */

.twb-card-room-image {
  margin: 8px 16px;
  border-radius: 8px;
  overflow: hidden;
}

.twb-card-room-image img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

/* Completely remove from layout */
.hidden {
  display: none;
}

/* =========================
   EDITOR ASSIGNMENT STATES
========================= */

.editor-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.editor-select {
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #ccc;
  font-weight: 700;
}

/* GREEN when done */
.editor-select.done {
  border-color: #22C55E;
  background: #ECFDF5;
}

/* Disabled look */
.editor-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Status text under dropdown */
.editor-status {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

/* RED pending text */
.editor-status.pending {
  color: #DC2626;
}

/* GREEN done text */
.editor-status.done {
  color: #16A34A;
}

/* ===== Editor dropdown completed text ===== */

.editor-select.done {
  border-color: #22C55E;
  background: #ECFDF5;
  color: #065F46;
  font-weight: 800;
}

/* Pending text under editor 1 */
.editor-status.pending {
  color: #DC2626;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
}

/* QC status under editors */
.qc-status {
  margin: 6px 16px 0;
  font-size: 13px;
  font-weight: 800;
  color: #DC2626;
}

/* Hide helper */
.hidden {
  display: none;
}

.editor-select {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-select option {
  white-space: nowrap;
}

.editor-select.done {
  position: relative;
  background: #ECFDF5;
  border-color: #22C55E;
  color: transparent; /* hide real value */
}

/* Fake text overlay */
.editor-select.done::after {
  content: "Done by " attr(data-done);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: #065F46;
  font-weight: 800;
  pointer-events: none;
}

.editor-select {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  white-space: nowrap;
}

/* EDITOR WRAPPER */
.editor-inputs {
  display: flex;
  gap: 12px;
}

/* FINAL SUMMARY BOX */
.editor-summary {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #ECFDF5;
  border: 2px solid #22C55E;
  font-weight: 800;
  color: #065F46;
  font-size: 14px;
}

/* Hide utility */
.hidden {
  display: none !important;
}

.demo-card {
  display: none;
}

.demo-card.active {
  display: block;
}

/* =========================
   CARD STATE TRANSITIONS
========================= */

.demo-card {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.demo-card.exit {
  opacity: 0;
  transform: translateX(-40px);
}

.state-qc input,
.state-qc select,
.state-qc .editable-pop,
.state-qc .editable-cover {
  pointer-events: none;
  opacity: 0.5;
}

/* OVERDUE BADGE */
.badge.overdue {
  background: #E9D5FF;   
  color: #6B21A8;
  font-weight: 800;
}

/* =========================
   BOTTOM ACTION BUTTON COLORS BY CARD STATE
========================= */

/* WAITING → Start Editing */
.twb-card.state-waiting .state-action {
  background: #7C3AED;   /* purple */
  color: #FFFFFF;
}

/* EDITING → Send to QC */
.twb-card.state-editing .state-action {
  background: #b00020;   /* red */
  color: #FFFFFF;
}


/* READY → Deliver */
/* READY badge dominance */
.twb-card.state-ready .badge.ready {
  background: #16A34A;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 900;
  padding: 6px 14px;
  letter-spacing: 0.4px;
}


/* DELIVERED → Disabled */
.twb-card.state-delivered .state-action {
  background: #22C55E;   /* green */
  color: #FFFFFF;
  cursor: not-allowed;
}

/* =========================================================
   WAITING STATE – HIDE NON-APPLICABLE UI
========================================================= */

/* Hide cover upload */
.twb-card.state-waiting .twb-card-cover {
  display: none;
}

/* Hide link field */
.twb-card.state-waiting .twb-card-field {
  display: none;
}

/* Hide room selector + preview */
.twb-card.state-waiting .room-select,
.twb-card.state-waiting .twb-card-room-image {
  display: none;
}

/* Hide editors section entirely */
.twb-card.state-waiting .twb-card-editors {
  display: none;
}

/* Hide payments (POP) */
.twb-card.state-waiting .twb-card-payments {
  display: none;
}

/* =========================================================
   WAITING STATE – REMOVE PICTURES SECTION
========================================================= */

.twb-card.state-waiting .twb-card-pictures-row {
  display: none;
}

/* =========================================================
   READY TO DELIVER — ATTENTION STATE
========================================================= */

/* Base emphasis */
.twb-card.state-ready {
  border-color: #22C55E;
  box-shadow:
    0 0 0 2px rgba(34,197,94,0.35),
    0 12px 30px rgba(34,197,94,0.25);
  transform: translateY(-2px);
}

/* Soft pulsing glow (attention without noise) */
@keyframes readyPulse {
  0%   { box-shadow: 0 0 0 2px rgba(34,197,94,0.25), 0 12px 30px rgba(34,197,94,0.25); }
  50%  { box-shadow: 0 0 0 6px rgba(34,197,94,0.45), 0 18px 40px rgba(34,197,94,0.35); }
  100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.25), 0 12px 30px rgba(34,197,94,0.25); }
}

.twb-card.state-ready {
  animation: readyPulse 2.8s ease-in-out infinite;
}

/* Kill animation on hover so it feels solid */
.twb-card.state-ready:hover {
  animation: none;
}

/* READY action button */
.twb-card.state-ready .state-action {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.twb-card.state-ready .state-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(34,197,94,0.4);
}

/* De-emphasize internal fields once ready */
.twb-card.state-ready .twb-card-field,
.twb-card.state-ready .twb-card-details,
.twb-card.state-ready .twb-card-pictures-row {
  opacity: 0.75;
}

/* =========================================================
   DELIVERED — FULL WIDTH FINAL RIBBON
========================================================= */

.twb-card.state-delivered {
  position: relative;
}

/* Full-width delivered ribbon */
.twb-card.state-delivered::before {
  content: "DELIVERED";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;

  height: 38px;
  line-height: 38px;

  background: linear-gradient(
    90deg,
    #16A34A,
    #22C55E,
    #16A34A
  ); /* living green */

  color: #ECFDF5;
  text-align: center;

  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;

  z-index: 10;

  box-shadow: 
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* Push content down to make space for ribbon */
.twb-card.state-delivered > *:first-child {
  margin-top: 38px;
}

.twb-card.state-delivered::before {
  animation: deliveredPulse 2.5s ease-in-out infinite;
}

@keyframes deliveredPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* ==========================
   OVERLAY SYSTEM
========================== */

.twb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.twb-overlay.hidden {
  display: none;
}

.twb-overlay-panel {
  width: 92%;
  height: 90%;
  background: #fff;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.overlay-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.overlay-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 10;
}

.payment-box.balance-pop:not(.locked) {
  border-color: #22C55E;
  background: #ECFDF5;
}

/* Balance POP unlocked but NOT uploaded */
.balance-pop.no-file:not(.uploaded) {
  border: 2px dashed #999;
  background: #fafafa;
}

.editable-cover.has-image {
  cursor: zoom-in;
}

.client-name {
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
  color: #111;
}
