:root {
  --page: #F7F8F6;
  --card: #FFFFFF;
  --forest: #1E3A2F;
  --forest-deep: #152B22;
  --forest-hover: #2A4C3E;
  --forest-tint: #E9F0EB;
  --forest-tint-2: #DCE8E0;
  --charcoal: #23262B;
  --text-2: #5A6169;
  --text-3: #8B929A;
  --gold: #C9A24B;
  --gold-deep: #8A6A24;
  --gold-tint: #FBF3DF;
  --green-ok: #1F7A4D;
  --green-ok-tint: #E4F3EA;
  --red-bad: #B4453A;
  --red-bad-tint: #FBEAE8;
  --line: #E7E9E5;
  --line-2: #F0F1EE;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,30,25,0.05), 0 4px 16px rgba(20,30,25,0.05);
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--page);
  color: var(--charcoal);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--forest);
  color: #DCE8E0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
}
.brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--forest-deep);
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand .name { font-weight: 600; font-size: 16px; color: #FFFFFF; }
.brand .sub { font-size: 11px; color: #9FB5A9; display: block; line-height: 1.2; }

.nav-group { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: #7E9A8C; padding: 14px 12px 6px; }
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #C4D4CA;
  text-decoration: none;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}
.snav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.snav a:hover { background: var(--forest-hover); color: #FFFFFF; }
.snav a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.snav a.active { background: var(--forest-deep); color: #FFFFFF; }
.snav a.active svg { opacity: 1; color: var(--gold); }
.snav .count {
  margin-left: auto;
  background: var(--gold);
  color: var(--forest-deep);
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 8px;
}
.sidebar .foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.userchip:hover { background: var(--forest-hover); }
.userchip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--forest-tint); color: var(--forest);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.userchip .who { font-size: 13px; font-weight: 600; color: #FFFFFF; line-height: 1.25; }
.userchip .who small { display: block; font-size: 11px; font-weight: 500; color: #9FB5A9; }

/* ---------- Main ---------- */
.main { padding: 28px 32px 56px; }
.page { display: none; }
.page.visible { display: block; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--charcoal);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  box-shadow: 0 1px 1px rgba(20,30,25,0.04);
}
.btn:hover { background: #F4F5F2; border-color: #D8DBD5; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #FFFFFF; }
.btn.primary:hover { background: var(--forest-hover); }
.btn.icon { padding: 9px 12px; line-height: 1; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 1px 1px rgba(20,30,25,0.04); }
.seg .btn { border: none; border-radius: 0; box-shadow: none; }
.seg .btn + .btn { border-left: 1px solid var(--line); }
.date-field {
  font-family: var(--font); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; background: var(--card); color: var(--charcoal);
}
.date-field:focus-visible { outline: 2px solid var(--forest); outline-offset: 1px; }

/* ---------- Banner ---------- */
.banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--gold-tint);
  border: 1px solid #EAD9AE;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--gold-deep);
  font-weight: 500;
}
.banner a { color: var(--gold-deep); font-weight: 700; margin-left: auto; text-decoration: none; white-space: nowrap; }
.banner a:hover { text-decoration: underline; }

/* ---------- Diary card ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.diary-grid { display: grid; grid-template-columns: 64px repeat(2, minmax(0, 1fr)); }
.dg-corner { border-bottom: 1px solid var(--line); }
.dg-staff {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line-2);
  font-weight: 600; font-size: 14px;
}
.dg-staff .dot { width: 9px; height: 9px; border-radius: 50%; }
.dg-staff .role { font-size: 11px; font-weight: 500; color: var(--text-3); }
.dg-time {
  padding: 10px 12px 0 0;
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.dg-time.half { color: #C2C7CC; font-size: 11px; }
.dg-cell {
  border-left: 1px solid var(--line-2);
  border-top: 1px solid var(--line-2);
  min-height: 42px;
  padding: 5px 8px;
}
.dg-cell.hour { border-top-color: var(--line); }

/* Diary duration blocks — overlay grid, row heights unchanged */
.diary-panel { overflow: visible; }
.diary-header-grid {
  display: grid;
  position: relative;
  z-index: 3;
  background: var(--card);
}
.diary-timeline {
  position: relative;
}
.diary-grid-lines { position: relative; z-index: 1; }
.diary-grid-appts {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}
.dg-overlay-spacer {
  visibility: hidden;
  pointer-events: none;
  border-color: transparent !important;
  background: transparent !important;
}
.dg-cell-overlay {
  position: relative;
  overflow: visible;
  border-color: transparent !important;
  background: transparent !important;
  pointer-events: none;
  min-height: 42px;
  padding: 5px 8px;
}

/* Professional diary appointment cards */
.appt.dg-duration-block {
  position: absolute;
  margin: 0;
  padding: 0;
  display: block;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  border: 1px solid var(--forest-tint-2);
  border-left: 4px solid var(--forest);
  box-shadow: 0 1px 3px rgba(20, 30, 25, 0.06);
  transition: box-shadow 120ms ease, transform 80ms ease;
}
.appt.dg-duration-block .dg-appt-content {
  position: relative;
  z-index: 1;
  padding: 8px 10px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  justify-content: flex-start;
}
.appt.dg-duration-block .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.appt.dg-duration-block .client {
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.appt.dg-duration-block .when {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.8;
  flex-shrink: 0;
}
.appt.dg-duration-block .service {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.3;
  opacity: 0.88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appt.dg-duration-block .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}
.appt.dg-duration-block .tag {
  font-size: 9.5px;
  padding: 1px 7px;
  line-height: 1.4;
}

/* Confirmed — soft green duration highlight */
.appt.dg-duration-block.confirmed {
  background: linear-gradient(
    180deg,
    #EEF5F0 0%,
    #E9F0EB 28%,
    rgba(233, 240, 235, 0.55) 100%
  );
  border-color: var(--forest-tint-2);
  border-left-color: var(--forest);
  color: var(--forest-deep);
}
.appt.dg-duration-block.pending {
  background: linear-gradient(180deg, #FCF6E8 0%, var(--gold-tint) 40%, rgba(251, 243, 223, 0.5) 100%);
  border-left-color: var(--gold);
  border-color: #EAD9AE;
  color: var(--gold-deep);
}
.appt.dg-duration-block.noshow {
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed #CFD3CE;
  border-left: 4px dashed #CFD3CE;
  color: var(--text-3);
}
.appt.dg-duration-block.noshow .client { text-decoration: line-through; }

.appt.dg-duration-block:hover {
  z-index: 20 !important;
  box-shadow: 0 2px 12px rgba(20, 30, 25, 0.12);
  transform: translateY(-1px);
}

/* Short appointments (< 64px) */
.appt.dg-duration-block.appt-short .dg-appt-content { padding: 5px 8px 5px 6px; gap: 1px; }
.appt.dg-duration-block.appt-short .client { font-size: 11px; }
.appt.dg-duration-block.appt-short .when { font-size: 10px; }
.appt.dg-duration-block.appt-short .service {
  font-size: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.appt.dg-duration-block.appt-short .tags { display: none; }

/* Medium appointments (64–119px) */
.appt.dg-duration-block.appt-medium .tags .tag:nth-child(n+3) { display: none; }

/* Long appointments — content at top, soft tint below */
.appt.dg-duration-block.appt-long::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 0;
  top: 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 6px 10px 0 0;
}
.appt.dg-duration-block.appt-long.confirmed::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  top: 68px;
  background: linear-gradient(180deg, transparent 0%, rgba(30, 58, 47, 0.04) 100%);
  pointer-events: none;
  border-radius: 0 0 10px 0;
}


/* ---------- Appointments ---------- */
.appt {
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: box-shadow 120ms ease, transform 80ms ease;
}
.appt:hover { box-shadow: 0 2px 10px rgba(20,30,25,0.10); transform: translateY(-1px); }
.appt .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.appt .client { font-weight: 700; font-size: 13px; }
.appt .when { font-size: 11px; font-weight: 600; white-space: nowrap; opacity: 0.75; }
.appt .service { font-size: 12px; margin: 1px 0 8px; opacity: 0.85; }
.appt.confirmed { background: var(--forest-tint); border-color: var(--forest-tint-2); color: var(--forest-deep); }
.appt.pending { background: var(--gold-tint); border-color: #EAD9AE; color: var(--gold-deep); }
.appt.noshow { background: transparent; border: 1px dashed #CFD3CE; color: var(--text-3); }
.appt.noshow .client { text-decoration: line-through; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: #FFFFFF;
}
.tag.ok { color: var(--green-ok); background: var(--green-ok-tint); }
.tag.due { color: var(--gold-deep); background: #F3E5C2; }
.tag.bad { color: var(--red-bad); background: var(--red-bad-tint); }
.tag.neutral { color: var(--text-2); background: var(--line-2); }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat .label { font-size: 12px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-top: 6px; }
.stat .hint { font-size: 12px; font-weight: 500; margin-top: 2px; color: var(--text-3); }
.stat.attention { border-color: #EAD9AE; background: linear-gradient(0deg, var(--gold-tint), var(--gold-tint)); }
.stat.attention .value { color: var(--gold-deep); }
.stat.attention .hint { color: var(--gold-deep); }

.section-title { font-size: 15px; font-weight: 700; margin: 30px 0 14px; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.ql {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-decoration: none;
  color: var(--charcoal);
  transition: border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  display: block;
}
.ql:hover { border-color: var(--forest-tint-2); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,30,25,0.08); }
.ql:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.ql .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--forest-tint); color: var(--forest);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.ql .ic svg { width: 18px; height: 18px; }
.ql h3 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.ql p { font-size: 12.5px; color: var(--text-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--red-bad); }
.input, .select, .textarea {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--card); color: var(--charcoal);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-tint); }
.textarea { min-height: 88px; resize: vertical; }
.card-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-block + .card-block { margin-top: 16px; }
.card-block h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.summary-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.summary-line:last-of-type { border-bottom: none; }
.summary-line .k { color: var(--text-2); font-weight: 500; }
.summary-line .v { font-weight: 600; }
.summary-line.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
.summary-line.total .v { font-size: 17px; font-weight: 700; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FBFCFA;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #FAFBF8; }
.cell-person { display: flex; align-items: center; gap: 11px; }
.cell-person .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--forest-tint); color: var(--forest);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.cell-person .nm { font-weight: 600; }
.cell-person .em { font-size: 12px; color: var(--text-3); display: block; }
.t-right { text-align: right; }
.link-btn { background: none; border: none; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--forest); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--forest-tint); }
.link-btn.danger { color: var(--red-bad); }
.link-btn.danger:hover { background: var(--red-bad-tint); }

/* ---------- Toolbar row ---------- */
.list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 9px 13px; box-shadow: 0 1px 1px rgba(20,30,25,0.04);
}
.search svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.search input { border: none; outline: none; font-family: var(--font); font-size: 13.5px; font-weight: 500; width: 100%; background: transparent; color: var(--charcoal); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer;
}
.chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---------- Request cards ---------- */
.req-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.req-card + .req-card { margin-top: 12px; }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.req-meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 14px; font-size: 13px; }
.req-meta .m { color: var(--text-2); }
.req-meta .m b { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.3px; }
.req-meta .m span { font-weight: 600; color: var(--charcoal); }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.approve { background: var(--green-ok); border-color: var(--green-ok); color: #fff; }
.btn.approve:hover { background: #196A42; }
.btn.decline { color: var(--red-bad); }
.btn.decline:hover { background: var(--red-bad-tint); border-color: #E8C7C3; }
.btn.danger, .link-btn.danger { color: var(--red-bad); }
.btn.danger:hover { background: var(--red-bad-tint); border-color: #E8C7C3; }
.link-btn.danger:hover { color: var(--red-bad); text-decoration: underline; }
.req-age { font-size: 12px; font-weight: 600; color: var(--text-3); }
.req-age.old { color: var(--gold-deep); }

/* ---------- Rota ---------- */
.rota-wrap { overflow-x: auto; }
table.rota { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.rota th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); padding: 11px 12px; border-bottom: 1px solid var(--line); background: #FBFCFA; text-align: left; }
table.rota td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line-2); }
table.rota td:first-child { border-left: none; font-weight: 600; white-space: nowrap; }
.shift { display: inline-block; background: var(--forest-tint); color: var(--forest-deep); border-radius: 8px; padding: 3px 10px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.shift.off { background: var(--line-2); color: var(--text-3); }
.shift.hol { background: var(--gold-tint); color: var(--gold-deep); }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: var(--forest); border-radius: 6px 6px 0 0; }
.bar.gold { background: var(--gold); }
.bar-col .lbl { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.bar-col .val { font-size: 11.5px; font-weight: 700; color: var(--forest-deep); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.rank { display: flex; flex-direction: column; }
.rank .r { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.rank .r:last-child { border-bottom: none; }
.rank .n { width: 22px; height: 22px; border-radius: 7px; background: var(--forest-tint); color: var(--forest-deep); font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank .grow { flex: 1; font-weight: 600; }
.rank .amt { font-weight: 700; color: var(--forest-deep); }

/* ---------- Toggles / settings ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: none; }
.setting-row .t { font-weight: 600; font-size: 14px; }
.setting-row .d { font-size: 12.5px; color: var(--text-2); }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; margin: 0; }
.toggle .tr { position: absolute; inset: 0; background: #D8DBD5; border-radius: 99px; transition: background 150ms ease; pointer-events: none; }
.toggle .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 150ms ease; }
.toggle input:checked + .tr { background: var(--forest); }
.toggle input:checked + .tr::after { transform: translateX(18px); }
.toggle input:focus-visible + .tr { outline: 2px solid var(--forest); outline-offset: 2px; }
.hours-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.hours-row:last-child { border-bottom: none; }
.hours-row .day { width: 90px; font-weight: 600; }
.hours-row .tm { color: var(--text-2); font-weight: 500; }
.hours-row .closed { color: var(--text-3); font-style: italic; }

/* ---------- HR people ---------- */
.person-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.person-card + .person-card { margin-top: 12px; }
.person-card .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--forest); color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.person-card .avatar.gold { background: var(--gold); color: var(--forest-deep); }
.person-card .info { flex: 1; min-width: 180px; }
.person-card .nm { font-weight: 700; font-size: 15px; }
.person-card .rl { font-size: 12.5px; color: var(--text-2); }
.person-facts { display: flex; gap: 26px; flex-wrap: wrap; }
.person-facts .f b { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); }
.person-facts .f span { font-size: 13.5px; font-weight: 600; }
.meter { width: 130px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 5px; }
.meter i { display: block; height: 100%; background: var(--forest); border-radius: 99px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px; padding: 12px 14px; }
  .brand { padding: 0 8px 0 0; }
  .brand .sub, .nav-group, .snav a span.txt-hide, .sidebar .foot { display: none; }
  .snav { flex-direction: row; flex-wrap: wrap; }
  .snav a { padding: 7px 10px; }
  .main { padding: 20px 16px 44px; }
  .diary-grid { grid-template-columns: 50px repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Eden app integration helpers */
.flash {
  margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 500;
}
.flash.error { border-color: #E8C4BF; background: var(--red-bad-tint); color: var(--red-bad); }
.flash.success { border-color: #B8D9C6; background: var(--green-ok-tint); color: var(--green-ok); }
.flash.warn { border-color: #EAD9AE; background: var(--gold-tint); color: var(--gold-deep); }

.empty-state {
  padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text-2); text-align: center; font-size: 13px;
}

.panel-body { padding: 18px 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; font-weight: 700; }

.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subnav a {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--charcoal); font-size: 12px; font-weight: 600; text-decoration: none;
}
.subnav a.is-active, .subnav a:hover { background: var(--forest); border-color: var(--forest); color: #fff; }

.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page); }
.login-panel {
  width: min(420px, 100%); padding: 28px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.login-panel .brand { padding: 0 0 18px; }
.login-panel h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-panel .sub { color: var(--text-2); font-size: 14px; }

.public-page { min-height: 100vh; background: var(--page); }
.public-header { background: var(--forest); color: #DCE8E0; padding: 14px 18px; }
.public-header-inner { max-width: 920px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-header .brand .name { color: #FFFFFF; }
.public-header .brand .sub { color: #9FB5A9; }
.public-main { max-width: 920px; margin: 0 auto; padding: 24px 18px 48px; }
.public-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.public-step {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card);
  color: var(--text-3); font-size: 12px; font-weight: 700;
}
.public-step.is-active { background: var(--forest); color: #fff; border-color: var(--forest); }
.public-step.is-done { background: var(--green-ok); color: #fff; border-color: var(--green-ok); }
.public-service-option {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
}
.public-service-option input { width: auto; min-height: auto; margin-top: 3px; }

a.btn, a.ql, a.userchip { text-decoration: none; color: inherit; }
a.snav { text-decoration: none; }
.hidden { display: none !important; }
.text-muted { color: var(--text-2); }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.full { grid-column: 1 / -1; }
.w-full { width: 100%; }

/* Map legacy form controls to template inputs when class omitted */
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="number"],
form input[type="date"], form input[type="time"], form input[type="search"], form input[type="tel"],
form select, form textarea {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--card); color: var(--charcoal); width: 100%;
}
form textarea { min-height: 88px; resize: vertical; }
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-tint);
}

/* Global form control fallback — unclassed fields must not look browser-default */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
  color: var(--charcoal);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-tint);
}
button,
input[type="submit"],
input[type="button"] {
  font-family: var(--font);
}
input[type="file"] {
  padding: 8px;
  width: 100%;
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--charcoal);
  border-radius: 10px;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: #F4F5F2;
  border-color: #D8DBD5;
}
.search input {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent !important;
}
table.data .input,
table.data input.input {
  width: 100%;
  min-width: 72px;
  max-width: 120px;
  padding: 8px 10px;
  font-size: 13px;
}
.btn.small { padding: 7px 11px; font-size: 12px; }
.btn.olive { background: var(--forest-tint); border-color: #C5D8CC; color: var(--forest); }
.btn.olive:hover { background: var(--forest-tint-2); }
.form-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-card { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); text-decoration: none; color: inherit; }
.photo-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-card span { display: block; padding: 8px 10px; font-size: 11px; color: var(--text-2); }


/* Diary blocked time / breaks */
.dg-block.dg-duration-block {
  position: absolute;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: none;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: repeating-linear-gradient(
    -45deg,
    rgba(120, 125, 130, 0.06),
    rgba(120, 125, 130, 0.06) 6px,
    rgba(120, 125, 130, 0.12) 6px,
    rgba(120, 125, 130, 0.12) 12px
  );
  color: var(--text-3);
}
.dg-block .dg-block-content {
  padding: 6px 8px;
}
.dg-block .dg-block-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.85;
}
.dg-block.block-holiday,
.dg-block.block-time_off {
  background: rgba(180, 140, 60, 0.1);
  border-color: rgba(180, 140, 60, 0.35);
}
.dg-block.block-break,
.dg-block.block-lunch {
  background: rgba(100, 110, 120, 0.08);
}

/* Phase 9 — lightweight report bar charts */
.hbar-list { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { flex: 0 0 120px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--forest); border-radius: 4px; min-width: 2px; }
.hbar-val { flex: 0 0 48px; text-align: right; font-weight: 700; color: var(--forest-deep); }

/* Phase 10 — admin polish */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.settings-card { display: flex; flex-direction: column; min-height: 180px; }
.settings-card .btn { margin-top: auto; align-self: flex-start; }
.action-danger-zone { border-color: #E8C4BF; background: linear-gradient(0deg, var(--red-bad-tint), var(--red-bad-tint)); }
.btn.danger { background: var(--red-bad-tint); border-color: #E8C4BF; color: var(--red-bad); font-weight: 600; }
.btn.danger:hover { background: #f5d6d2; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty-state { line-height: 1.5; }
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .btn-row { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .hbar-label { flex: 0 0 90px; font-size: 12px; }
}
