html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
  background: #f8f9fa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
}

/* ===== BOARD GRID ===== */
.board {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr) 200px;
  gap: 0.75rem;
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  align-items: start;
  overflow-x: auto;
}

/* border around each column/sidebar */
.board .column,
.board .assignee-sidebar {
  border: 1px solid #aaa;
  padding: 0.5rem;
  border-radius: 0.5rem;
  min-width: 0;
}

/* Column base */
.column {
  min-width: 0;
}

/* Column colors */
.column#todo        { background: #CE93D8; }
.column#in-progress { background: #FFF59D; }
.column#done        { background: #C5D6A7; }

/* Task list */
.task-list {
  min-height: 150px;
}

/* Task card */
.task {
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Date bar */
.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  min-width: 0;
}

.task-header .date-block {
  text-align: center;
  flex: 0 0 auto;
  min-width: 0;
}

.task-header .date {
  font-size: 0.85rem;
  color: #555;
  word-break: break-word;
}

.task-header .label {
  font-size: 0.6rem;
  color: #500 !important;
  font-weight: 300;
  margin-top: 0.1rem;
}

/* Title */
.task-header .title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 500;
  color: #222;
  padding: 0 0.5rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Description */
.task .task-desc {
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  line-height: 1.3;
  flex-grow: 1;
  margin-bottom: 1.2rem;
  text-align: justify;
  hyphens: auto;
}

.task-entry {
  margin-bottom: 0.45rem;
}

.task-entry-author,
.modal-task-entry-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.15rem;
}

.task-entry-body,
.modal-task-entry-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-entry-stamp {
  margin-top: 0.2rem;
  text-align: right;
  font-size: 0.66rem;
  line-height: 1;
  color: #777;
  font-weight: 400;
}

.entry-panel {
  margin-bottom: 0.75rem;
}

.entry-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.35rem;
}

.modal-task-entry {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 0.35rem;
  padding: 0.5rem;
  margin-bottom: 0.45rem;
}

.readonly-entry {
  opacity: 0.96;
}

.own-entry {
  background: #fff;
  border-color: #b7d7a8;
}

.own-entry .modal-task-entry-body {
  min-height: 1.4rem;
  outline: none;
}

.admin-entry {
  background: #fff;
  border-color: #9fc5e8;
}

.admin-entry .modal-task-entry-body {
  min-height: 1.4rem;
  outline: none;
}

.own-entry .modal-task-entry-body:focus,
.admin-entry .modal-task-entry-body:focus {
  box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.18);
}

/* Assignee chips */
.task .task-assignee {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  text-align: right;
  font-weight: 500;
  color: #333;
  max-width: calc(100% - 1rem);
  overflow-wrap: anywhere;
}

.task-assignee .assignee-chip {
  display: inline-block;
  background: #eee;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 4px;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #333;
}

/* Add button */
#addBtn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #007bff;
  color: #fff;
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
  z-index: 1000;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: #fff;
  padding: 0;
  border-radius: 0.5rem;
  width: 95%;
  max-width: 800px;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-content .form-group {
  margin-bottom: 0.45rem;
}

.modal-content label {
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
}

.modal-content .form-control {
  padding: 0.28rem 0.55rem;
  min-height: 0;
  height: auto;
  font-size: 0.9rem;
}

.modal-content .form-row {
  margin-bottom: 0;
}

.modal-content .mt-2 {
  margin-top: 0.35rem !important;
}

.modal-content small,
.modal-content .text-muted {
  font-size: 0.72rem;
  line-height: 1.1;
}

.modal-content form {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.modal-fixed-top {
  flex: 0 0 auto;
  padding: 0.75rem 1.25rem 0.45rem;
  border-bottom: 1px solid #ddd;
  background: #fff;
  z-index: 1;
}

.modal-fixed-top h5 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.55rem 1.25rem;
}

.modal-fixed-bottom {
  flex: 0 0 auto;
  padding: 0.5rem 1.25rem 0.75rem;
  border-top: 1px solid #ddd;
  background: #fff;
}

.rich-editor {
  min-height: 360px;
  max-height: none;
  overflow: visible;
}

.editor-toolbar {
  position: sticky;
  top: -1rem;
  z-index: 2;
  background: #fff;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.close {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Sidebar */
.assignee-sidebar {
  background: #fff3cd;
  min-width: 180px;
  max-width: 220px;
  overflow-wrap: anywhere;
}

.assignee-sidebar li {
  padding: 0.5rem;
  cursor: pointer;
}

.assignee-sidebar li.active,
.assignee-sidebar li:hover {
  background: #ffe8a1;
}

/* Due-date highlights */
.task.due-soon { background-color: #FF941A !important; }
.task.overdue  { background-color: #Ff5454 !important; }

.task.overdue .task-header .date-block:last-child .date {
  display: inline-block;
  font-weight: 500;
  border: 1px solid #000;
  padding: 0 4px;
  border-radius: 2px;
}

.task.due-soon .task-header .date-block:last-child .date {
  text-decoration: underline;
  font-weight: 600;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  5% { opacity: 0; }
}

.task.overdue .task-header .date-block:last-child .date,
.task.due-soon .task-header .date-block:last-child .date {
  animation: blink 3s step-start infinite;
}

/* Done cards green */
.column#done .task {
  background-color: #A5D6A7 !important;
}

/* ===== COMPACT VIEW ===== */
body.compact .task-desc {
  display: none !important;
}

body.compact .task-header .label {
  display: none !important;
}

body.compact .task {
  padding: 0.4rem;
}

body.compact .task-header .title {
  -webkit-line-clamp: 2;
}

body.compact .task-assignee {
  display: block !important;
  position: static;
  margin-top: 0.4rem;
  text-align: right;
  max-width: 100%;
}

/* ===== FOCUS MODE ===== */
body.focus #done,
body.focus .assignee-sidebar {
  display: none !important;
}

body.focus .board {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) !important;
}

/* ===== PRINT ===== */
@media print {
  @page {
    size: A4 landscape;
    margin: 0.5cm;
  }

  #addBtn,
  .modal-overlay,
  .close,
  .navbar a,
  #focusToggle,
  #exportPdf,
  #exportPdfNoDone {
    display: none !important;
  }

  .board .column,
  .task-list .task {
    border-color: #000 !important;
  }

  .board {
    grid-template-columns: repeat(3, 1fr) !important;
    width: 100% !important;
    overflow: visible !important;
  }

  body.print-no-done #done,
  body.print-no-done .assignee-sidebar {
    display: none !important;
  }

  body.print-no-done .board {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  body {
    font-size: 10pt !important;
  }

  .column h5 {
    font-size: 12pt !important;
  }

  .task {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1600px) {
  .board {
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
  }

  .assignee-sidebar {
    display: none;
  }
}

@media (max-width: 1100px) {
  .board {
    grid-template-columns: 1fr;
  }

  .navbar {
    flex-wrap: wrap;
  }
}

/* =====================================================
   WHATSAPP SHARE EXPORT - MERGED FROM WORKING VERSION
   ===================================================== */

/* =====================================================
   WhatsApp Share Export - Stage 1 PNG rendering
   Class-based duplicate of live board/card look.
   ===================================================== */
.wa-share-modal-content {
  max-width: 520px;
}

.wa-export {
  font-family: 'Roboto', sans-serif;
  color: #111;
}

.wa-page {
  padding: 12px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.wa-measurer {
  position: absolute;
  left: -99999px;
  top: 0;
  visibility: hidden;
}

.wa-band {
  font-weight: 700;
  font-size: 20px;
  padding: 10px 14px;
  border: 1px solid #000;
  border-radius: 8px;
  margin: 6px 0 10px 0;
}

.wa-band.todo { background: #CE93D8; }
.wa-band.in-progress { background: #FFF59D; }
.wa-band.done { background: #C5D6A7; }

.wa-export .task {
  position: relative;
  background: #ffffff;
  border: 1px solid #000;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  cursor: default;
  display: flex;
  flex-direction: column;
  min-height: 118px;
}

.wa-export .task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wa-export .task-header .date-block {
  text-align: center;
  flex: 0 0 auto;
  min-width: 100px;
}

.wa-export .task-header .date {
  font-size: 15px;
  color: #444;
}

.wa-export .task-header .label {
  font-size: 11px;
  color: #500 !important;
  font-weight: 400;
  margin-top: 2px;
}

.wa-export .task-header .title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  color: #111;
  padding: 0 10px;
  word-break: break-word;
  font-size: 18px;
}

.wa-export .task .task-desc {
  overflow-wrap: break-word;
  width: 100%;
  line-height: 1.35;
  flex-grow: 1;
  margin-bottom: 26px;
  text-align: left;
  hyphens: auto;
  font-size: 16px;
}

.wa-export .task .task-assignee {
  position: absolute;
  bottom: 8px;
  right: 8px;
  text-align: right;
  font-weight: 600;
  color: #333;
}

.wa-export .task-assignee .assignee-chip {
  display: inline-block;
  background: #eeeeee;
  border-radius: 5px;
  padding: 3px 7px;
  margin-left: 4px;
  font-size: 12px;
  color: #333;
}

.wa-export .task.overdue {
  background-color: #FF5454 !important;
}

.wa-export .task.due-soon {
  background-color: #FF941A !important;
}

.wa-export .task.done-card {
  background-color: #A5D6A7 !important;
}

.wa-export .task.overdue .task-header .date-block:last-child .date {
  display: inline-block;
  font-weight: 600;
  border: 1px solid #000;
  padding: 0 4px;
  border-radius: 2px;
}

.wa-export .task.due-soon .task-header .date-block:last-child .date {
  text-decoration: underline;
  font-weight: 700;
}

.wa-capturing .task .date,
.wa-capturing .task.overdue .task-header .date-block:last-child .date,
.wa-capturing .task.due-soon .task-header .date-block:last-child .date {
  animation: none !important;
  opacity: 1 !important;
}


/* ===== WhatsApp PNG compact export tuning: fit more cards per image ===== */
.wa-page.wa-compact-export .wa-band {
  font-size: 18px;
  padding: 7px 10px;
  margin: 3px 0 7px 0;
  border-radius: 6px;
}

.wa-page.wa-compact-export .task {
  margin-bottom: 7px;
  padding: 7px 8px;
  border-radius: 6px;
  min-height: 0 !important;
  box-shadow: none;
}

.wa-page.wa-compact-export .task-header {
  margin-bottom: 5px;
}

.wa-page.wa-compact-export .task-header .date-block {
  min-width: 92px;
}

.wa-page.wa-compact-export .task-header .date {
  font-size: 13px;
}

.wa-page.wa-compact-export .task-header .label {
  font-size: 9px;
  margin-top: 1px;
}

.wa-page.wa-compact-export .task-header .title {
  font-size: 16px;
  line-height: 1.12;
  padding: 0 7px;
}

.wa-page.wa-compact-export .task .task-desc {
  font-size: 13px;
  line-height: 1.18;
  margin-bottom: 20px;
}

.wa-page.wa-compact-export .task-assignee .assignee-chip {
  font-size: 10px;
  padding: 2px 5px;
}

.wa-page.wa-compact-export .task .task-assignee {
  bottom: 5px;
  right: 6px;
}


/* === LINE-WISE AUTHOR PREFIX === */
.line-author {
  display: inline-block;
  font-weight: 700;
  color: #0b5394;
  background: #e8f1ff;
  border: 1px solid #9fc5e8;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 5px;
  font-size: 0.9em;
}

#myLineBtn {
  font-weight: 600;
}
