/* Banana Boards — Banana Digital brand system ("Refined Threshold") */
:root {
  --earth: #2A2420;
  --champagne: #C9A96E;
  --taupe: #9E8878;
  --ivory: #F5EDE2;
  --terracotta: #B86B4A;
  --sage: #6F8A63;
  --hairline: rgba(42, 36, 32, 0.12);
  --lift: 0 4px 20px rgba(42, 36, 32, 0.10);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--earth);
  background: var(--ivory);
}
button { font-family: var(--sans); cursor: pointer; }
input, select, textarea { font-family: var(--sans); font-size: 0.9rem; color: var(--earth); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--taupe); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.75rem; }

/* ---------- layout ---------- */
#app { height: 100vh; display: flex; overflow: hidden; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--earth); color: var(--ivory);
  display: flex; flex-direction: column; padding: 28px 0;
}
.wordmark {
  font-family: var(--serif); font-weight: 300; font-size: 1.15rem;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--ivory);
  padding: 0 24px 6px; white-space: nowrap;
}
.wordmark img { height: 26px; vertical-align: middle; margin-right: 10px; }
.side-sub { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--champagne); padding: 0 24px 24px; }
.side-nav { flex: 1; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: rgba(245, 237, 226, 0.75);
  padding: 10px 24px; font-size: 0.85rem; letter-spacing: 0.02em;
}
.side-link:hover { color: var(--ivory); background: rgba(245, 237, 226, 0.06); }
.side-link.active { color: var(--ivory); background: rgba(201, 169, 110, 0.14); box-shadow: inset 3px 0 0 var(--champagne); }
.side-label { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--taupe); padding: 20px 24px 6px; }
.side-foot { padding: 16px 24px 0; border-top: 1px solid rgba(245, 237, 226, 0.12); font-size: 0.75rem; color: rgba(245, 237, 226, 0.6); }
.side-foot button { background: none; border: none; color: var(--champagne); font-size: 0.75rem; padding: 4px 0; display: block; }
.side-foot button:hover { color: var(--terracotta); }

.main { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 22px 32px 14px;
  border-bottom: 1px solid var(--hairline); background: var(--ivory);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; }
.page-title input {
  font-family: var(--serif); font-size: inherit; font-weight: 400; border: none; background: transparent;
  border-bottom: 1px dashed transparent; max-width: 60vw;
}
.page-title input:hover, .page-title input:focus { border-bottom-color: var(--champagne); outline: none; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 32px 80px; }

/* ---------- buttons ---------- */
.btn {
  border-radius: 100px; padding: 10px 24px; font-size: 0.85rem; font-weight: 500;
  border: 1px solid transparent; transition: all 0.15s ease; letter-spacing: 0.02em;
}
.btn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.btn-primary { background: var(--earth); color: var(--ivory); }
.btn-primary:hover { background: var(--terracotta); box-shadow: var(--lift); }
.btn-ghost { background: transparent; color: var(--earth); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--earth); }
.btn-small { padding: 6px 16px; font-size: 0.78rem; }
.btn-danger { background: transparent; color: var(--terracotta); border-color: transparent; }
.btn-danger:hover { border-color: var(--terracotta); }
.view-toggle { display: inline-flex; border: 1px solid var(--hairline); border-radius: 100px; overflow: hidden; }
.view-toggle button {
  border: none; background: transparent; padding: 8px 18px; font-size: 0.78rem; color: var(--taupe); letter-spacing: 0.05em;
}
.view-toggle button.active { background: var(--earth); color: var(--ivory); }

/* ---------- table view ---------- */
.group-block { margin-bottom: 36px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.group-name {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 500; border: none; background: transparent;
  border-bottom: 1px dashed transparent; min-width: 60px;
}
.group-name:hover, .group-name:focus { border-bottom-color: var(--champagne); outline: none; }
.group-count { font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--taupe); }
.group-del { background: none; border: none; color: var(--taupe); font-size: 0.9rem; opacity: 0; transition: opacity 0.15s; }
.group-head:hover .group-del { opacity: 1; }
.group-del:hover { color: var(--terracotta); }

.board-table { width: 100%; border-collapse: collapse; background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.board-table { display: block; overflow-x: auto; }
.board-table table { width: 100%; border-collapse: collapse; min-width: 760px; }
.board-table th {
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500; color: var(--taupe);
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.board-table th .col-del, .board-table th .col-edit { visibility: hidden; background: none; border: none; color: var(--taupe); margin-left: 6px; }
.board-table th:hover .col-del, .board-table th:hover .col-edit { visibility: visible; }
.board-table th .col-del:hover { color: var(--terracotta); }
.board-table th .col-edit:hover { color: var(--champagne); }
.ec-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.ec-row input[type=text] { flex: 1; width: auto; }
.ec-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hairline); flex-shrink: 0; cursor: pointer; }
.ec-swatch:hover { box-shadow: var(--lift); }
.ec-del { background: none; border: none; color: var(--taupe); font-size: 0.9rem; }
.ec-del:hover { color: var(--terracotta); }
.board-table td { padding: 8px 14px; border-bottom: 1px solid rgba(42, 36, 32, 0.06); font-size: 0.88rem; vertical-align: middle; }
.board-table tr:last-child td { border-bottom: none; }
.board-table tr:hover td { background: rgba(201, 169, 110, 0.06); }
.item-name { display: flex; align-items: center; gap: 8px; }
.item-name input {
  border: none; background: transparent; font-size: 0.88rem; width: 100%; min-width: 160px;
  border-bottom: 1px dashed transparent; font-weight: 500;
}
.item-name input:hover, .item-name input:focus { border-bottom-color: var(--champagne); outline: none; }
.talk-btn { background: none; border: none; color: var(--taupe); font-size: 0.78rem; white-space: nowrap; }
.talk-btn:hover { color: var(--terracotta); }
.talk-btn.has { color: var(--champagne); font-weight: 600; }
.row-del, .row-move { background: none; border: none; color: var(--taupe); opacity: 0; }
tr:hover .row-del, tr:hover .row-move { opacity: 1; }
.row-del:hover { color: var(--terracotta); }
.row-move { font-size: 0.95rem; margin-right: 4px; }
.row-move:hover { color: var(--champagne); }

.pill {
  display: inline-block; padding: 4px 14px; border-radius: 100px; font-size: 0.75rem; font-weight: 600;
  color: var(--ivory); border: none; min-width: 110px; text-align: center; letter-spacing: 0.03em;
}
.pill.empty { background: transparent; color: var(--taupe); border: 1px dashed var(--hairline); font-weight: 400; }
.cell-input { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 4px 6px; width: 100%; min-width: 110px; }
.cell-input:hover { border-color: var(--hairline); }
.cell-input:focus { border-color: var(--champagne); outline: none; background: #fff; }
select.cell-input { min-width: 130px; }

.add-item-row { display: flex; gap: 8px; padding: 10px 2px; }
.add-item-row input {
  flex: 1; max-width: 340px; border: 1px solid var(--hairline); border-radius: 100px; padding: 8px 18px; background: #FDF9F3;
}
.add-item-row input:focus { outline: none; border-color: var(--champagne); }
.board-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- dropdown ---------- */
.dropdown { position: fixed; background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--lift); padding: 8px; z-index: 60; min-width: 160px; }
.dropdown button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 8px; font-size: 0.82rem; }
.dropdown button:hover { background: rgba(201, 169, 110, 0.15); }
.dropdown .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.kanban-col { min-width: 250px; width: 250px; flex-shrink: 0; background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 16px; padding: 14px; min-height: 260px; display: flex; flex-direction: column; }
.kanban-col.drag-over { border-color: var(--champagne); background: rgba(201, 169, 110, 0.10); border-style: dashed; }
.kanban-card.dragging { opacity: 0.45; }
.kanban-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kanban-col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.kanban-col-head .t { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.kanban-col-head .n { margin-left: auto; font-size: 0.72rem; color: var(--taupe); }
.kanban-card {
  background: var(--ivory); border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: grab;
}
.kanban-card:hover { box-shadow: var(--lift); }
.kanban-card .t { font-weight: 500; font-size: 0.88rem; margin-bottom: 6px; }
.kanban-card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.72rem; color: var(--taupe); }
.kanban-card .meta .pr { font-weight: 600; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-tile { background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 16px; padding: 24px 28px; }
.stat-tile .k { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--taupe); font-weight: 500; }
.stat-tile .v { font-family: var(--serif); font-size: 2.6rem; font-weight: 300; line-height: 1.1; margin-top: 6px; }
.stat-tile .v.warn { color: var(--terracotta); }
.dash-section-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; margin: 26px 0 14px; }
.dash-card {
  background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 16px;
  padding: 24px 28px; margin-top: 28px;
}
.dash-card .dash-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.dash-card .dash-section-title { margin: 0; }
.dash-card .activity-list li:last-child { border-bottom: none; }
.dash-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.dash-board-card { background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 16px; padding: 24px 28px; cursor: pointer; }
.dash-board-card:hover { box-shadow: var(--lift); }
.dash-board-card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin-bottom: 12px; }
.hbar { display: flex; height: 10px; border-radius: 100px; overflow: hidden; background: rgba(42, 36, 32, 0.07); margin-bottom: 10px; }
.hbar div { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 0.74rem; color: var(--earth); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.person-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 0.85rem; }
.person-row .nm { width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-row .bar { flex: 1; height: 12px; background: rgba(42, 36, 32, 0.07); border-radius: 100px; overflow: hidden; }
.person-row .bar div { height: 100%; background: var(--champagne); border-radius: 100px; }
.person-row .ct { width: 30px; text-align: right; font-size: 0.78rem; color: var(--taupe); }
.activity-list { list-style: none; }
.activity-list li { padding: 9px 0; border-bottom: 1px solid rgba(42, 36, 32, 0.06); font-size: 0.85rem; display: flex; gap: 8px; }
.activity-list .who { font-weight: 600; }
.activity-list .when { margin-left: auto; color: var(--taupe); font-size: 0.75rem; white-space: nowrap; }

/* ---------- panel (item detail) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(42, 36, 32, 0.35); z-index: 40; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--ivory);
  z-index: 50; box-shadow: -8px 0 40px rgba(42, 36, 32, 0.2); display: flex; flex-direction: column;
}
.panel-head { padding: 26px 30px 14px; border-bottom: 1px solid var(--hairline); }
.panel-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.2; padding-right: 40px; }
.panel-close { position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 1.3rem; color: var(--taupe); }
.panel-close:hover { color: var(--terracotta); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px 30px; }
.comment-form { padding: 16px 30px 24px; border-top: 1px solid var(--hairline); background: var(--ivory); }
.comment-form textarea {
  width: 100%; border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; resize: vertical;
  min-height: 70px; background: #FDF9F3; font-size: 0.88rem;
}
.comment-form textarea:focus { outline: none; border-color: var(--champagne); }
.comment-form .row { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment { background: #FDF9F3; border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.comment .hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment .who { font-weight: 600; font-size: 0.84rem; }
.comment .guest-tag { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terracotta); border: 1px solid var(--terracotta); border-radius: 100px; padding: 1px 8px; }
.comment .when { margin-left: auto; font-size: 0.72rem; color: var(--taupe); }
.comment .bd { font-size: 0.88rem; white-space: pre-wrap; }
.mini-activity { margin-top: 20px; }
.mini-activity h4 { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--taupe); margin-bottom: 8px; }
.mini-activity div { font-size: 0.78rem; padding: 4px 0; color: var(--earth); border-bottom: 1px solid rgba(42, 36, 32, 0.05); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(42, 36, 32, 0.35); z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--ivory); border-radius: 16px; box-shadow: var(--lift); width: min(520px, 100%); max-height: 85vh; overflow-y: auto; padding: 32px; }
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin-bottom: 4px; }
.modal .sub { color: var(--taupe); font-size: 0.85rem; margin-bottom: 20px; }
.modal label { display: block; font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500; color: var(--taupe); margin: 14px 0 5px; }
.modal input[type=text], .modal input[type=email], .modal input[type=password], .modal select {
  width: 100%; border: 1px solid var(--hairline); border-radius: 12px; padding: 11px 14px; background: #FDF9F3; font-size: 0.9rem;
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--champagne); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(42, 36, 32, 0.07); flex-wrap: wrap; }
.share-row .perm { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 12px; border-radius: 100px; background: var(--earth); color: var(--ivory); }
.share-row .perm.edit { background: var(--terracotta); }
.share-row .perm.comment { background: var(--champagne); color: var(--earth); }
.share-row .lbl { font-size: 0.85rem; flex: 1; min-width: 120px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(42, 36, 32, 0.07); }
.member-row .nm { font-weight: 600; font-size: 0.9rem; }
.member-row .em { color: var(--taupe); font-size: 0.8rem; flex: 1; }
.role-tag { font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--champagne); border: 1px solid var(--champagne); padding: 2px 10px; border-radius: 100px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--earth); padding: 20px; }
.login-card { background: var(--ivory); border-radius: 16px; padding: 48px 44px; width: min(420px, 100%); box-shadow: var(--lift); text-align: center; }
.login-card img { height: 52px; margin-bottom: 18px; }
.login-card h1 { font-family: var(--serif); font-weight: 300; letter-spacing: 0.3em; text-transform: uppercase; font-size: 1.4rem; margin-bottom: 4px; white-space: nowrap; }
.login-card .sub { font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--champagne); margin-bottom: 30px; }
.login-card input { width: 100%; border: 1px solid var(--hairline); border-radius: 100px; padding: 13px 22px; margin-bottom: 12px; background: #FDF9F3; font-size: 0.92rem; }
.login-card input:focus { outline: none; border-color: var(--champagne); }
.login-card .btn { width: 100%; padding: 13px; margin-top: 6px; }
.login-err { color: var(--terracotta); font-size: 0.82rem; margin-bottom: 10px; min-height: 1.2em; }

/* ---------- guest banner ---------- */
.guest-banner {
  background: var(--earth); color: var(--ivory); padding: 10px 32px; font-size: 0.8rem;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.guest-banner .perm-note { color: var(--champagne); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.66rem; }
.guest-banner .brand { margin-left: auto; font-family: var(--serif); letter-spacing: 0.25em; text-transform: uppercase; font-size: 0.72rem; color: rgba(245, 237, 226, 0.7); }

/* ---------- notification bell ---------- */
.bell-wrap { position: relative; display: inline-block; }
.bell-btn {
  background: transparent; border: 1px solid var(--hairline); border-radius: 100px;
  padding: 7px 14px; font-size: 0.95rem; position: relative; transition: all 0.15s ease;
}
.bell-btn:hover { border-color: var(--earth); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; background: var(--terracotta); color: var(--ivory);
  border-radius: 100px; font-size: 0.62rem; font-weight: 700; padding: 1px 6px; line-height: 1.4;
}
.notif-panel { width: min(340px, 92vw); max-height: 420px; overflow-y: auto; left: auto; padding: 6px; }
.notif-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 12px; border-radius: 8px; border-bottom: 1px solid rgba(42, 36, 32, 0.06);
}
.notif-item:hover { background: rgba(201, 169, 110, 0.15); }
.notif-item.unread { background: rgba(201, 169, 110, 0.10); box-shadow: inset 2px 0 0 var(--terracotta); }
.notif-item .ni-t { display: block; font-size: 0.83rem; line-height: 1.4; }
.notif-item .ni-m { display: block; font-size: 0.72rem; color: var(--taupe); margin-top: 2px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--earth); color: var(--ivory);
  border-radius: 100px; padding: 11px 28px; font-size: 0.85rem; z-index: 90; box-shadow: var(--lift);
}
.empty-note { color: var(--taupe); font-size: 0.9rem; padding: 30px 0; text-align: center; }

@media (max-width: 800px) {
  .sidebar { display: none; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 16px 16px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
