@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/assets/fonts/material-symbols-rounded.ttf") format("truetype");
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded" !important;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* Camada responsiva consolidada do aplicativo autenticado. Desktop permanece inalterado. */
@media (max-width: 760px) {
  #app { min-width: 0; font-size: 15px; overflow-x: clip; }
  #app main, #app .content, #app .page-head, #app .card, #app .table-card { min-width: 0; }
  #app .content { width: 100%; padding: 20px 16px calc(112px + env(safe-area-inset-bottom)) !important; }

  #app .topbar { height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; gap: 5px; }
  #app .topbar .icon-btn, #app .topbar .user-mini { min-width: 44px; min-height: 44px; }
  #app .topbar .material-symbols-rounded { font-size: 24px; }
  #app .connection-status { min-width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
  #app .connection-status b { display: none; }
  #app .user-mini { margin-left: 0; padding: 4px; }
  #app .user-mini > .material-symbols-rounded { display: none; }
  #app .topbar > .global-search, #app .topbar .logout-action { display: none !important; }
  #app .top-actions { gap: 2px; }

  #app .page-head { display: block; margin-bottom: 22px; }
  #app .breadcrumbs { margin-bottom: 7px; font-size: 11px; }
  #app .page-head h1 { font-size: 30px; line-height: 1.08; }
  #app .page-head p { margin-top: 8px; font-size: 14px; line-height: 1.5; }
  #app .page-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 16px; }
  #app .page-actions > * { width: 100%; }

  #app button, #app .primary, #app .secondary, #app .filter { min-height: 46px; font-size: 14px; }
  #app .icon-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  #app input:not([type="checkbox"]):not([type="radio"]), #app select, #app textarea { width: 100%; min-height: 50px; padding: 12px 13px; border-radius: 12px; font-size: 16px; }
  #app textarea { min-height: 112px; }
  #app input[type="checkbox"], #app input[type="radio"] { min-width: 20px; width: 20px; min-height: 20px; height: 20px; }
  #app form label { font-size: 13px; line-height: 1.4; }
  #app .form-grid, #app .form-grid.three, #app .history-row { grid-template-columns: 1fr !important; gap: 14px; }
  #app .form-actions { position: sticky; z-index: 3; bottom: calc(82px + env(safe-area-inset-bottom)); display: grid; padding: 10px; margin: 20px -8px -8px; border: 1px solid var(--color-border); border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 -8px 24px rgba(20,55,34,.08); backdrop-filter: blur(10px); }
  #app .form-actions > *, #app form > .primary:last-child { width: 100%; }

  #app .card { padding: 16px; border-radius: 16px; }
  #app .card-head { align-items: flex-start; gap: 12px; margin-bottom: 15px; }
  #app .card-head h3, #app .card h3 { font-size: 16px; line-height: 1.25; }
  #app .card-head p, #app .card p { font-size: 13px; line-height: 1.5; }
  #app .grid, #app .grid.equal, #app .two-one, #app .stats, #app .operation-cards, #app .admin-summary, #app .report-grid { grid-template-columns: 1fr !important; gap: 12px; }
  #app .stat { min-height: 104px; padding: 16px; border-radius: 15px; }
  #app .stat small, #app .stat span { font-size: 12px; }
  #app .stat strong { margin-top: 10px; font-size: 26px; }

  #app .toolbar, #app .list-toolbar, #app .report-filters { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  #app .toolbar > *, #app .list-toolbar > *, #app .report-filters > *, #app .toolbar .global-search { width: 100%; margin: 0; }
  #app .tabs { gap: 22px; margin-inline: -16px; padding-inline: 16px; overflow-x: auto; scrollbar-width: none; }
  #app .tabs::-webkit-scrollbar { display: none; }
  #app .tabs a { flex: none; min-height: 44px; padding-top: 12px; font-size: 14px; }

  #app .table-card { padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; }
  #app .table-scroll { overflow: visible; }
  #app .table-card table, #app .table-card tbody, #app .table-card tr, #app .table-card td { display: block; width: 100%; }
  #app .table-card thead { display: none; }
  #app .table-card tr { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
  #app .table-card td { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 11px 0; border-bottom: 1px solid #edf1ee; font-size: 14px; line-height: 1.4; text-align: right; overflow-wrap: anywhere; }
  #app .table-card td::before { content: attr(data-label); flex: 0 0 35%; color: var(--color-muted); font-size: 11px; font-weight: 800; letter-spacing: .35px; text-align: left; text-transform: uppercase; }
  #app .table-card td:first-child { align-items: flex-start; font-size: 15px; }
  #app .table-card td:last-child { border-bottom: 0; }
  #app .table-card td[colspan] { display: block; text-align: center; }
  #app .table-card td[colspan]::before, #app .table-card td:empty::before { display: none; }
  #app .table-card .row-actions, #app .table-card .user-actions { display: flex; justify-content: flex-end; width: 100%; }
  #app .badge { padding: 7px 10px; font-size: 11px; }

  #app .bottom-navigation { height: calc(78px + env(safe-area-inset-bottom)); padding: 6px 4px max(8px,env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  #app .bottom-nav-item { min-height: 58px; touch-action: manipulation; }
  #app .bottom-nav-item .material-symbols-rounded { font-size: 25px; }
  #app .bottom-nav-item b { font-size: 11px; }
  #app .bottom-nav-primary { transform: translateY(-8px); }
  #app .bottom-nav-primary .material-symbols-rounded { width: 52px; height: 52px; }

  .modal { align-items: end; padding: max(8px,env(safe-area-inset-top)) 0 0; }
  .modal-card { width: 100%; max-width: none; height: calc(100dvh - max(8px,env(safe-area-inset-top))); max-height: none; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 24px 24px 0 0; overscroll-behavior: contain; }
  .modal-card .close-modal { position: sticky; z-index: 5; top: 0; float: right; margin: -4px -2px 0 8px; background: #f1f5ef; }
  .modal-header { min-height: 58px; padding: 0 0 16px; margin-bottom: 18px; }
  .modal-header h2 { font-size: 24px; }
  .modal-header > .modal-icon { width: 46px; height: 46px; }
  .modal-card input:not([type="checkbox"]):not([type="radio"]), .modal-card select, .modal-card textarea { min-height: 50px; font-size: 16px; }
  .modal-card textarea { min-height: 120px; }
  .modal-card form > .primary { position: sticky; bottom: 0; width: 100%; min-height: 52px; margin-top: 22px; box-shadow: 0 -8px 22px rgba(255,255,255,.92); }

  .toast { right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); left: 12px; padding: 14px 16px; font-size: 14px; text-align: center; }

  /* Início e atalhos operacionais */
  #app .home-dashboard-grid, #app .home-day-summary, #app .home-checklist-progress, #app .featured-culture-grid, #app .culture-page-grid { grid-template-columns: 1fr !important; }
  #app .home-quick-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 0; padding: 0; overflow: visible; }
  #app .home-quick-actions button { display: grid; grid-template-columns: 46px 1fr auto; justify-content: stretch; min-width: 0; min-height: 72px; padding: 11px 14px; text-align: left; }
  #app .home-quick-actions .material-symbols-rounded { grid-row: 1/3; display: grid; place-items: center; width: 42px; height: 42px; margin: 0; border-radius: 12px; background: var(--color-primary-light); }
  #app .home-quick-actions b, #app .home-quick-actions small { grid-column: 2; }
  #app .home-quick-actions b { align-self: end; font-size: 15px; }
  #app .home-quick-actions small { align-self: start; font-size: 12px; }
  #app .home-day-summary article { min-height: 82px; padding: 15px; }
  #app .home-day-summary small, #app .home-upcoming small, #app .home-stock-items small, #app .home-checklist-progress small { font-size: 12px; }
  #app .home-upcoming article, #app .home-stock-items article { min-height: 62px; padding: 11px 2px; }
  #app .featured-culture-card > img { height: 180px; }
  #app .featured-culture-card h3 { font-size: 17px; }
  #app .culture-health, #app .culture-bed { font-size: 12px; }
  #app .culture-actions { position: static; justify-content: flex-end; margin-top: 9px; }
  #app .culture-actions .icon-btn { width: 44px; height: 44px; }

  /* Checklists, tarefas e histórico */
  #app .operation-hero, #app .knowledge-hero { align-items: flex-start; padding: 22px 20px; }
  #app .operation-hero h2, #app .knowledge-hero h2 { font-size: 28px; }
  #app .operation-hero > .material-symbols-rounded, #app .knowledge-hero-icon { font-size: 52px; }
  #app .operation-cards { grid-template-columns: 1fr !important; }
  #app .operation-cards button { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; min-height: 86px; padding: 14px; }
  #app .operation-cards > button > .material-symbols-rounded { grid-row: 1/3; font-size: 32px; }
  #app .operation-cards b, #app .operation-cards small { grid-column: 2; }
  #app .operation-cards b { font-size: 16px; }
  #app .operation-cards small { font-size: 12px; }
  #app .operation-cards i { position: static; grid-column: 3; grid-row: 1/3; }
  #app .task-catalog-form { flex-direction: column; align-items: stretch; }
  #app .task-catalog-form button { width: 100%; }
  #app .checklist, #app .checklist-task-group, #app .checklist-details { grid-template-columns: 1fr !important; }
  #app .checkitem, #app .checklist label:has(.check-item) { min-height: 58px; padding: 13px; }
  #app .checkitem span { font-size: 14px; line-height: 1.4; }
  #app .checklist-plant-head { display: grid; gap: 5px; }
  #app .checklist-plant { grid-template-columns: 58px 1fr; padding: 13px; }
  #app .checklist-plant img { width: 58px; height: 58px; }
  #app .checklist-plant label { grid-column: 1/-1; font-size: 13px; }
  #app .history-section .section-heading { display: grid; grid-template-columns: auto 1fr; }
  #app .history-section .add-history { grid-column: 1/-1; width: 100%; margin: 8px 0 0; }
  #app .remove-history { justify-self: end; }

  /* Estoque, canteiros, cultivos, colheitas e perdas */
  #app .stock-categories, #app .vegetable-stock-summary, #app .inventory-grid, #app .stock-gallery { grid-template-columns: 1fr !important; }
  #app .stock-categories button { min-height: 88px; }
  #app .stock-summary-card { min-height: 86px; padding: 15px; }
  #app .stock-summary-card small { font-size: 11px; }
  #app .stock-summary-card p { font-size: 13px; }
  #app .vegetable-chart-row { grid-template-columns: minmax(88px,1fr) minmax(92px,1.3fr) 46px; min-height: 38px; gap: 8px; }
  #app .vegetable-chart-row > b { font-size: 12px; }
  #app .bed-crop { display: grid; grid-template-columns: 52px minmax(0,1fr); padding: 12px; }
  #app .bed-crop > img { grid-row: 1/3; }
  #app .bed-crop > .icon-btn, #app .bed-crop > button { grid-row: 3; width: 44px; height: 44px; }
  #app .garden-bed-soil { min-height: 170px; }
  #app .harvest-alert { align-items: flex-start; padding: 14px; }
  #app .harvest-alert p, #app .harvest-warning, #app .culture-dates small { font-size: 12px; }
  #app .calendar-event { grid-template-columns: 66px 42px 1fr; gap: 9px; padding: 12px 4px; }
  #app .calendar-event > .badge { grid-column: 3; justify-self: start; }

  /* Calendário orientado ao toque e aos eventos do dia */
  #app .gcal-shell { margin-inline: -16px; border-radius: 0; }
  #app .gcal-toolbar { display: grid; grid-template-columns: auto 44px 44px 1fr; gap: 6px; padding: 12px 16px; }
  #app .gcal-toolbar h2 { grid-column: 1/-1; grid-row: 1; width: 100%; margin: 0 0 5px; font-size: 22px; }
  #app .gcal-toolbar select { grid-column: 1/-1; width: 100%; margin: 4px 0 0; }
  #app .gcal-weekdays b { padding: 9px 1px; font-size: 10px; }
  #app .gcal-grid { grid-template-rows: repeat(6,58px); min-height: 348px; }
  #app .gcal-day { min-height: 58px; padding: 4px 2px; }
  #app .gcal-day time { width: 28px; height: 28px; font-size: 12px; }
  #app .gcal-event-chip { width: 6px; height: 6px; padding: 0; margin: 0 auto; color: transparent !important; border-radius: 50%; font-size: 0; }
  #app .gcal-sidebar { padding: 20px 16px; }
  #app .gcal-selected-date span, #app .gcal-selected-date b { font-size: 12px; }
  #app .calendar-day-event { grid-template-columns: 5px minmax(0,1fr) auto; padding: 13px; }
  #app .calendar-day-event span, #app .calendar-day-event small { font-size: 10px; }
  #app .calendar-day-event b { font-size: 14px; }
  #app .calendar-day-event p { font-size: 12px; }
  #app .calendar-event-actions .icon-btn { width: 42px; height: 42px; }

  /* Relatórios, gráficos e indicadores */
  #app .report-export { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  #app .report-export > div { align-items: flex-start; }
  #app .report-export > label, #app .report-export > button { width: 100%; }
  #app .chart, #app .line-chart, #app .bar-chart { min-height: 230px; height: 230px; }
  #app .chart-legend { flex-wrap: wrap; gap: 9px 14px; font-size: 12px; }
  #app .donut-wrap, #app .marketing-status-summary { grid-template-columns: 1fr; gap: 18px; }
  #app .donut-wrap { flex-direction: column; }
  #app .legend-list { width: 100%; font-size: 13px; }
  #app .impact-grid, #app .incident-summary, #app .donation-summary, #app .sync-metrics, #app .support-summary { grid-template-columns: 1fr !important; }
  #app .impact-grid article, #app .incident-summary article, #app .donation-summary article, #app .sync-metrics article, #app .support-summary article { min-height: 86px; }
  #app .workday-hero, #app .impact-hero { padding: 22px 20px; }
  #app .workday-hero { align-items: flex-start; flex-direction: column; }
  #app .workday-progress { width: 96px; height: 96px; }
  #app .workday-checklists, #app .incident-board, #app .training-grid { grid-template-columns: 1fr !important; }

  /* Base de conhecimento e capacitação */
  #app .knowledge-categories, #app .document-grid { grid-template-columns: 1fr !important; }
  #app .knowledge-material-card { border-radius: 16px; }
  #app .knowledge-card-cover, #app .knowledge-card-placeholder { height: 190px; }
  #app .knowledge-material-card .document-info { padding: 15px; }
  #app .knowledge-material-card h3 { font-size: 17px; }
  #app .knowledge-material-card p, #app .knowledge-material-card small { font-size: 13px; }
  #app .document-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  #app .document-actions > *, #app .knowledge-course-link { width: 100%; min-height: 46px; justify-content: center; font-size: 13px; }
  #app .training-card { padding: 17px; }
  #app .training-card h3 { font-size: 17px; }
  #app .training-card p { font-size: 13px; line-height: 1.5; }
  #app .training-card footer > div { display: grid; grid-template-columns: 1fr; }
  #app .quiz-taking label { min-height: 54px; padding: 12px; font-size: 14px; }
  #app .quiz-course-list button { min-height: 62px; }

  /* Administração, usuários e permissões */
  #app .admin-summary > div { min-height: 86px; padding: 16px; }
  #app .person-cell { align-items: center; text-align: left; }
  #app .person-cell .avatar { width: 42px; height: 42px; }
  #app .role-label { justify-content: flex-end; font-size: 13px; }
  #app .health-access-badge { display: inline-flex; margin-top: 6px; padding: 6px 8px; font-size: 11px; }
  #app .user-actions { gap: 7px; }
  #app .user-actions .icon-btn { border: 1px solid var(--color-border); background: #f8faf8; }

  /* Pedidos, suporte, prospecção e fluxos complementares */
  #app .order-item-row { grid-template-columns: 1fr; padding: 14px; }
  #app .order-item-row label, #app .order-item-row label:first-child, #app .order-item-balance, #app .order-item-row .remove-order-item { grid-column: 1; }
  #app .order-item-row .remove-order-item { width: 100%; justify-self: stretch; }
  #app .order-total { align-items: flex-start; flex-direction: column; }
  #app .support-ticket { padding: 16px; }
  #app .support-ticket header, #app .support-ticket footer { flex-direction: column; }
  #app .support-ticket header span, #app .support-ticket footer small { font-size: 11px; }
  #app .support-ticket footer button { width: 100%; }
  #app .prospecting-hero { grid-template-columns: 1fr; padding: 21px; }
  #app .prospecting-hero strong, #app .prospecting-hero small { grid-column: 1; grid-row: auto; }
  #app .prospect-top, #app .prospect-pipeline, #app .converted-clients { grid-template-columns: 1fr; }
  #app .prospect-card { padding: 17px; }
  #app .prospect-card h3 { font-size: 16px; }
  #app .prospect-card p, #app .prospect-contacts span, #app .prospect-contacts a { font-size: 12px; }
  #app .donation-card header, #app .donation-card footer { align-items: flex-start; flex-direction: column; }
  #app .donation-card footer > div, #app .signature-actions { width: 100%; flex-direction: column; }
  #app .signature-actions button { width: 100%; }
  #app .sync-queue article { align-items: flex-start; }
  #app .sync-queue small, #app .sync-queue i { font-size: 11px; }

  /* Saúde e chat */
  #app .health-hero { padding: 22px 18px; }
  #app .health-blog, #app .health-management-grid, #app .curiosity-grid, #app .team-wall-grid { grid-template-columns: 1fr !important; }
  #app .mood-options { gap: 9px; margin-inline: -16px; padding-inline: 16px; overflow-x: auto; }
  #app .mood-options label { min-width: 122px; min-height: 105px; }
  #app .chat-shell { display: block; padding: 0; overflow: hidden; }
  #app .chat-shell > aside { max-height: 42dvh; border-right: 0; border-bottom: 1px solid var(--color-border); overflow: auto; }
  #app .chat-contacts button { min-height: 62px; }
  #app .chat-conversation { min-height: 58dvh; }
  #app .chat-conversation > header { min-height: 62px; }
  #app .chat-conversation form { position: sticky; bottom: 0; padding-bottom: max(10px,env(safe-area-inset-bottom)); background: #fff; }
}

@media (max-width: 374px) {
  #app .content { padding-inline: 13px !important; }
  #app .page-head h1 { font-size: 27px; }
  #app .bottom-nav-item b { font-size: 10px; }
  #app .card { padding: 14px; }
}

@media (min-width: 761px) and (max-width: 820px) {
  #app .content { padding: 26px 22px 116px; }
  #app .grid.equal, #app .two-one, #app .report-grid, #app .admin-summary { grid-template-columns: 1fr; }
  #app .form-grid.three { grid-template-columns: 1fr 1fr; }
  #app .page-actions { flex-wrap: wrap; }
  .modal-card { width: min(700px,calc(100% - 28px)); max-height: 92dvh; }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px) {
  #app .content { padding: 16px max(18px,env(safe-area-inset-left)) calc(86px + env(safe-area-inset-bottom)); }
  #app .topbar { height: 54px; padding-top: 0; }
  #app .page-head { margin-bottom: 15px; }
  #app .page-head h1 { font-size: 25px; }
  #app .bottom-navigation { height: calc(66px + env(safe-area-inset-bottom)); }
  #app .bottom-nav-item { min-height: 48px; }
  .modal-card { height: 100dvh; border-radius: 0; }
}
