/* Avizo desktop layouts (≥1024px) — mobile unchanged */
@media (min-width: 1024px) {
  html.desktop-ui #view-app {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 0 !important;
  }

  html.desktop-ui #view-app .app-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
  }

  html.desktop-ui #view-app .app-shell > header {
    flex-shrink: 0;
  }

  html.desktop-ui #view-app #main {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.25rem 1.5rem;
    max-width: none;
  }

  html.desktop-ui #view-app .bottom-nav {
    position: sticky;
    top: 0;
    left: 0;
    bottom: auto;
    right: auto;
    width: 5.75rem;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 0;
    border-top: none;
    border-right: 1px solid color-mix(in srgb, var(--brand) 10%, #e2e8f0);
    box-shadow: 8px 0 28px rgba(15, 58, 120, 0.05);
    padding: 1rem 0.5rem;
    gap: 0.35rem;
    z-index: 30;
  }

  html.desktop-ui #view-app .bottom-nav .tab {
    flex: 0 0 auto;
    width: 100%;
    min-height: 4.5rem;
    border-radius: 1rem;
    padding: 0.5rem 0.25rem;
  }

  html.desktop-ui #view-app .bottom-nav .tab-label {
    font-size: 0.7rem;
  }

  html.desktop-ui #view-app .header-subbar {
    max-width: none;
  }

  /* Agenda 2/3 + 1/3 — fills viewport */
  .desk-agenda {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 0.85rem;
    align-items: stretch;
    height: calc(100dvh - 7.75rem);
    max-height: calc(100vh - 7.75rem);
    min-height: 0;
  }

  .desk-month {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 12%, #e2e8f0);
    border-radius: 1.35rem;
    box-shadow: var(--bento-shadow);
    padding: 0.75rem 0.9rem 0.85rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .desk-month__nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    flex-shrink: 0;
  }

  .desk-month__title {
    flex: 1;
    text-align: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
    text-transform: capitalize;
  }

  .desk-month__nav button {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.4rem 0.7rem;
    font-weight: 700;
    color: #334155;
  }

  .desk-month__nav button:hover {
    border-color: color-mix(in srgb, var(--brand) 40%, #e2e8f0);
    color: var(--brand);
  }

  .desk-month__filter {
    flex-shrink: 0;
    margin-bottom: 0.45rem;
  }

  .desk-month__filter label {
    margin-bottom: 0.2rem !important;
    font-size: 0.75rem !important;
  }

  .desk-month__filter select {
    margin-bottom: 0 !important;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
  }

  .desk-month__dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
    margin-bottom: 0.2rem;
    flex-shrink: 0;
  }

  .desk-month__dow span {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0;
  }

  .desk-month__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 0.2rem;
    flex: 1;
    min-height: 0;
  }

  .desk-day {
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    background: #f8fafc;
    padding: 0.2rem 0.28rem 0.22rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
  }

  .desk-day:hover {
    background: #fff;
    border-color: color-mix(in srgb, var(--brand) 28%, #e2e8f0);
  }

  .desk-day--muted {
    opacity: 0.4;
    background: transparent;
  }

  .desk-day--today .desk-day__num {
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .desk-day--selected {
    background: color-mix(in srgb, var(--brand) 10%, white);
    border-color: var(--brand);
  }

  .desk-day--busy:not(.desk-day--selected) {
    background: color-mix(in srgb, var(--brand) 7%, #f8fafc);
  }

  .desk-day--closed {
    background: #f1f5f9;
  }

  .desk-day__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .desk-day__num {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
  }

  .desk-day__badge {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 14%, white);
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
    line-height: 1.3;
  }

  .desk-day__events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    overflow: hidden;
    flex: 1;
  }

  .desk-day__chip {
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.15;
    padding: 0.1rem 0.22rem;
    border-radius: 0.28rem;
    background: color-mix(in srgb, var(--brand) 16%, white);
    color: color-mix(in srgb, var(--brand) 75%, #0f172a);
    border-left: 2.5px solid var(--brand);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    max-width: 100%;
  }

  .desk-day__chip--pending {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
  }

  .desk-day__chip--done {
    background: #f1f5f9;
    color: #475569;
    border-left-color: #94a3b8;
  }

  .desk-day__chip--online {
    background: #ecfdf5;
    color: #065f46;
    border-left-color: #10b981;
  }

  .desk-day__more {
    font-size: 0.55rem;
    font-weight: 800;
    color: #64748b;
    padding-left: 0.1rem;
  }

  .desk-side {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 12%, #e2e8f0);
    border-radius: 1.35rem;
    box-shadow: var(--bento-shadow);
    padding: 1rem;
    height: 100%;
    max-height: none;
    overflow: auto;
    min-height: 0;
  }

  .desk-side__title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
  }

  .desk-side__sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.85rem;
  }

  .desk-side__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }

  .desk-side__actions button {
    width: 100%;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.95rem;
  }

  .desk-side__btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
  }

  .desk-side__btn-secondary:hover {
    border-color: color-mix(in srgb, var(--brand) 40%, #e2e8f0);
    color: var(--brand);
  }

  .desk-side__days {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .desk-side__day-tile {
    border: 1px solid color-mix(in srgb, var(--brand) 18%, #e2e8f0);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
  }

  .desk-side__day-tile-head {
    background: var(--brand);
    color: var(--brand-contrast, #fff);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.75rem;
    line-height: 1.2;
  }

  .desk-side__day-tile-body {
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #f8fafc;
  }

  .desk-side__day-tile-body .desk-side__appt {
    margin-bottom: 0;
  }

  .desk-side__day {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin: 0.65rem 0 0.3rem;
  }

  .desk-side__day:first-child {
    margin-top: 0;
  }

  .desk-side__appt {
    display: grid;
    grid-template-columns: 2fr 2fr minmax(0, 6fr) 2fr;
    align-items: stretch;
    padding: 0;
    margin-bottom: 0.45rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    min-height: 3.4rem;
    cursor: pointer;
  }

  .desk-side__appt-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    align-self: stretch;
    margin: 0;
    border-radius: 0;
    padding: 0.4rem 0.15rem;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.05;
    height: 100%;
  }

  .desk-side__appt-arrow {
    font-size: 0.58rem;
    opacity: 0.8;
    line-height: 1;
  }

  .desk-side__appt-deposit {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f766e;
    line-height: 1.1;
    border-right: 1px solid #f1f5f9;
  }

  .desk-side__appt-deposit-empty {
    color: #cbd5e1;
    font-weight: 700;
    font-size: 0.9rem;
  }

  .desk-side__appt-who {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.45rem 0.55rem;
  }

  .desk-side__appt-name {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
  }

  .desk-side__appt-name-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .desk-side__appt-arrow-inline {
    color: #94a3b8;
    font-weight: 600;
  }

  .desk-side__appt-group {
    font-weight: 600;
    color: #475569;
  }

  .desk-side__appt .copy-phone-btn--desk {
    flex-shrink: 0;
  }

  .desk-side__appt-services {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .desk-side__appt-notify {
    display: block;
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .desk-side__appt-status {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    height: 100%;
    margin: 0;
    border-radius: 0;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.3rem;
    text-align: center;
    line-height: 1.15;
    overflow: hidden;
    word-break: break-word;
    max-width: none;
    white-space: normal;
  }

  .desk-side__appt-meta {
    margin-top: 0.12rem;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.25;
  }

  .desk-side__dot {
    margin: 0 0.28rem;
    color: #cbd5e1;
  }

  /* Clients kanban */
  .desk-kanban-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 1rem;
  }

  .desk-kanban-toolbar input {
    flex: 1;
    min-width: 220px;
  }

  .desk-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 0.85rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .desk-kanban__col {
    background: color-mix(in srgb, var(--brand) 4%, #f8fafc);
    border: 1px solid color-mix(in srgb, var(--brand) 10%, #e2e8f0);
    border-radius: 1.15rem;
    padding: 0.75rem;
    min-height: 18rem;
  }

  .desk-kanban__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    padding: 0 0.15rem;
  }

  .desk-kanban__head strong {
    font-size: 0.9rem;
  }

  .desk-kanban__badge {
    font-size: 0.7rem;
    font-weight: 800;
    background: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
  }

  .desk-kanban__card {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 12%, #e2e8f0);
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.55rem;
    box-shadow: var(--bento-shadow);
    cursor: pointer;
    text-align: left;
    width: 100%;
  }

  .desk-kanban__card:hover {
    border-color: color-mix(in srgb, var(--brand) 45%, #e2e8f0);
  }

  .desk-kanban__card-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.95rem;
  }

  .desk-kanban__card-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
  }

  .desk-kanban__card-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.55rem;
  }

  .desk-kanban__card-actions button {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.4rem 0.35rem;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
  }

  .desk-kanban__card-actions button.danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
  }

  /* Compte desktop */
  .desk-account {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    min-height: calc(100vh - 9rem);
  }

  .desk-account__nav {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 12%, #e2e8f0);
    border-radius: 1.25rem;
    padding: 0.65rem;
    box-shadow: var(--bento-shadow);
    position: sticky;
    top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }

  .desk-account__nav button {
    text-align: left;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    border: none;
    background: transparent;
    color: #475569;
  }

  .desk-account__nav button.is-active {
    background: color-mix(in srgb, var(--brand) 12%, white);
    color: var(--brand);
  }

  .desk-account__panel {
    min-width: 0;
  }

  .desk-account .acc-tabs {
    display: none !important;
  }

  /* Prestations : panneau gauche (titre + formulaire) + kanban */
  html.desktop-ui .desk-services {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }

  html.desktop-ui .desk-services__side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0.5rem;
  }

  html.desktop-ui .desk-services__side > .acc-tile,
  html.desktop-ui .desk-services__board {
    margin-bottom: 0;
  }

  html.desktop-ui .desk-services-kanban {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: start;
  }

  html.desktop-ui .desk-services-kanban .desk-kanban__col {
    min-height: 14rem;
  }

  html.desktop-ui .desk-services-kanban .desk-kanban__card {
    cursor: default;
  }

  /* Horaires : Lun–Mer | Jeu–Sam | Dimanche seul */
  html.desktop-ui .oh-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: stretch;
  }

  html.desktop-ui .oh-grid .oh-day {
    margin-bottom: 0;
    height: 100%;
  }

  html.desktop-ui .oh-grid .oh-day[data-day="sun"] {
    grid-column: 1;
  }

  html.desktop-ui .desk-hours__head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  html.desktop-ui .desk-hours__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.55rem;
    flex-shrink: 0;
  }

  html.desktop-ui .desk-hours__actions button {
    width: auto;
    min-width: 8.5rem;
  }

  html.desktop-ui .desk-hours__grid {
    margin-top: 0.25rem;
  }

  /* Paramètres : tuiles / actions / prefs en 2 colonnes */
  html.desktop-ui .acc-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
  }

  html.desktop-ui .acc-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html.desktop-ui .acc-row > .acc-tile {
    margin-bottom: 0;
    height: 100%;
  }

  html.desktop-ui .acc-row--actions {
    margin-bottom: 1rem;
  }

  html.desktop-ui .acc-row--actions:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  html.desktop-ui .acc-row--actions > button {
    margin: 0;
  }

  html.desktop-ui .acc-row--prefs > .acc-tile {
    margin: 0;
    height: 100%;
  }

  /* Modale horaires / Nouveau RDV */
  html.desktop-ui #modal .modal-panel.modal-panel--wide {
    max-width: min(96vw, 72rem);
    width: min(96vw, 72rem);
  }

  html.desktop-ui .appt-form__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.25rem 1.5rem;
    align-items: start;
  }

  html.desktop-ui .appt-form__when {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }

  html.desktop-ui .appt-form__col--client {
    position: sticky;
    top: 0;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 16%, #e2e8f0);
    border-radius: var(--bento-radius, 1.35rem);
    padding: 1rem 1.1rem;
    box-shadow: var(--bento-shadow, 0 10px 28px rgba(15, 58, 120, 0.07));
  }

  html.desktop-ui .appt-form__col--client #a-cust {
    max-height: 14rem;
  }

  html.desktop-ui .appt-form__save {
    margin-top: 0.5rem;
  }

  /* Profil : identité (+ horaires/congés) | notifications */
  html.desktop-ui .desk-profile__head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }

  html.desktop-ui .desk-profile__actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
    height: auto;
  }

  html.desktop-ui .desk-profile__btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 9.5rem;
    margin: 0;
    background: var(--brand);
    border: none;
    border-radius: 1rem;
    box-shadow: none;
    font-weight: 700;
    padding: 0.7rem 1rem;
    color: var(--brand-contrast, #fff);
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .desk-kanban {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
  }
}
