/* =========================================================
   deeBoard — Design Tokens
   ========================================================= */
:root {
  /* Type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Accent (shared across themes) */
  --accent: #7FB3A3;
  --accent-strong: #5F9585;
  --accent-soft: rgba(127, 179, 163, 0.14);
  --accent-amber: #E0B168;
  --accent-amber-soft: rgba(224, 177, 104, 0.14);
  --accent-rose: #D98282;
  --accent-rose-soft: rgba(217, 130, 130, 0.14);

  /* Column indicator colors */
  --dot-no-progress: #8B8F9A;
  --dot-in-progress: #E0B168;
  --dot-completed: #7FB3A3;

  /* Radii & motion */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 180ms;

  color-scheme: dark;

  /* Dark theme (default) */
  --bg: #14161B;
  --bg-elevated: #191C22;
  --surface: #1D2028;
  --surface-hover: #242833;
  --border: #2A2E38;
  --border-soft: #22252E;
  --text: #E8E9ED;
  --text-secondary: #8B8F9A;
  --text-tertiary: #5C606C;
  --shadow-color: rgba(0, 0, 0, 0.45);
  --overlay: rgba(10, 11, 14, 0.68);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F7F6F3;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-hover: #F0EEE9;
  --border: #E4E2DC;
  --border-soft: #ECEAE4;
  --text: #232529;
  --text-secondary: #6B6E76;
  --text-tertiary: #A2A5AC;
  --shadow-color: rgba(30, 25, 15, 0.10);
  --overlay: rgba(40, 38, 32, 0.35);

  --accent-strong: #4E7E70;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  user-select: none; /* Tambahkan baris ini */
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================
   LOGIN SCREEN
   ========================================================= */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, var(--accent-soft), transparent 45%),
    radial-gradient(circle at 82% 78%, var(--accent-amber-soft), transparent 40%),
    var(--bg);
  padding: 24px;
  gap: 28px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  text-align: center;
  box-shadow: 0 24px 60px var(--shadow-color);
  animation: loginRise 520ms var(--ease);
}
@keyframes loginRise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-mark {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 18px;
}
.login-mark-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dot-no-progress);
}
.login-mark-dot:nth-child(2) { background: var(--dot-in-progress); }
.login-mark-dot:nth-child(3) { background: var(--dot-completed); }
.login-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 30px;
}
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-google:hover { background: var(--surface-hover); border-color: var(--text-tertiary); }
.btn-google:active { transform: scale(0.98); }
.login-hint {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.login-credit {
  font-size: 12.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
/* Always an off-canvas overlay — same mechanism regardless of screen
   size, desktop or mobile. It used to sit in-flow on wide screens
   (pushing/squeezing .main when opened/closed or collapsed), which meant
   .main's actual width changed depending on sidebar state — causing the
   header row to overlap/misbehave at some viewport widths but not others
   even though nothing about the *window* had changed. Making it always
   `position: fixed` means .main is always full width, so the header
   layout no longer depends on whether the sidebar happens to be open. */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 70;
  width: 264px;
  max-width: 82vw;
  transform: translateX(-100%);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 20px 0 50px var(--shadow-color);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sidebar.open { transform: translateX(0); }
.sidebar-top { padding: 18px 16px 8px; display: flex; align-items: stretch; gap: 8px; }

.new-project-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.new-project-btn i { font-size: 15px; }
.new-project-btn:hover { background: var(--accent); color: #0F1410; }
.new-project-btn:active { transform: scale(0.97); }

/* ---------- Import project button (sidebar, next to "Project Baru") ---------- */
.import-project-btn {
  flex-shrink: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.import-project-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--accent); }
.import-project-btn:active { transform: scale(0.94); }

.archive-list { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.archive-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.archive-item i { color: var(--text-tertiary); font-size: 18px; }
.archive-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.archive-empty { color: var(--text-tertiary); text-align: center; padding: 20px 4px; font-size: 13px; }
.archive-restore-btn { flex-shrink: 0; padding: 6px 9px; font-size: 12px; }

/* ---------- Drag & drop overlay for importing a .debrdp project file ---------- */
.import-dropzone-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.import-dropzone-overlay.hidden { display: none; }
.import-dropzone-card {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 56px;
  background: var(--surface);
  border: 2.5px dashed var(--accent);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.import-dropzone-card i { font-size: 40px; color: var(--accent); }
.import-dropzone-card p { font-size: 15px; font-weight: 600; max-width: 280px; }
.import-dropzone-card strong { color: var(--accent-strong); }

.sidebar-projects {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.project-list-empty {
  margin-top: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 0 16px;
}
.project-list-empty i { font-size: 26px; display: block; margin-bottom: 8px; opacity: 0.7; }

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative;
  border: 1px solid transparent;
}
.project-item:hover { background: var(--surface-hover); color: var(--text); }
.project-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-soft);
}
.project-item i.ph-folder-simple { font-size: 15px; flex-shrink: 0; }
.project-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-bottom {
  padding: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.user-chip:hover,
.user-chip:focus-visible {
  background: var(--surface-hover);
}
.user-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Clicks on the logout icon-btn should never trigger the settings modal —
   handled in JS via stopPropagation, this just keeps the button's own
   hover state visually distinct from the chip's hover background. */
.user-chip .icon-btn { position: relative; z-index: 1; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-strong); 
  color: #14161B;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
}
.user-chip-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn-danger:hover { background: var(--accent-rose-soft); color: var(--accent-rose); }

/* ---------- Settings modal (Akun & Tampilan) ---------- */
.settings-modal-panel { max-width: 380px; }
.settings-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-theme-options {
  display: flex;
  gap: 8px;
}
.settings-theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.settings-theme-btn:hover { background: var(--surface-hover); color: var(--text); }
.settings-theme-btn[aria-checked="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}
.settings-accent-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-accent-color-input {
  width: 40px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}
.settings-accent-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-accent-reset {
  margin-left: auto;
  font-size: 12px;
  padding: 7px 10px;
}

/* ---------- Sidebar overlay (all screen sizes now) ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 60;
}
.sidebar-overlay.show { display: block; }

/* ---------- Main ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  container-type: inline-size;
  container-name: main-pane;
}
.main-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px 14px;
  flex-shrink: 0;
}
.main-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.main-header-title h1 {
  font-size: 19px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Task 5: header action buttons (flowchart/catatan/rename/delete) are now
   always visible on desktop and mobile instead of only appearing on hover. */
.project-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 1;
}
.mobile-only { display: none; }

/* ---------- Header overflow ("more") menu — narrow header widths ---------- */
.header-more-btn { display: none; margin-left: auto; flex-shrink: 0; }
.header-more-menu {
  position: fixed;
  z-index: 950;
  min-width: 200px;
  max-width: 80vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px var(--shadow-color);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.header-more-menu.hidden { display: none; }
.header-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
}
.header-more-item:hover { background: var(--surface-hover); }
.header-more-item i { font-size: 16px; color: var(--text-secondary); flex-shrink: 0; }
.header-more-sep {
  height: 1px;
  background: var(--border-soft);
  margin: 4px 6px;
}

/* ---------- Empty state ---------- */
.board-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-secondary);
}
.board-empty-state i { font-size: 46px; color: var(--text-tertiary); margin-bottom: 6px; }
.board-empty-state h2 { font-size: 18px; color: var(--text); }
.board-empty-state p { font-size: 13.5px; max-width: 320px; }
.board-empty-state .btn-primary { margin-top: 14px; }

/* ---------- Board & Columns ---------- */
.board {
  flex: 1;
  display: flex;
  gap: 18px;
  padding: 4px 26px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 0;
}
.column {
  flex: 1 1 0;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  min-height: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.column-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 16px 12px;
  flex-shrink: 0;
}
.column-header h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.column-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-no-progress { background: var(--dot-no-progress); }
.dot-in-progress { background: var(--dot-in-progress); }
.dot-completed { background: var(--dot-completed); }
.column-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: 20px;
  padding: 2px 8px;
  font-weight: 600;
}

.column-input-wrap { padding: 0 12px 10px; flex-shrink: 0; }
.column-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.column-input::placeholder { color: var(--text-tertiary); }
.column-input:focus { border-color: var(--accent); background: var(--bg-elevated); }

.column-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.column-list.drag-over-empty {
  background: var(--accent-soft);
  border-radius: var(--radius-md);
}

/* ---------- Note Card ---------- */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--dot-no-progress);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  touch-action: manipulation;
}
.note-card[data-status="in-progress"] { border-left-color: var(--dot-in-progress); }
.note-card[data-status="completed"] { border-left-color: var(--dot-completed); }

.note-card:hover {
  border-color: var(--text-tertiary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--shadow-color);
}
.note-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.note-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.note-card-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}
.note-card[data-status="completed"] .note-card-title {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}
.note-card-desc-icon {
  color: var(--text-tertiary);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Styling untuk Subtask di dalam Kanban Card */
.note-card-subtasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  padding-left: 6px;
  border-left: 2px solid var(--border);
}
.note-card-subtask-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.note-card-subtask-item i {
  font-size: 13px;
  margin-top: 1px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.note-card-subtask-item.done i {
  color: var(--accent);
}
.note-card-subtask-item.done span {
  text-decoration: line-through;
  color: var(--text-tertiary);
  opacity: 0.7;
}
.note-card[data-status="completed"] .note-card-title {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}
.note-card-desc-icon {
  color: var(--text-tertiary);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* SortableJS drag states */
.sortable-ghost {
  opacity: 0.4;
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
}
.sortable-chosen { box-shadow: 0 10px 28px var(--shadow-color); }
.sortable-drag { opacity: 0.95 !important; transform: scale(1.03) rotate(1deg); cursor: grabbing; }

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  animation: overlayIn 160ms var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 540px;
  max-height: min(88vh, 720px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px var(--shadow-color);
  animation: modalIn 200ms var(--ease);
  overflow: hidden;
}
.small-modal { max-width: 420px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 12px;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; flex: 1; }
.note-title-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  padding: 4px 0;
}
.note-title-input:focus { outline: none; }

.modal-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 14px;
  flex-shrink: 0;
}
.modal-label-inline { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.status-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
}

.modal-body {
  padding: 4px 18px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 8px;
}
.modal-label i { font-size: 14px; }

.note-desc-input {
  width: 100%;
  resize: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 80px;
  transition: border-color var(--dur) var(--ease);
}
.note-desc-input::placeholder { color: var(--text-tertiary); }
.note-desc-input:focus { border-color: var(--accent); }

/* Resize holder for the task-description editor.  This remains usable on
   touch devices, unlike the browser's native textarea resize control. */
.note-desc-resize-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}
.note-desc-resize-wrap .note-desc-input {
  display: block;
  padding-right: 28px;
}
.note-desc-resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 25px;
  height: 25px;
  border-radius: 0 0 calc(var(--radius-md) - 2px) 0;
  cursor: ns-resize;
  touch-action: none;
  z-index: 1;
}
.note-desc-resize-handle::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  opacity: .8;
}
.note-desc-resize-wrap.resizing .note-desc-input { border-color: var(--accent); }

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color var(--dur) var(--ease);
}
.text-input:focus { border-color: var(--accent); }

/* Subtasks */
.subtask-section { margin-top: 6px; }
.subtask-header { display: flex; align-items: center; justify-content: space-between; }
.subtask-progress { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; margin-top: 8px; }

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.subtask-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}
.subtask-item:hover { background: var(--surface-hover); }
.subtask-item:hover .subtask-delete { opacity: 1; }

.subtask-checkbox {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--text-tertiary);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 12px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.subtask-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #0F1410;
}
.subtask-text {
  flex: 1;
  font-size: 13.5px;
  word-break: break-word;
  line-height: 1.4;
}
.subtask-item.checked .subtask-text {
  color: var(--text-tertiary);
  text-decoration: line-through;
}
.subtask-delete {
  opacity: 0;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  flex-shrink: 0;
  font-size: 13px;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.subtask-delete:hover { background: var(--accent-rose-soft); color: var(--accent-rose); }

.subtask-add-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.subtask-input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
}
.subtask-input:focus { border-color: var(--accent); }
.subtask-add-row .icon-btn {
  background: var(--accent-soft);
  color: var(--accent-strong);
  width: 34px; height: auto;
  border-radius: var(--radius-sm);
}
.subtask-add-row .icon-btn:hover { background: var(--accent); color: #0F1410; }

.modal-footer {
  display: flex;
  align-items: center;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
  gap: 10px;
}
.modal-footer-end { justify-content: flex-end; }
.modal-save-indicator {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.modal-save-indicator.show { opacity: 1; }

.confirm-message { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

/* =========================================================
   BUTTONS (shared)
   ========================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--accent);
  color: #0F1410;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger {
  padding: 10px 16px;
  background: var(--accent-rose);
  border: none;
  border-radius: var(--radius-md);
  color: #2A1010;
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--dur) var(--ease);
}
.btn-danger:hover { background: #C56A6A; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-danger-text:hover { background: var(--accent-rose-soft); color: var(--accent-rose); }

/* =========================================================
   TOASTS
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 220ms var(--ease);
}
.toast.toast-error { border-color: var(--accent-rose); color: var(--accent-rose); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.toast-out { animation: toastOut 200ms var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* =========================================================
   WATERMARK
   ========================================================= */
.app-watermark {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  opacity: 0.55;
  z-index: 30;
  pointer-events: none;
  letter-spacing: 0.01em;
  font-weight: 500;
}

/* =========================================================
   PROJECT TIMELINE
   ========================================================= */
.project-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto; /* Mendorong ke pojok kanan */
  margin-right: 12px;
  padding: 6px 14px;
  background: var(--bg-sec);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.project-timeline:hover {
  background: var(--border);
}
.date-display {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.timeline-bar-container {
  width: 120px;
  height: 6px;
  background: rgba(127, 179, 163, 0.15); /* Soft accent */
  border-radius: 6px;
  overflow: hidden;
}
.timeline-progress {
  height: 100%;
  width: 0%;
  background: var(--accent); /* Default hijau */
  border-radius: 6px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

/* =========================================================
   RESPONSIVE — Mobile (iPhone etc.)
   ========================================================= */
@media (max-width: 860px) {
  .board {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 16px 100px;
    gap: 14px;
  }
  .column {
    flex: none;    /* TAMBAHKAN INI: Matikan pembagian tinggi rata-rata */
    height: auto;  /* TAMBAHKAN INI: Biarkan tinggi box ngikutin isi konten */
    min-width: 0;
    max-width: none;
    max-height: none;
  }
  .column-list { overflow-y: visible; }
}

/* Collapse the full action row (rename/archive/delete/export/notes/
   flowchart/sketch) behind a single kebab menu once the *main content
   pane* — not the raw viewport — gets too narrow to fit them. A container
   query (keyed off .main's own width) is used here instead of a media
   query because the available width depends on whether the sidebar is
   open, which a viewport-width media query has no way to know: on a
   1024px iPad with the sidebar open, main-pane width drops to ~760px
   and the row needs to collapse even though the viewport itself is wide. */
@container main-pane (max-width: 860px) {
  .main-header { flex-wrap: nowrap; }
  .project-actions { display: none; }
  .header-more-btn { display: inline-flex; }
}

@media (max-width: 720px) {
  .mobile-only { display: inline-flex; }

  .main-header {
    padding: 12px 12px 10px;
  }
  .main-header-title h1 { font-size: 16px; }

  .board { padding: 4px 12px 90px; }

  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .modal { animation: modalInMobile 220ms var(--ease); max-width: 100%; }
  @keyframes modalInMobile {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .app-watermark { font-size: 9.5px; bottom: 6px; right: 8px; }
  .login-card { padding: 36px 24px 28px; }
}

/* Timeline/deadline bar shrink — also container-query based so it reacts
   correctly to the sidebar being open (narrow main-pane) even on a
   physically wide screen like a tablet, instead of only kicking in at
   small viewport widths where it used to get squeezed to a textless
   sliver while the sidebar was open (or worse, overlapped the action row
   before that collapsed into the kebab menu above). */
@container main-pane (max-width: 720px) {
  .project-timeline {
    gap: 8px;
    padding: 4px 10px;
    margin-right: 6px;
    flex-shrink: 0;
  }
  .timeline-bar-container { width: 55px; } /* Bar diperpendek */
  .date-display { font-size: 11px; }
}

@container main-pane (max-width: 480px) {
  /* Very narrow main-pane: tighten spacing and shrink the timeline bar
     further so title + timeline + kebab all fit one row without
     wrapping or overlapping. */
  .main-header { gap: 6px; }
  .main-header-title { gap: 4px; }
  .project-timeline { gap: 5px; padding: 4px 6px; margin-right: 2px; }
  .timeline-bar-container { width: 34px; }
  .date-display { display: none; } /* keep just the progress bar, drop labels */
}

@media (max-width: 400px) {
  .note-title-input { font-size: 16px; }
}

/* Task 4: deadline modal on mobile — fit the viewport exactly (no bleed,
   no internal scroll needed) instead of inheriting the generic bottom-sheet
   sizing that let it grow taller than the screen and scroll. */
@media (max-width: 900px) {
  #deadline-modal .modal-overlay {
    align-items: center;
    padding: 16px;
  }
  #deadline-modal .modal {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: var(--radius-lg);
    animation: modalIn 200ms var(--ease);
  }
  #deadline-modal .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100dvh - 200px);  /* ensure inputs don't extend beyond viewport */
  }
  #deadline-modal .text-input {
    font-size: 16px;  /* 16px prevents iOS auto-zoom on input focus */
    max-width: 100%;
    box-sizing: border-box;
  }
  #deadline-modal input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
  }
  /* iOS renders the date input's inner fields + calendar icon as a single
     flex row inside its shadow DOM. It won't shrink below that row's
     intrinsic width on its own, so it silently overflows its own box —
     this shrinks the whole control by scaling instead of relying on the
     shadow DOM to respect width:100%. */
  @supports (-webkit-touch-callout: none) {
    #deadline-modal input[type="date"] {
      font-size: 15px;
      padding: 10px 6px;
    }
  }
}
/* Applied to <body> via JS (app.js) while #deadline-modal is open, so the
   page behind the modal can't be scrolled on mobile. */
body.modal-lock-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ---------- Sidebar trigger button ---------- */
.sidebar-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Sidebar is always the fixed off-canvas overlay defined near the top of
   this file — .open shows it, closed is the default. No separate
   desktop "collapsed" (in-flow, width:0) mode anymore; one mechanism,
   every screen size, so .main's width is never affected by sidebar
   state. */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

input, textarea, select, .note-card-title, .subtask-text, .note-title-input, .note-desc-input {
  user-select: text; 
}