  :root {
    --wine: #343434;
    --wine-soft: #2A5A5E;
    --gold: #FF3131;
    --bg: #FBFAF8;
    --surface: #FFFFFF;
    --text: #121212;
    --text-soft: #4A5358;
    --text-mute: #9AA6AB;
    --border: rgba(15, 61, 64, 0.06);
    --border-strong: rgba(15, 61, 64, 0.10);
    --accent: #FF3131;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100vh; overflow: hidden; }
  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: grid;
    grid-template-columns: 64px 1fr 380px;
    height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: grid-template-columns .22s ease;
  }
  body.sidebar-open { grid-template-columns: 220px 1fr 380px; }

  /* ========== SIDEBAR ========== */
  .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    gap: 4px;
    overflow: hidden;
  }
  body.sidebar-open .sidebar { align-items: stretch; padding: 18px 12px; }

  .sidebar .logo {
    width: 100%; display: flex; align-items: center; justify-content: center;
    padding: 4px 6px; margin-bottom: 16px; min-height: 40px;
    overflow: hidden;
  }
  .sidebar .logo .brand-logo { display: none; height: 32px; width: auto; }
  .sidebar .logo .brand-mark { display: block; height: 28px; width: auto; }
  body.sidebar-open .sidebar .logo .brand-mark { display: none; }
  body.sidebar-open .sidebar .logo .brand-logo { display: block; }

  
  
  body.sidebar-open 
  body.sidebar-open 
  body.sidebar-open .sidebar .logo {
    justify-content: flex-start; padding: 4px 8px;
  }


  .sidebar-toggle {
    position: absolute;
    top: 22px; left: 56px;
    width: 22px; height: 22px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-mute);
    display: flex; align-items: center; justify-content: center;
    transition: all .22s ease;
    z-index: 20;
  }
  body.sidebar-open .sidebar-toggle { left: 212px; }
  .sidebar-toggle:hover { color: var(--wine); border-color: var(--wine); }
  .sidebar-toggle svg { width: 12px; height: 12px; stroke-width: 2.2; }

  .nav-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-mute);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all .15s;
    text-decoration: none;
    flex-shrink: 0;
  }
  body.sidebar-open .nav-icon {
    width: 100%; height: 38px;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 12px;
  }
  .nav-icon:hover { color: var(--wine); background: var(--bg); }
  .nav-icon.active { color: var(--wine); background: rgba(15,61,64,0.06); }
  .nav-icon svg { width: 19px; height: 19px; stroke-width: 1.6; flex-shrink: 0; }
  .nav-icon .ping {
    position: absolute; top: 8px; right: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    background: #C26A66;
  }
  body.sidebar-open .nav-icon .ping { top: 50%; right: 14px; transform: translateY(-50%); }

  .nav-icon .label {
    display: none;
    font-size: 13.5px; font-weight: 500;
    color: inherit;
  }
  body.sidebar-open .nav-icon .label { display: inline; }

  .nav-icon .tip {
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--text); color: #fff;
    padding: 6px 10px; border-radius: 6px;
    font-size: 12px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s;
    z-index: 100;
  }
  .nav-icon:hover .tip { opacity: 1; }
  body.sidebar-open .nav-icon .tip { display: none; }

  .sidebar .spacer { flex: 1; }
  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--wine); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    margin-top: 6px;
    flex-shrink: 0;
  }
  body.sidebar-open .avatar {
    align-self: flex-start; margin-left: 10px;
  }
  .user-block {
    display: none;
    flex-direction: column;
    margin-left: 10px;
  }
  .user-block .name { font-size: 13px; font-weight: 500; color: var(--text); }
  .user-block .role { font-size: 11.5px; color: var(--text-mute); }
  body.sidebar-open .user-row {
    display: flex; align-items: center; padding: 6px 0; gap: 10px;
  }
  body.sidebar-open .user-block { display: flex; margin-left: 0; }
  body.sidebar-open .avatar { margin: 0; align-self: auto; }

  /* ========== MAIN ========== */
  .main {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }

  .header {
    padding: 28px 40px 14px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
  }
  .title-block h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
  }
  .title-block .sub {
    font-size: 13px;
    color: var(--text-mute);
    margin-top: 2px;
  }

  .header-actions {
    display: flex; align-items: center; gap: 8px;
  }
  .view-toggle {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 3px;
  }
  .view-toggle button {
    background: transparent; border: 0; cursor: pointer;
    padding: 6px 14px;
    color: var(--text-soft);
    font-size: 13px; font-weight: 500;
    border-radius: 6px;
    transition: all .15s;
  }
  .view-toggle button:hover { color: var(--text); }
  .view-toggle button.active {
    background: var(--wine); color: #fff;
  }

  .day-nav {
    display: flex; align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 2px;
  }
  .day-nav button {
    background: transparent; border: 0; cursor: pointer;
    padding: 6px 10px;
    color: var(--text-soft);
    font-size: 13px; font-weight: 500;
    border-radius: 6px;
    display: flex; align-items: center; gap: 6px;
  }
  .day-nav button:hover { color: var(--text); }
  .day-nav .label { padding: 6px 14px; min-width: 110px; text-align: center; color: var(--text); font-weight: 500; }
  .day-nav svg { width: 14px; height: 14px; stroke-width: 2; }

  .filter {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px; font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
  }
  .filter svg { width: 13px; height: 13px; }

  /* ========== VIEW SEMANA ========== */
  .view { display: none; }
  .view.active { display: block; }

  .week-grid {
    display: grid;
    grid-template-columns: 56px repeat(7, 1fr);
    gap: 0;
    padding: 0 56px 60px;
  }
  .week-head {
    position: sticky; top: 0; z-index: 5;
    background: var(--bg);
    padding: 14px 8px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }
  .week-head .dn {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-mute); font-weight: 600;
  }
  .week-head .dnum {
    font-size: 20px; font-weight: 600; color: var(--text);
    margin-top: 4px; font-variant-numeric: tabular-nums;
  }
  .week-head.today .dnum {
    color: #fff; background: var(--wine);
    width: 32px; height: 32px; border-radius: 50%;
    margin: 4px auto 0; display: flex; align-items: center; justify-content: center;
    font-size: 14px;
  }
  .week-corner {
    border-bottom: 1px solid var(--border);
  }
  .week-hour {
    font-size: 11px; color: var(--text-mute);
    padding: 8px 8px 0 0; text-align: right;
    font-variant-numeric: tabular-nums;
    border-top: 1px solid var(--border);
    min-height: 56px;
  }
  .week-cell {
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    padding: 4px;
    min-height: 56px;
    position: relative;
  }
  .week-cell:last-child { border-right: 1px solid var(--border); }
  .week-event {
    background: rgba(15,61,64,0.06);
    border-left: 2px solid var(--wine);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    color: var(--text);
    line-height: 1.3;
    cursor: pointer;
    margin-bottom: 2px;
  }
  .week-event:hover { background: rgba(76,48,71,0.10); }
  .week-event.t-aval { border-left-color: #B8956A; background: rgba(184,149,106,0.10); }
  .week-event.t-mant { border-left-color: #8B9D83; background: rgba(139,157,131,0.10); }
  .week-event .we-time { font-weight: 600; font-size: 10.5px; color: var(--text-soft); }

  /* ========== VIEW MÊS ========== */
  .month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    margin: 0 56px 60px;
  }
  .month-dn {
    padding: 10px;
    text-align: center;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-mute); font-weight: 600;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .month-cell {
    min-height: 110px;
    padding: 8px 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex; flex-direction: column;
    cursor: pointer;
    transition: background .12s;
  }
  .month-cell:hover { background: var(--bg); box-shadow: inset 0 0 0 1px var(--wine); }
  .week-head[data-date] { cursor: pointer; transition: background .12s; }
  .week-head[data-date]:hover { background: rgba(76,48,71,0.04); }
  .week-head[data-date]:hover .dn { color: var(--wine); }
  .month-cell.other { color: var(--text-mute); background: var(--bg); }
  .month-cell.today .mc-num {
    color: #fff; background: var(--wine);
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 600;
  }
  .mc-num {
    font-size: 13px; font-weight: 500; color: var(--text);
    margin-bottom: 6px;
  }
  .mc-evts { display: flex; flex-direction: column; gap: 2px; }
  .mc-pill {
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(15,61,64,0.06);
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mc-more { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; }

  /* ========== TIMELINE ========== */
  .timeline-wrap {
    overflow-y: auto;
    padding: 12px 56px 60px;
  }
  .timeline { width: 100%; }

  .hour-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    position: relative;
  }
  .hour-row:first-child { border-top: 0; }
  .hour-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mute);
    padding-top: 10px;
    font-variant-numeric: tabular-nums;
  }
  .hour-row.now .hour-label { color: var(--wine); font-weight: 600; }
  .hour-row.now::before {
    content: '';
    position: absolute;
    left: 56px; right: 0;
    top: 14px;
    height: 1px;
    background: var(--wine);
    opacity: 0.35;
  }

  .slot-list { display: flex; flex-direction: column; gap: 4px; }

  .slot {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
  }
  .slot:hover { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
  .slot.selected { background: var(--surface); box-shadow: 0 0 0 1px var(--wine); }

  .slot-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .slot-name { font-size: 14px; font-weight: 500; color: var(--text); }
  .slot-meta {
    font-size: 12.5px; color: var(--text-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .slot-time {
    font-size: 12px; color: var(--text-mute);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
  }

  /* tipo - barra esquerda fina */
  .slot { position: relative; padding-left: 20px; }
  .slot::before {
    content: '';
    position: absolute; left: 8px; top: 12px; bottom: 12px;
    width: 2px; border-radius: 2px;
    background: var(--text-mute); opacity: 0.4;
  }
  .slot.t-aval::before { background: #B8956A; opacity: 0.7; }
  .slot.t-sess::before { background: #121212; opacity: 0.55; }
  .slot.t-mant::before { background: #8B9D83; opacity: 0.6; }

  .slot-empty {
    padding: 10px 14px 10px 20px;
    color: var(--text-mute);
    font-size: 12.5px;
    font-style: italic;
  }

  /* ========== DETAIL PANEL (fixo direita) ========== */
  .detail {
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .detail-head {
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--border);
  }
  .detail-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--gold);
    display: flex; align-items: center; gap: 8px;
  }
  .detail-eyebrow .live {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4C8E5E;
    box-shadow: 0 0 0 4px rgba(76,142,94,0.18);
    animation: pulse 1.8s ease-in-out infinite;
  }
  @keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(76,142,94,0); } }
  .detail-who {
    font-size: 22px; font-weight: 600; color: var(--text);
    letter-spacing: -0.4px; margin-top: 10px;
  }
  .detail-when {
    font-size: 13px; color: var(--text-mute); margin-top: 4px;
  }
  .detail-body { padding: 18px 28px; flex: 1; overflow-y: auto; }
  .row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .row:last-child { border-bottom: 0; }
  .row .k { color: var(--text-mute); font-size: 13px; }
  .row .v { color: var(--text); font-size: 13px; font-weight: 500; text-align: right; }

  .detail-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
  }
  .detail-section h4 {
    font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--text-mute);
    margin-bottom: 10px;
  }
  .note {
    font-size: 13px; color: var(--text-soft); line-height: 1.6;
    background: var(--bg); padding: 12px 14px; border-radius: 8px;
  }
  .progress-track {
    height: 4px; background: var(--bg); border-radius: 4px;
    overflow: hidden; margin-top: 8px;
  }
  .progress-fill { height: 100%; background: var(--wine); border-radius: 4px; }

  .detail-foot {
    padding: 16px 28px 22px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px;
  }
  .btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
  }
  .btn:hover { background: var(--bg); }
  .btn-primary {
    background: var(--wine); color: #fff; border-color: var(--wine);
  }
  .btn-primary:hover { background: var(--wine-soft); }

  /* scrollbar minimal */
  .timeline-wrap::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 6px; }
  .timeline-wrap::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb {
    background: rgba(76,48,71,0.10); border-radius: 6px;
  }

  /* badge bem sutil só onde absolutamente precisa */
  .pendente-mark {
    width: 6px; height: 6px; border-radius: 50%;
    background: #C89657; display: inline-block;
    margin-left: 6px; vertical-align: middle;
  }

/* ============================================================
   MOBILE / WEBAPP — max-width 768px
   ============================================================ */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
  }

  /* Layout: sidebar vira bottom-bar, detail vira bottom sheet */
  body {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* SIDEBAR → BOTTOM TAB BAR */
  .sidebar {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    width: 100% !important; height: 64px !important;
    flex-direction: row !important;
    align-items: stretch !important;
    border-right: 0 !important;
    border-top: 1px solid var(--border) !important;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 0 !important;
    z-index: 100;
    overflow: visible !important;
    background: var(--surface);
  }
  body.sidebar-open .sidebar {
    /* mobile não tem expansão lateral */
    width: 100% !important;
  }
  .sidebar .logo, .sidebar .spacer, .sidebar .user-row, .sidebar > a[href="09-config.html"] {
    display: none !important;
  }
  .sidebar .nav-icon {
    flex: 1 !important;
    height: auto !important;
    width: auto !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 4px 0 !important;
    gap: 3px !important;
    border-radius: 8px !important;
  }
  .sidebar .nav-icon svg { width: 22px !important; height: 22px !important; stroke-width: 1.7; }
  .sidebar .nav-icon .label {
    display: block !important;
    font-size: 10px !important;
    font-weight: 500;
    color: inherit !important;
  }
  .sidebar .nav-icon .tip { display: none !important; }
  .sidebar .nav-icon.active { background: transparent !important; color: var(--wine) !important; }
  .sidebar .nav-icon .ping { top: 4px !important; right: calc(50% - 14px) !important; }

  /* Sidebar toggle vira invisível em mobile */
  .sidebar-toggle { display: none !important; }

  /* MAIN ocupa tudo + padding bottom pra não cobrir tab bar */
  .main {
    padding-bottom: 80px !important;
    overflow-y: auto !important;
  }

  /* HEADER mobile */
  .header {
    padding: 16px 18px 8px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .title-block h1 { font-size: 22px !important; }
  .title-block .sub { font-size: 12.5px !important; }
  .header-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .header-actions .filter, .view-toggle, .day-nav {
    font-size: 12px !important;
  }
  .view-toggle button { padding: 6px 10px !important; font-size: 12px !important; }
  .day-nav .label { padding: 6px 10px !important; font-size: 12px !important; min-width: 80px !important; }

  /* DETAIL → BOTTOM SHEET */
  .detail {
    position: fixed !important;
    bottom: 64px;
    left: 0; right: 0;
    width: 100% !important;
    max-height: 85vh;
    border-left: 0 !important;
    border-top: 1px solid var(--border) !important;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 32px rgba(42,30,39,0.12);
    transform: translateY(100%);
    transition: transform .25s ease;
    z-index: 90;
    display: flex !important;
  }
  .detail.open { transform: translateY(0); }
  .detail::before {
    content: '';
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px;
    background: rgba(76,48,71,0.20);
  }
  .detail-head { padding-top: 24px !important; }
  .detail-close-mobile {
    display: block !important;
    position: absolute; top: 18px; right: 16px;
    width: 30px; height: 30px;
    background: var(--bg); border: 0; border-radius: 50%;
    cursor: pointer; z-index: 5;
    color: var(--text-soft);
  }

  /* Conteúdo da agenda */
  .timeline-wrap, .week-grid, .month-grid { padding: 8px 16px 80px !important; }
  .week-grid { grid-template-columns: 40px repeat(7, minmax(60px, 1fr)) !important; min-width: max-content; }
  .week-head .dnum { font-size: 16px !important; }

  /* Leads kanban — vira swipe horizontal por scroll-snap */
  .kanban-wrap { padding: 8px 16px 80px !important; scroll-snap-type: x mandatory; }
  .kanban { grid-template-columns: repeat(7, 88vw) !important; gap: 12px !important; }
  .col { scroll-snap-align: center; }

  /* Pacientes tabela vira lista de cards */
  .pat-wrap { padding: 0 16px 80px !important; }
  .pat-table thead { display: none !important; }
  .pat-table, .pat-table tbody, .pat-table tr { display: block !important; }
  .pat-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 4px 10px;
  }
  .pat-table tr.selected { box-shadow: 0 0 0 1.5px var(--wine); border-color: var(--wine); }
  .pat-table td {
    display: flex !important;
    justify-content: space-between !important;
    padding: 6px 4px !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 12.5px !important;
  }
  .pat-table td:first-child { border-bottom: 1px solid var(--border) !important; }
  .pat-table td:last-child { border-bottom: 0 !important; }
  .pat-table td:before {
    content: attr(data-l);
    color: var(--text-mute);
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .pat-table td:first-child:before { display: none; }

  /* Conversas mobile — 1 painel por vez */
  .conv-list { display: none !important; }
  .conv-list.show-mobile { display: flex !important; position: fixed; inset: 0 0 64px 0; z-index: 80; }
  .chat-head .ia-on { font-size: 11px !important; padding: 4px 8px !important; }

  /* Protocolos */
  .proto-wrap { padding: 0 16px 80px !important; }
  .proto-grid { grid-template-columns: 1fr !important; }
  .cat-tabs { padding: 6px 0 12px !important; }

  /* Dashboard */
  .dash-wrap { padding: 0 16px 80px !important; }
  .kpi-row { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .kpi { padding: 14px !important; }
  .kpi-value { font-size: 22px !important; }
  .panel-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  .chart-bar { height: 160px !important; gap: 6px !important; }
  .bar-val { font-size: 9px !important; }
  .bar-label { font-size: 10px !important; }

  /* Config */
  body[data-page="config"] { grid-template-columns: 1fr !important; }
  .cfg-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    gap: 4px;
  }
  .cfg-nav h5 { display: none !important; }
  .cfg-nav a { padding: 8px 12px !important; font-size: 12.5px !important; white-space: nowrap; flex-shrink: 0; }
  .cfg-content { padding: 18px 18px 80px !important; }
  .field { grid-template-columns: 1fr !important; gap: 8px !important; }
  .role-table { font-size: 11px !important; }
  .role-table th, .role-table td { padding: 6px 4px !important; }

  /* Login mobile — 1 coluna vertical */
  body.login-page { grid-template-columns: 1fr !important; grid-template-rows: 250px 1fr !important; height: auto !important; min-height: 100vh !important; overflow-y: auto !important; }
  body.login-page .panel-left { padding: 32px 24px !important; }
  body.login-page .panel-right { padding: 32px 24px 40px !important; }
  body.login-page .pl-headline { font-size: 24px !important; }
  body.login-page .pl-sub { font-size: 13px !important; }
  body.login-page .pl-credit { display: none; }
  body.login-page .panel-left::before { background-size: 280px !important; background-position: center bottom !important; }

  /* Index mobile */
  .container { padding: 0 18px !important; }
  .hero { padding: 32px 0 24px !important; }
  .hero h1 { font-size: 24px !important; }
  .hero .lead { font-size: 14px !important; }
  .hero .actions .btn { width: 100%; justify-content: center; }
  .section { padding: 32px 0 !important; }
  .grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .card.feat { grid-column: span 1 !important; }
  .top .row { flex-direction: column; gap: 8px; align-items: flex-start; }
  .footer .row { flex-direction: column; gap: 8px; text-align: center; }
}

/* Telas muito pequenas (< 380px) */
@media (max-width: 380px) {
  .sidebar .nav-icon .label { display: none !important; }
  .header-actions { font-size: 11px !important; }
}

/* iPhone notch */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .header { padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important; }
  }
}

/* ============================================================
   CRM WHITE-LABEL — MODULOS OCULTOS (NAO EXCLUIDOS)
   Empresa nao usa os modulos clinicos do template.
   Para REATIVAR um item: comentar a linha correspondente abaixo
   (e, na ficha, o bloco <style id="crm-oculto-clinico"> em
   04-paciente.html oculta: anamnese, evolucao, plano,
   documentos medicos/Memed e botao gravar consulta).
   ============================================================ */
.nav-icon[href*='/protocolos'], .nav-icon[href*='/estoque'] { display: none !important; }

.crm-oculto { display: none !important; }
