/* Pastas e etiquetas estilo Drive (Documentos criados). Pensado para toque: alvos de 44 px, sem hover obrigatório. */

.drive-tap { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.dropdown-item.drive-tap { display: flex; width: 100%; }
.min-w-0 { min-width: 0; }
.table-responsive { position: relative; } /* textos posicionados dentro da tabela não escapam da rolagem */

/* Migalhas: rolam na horizontal se o caminho for longo */
.drive-breadcrumb { display: flex; align-items: center; flex-wrap: nowrap; gap: .5rem; overflow-x: auto; white-space: nowrap; font-weight: 600; -webkit-overflow-scrolling: touch; padding: .25rem 0; }
.drive-breadcrumb .drive-sep { opacity: .7; }

/* Cartões de pasta */
.drive-folders.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.drive-folders.drive-list { display: flex; flex-direction: column; gap: .25rem; }
.drive-folder { margin-bottom: 0; }
.drive-folder .card-body { padding-top: .35rem; padding-bottom: .35rem; }
.drive-folder:hover { box-shadow: 0 0 0 2px rgba(11, 99, 199, .35); }

/* Etiquetas */
.drive-chip .badge { display: inline-flex; align-items: center; margin: 0; }
.drive-color { cursor: pointer; border-radius: .5rem; padding: .15rem; border: 2px solid transparent; }
.drive-color.is-selected { border-color: currentColor; }

/* Árvore "Mover para…" */
.drive-tree-row { display: flex; align-items: center; width: 100%; padding-top: .35rem; padding-bottom: .35rem; padding-right: .5rem; border-radius: .4rem; cursor: pointer; justify-content: flex-start; }
.drive-tree-row:hover { background: rgba(11, 99, 199, .12); }
.drive-tree-row.is-disabled { opacity: .55; cursor: not-allowed; }

/* Lista de documentos vira cartões em tela estreita */
@media (max-width: 575.98px) {
    .drive-docs thead { display: none; }
    .drive-docs, .drive-docs tbody, .drive-docs tr, .drive-docs td { display: block; width: 100%; }
    .drive-docs tr { border: 1px solid var(--bs-border-color); border-radius: .6rem; margin-bottom: .75rem; padding: .35rem .25rem; }
    .drive-docs td { border: 0; padding: .25rem .6rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; text-align: right; }
    .drive-docs td::before { content: attr(data-label); font-weight: 700; text-align: left; flex: 0 0 auto; }
    .drive-docs td[data-label="Título"] { font-size: 1.05rem; }
    .drive-folders.drive-grid { grid-template-columns: 1fr; }
}

/* Sugestões de contatos no formulário de criar documento */
.contact-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 1056; max-height: 320px; overflow-y: auto; }

/* Calendário */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--bs-border-color); border: 1px solid var(--bs-border-color); border-radius: .5rem; overflow: hidden; }
.cal-head { background: var(--bs-tertiary-bg, #f1f3f5); font-weight: 700; text-align: center; padding: .4rem 0; }
.cal-day { background: var(--bs-body-bg); min-height: 112px; padding: .3rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-grid.is-week .cal-day { min-height: 260px; }
.cal-day.is-out { background: var(--bs-tertiary-bg, #f1f3f5); }
.cal-day.is-out .cal-num { font-weight: 400; }
.cal-num { font-weight: 700; font-size: .9rem; }
.cal-day.is-today .cal-num { background: #0b63c7; color: #fff; border-radius: 999px; width: 1.75rem; height: 1.75rem; display: inline-flex; align-items: center; justify-content: center; }
.cal-ev { display: block; font-size: .8rem; font-weight: 600; line-height: 1.25; padding: .2rem .4rem; border-radius: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-ev:hover, .cal-ev:focus { text-decoration: underline; }
.cal-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.cal-prazo { background: #b02a37; color: #fff !important; }
.cal-criado { background: #0b63c7; color: #fff !important; }
.cal-concluido { background: #146c43; color: #fff !important; }
.cal-lembrete { background: #ffc107; color: #1a1a1a !important; }
.cal-list-day { border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .6rem; margin-bottom: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.cal-list-day.is-today { border-color: #0b63c7; border-width: 2px; }
.cal-list-day .cal-ev { font-size: .95rem; white-space: normal; display: flex; align-items: center; padding: .5rem .6rem; }
@media (min-width: 576px) { .d-sm-grid { display: grid !important; } }

/* Celular: campos e links de título com alvo de 44 px; títulos longos quebram dentro do cartão */
@media (max-width: 575.98px) {
    .page-content .form-control, .page-content .form-select { min-height: 44px; }
    .drive-docs td > a.fw-semibold { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; overflow-wrap: anywhere; }
    .drive-docs td { min-width: 0; }
    .page-breadcrumb .breadcrumb-title { border-right: 0; }
}
@media (max-width: 575.98px) { .modal .btn-close { width: 44px; height: 44px; padding: 0; margin: -.5rem -.5rem -.5rem auto; } }
@media (max-width: 575.98px) { .auth-cover-right .form-control, .auth-cover-right .btn, .auth-cover-right .input-group-text { min-height: 44px; } }

/* Tabelas largas (Relatórios) também viram cartões no tablet; alvos de 44 px em telas de toque */
@media (max-width: 991.98px) {
    .drive-docs-md thead { display: none; }
    .drive-docs-md, .drive-docs-md tbody, .drive-docs-md tr, .drive-docs-md td { display: block; width: 100%; }
    .drive-docs-md tr { border: 1px solid var(--bs-border-color); border-radius: .6rem; margin-bottom: .75rem; padding: .35rem .25rem; }
    .drive-docs-md td { border: 0; padding: .25rem .6rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; text-align: right; min-width: 0; }
    .drive-docs-md td::before { content: attr(data-label); font-weight: 700; text-align: left; flex: 0 0 auto; }
    .drive-docs-md td > a.fw-semibold { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
    .page-content .form-control, .page-content .form-select { min-height: 44px; }
    .page-breadcrumb .breadcrumb-item a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}
.cal-grid .cal-ev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
html.dark-theme .cal-grid { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .16); }
html.dark-theme .cal-day { background: #161a1d; color: #e8eaed; }
html.dark-theme .cal-head, html.dark-theme .cal-day.is-out { background: #23292e; color: #e8eaed; }
html.dark-theme .cal-list-day { border-color: rgba(255, 255, 255, .2); }

/* Cartões no celular/tablet: o tema força nowrap nas células; textos longos (limites, notas) precisam quebrar */
@media (max-width: 575.98px) { .drive-docs td { white-space: normal; } }
@media (max-width: 991.98px) { .drive-docs-md td { white-space: normal; } }
/* Link da faixa de aviso com alvo de toque de 44 px */
.plan-banner-link { display: inline-flex; align-items: center; min-height: 44px; }
