/* Página Revenda — mesmo shell visual da gestão comercial; overrides locais */

.rev-page-title-wrap h1 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.rev-page-title-wrap .gc-topbar-subtitle {
    max-width: 42rem;
}

/* Abas internas da página Revenda */
.rev-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    border-bottom: 1px solid var(--border);
}

.rev-tab {
    appearance: none;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px;
    margin-bottom: -1px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, background 0.15s;
}

.rev-tab:hover {
    color: var(--text-primary);
    background: var(--bg-body);
}

.rev-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.rev-panel {
    margin-top: 4px;
}

.rev-panel-toolbar {
    margin-bottom: 12px;
}

.rev-mov-grid {
    margin-bottom: 14px;
    max-width: 560px;
}

/* Âncoras no menu lateral: mesmo comportamento visual dos botões da gestão */
#gcApp .sidebar-nav a.nav-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

/* Modal cadastro de produto */
#gcRevModalProdutosBackdrop .gc-ct-modal.rev-prod-modal {
    max-width: min(520px, calc(100vw - 24px));
}

.rev-prod-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.rev-prod-img-preview {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
}

.rev-prod-img-preview .gc-rev-img-preview {
    max-height: 100px;
    max-width: 140px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.rev-prod-modal .gc-rev-prod-section.rev-prod-fieldset .gc-rev-field > span:first-child {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Tabela aprovações — gestão */
.gc-rev-aprov-table-wrap {
    overflow-x: auto;
}

.gc-rev-aprov-table .gc-ct-td-produto {
    max-width: 200px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-rev-aprov-table .gc-ct-td-ref {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.gc-rev-lanc-table .gc-ct-td-acoes {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.gc-ct-icon-btn--edit {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.07);
}

.gc-ct-icon-btn--edit:hover {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.45);
    color: #1e40af;
}

.gc-rev-lanc-table .gc-rev-lanc-path {
    max-width: 220px;
    font-size: 0.82rem;
}

.gc-rev-lanc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    color: var(--primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-rev-lanc-link:hover {
    text-decoration: underline;
}

.gc-rev-lanc-link i {
    flex-shrink: 0;
    font-size: 0.72rem;
    opacity: 0.85;
}

.gc-ct-td-foto {
    width: 56px;
    padding: 6px 8px !important;
    vertical-align: middle;
}

.gc-rev-prod-thumb {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    background: var(--bg-secondary, #f8fafc);
}

.gc-rev-prod-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px dashed var(--border, rgba(0, 0, 0, 0.15));
    background: var(--bg-secondary, #f8fafc);
    padding: 0;
}

.gc-rev-prod-thumb--empty:hover {
    color: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
}

.gc-rev-aprov-table .gc-ct-td-obs {
    max-width: 200px;
    font-size: 0.8rem;
    line-height: 1.35;
}

.gc-rev-obs-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.gc-rev-obs-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.gc-rev-obs-link:hover {
    background: rgba(59, 130, 246, 0.14);
}

.gc-rev-obs-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    max-width: 180px;
}

/* Modal detalhe revenda — vendedor */
#gcRevModalDetalheBackdrop .gc-ct-modal.gc-rev-modal--detalhe {
    max-width: min(640px, calc(100vw - 24px));
}

.gc-rev-det-vend {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.06) 0%, var(--bg-body) 55%);
}

.gc-rev-det-vend__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    background: var(--primary, #E63946);
    overflow: hidden;
}

.gc-rev-det-vend__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gc-rev-det-vend__main {
    flex: 1;
    min-width: 0;
}

.gc-rev-det-vend__nome {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.gc-rev-det-vend__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.gc-rev-det-vend__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gc-rev-det-vend__meta a {
    color: var(--primary, #E63946);
    text-decoration: none;
    font-weight: 600;
}

.gc-rev-det-vend__meta a:hover {
    text-decoration: underline;
}

.gc-rev-det-vend__portal {
    flex-shrink: 0;
}

.gc-rev-det-section {
    margin-bottom: 16px;
}

.gc-rev-det-section__title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.gc-rev-det-dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin: 0;
}

.gc-rev-det-dl__row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gc-rev-det-dl__row--full {
    grid-column: 1 / -1;
}

.gc-rev-det-dl dt {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 0;
}

.gc-rev-det-dl dd {
    margin: 0;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    word-break: break-word;
}

.gc-rev-det-dl dd.gc-rev-det-valor {
    color: var(--success, #16a34a);
    font-size: 1.05rem;
}

.gc-rev-det-obs {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.gc-rev-det-obs a {
    color: var(--primary, #E63946);
    font-weight: 600;
}

@media (max-width: 520px) {
    .gc-rev-det-vend {
        flex-wrap: wrap;
    }
    .gc-rev-det-dl {
        grid-template-columns: 1fr;
    }
}
