/* LifeBalance modern views (Master List / Smart Lists).
   All rules are scoped under body.modern or .viewswitch so Classic is untouched. */

/* ---- view switcher (lives in the header in both modes) ---- */
.viewswitch { display: flex; justify-content: flex-end; }
.viewswitch button {
  border: 1px solid #8a8a8a; border-left: none; border-radius: 0;
  background: linear-gradient(#ffffff, #efefef 50%, #e3e3e3);
  padding: 4px 14px; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.viewswitch button:first-child { border-left: 1px solid #8a8a8a; border-radius: 9px 0 0 9px; }
.viewswitch button:last-child { border-radius: 0 9px 9px 0; }
.viewswitch button.active {
  background: linear-gradient(#8db9f6 0%, #5a97ee 45%, #2e7de0 55%, #3d8bf0 100%);
  color: #fff; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

#mnav { display: none; }
body.modern #tabs { display: none; }
body.modern #mnav {
  display: flex; flex-direction: column;
  width: 248px; flex-shrink: 0; overflow-y: auto;
  background: #f7f8fa; border: 1px solid #d5d9df; border-radius: 6px;
  padding: 10px 6px; font-size: 13px; color: #1f2430;
}
body.modern {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #eef0f3;
}
body.modern #content { border-color: #d5d9df; }

/* ---- sidebar ---- */
.mnav-head {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #6b7280; padding: 8px 10px 4px; display: flex; align-items: center;
}
.mnav-head .add { margin-left: auto; font-size: 14px; line-height: 1; cursor: pointer;
  background: none; border: none; color: #6b7280; padding: 0 2px; }
.mnav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.mnav-item:hover { background: #e9edf3; }
.mnav-item.sel { background: #dbeafe; }
.mnav-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mnav-item .cnt { margin-left: auto; color: #6b7280; font-size: 12px; }
.mnav-item .ic { flex-shrink: 0; width: 16px; text-align: center; }

/* ---- master list ---- */
.m-wrap { padding: 10px 14px 16px; }
.m-toolbar { display: flex; gap: 8px; align-items: center; padding: 4px 0 10px; flex-wrap: wrap; }
.m-toolbar .spacer { flex: 1; }
.m-toolbar button {
  background: #fff; border: 1px solid #c9cfd8; border-radius: 7px; padding: 4px 12px;
  font-size: 12px; box-shadow: none; text-shadow: none;
}
.m-toolbar button.primary { background: #2e7de0; border-color: #1c5cb4; color: #fff; font-weight: 600; }
.m-toolbar label { font-size: 12px; color: #444; display: flex; gap: 5px; align-items: center; }
.m-title { font-size: 17px; font-weight: 700; margin: 2px 0 8px; }

.mrow {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 6px; background: #fff;
  border-bottom: 1px solid #f0f1f4;
}
.mrow:hover { background: #f6f9ff; }
.mrow.sel { background: #e3efff; }
.mrow .tri { width: 16px; flex-shrink: 0; text-align: center; cursor: pointer; color: #888;
  font-size: 11px; user-select: none; }
.mrow .kind { flex-shrink: 0; width: 18px; text-align: center; font-size: 13px; }
.mrow .kind.sphere { width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; }
.mrow input[type=checkbox] { flex-shrink: 0; width: 15px; height: 15px; accent-color: #2e7de0; }
.mrow .mtitle { flex: 1; min-width: 0; cursor: pointer; line-height: 1.35; }
.mrow.done .mtitle { text-decoration: line-through; color: #9aa0aa; }
.mrow .drag { cursor: grab; color: #c3c9d4; flex-shrink: 0; padding: 0 1px; user-select: none; }
.mrow.dragging { opacity: .45; }
.mrow.drop-before { box-shadow: 0 -2px 0 #2e7de0; }
.mrow.drop-after { box-shadow: 0 2px 0 #2e7de0; }
.mrow.drop-inside { background: #dbeafe; box-shadow: inset 0 0 0 2px #2e7de0; }
.mrow .qs { flex-shrink: 0; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.mrow:hover .qs { opacity: 1; }
.mrow .qs button {
  background: #fff; border: 1px solid #d5d9df; border-radius: 6px; padding: 1px 6px;
  font-size: 12px; line-height: 1.5; box-shadow: none; text-shadow: none; cursor: pointer;
}
.mrow .qs button:hover { background: #eef4ff; border-color: #2e7de0; }
.mrow .qs button i { font-style: normal; font-size: 9px; vertical-align: super; color: #2e7de0; }

/* ---- smart lists ---- */
.m-pies { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; margin: 6px 0 10px; }
.m-pie-box { text-align: center; }
.m-pie-box .ptitle { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.m-share { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 14px; }
.m-share th, .m-share td { padding: 4px 8px; border-bottom: 1px solid #eef0f3; text-align: right; }
.m-share th:first-child, .m-share td:first-child { text-align: left; }
.m-share th { color: #6b7280; font-weight: 600; }
.m-share .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.m-share .up { color: #b45309; } .m-share .down { color: #047857; }

.mrank { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #f0f1f4; }
.mrank:hover { background: #f6f9ff; }
.mrank.sel { background: #e3efff; }
.mrank .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mrank .rtitle { flex: 1; min-width: 0; cursor: pointer; }
.mrank .score { font-weight: 700; color: #1c5cb4; min-width: 42px; text-align: right; }
.mrank .eff { color: #6b7280; font-size: 12px; min-width: 64px; text-align: right; }

/* ---- places (modern, read-only) ---- */
.mplace { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid #f0f1f4; }
.mplace .pname { font-weight: 600; }
.mplace .phours { color: #6b7280; font-size: 12px; flex: 1; min-width: 0; }
.mplace .chip { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.mplace .chip.open { background: #dcfce7; color: #166534; }
.mplace .chip.closed { background: #fee2e2; color: #991b1b; }
.mplace .pcount { color: #6b7280; font-size: 12px; }

/* ---- details pane light refresh in modern mode ---- */
body.modern #details { background: #fff; border-color: #d5d9df; }
/* Modern has no calendar view; the classic calendar widget would otherwise
   eat 280px of vertical space (brutal on mobile where #side stacks below). */
body.modern #calendar { display: none; }

/* ---- custom smart lists ---- */
.sedit { margin-left: auto; color: #9aa1ad; cursor: pointer; padding: 0 2px; font-size: 12px; }
.sedit:hover { color: #374151; }
.m-toolbar .cnt { color: #6b7280; font-size: 12px; }
.sl-group { font-weight: 600; font-size: 13px; color: #4b5563; margin: 14px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #e5e7eb; }
.sl-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.sl-dialog { background: #fff; border-radius: 10px; padding: 18px; width: 560px; max-width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.sl-dtitle { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.sl-name { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 14px; }
.sl-name input { flex: 1; padding: 6px 8px; font-size: 14px; border: 1px solid #c9cfd8; border-radius: 7px; }
.sl-sec { margin: 14px 0; }
.sl-shead { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #374151; }
.sl-shead select { font-size: 13px; padding: 3px 5px; }
.sl-frow { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.sl-frow select, .sl-frow input { padding: 5px 6px; font-size: 13px; border: 1px solid #c9cfd8; border-radius: 7px; }
.sl-frow input[type="text"], .sl-frow input[type="date"] { flex: 1; min-width: 0; }
.sl-frow button { background: #fff; border: 1px solid #c9cfd8; border-radius: 7px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.sl-noval { flex: 1; }
.sl-sec > button { background: #fff; border: 1px solid #c9cfd8; border-radius: 7px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.sl-sec select { font-size: 13px; padding: 5px 6px; border: 1px solid #c9cfd8; border-radius: 7px; }
.sl-sec label { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.sl-actions { display: flex; gap: 8px; margin-top: 16px; }
.sl-actions button { border: 1px solid #c9cfd8; border-radius: 7px; padding: 6px 16px; font-size: 13px; cursor: pointer; background: #fff; }
.sl-actions button.primary { background: #2e7de0; border-color: #1c5cb4; color: #fff; font-weight: 600; }
.sl-actions button.danger { color: #b00; margin-left: auto; }
@media (max-width: 700px) {
  .sl-dialog { width: 100%; }
  .sl-frow { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  body.modern #mnav { width: 200px; }
}
