.agenda-app .k9-shell {
  --ink: #152b24;
  --muted: #465e53;
  --blue: #204e3a;
  --line: #dce5de;
  --surface: #fff;
  --k9-ground: #f3f5f0;
  --k9-clay: #a64e39;
  --k9-mint: #e6eee6;
  --k9-shadow: 0 7px 22px #14382a0b;
  background: var(--k9-ground);
  color: var(--ink);
  grid-template-columns: 220px minmax(0, 1fr);
}
.k9-shell .sidebar { background: #193b30; border: 0; gap: 30px; }
.k9-shell .brand-mark { background: #dce6c7; color: #233a24; }
.k9-shell .sidebar nav .side-link { white-space: normal; border-radius: 12px; }
.k9-shell .sidebar nav .side-link[aria-current] { background: #deeadb; color: #183728; box-shadow: none; }
.k9-shell .sidebar nav .side-link[aria-current] .symbol { color: #204e3a; }
.k9-shell .sidebar nav .side-link:focus-visible { outline-offset: -2px; }
.k9-shell .workspace { max-width: 1330px; padding: 34px clamp(20px,4vw,60px) 48px; }
.k9-shell .top { min-height: 0; padding: 0; background: transparent; color: var(--ink); margin-bottom: 20px; border-radius: 0; box-shadow: none; }
.k9-shell .top h1 { color: var(--ink); font-size: clamp(2.05rem,4vw,3.55rem); font-weight: 720; letter-spacing: -.055em; }
.k9-shell .top #page-description { color: var(--muted); font-size: 1rem; line-height: 1.4; }
.k9-shell .top .page-date { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.k9-shell .top .primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.k9-shell .top .secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.k9-shell .top .primary:hover { background: #153c2c; }
.k9-shell .top .secondary:hover { background: #ecf2e9; }
.k9-shell .demo-message { background: transparent; color: var(--muted); border: 0; padding: 0; font-size: .875rem; }
.k9-shell .card { border-radius: 20px; background: #fff; border-color: var(--line); box-shadow: var(--k9-shadow); }
.k9-shell .reminders { background: #fff6df; border-color: #e4c891; }
.k9-shell :is(.primary,.secondary,.mini) { border-radius: 10px; min-height: 44px; }
.k9-shell :is(.secondary,.mini):hover { background: #eef4ed; border-color: #b7c8bb; }
.k9-shell .empty { color: var(--muted); }

.dog-initial { display: grid; place-items: center; border-radius: 50%; background: #dbe8d5; color: #234b36; font-size: 1.35rem; font-weight: 750; }
.lesson-progress { background: #edf3ee; border-radius: 12px; padding: 12px; margin-top: 14px; min-width: 0; }
.lesson-progress div { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.lesson-progress span,.lesson-progress p { color: var(--muted); font-size: .875rem; }
.lesson-progress progress { display: block; width: 100%; height: 9px; margin: 8px 0 4px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: #d8e4d8; }
.lesson-progress progress::-webkit-progress-bar { background: #d8e4d8; }
.lesson-progress progress::-webkit-progress-value { background: #2b6148; }
.lesson-progress progress::-moz-progress-bar { background: #2b6148; }

.k9-shell .agenda-card { margin-top: 0; }
.k9-shell .agenda-card .week { gap: 5px; margin-top: 0; }
.k9-shell .agenda-card .day { border-color: transparent; background: #f2f5ef; border-radius: 12px; }
.k9-shell .agenda-card .day[aria-pressed=true] { background: var(--blue); color: #fff; }
.k9-shell .day[aria-pressed=true] :is(.day-count,small) { color: #fff; }
.k9-shell .week-actions { flex-wrap: nowrap; max-width: 100%; }
.k9-shell .week-actions input { max-width: 143px; }
.k9-shell .field-slot { --session-color: #2a624b; --session-background: #ecf4ed; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 10px 0; gap: 8px; grid-template-columns: minmax(58px,83px) minmax(0,1fr); }
.k9-shell .field-slot[data-service-color="group"],.k9-shell .field-slot[data-service-color="assessment"] { --session-color: #9c4a36; --session-background: #fcf0eb; }
.k9-shell .field-slot[data-service-color="online"],.k9-shell .field-slot[data-service-color="event"] { --session-color: #485e75; --session-background: #edf2f6; }
.k9-shell .field-slot .slot-main { border-left: 4px solid var(--session-color); background: var(--session-background); padding: 12px; border-radius: 12px; min-width: 0; }
.k9-shell .field-slot .slot-when time { color: var(--ink); }
.k9-shell .field-slot .slot-title { align-items: center; }
.k9-shell .field-slot .slot-title h3 { flex: 1 1 125px; overflow-wrap: anywhere; }

.k9-shell .record-card { background: #fff; border-radius: 16px; padding: 16px; }
.k9-shell .record-card h3 { font-size: 1.25rem; }
.k9-shell .client-dogs { background: #f1f5ee; border: 0; padding: 14px; border-radius: 14px; }
.k9-shell .client-dogs li { gap: 7px; }
.k9-shell .client-dogs li .link-button { text-align: left; justify-content: flex-start; }
.k9-shell .record-actions { margin-bottom: 12px; }
.dog-profile { border-radius: 18px; background: #f6f7f3; overflow: hidden; border: 1px solid var(--line); }
.dog-identity { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; background: #204e3a; padding: clamp(16px,3vw,26px); color: #fff; }
.dog-identity h2 { font-size: 1.6rem; overflow-wrap: anywhere; }
.dog-identity p { color: #dfeee4; overflow-wrap: anywhere; }
.dog-initial { width: 58px; height: 58px; flex: none; border: 2px solid #fff; }
.dog-identity .secondary { margin-left: auto; }
.dog-data { padding: clamp(12px,2vw,20px); }
.dog-sections { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; border-bottom: 1px solid var(--line); }
.dog-sections button { min-height: 45px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 650; padding: 5px 2px; white-space: normal; overflow-wrap: anywhere; }
.dog-sections button[aria-pressed=true] { border-color: var(--blue); color: var(--blue); }
.dog-facts { margin: 14px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dog-facts div { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.dog-facts dt { font-size: .875rem; color: var(--muted); }
.dog-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.k9-shell .diary-entry dl { display: grid; grid-template-columns: 1fr; gap: 8px; }
.k9-shell .diary-entry dl div { background: #f2f5ef; padding: 10px 12px; border-radius: 10px; }
.k9-shell .diary-entry dl dd { overflow-wrap: anywhere; }
.k9-shell[data-page="diario"] .records .record-grid { grid-template-columns: minmax(0,1fr); }
.k9-public { --blue: #204e3a; --ink: #152b24; --line: #dce5de; --page: #f3f5f0; --muted: #465e53; background: var(--page); }
.k9-public .public-card { box-shadow: 0 7px 22px #14382a0b; border-radius: 20px; }
.k9-public :is(.booking-offer,#client-homework) { background: #eff4ed; padding: 14px; border: 1px solid var(--line); border-radius: 13px; margin-block: 14px; }
.k9-public #client-homework .portal-heading { margin-top: 0; }

@media (max-width: 780px) {
  .agenda-app .k9-shell { display: block; }
  .agenda-app .k9-shell .sidebar { position: relative; z-index: 4; height: auto; background: #fcfdf9; color: var(--ink); gap: 3px 8px; padding: max(8px,env(safe-area-inset-top)) 14px 6px; border-bottom: 1px solid var(--line); }
  .agenda-app .k9-shell .sidebar .brand { font-size: 1rem; }
  .agenda-app .k9-shell .sidebar .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .agenda-app .k9-shell .sidefoot #logout { color: var(--muted); padding: 5px 8px; font-size: .875rem; }
  .agenda-app .k9-shell .sidebar nav { display: contents; }
  .agenda-app .k9-shell #main-nav { position: fixed; inset: auto 0 0; z-index: 4; background: #fff; box-shadow: 0 -3px 18px #203b2e14; border-top: 1px solid var(--line); padding: 5px 8px max(5px,env(safe-area-inset-bottom)); gap: 4px; }
  .agenda-app .k9-shell .sidebar #main-nav .side-link { color: #304c3e; min-height: 52px; border-radius: 10px; padding: 3px 2px; }
  .agenda-app .k9-shell .sidebar #main-nav .side-link[aria-current] { background: #e6eee3; color: #183f2c; }
  .agenda-app .k9-shell .sidebar .symbol { color: #2a513b; }
  .agenda-app .k9-shell .workspace { padding: 18px 14px calc(88px + env(safe-area-inset-bottom)); }
  .agenda-app .k9-shell .top { align-items: flex-start; }
  .agenda-app .k9-shell .top .controls { width: 100%; gap: 7px; }
  .agenda-app .k9-shell .top .controls > * { flex: 1 1 auto; padding-inline: 8px; }
}
@media (max-width: 400px) {
  .k9-shell .agenda-card .week-actions input { max-width: 125px; }
  .k9-shell .agenda-card .week-actions .mini { min-width: 35px; padding-inline: 5px; }
  .k9-shell .field-slot { grid-template-columns: 49px minmax(0,1fr); }
  .k9-shell .field-slot .slot-main { padding: 9px; }
  .dog-facts { grid-template-columns: minmax(0,1fr); }
}

/* Workspace navigation and toolbar */
.agenda-app .k9-shell {
  --k9-ground: #f5f3ed;
  --line: #e2e4da;
  --k9-mint: #e9eee2;
  --k9-clay: #a64e35;
  --k9-shadow: 0 2px 6px #2636260b, 0 10px 24px #26362606;
  grid-template-columns: 224px minmax(0,1fr);
}
.agenda-app .k9-shell .sidebar { gap: 20px; padding: 22px 13px 15px; background: #19372b; }
.k9-shell .sidebar .brand { color: #fff; padding-inline: 8px; }
.k9-shell .sidebar .brand-mark { background: #d3dec6; color: #213e2f; }
.k9-shell .sidebar nav { min-height: 0; overflow-y: auto; gap: 11px; }
.k9-shell .sidebar nav .side-link { min-height: 40px; padding: 6px 9px; font-size: .94rem; }
.k9-shell .sidebar nav .side-link[aria-current="page"] { background: var(--k9-clay); border-color: transparent; color: #fff; box-shadow: none; }
.k9-shell .sidebar nav .side-link[aria-current="page"] .symbol { color: #fff; }
.k9-shell .sidebar #tools-nav { border-top: 1px solid #ffffff27; padding-top: 7px; }
.k9-shell .sidefoot .side-link { white-space: normal; font-size: .87rem; padding: 8px 7px; }
.k9-shell .workspace { max-width: none; padding: 0 clamp(22px,3vw,48px) 48px; }
.workspace-toolbar {
  min-height: 66px; padding: 9px clamp(22px,3vw,48px); margin: 0 calc(-1 * clamp(22px,3vw,48px)) 25px;
  background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.workspace-search { flex: 0 1 345px; display: flex; gap: 6px; min-width: 0; }
.workspace-search input { background: #f3f3ec; border-color: #e4e6dc; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; min-width: 0; }
.toolbar-actions .account-name { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.toolbar-actions .primary { background: var(--k9-clay); border-color: var(--k9-clay); white-space: nowrap; }
.toolbar-actions .primary:hover { background: #894029; }
.toolbar-reminders { display: grid; place-items: center; position: relative; width: 43px; min-height: 43px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 1.25rem; color: var(--blue); }
#toolbar-reminder-count { position: absolute; top: 2px; right: 3px; background: var(--k9-clay); border-radius: 30px; color: #fff; padding: 1px 5px; font-size: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.k9-shell .top { margin-bottom: 16px; }
.k9-shell .top h1 { font-size: clamp(1.95rem,3.8vw,3rem); }
.k9-shell .demo-message { font-size: .83rem; margin-bottom: 14px; }
.k9-shell .card { border-radius: 15px; }
#panel > .card + .card { margin-top: 14px; }

/* Directory master-detail */
.client-directory { display: grid; grid-template-columns: minmax(225px,.88fr) minmax(0,1.8fr); gap: 17px; align-items: start; }
.k9-shell .directory-list { padding: clamp(12px,1.7vw,20px); min-width: 0; }
.directory-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.directory-heading h2 { font-size: 1.16rem; }
.directory-heading button { padding-inline: 10px; font-size: .87rem; }
.directory-list input { border-color: var(--line); background: #f8f8f2; }
.directory-rows { display: grid; gap: 8px; margin-top: 12px; }
.directory-avatar { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 50%; background: #e7ecdc; color: #21422e; font-weight: 720; font-size: 1.1rem; }
.directory-detail { min-width: 0; }
.directory-detail > .directory-back { display: none; }
.directory-detail .record-editor { margin-top: 0; }
.directory-detail > .record-card,.directory-detail .dog-profile { box-shadow: var(--k9-shadow); }
.directory-detail .dog-profile { background: #fff; border-radius: 15px; }
.directory-detail .dog-identity { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.directory-detail .dog-identity p { color: var(--muted); }
.directory-detail .dog-initial { background: #e3ead7; color: #234b36; border: 0; width: 66px; height: 66px; }
.directory-detail .dog-data { padding: 0 clamp(12px,2vw,20px) 16px; }
.directory-detail .dog-sections { justify-content: start; display: flex; gap: 10px; overflow-x: auto; }
.directory-detail .dog-sections button { flex: 0 0 auto; padding: 8px 7px; }
.directory-detail .dog-sections button[aria-pressed=true] { border-color: var(--k9-clay); color: #843e2c; }
.dog-profile-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(145px,1fr); gap: 16px; }
.dog-actions { display: grid; align-content: start; gap: 7px; padding: 15px 0 4px 12px; border-left: 1px solid var(--line); }
.dog-actions h3 { margin-bottom: 3px; font-size: .98rem; }
.dog-actions button { justify-content: start; text-align: left; padding-inline: 9px; overflow-wrap: anywhere; }
.dog-actions .remove-record { margin-top: 5px; }
.directory-detail .dog-facts { grid-template-columns: minmax(0,1fr); gap: 6px; }
.directory-detail .dog-facts div { background: #f5f6ef; }
.directory-detail .lesson-progress progress::-webkit-progress-value { background: var(--k9-clay); }
.directory-detail .lesson-progress progress::-moz-progress-bar { background: var(--k9-clay); }
.reminder-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 14px; align-items: start; }
.upcoming-reminders { list-style: none; margin: 8px 0 0; padding: 0; }
.upcoming-reminders li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upcoming-reminders li:last-child { border-bottom: 0; }

@media (max-width: 1040px) {
  .dog-profile-grid { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .dog-actions { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
}
@media (max-width: 780px) {
  .agenda-app .k9-shell .sidebar { padding: max(8px,env(safe-area-inset-top)) 12px 6px; gap: 5px 8px; background: #19372b; color: #fff; }
  .agenda-app .k9-shell .sidefoot .side-link,.agenda-app .k9-shell .sidefoot #logout { color: #eef4ed; padding-inline: 4px; min-height: 35px; }
  .agenda-app .k9-shell #main-nav { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .agenda-app .k9-shell .sidebar #main-nav .side-link[aria-current="page"] { background: #f6e8df; color: #753623; }
  .agenda-app .k9-shell .sidebar #main-nav .side-link[aria-current="page"] .symbol { color: #753623; }
  .agenda-app .k9-shell #extra-nav,.agenda-app .k9-shell #tools-nav { grid-column: 1/-1; position: static; width: 100%; grid-template-columns: repeat(4,minmax(0,1fr)); background: transparent; border: 0; border-top: 1px solid #ffffff2a; border-radius: 0; box-shadow: none; padding: 4px 0 0; gap: 2px; }
  .agenda-app .k9-shell .sidebar :is(#extra-nav,#tools-nav) .side-link { color: #f0f5ef; display: block; text-align: center; padding: 4px 1px; font-size: clamp(.72rem,2.7vw,.85rem); line-height: 1.2; min-height: 35px; }
  .agenda-app .k9-shell .sidebar :is(#extra-nav,#tools-nav) .side-link .symbol { display: none; }
  .agenda-app .k9-shell .sidebar :is(#extra-nav,#tools-nav) .side-link[aria-current="page"] { background: #ab5238; color: #fff; }
  .agenda-app .k9-shell .workspace { padding: 0 13px calc(88px + env(safe-area-inset-bottom)); }
  .workspace-toolbar { min-height: 0; padding: 7px 13px; margin: 0 -13px 15px; gap: 8px; }
  .workspace-search { flex: 1 1 auto; }
  .workspace-search button { padding-inline: 8px; font-size: .8rem; }
  .toolbar-actions { gap: 5px; }
  .toolbar-actions .account-name,.toolbar-reminders { display: none; }
  .toolbar-actions .primary { padding-inline: 7px; font-size: .82rem; }
  .client-directory,.reminder-layout { grid-template-columns: minmax(0,1fr); }
  .client-directory[data-detail=false] .directory-detail,.client-directory[data-detail=true] .directory-list { display: none; }
  .directory-detail > .directory-back { display: inline-flex; margin-bottom: 8px; }
  .directory-heading button { font-size: .89rem; }
  .directory-detail .dog-identity { background: #204e3a; color: #fff; padding: 15px; }
  .directory-detail .dog-identity p { color: #e3eee6; }
  .directory-detail .dog-initial { width: 50px; height: 50px; }
}
@media (max-width: 390px) {
  .workspace-toolbar .workspace-search button { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); padding: 0; }
  .workspace-toolbar .workspace-search button:focus-visible { position: static; width: auto; height: auto; min-height: 44px; clip-path: none; padding-inline: 6px; }
}
