@import url("/ds/bf-tokens.css"); /* bf-ds v2 */
:root {
  color-scheme: dark;
  --bg: #10141c;
  --panel: #181d27;
  --raised: #202633;
  --line: #323946;
  --text: #f4eee4;
  --muted: #b4b8c3;
  --gold: #dfbd83;
  --green: #accaba;
  --rose: #e0a9b0;
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--text);
  padding: 9px 15px;
  min-height: 44px;
}
button:hover {
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
input,
textarea,
select {
  background: var(--bf-surface);
  border: 1px solid #424b5c;
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  max-width: 100%;
  width: 100%;
  min-height: 46px;
}
textarea {
  resize: vertical;
  min-height: 96px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--gold);
}
input[type="date"],
input[type="time"],
input[type="number"] {
  direction: ltr;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Amiri, serif;
  font-size: 58px;
  line-height: 1.2;
  margin-bottom: 12px;
}
h1 span {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--gold);
}
h2 {
  font-size: 21px;
  margin-bottom: 15px;
}
h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
small,
.meta {
  font-size: 14px;
  color: var(--muted);
}
.skip {
  position: fixed;
  top: -100px;
  right: 20px;
  z-index: 20;
  background: var(--gold);
  color: #111;
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 244px;
  height: 100dvh;
  border-left: 1px solid var(--line);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  background: var(--bf-surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
}
.brand-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  width: 44px;
  height: 50px;
  border-radius: 50% 50% 6px 6px;
  font-family: Amiri;
  font-size: 32px;
}
.edition {
  margin: 42px 10px 26px;
}
.edition > span {
  letter-spacing: 4px;
  font-size: 14px;
  color: var(--gold);
}
.edition p {
  margin: 8px 0 3px;
  font-family: Amiri;
  font-size: 25px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.nav-item {
  background: transparent;
  border-color: transparent;
  text-align: right;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-item .glyph {
  width: 22px;
  text-align: center;
  font-size: 20px;
}
.nav-item[aria-current="page"] {
  color: var(--gold);
  background: var(--bf-surface-2);
  border-color: #514839;
}
.sidebar-foot {
  margin-top: auto;
  padding: 22px 10px 0;
  font-size: 13px;
  color: var(--muted);
}
.sidebar-foot p {
  margin: 6px 0 14px;
}
.sidebar-foot a {
  color: var(--gold);
}
.local-label {
  font-size: 14px;
}
.shell {
  margin-right: 244px;
}
.topbar {
  height: 83px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
}
.breadcrumb {
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb span {
  margin: 0 14px;
  color: #737989;
}
.top-actions {
  display: flex;
  gap: 10px;
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #211b13;
  font-weight: 600;
}
.quiet {
  background: transparent;
}
.danger {
  color: #ffb7b0;
  background: transparent;
}
.icon-button {
  font-size: 26px;
  line-height: 1;
  padding: 8px 13px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 16px;
}
.subtitle {
  color: var(--muted);
  margin: 0;
}
.month-stamp {
  text-align: center;
  border-right: 1px solid var(--line);
  padding: 0 32px;
}
.month-stamp b {
  display: block;
  font-size: 42px;
  font-weight: 400;
  color: var(--gold);
  line-height: 1.3;
}
.month-stamp span {
  font-size: 13px;
  color: var(--muted);
}
main {
  max-width: 1450px;
  margin: auto;
  padding: 36px 38px 55px;
  min-height: calc(100vh - 150px);
}
.utility {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.search {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}
.search > span {
  position: absolute;
  right: 14px;
  font-size: 28px;
  color: var(--muted);
}
.search input {
  padding-right: 45px;
  background: var(--panel);
  height: 51px;
}
.date-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.date-picker input {
  width: 168px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 28px;
}
.stat {
  padding: 19px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat b {
  font-weight: 500;
  font-size: 30px;
  color: var(--gold);
}
.stat span {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.stat strong {
  font-size: 16px;
  font-weight: 500;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr);
  gap: 24px;
}
.stack {
  display: grid;
  gap: 24px;
  align-content: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 24px;
  min-width: 0;
}
.panel.accent {
  border-top: 3px solid var(--gold);
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.section-head h2,
.section-head h3 {
  margin: 0;
}
.text-button {
  color: var(--gold);
  background: transparent;
  border-color: transparent;
  font-size: 14px;
  padding: 5px 8px;
  white-space: nowrap;
}
.day-caption {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 15px;
}
.empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #414958;
  border-radius: 10px;
}
.empty strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.empty p {
  font-size: 14px;
  margin: 0;
}
.item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.item:last-child {
  border-bottom: 0;
}
.item-main {
  flex: 1;
  min-width: 0;
}
.item-title {
  display: block;
  border: 0;
  min-height: 0;
  background: none;
  text-align: right;
  padding: 0;
  font-size: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.item.done .item-title {
  text-decoration: line-through;
  color: var(--muted);
}
.item .toggle {
  padding: 0;
  width: 25px;
  min-height: 25px;
  border-radius: 7px;
  margin-top: 4px;
  flex-shrink: 0;
  color: var(--green);
}
.item .meta {
  font-size: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.item .time {
  direction: ltr;
  font-size: 14px;
  color: var(--gold);
  padding-top: 3px;
  min-width: 40px;
}
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid #424956;
  border-radius: 5px;
  color: var(--muted);
}
.pill.rose {
  color: var(--rose);
  border-color: #684e58;
}
.pill.green {
  color: var(--green);
  border-color: #456457;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.cards .panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 20px;
  color: var(--text);
  text-align: right;
  border: 0;
  background: none;
  padding: 0;
}
.card-note {
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.progress {
  height: 5px;
  background: var(--bf-surface-3);
  border-radius: 3px;
  margin: 13px 0;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 3px;
}
.capture {
  display: flex;
  gap: 8px;
}
.capture input {
  min-width: 0;
}
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.health-grid label {
  font-size: 14px;
  color: var(--muted);
}
.health-grid .wide {
  grid-column: 1/-1;
}
.health-grid input {
  margin-top: 5px;
}
.health-grid button {
  margin-top: 10px;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.weekday {
  text-align: center;
  padding: 12px 3px;
  background: var(--raised);
  font-size: 13px;
  color: var(--muted);
}
.cal-day {
  background: var(--panel);
  padding: 10px;
  border: 0;
  border-radius: 0;
  min-height: 118px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  overflow: hidden;
}
.cal-day:hover {
  background: var(--bf-surface-2);
}
.cal-day.selected {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.cal-day.outside {
  opacity: 0.6;
}
.cal-day .day-num {
  font-size: 17px;
}
.cal-day .cal-event {
  font-size: 12px;
  background: var(--bf-surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-day.on-leave {
  background: var(--bf-primary-tint);
}
.cal-day.today .day-num {
  color: var(--gold);
  font-weight: 700;
}
.calendar-key {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0;
}
.week-list {
  display: grid;
  gap: 16px;
}
.week-day {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 25px;
}
.week-day.outside {
  opacity: 0.7;
}
.week-day header {
  border-left: 1px solid var(--line);
  padding-left: 15px;
}
.week-day header button {
  display: block;
  margin-bottom: 10px;
}
.week-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.review-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.review-grid .wide {
  grid-column: 1/-1;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.settings-grid label {
  display: block;
  margin-bottom: 14px;
}
.check-days {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.check-days label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.settings-actions label {
  cursor: pointer;
}
.hint {
  font-size: 14px;
  color: var(--muted);
}
#notice:empty {
  display: none;
}
#notice {
  border: 1px solid #56634f;
  background: var(--bf-success-tint);
  color: #d1e6d8;
  padding: 12px 18px;
  margin-bottom: 20px;
  border-radius: 9px;
}
#notice.error {
  border-color: #986260;
  background: var(--bf-danger-tint);
  color: #ffd2ce;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #655640;
  padding: 18px 22px;
  border-radius: 12px;
  margin-bottom: 24px;
  background: var(--bf-warning-tint);
}
.intro p {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
}
.intro button {
  flex-shrink: 0;
}
footer {
  border-top: 1px solid var(--line);
  padding: 20px 38px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
}
dialog {
  width: min(680px, calc(100% - 24px));
  max-height: 90dvh;
  border: 1px solid #515867;
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  padding: 28px;
}
dialog::backdrop {
  background: rgba(3, 7, 14, 0.78);
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.dialog-head .eyebrow {
  margin-bottom: 4px;
}
.dialog-head h2 {
  margin: 0;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.fields label {
  font-size: 14px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.fields .wide {
  grid-column: 1/-1;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#form-error {
  color: #ffb7b0;
}
#related {
  margin-top: 18px;
}
#related h3 {
  font-size: 16px;
  margin-top: 18px;
}
.relation {
  display: block;
  font-size: 14px;
  color: var(--gold);
  text-align: right;
  background: none;
  border: 0;
  padding: 5px 0;
}
.print-only {
  display: none;
}
.routine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.routine > label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.goal-context {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.notes-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.health-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}
@media (min-width: 1600px) {
  main {
    padding-top: 48px;
  }
  .sidebar {
    width: 264px;
  }
  .shell {
    margin-right: 264px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 208px;
    padding: 25px 15px;
  }
  .shell {
    margin-right: 208px;
  }
  main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stack {
    grid-template-columns: 1fr 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 15px;
  }
  .stat b {
    font-size: 25px;
  }
  .month-stamp {
    padding: 0 18px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 16px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 19px;
  }
  .brand-mark {
    width: 34px;
    height: 38px;
    font-size: 25px;
  }
  .edition,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    margin-top: 17px;
    gap: 7px;
    padding-bottom: 4px;
  }
  .nav-item {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 12px;
    flex-shrink: 0;
  }
  .nav-item .glyph {
    display: none;
  }
  .shell {
    margin: 0;
  }
  .topbar {
    height: 68px;
    padding: 0 18px;
  }
  .breadcrumb {
    font-size: 12px;
  }
  .breadcrumb span {
    margin: 0 5px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    font-size: 13px;
    padding: 8px 10px;
  }
  main {
    padding: 26px 17px 36px;
  }
  .heading {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 44px;
  }
  h1 span {
    font-size: 32px;
  }
  .eyebrow {
    font-size: 12px;
    margin-bottom: 11px;
  }
  .month-stamp {
    display: none;
  }
  .subtitle {
    font-size: 14px;
  }
  .utility {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 21px;
  }
  .date-picker {
    justify-content: space-between;
  }
  .date-picker input {
    flex: 1;
    max-width: 200px;
  }
  .stats {
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
  }
  .stat {
    padding: 12px 10px;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 5px;
  }
  .stat b {
    font-size: 26px;
  }
  .stat strong {
    font-size: 13px;
  }
  .stat span {
    font-size: 12px;
  }
  .panel {
    padding: 18px;
  }
  .stack,
  .cards,
  .settings-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }
  .grid,
  .stack {
    gap: 18px;
  }
  .intro {
    padding: 15px;
    flex-direction: column;
    align-items: flex-start;
  }
  .section-head h2 {
    font-size: 18px;
  }
  .cal-day {
    min-height: 93px;
    padding: 5px;
    gap: 3px;
  }
  .cal-day .cal-event {
    font-size: 10px;
    padding: 1px 3px;
  }
  .weekday {
    font-size: 11px;
    padding: 10px 0;
  }
  .cal-day .day-num {
    font-size: 14px;
  }
  .week-day {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .week-day header {
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .week-day header button {
    margin: 0;
  }
  .week-actions {
    gap: 6px;
    flex-wrap: wrap;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .fields .wide {
    grid-column: auto;
  }
  dialog {
    padding: 20px;
  }
  .review-grid .wide {
    grid-column: auto;
  }
  footer {
    padding: 18px;
    flex-direction: column;
    gap: 4px;
  }
  .calendar-key {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cards .card-title {
    font-size: 19px;
  }
}
@media print {
  color-scheme: light;
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  .sidebar,
  .topbar,
  .utility,
  footer,
  .intro,
  .dialog-actions,
  dialog,
  #notice,
  .no-print,
  .text-button,
  .capture,
  button.primary,
  .item .toggle,
  .routine button {
    display: none !important;
  }
  .shell {
    margin: 0;
  }
  main {
    padding: 0;
    max-width: none;
    min-height: 0;
  }
  .heading {
    margin-bottom: 15px;
  }
  h1,
  h1 span {
    font-size: 28pt;
    color: black;
  }
  .eyebrow,
  .subtitle,
  .meta,
  small,
  .day-caption,
  .hint,
  .pill {
    color: #333 !important;
  }
  .month-stamp {
    display: none;
  }
  .stats {
    margin-bottom: 15px;
  }
  .stat,
  .panel,
  .week-day {
    background: white;
    border: 1px solid #aaa;
    break-inside: avoid;
    color: black;
  }
  .grid,
  .stack {
    display: block;
  }
  .panel {
    margin-bottom: 15px;
  }
  .item-title,
  .card-title,
  .text-button {
    color: black !important;
  }
  .calendar,
  .weekday,
  .cal-day {
    background: white;
    color: black;
  }
  .cal-day {
    min-height: 95px;
    break-inside: avoid;
  }
  .cal-event {
    background: #eee !important;
    color: black;
  }
  .cal-day.on-leave {
    background: #eee;
  }
  .cal-day.selected {
    box-shadow: none;
  }
  .stat b {
    color: black;
  }
  .search {
    display: none;
  }
  .week-actions button {
    display: none;
  }
  .week-day header button {
    display: block;
    background: none;
    color: black;
    border: 0;
  }
  .fields input,
  textarea,
  select,
  input {
    background: white;
    color: black;
    border-color: #999;
  }
  .print-only {
    display: block;
  }
  .health-grid button {
    display: none;
  }
  .calendar-key {
    color: #333;
  }
  .item {
    break-inside: avoid;
  }
  .cards {
    display: block;
  }
  .card-note {
    color: #333;
  }
  .progress {
    background: #ddd;
  }
  .progress > span {
    background: #555;
  }
  .section-head > button {
    display: none;
  }
}


/* bf-ds v2 map: start — يولّده _unify/sync-ds.mjs؛ لا تعدّل هنا */
:root{color-scheme:light;--bg:var(--bf-bg);--panel:var(--bf-surface);--raised:var(--bf-surface-2);--line:var(--bf-border);--text:var(--bf-text);--muted:var(--bf-text-2);--gold:var(--bf-movement);--green:var(--bf-primary);--rose:var(--bf-connection);font-family:var(--bf-font)}
/* bf-ds v2 map: end */
