/* ===================================
   Young Empreendimentos - Sistema Pós-Venda
   Identidade Visual
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Young Empreendimentos - Identidade Visual */
    --primary: #FE5009;
    --primary-dark: #751900;
    --primary-light: #FFF0EB;
    --secondary: #10B981;
    --danger: #DC2626;
    --warning: #F59E0B;
    --info: #3B82F6;
    --black: #0D0D0D;
    --gray-dark: #323232;
    --gray-medium: #6B7280;
    --gray-light: #C9C5BE;
    --gray-lighter: #D8D4CD;
    --text-main: #0D0D0D;
    --text-muted: #5C5A55;
    --bg-body: #E4E2DE;
    --bg-card: #F1F0ED;
    --bg-input: #F8F7F5;
    --bg-hover: #EAE8E4;
    --bg-subtle: #EBE9E5;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(13, 13, 13, 0.07), 0 2px 4px -1px rgba(13, 13, 13, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(13, 13, 13, 0.08), 0 4px 6px -2px rgba(13, 13, 13, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
}

/* ===================================
   LAYOUT
   =================================== */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ===================================
   HEADER E NAVEGAÇÃO
   =================================== */
.site-main-header {
    background: linear-gradient(135deg, var(--black) 0%, var(--gray-dark) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo-area a {
    text-decoration: none;
}

.page-context-title {
    flex-grow: 1;
    text-align: center;
}

.page-context-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: var(--gray-light);
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-logout,
.btn-login {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-logout {
    background: transparent;
    color: var(--gray-light);
    border: 1px solid var(--gray-light);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
}

.btn-login {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-login:hover {
    background: var(--primary-dark);
}

/* Menu de Navegação */
.main-navigation {
    background: var(--bg-card);
    border-bottom: 1px solid var(--gray-lighter);
    padding: 0;
}

.main-navigation .container {
    padding: 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 24px;
}

.main-navigation ul li {
    position: relative;
}

.main-navigation ul li a,
.main-navigation ul li .dropbtn {
    display: block;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
}

.main-navigation ul li a:hover,
.main-navigation ul li .dropbtn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.main-navigation ul li a.active {
    background: var(--primary);
    color: #FFFFFF;
}

.dropdown .dropbtn .fa-caret-down {
    margin-left: 6px;
    font-size: 0.75em;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--bg-card);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    border-radius: var(--radius);
    border: 1px solid var(--gray-lighter);
    padding: 8px 0;
    top: 100%;
    left: 0;
    margin-top: 4px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 16px;
    display: block;
    font-size: 13px;
    border-radius: 0;
}

.dropdown-content a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===================================
   CONTEÚDO PRINCIPAL
   =================================== */
.page-content {
    flex-grow: 1;
    padding: 24px 0;
}

.page-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-main);
}

.page-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

/* ===================================
   BOTÕES
   =================================== */
.btn,
.btn-primary,
.button-principal,
button[type="submit"] {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    text-decoration: none;
}

.btn-primary,
.button-principal,
button[type="submit"] {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-primary:hover,
.button-principal:hover,
button[type="submit"]:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(254, 80, 9, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-lighter);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--gray-light);
}

.btn-danger,
.button-perigo {
    background: var(--danger) !important;
    color: #FFFFFF !important;
}

.btn-danger:hover,
.button-perigo:hover {
    background: #B91C1C !important;
}

.btn-success {
    background: var(--secondary);
    color: #FFFFFF;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #F59E0B;
    color: #FFFFFF;
}

.btn-warning:hover {
    background: #D97706;
}

/* Botões de ação na página de detalhes */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.action-buttons .btn {
    min-width: 140px;
}

.action-buttons form {
    margin: 0;
}

/* Botões de ação em tabelas */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
    display: inline;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* ===================================
   CARDS E SEÇÕES
   =================================== */
.details-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.details-section h2 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-lighter);
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.detail-item {
    padding: 12px 0;
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.detail-item a:hover {
    text-decoration: underline;
}

/* Detail Card (templates antigos) */
.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.detail-card .detail-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-lighter);
}

.detail-card .detail-item:last-child {
    border-bottom: none;
}

.detail-card .detail-item strong {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 200px;
    font-size: 13px;
}

.detail-card .detail-item span {
    color: var(--text-main);
    flex: 1;
}

.detail-card .full-width-detail {
    flex-direction: column;
}

.detail-card .detail-text-block {
    background: var(--bg-body);
    padding: 12px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    display: block;
    margin-top: 8px;
}

.section-title-view {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-lighter);
}

.section-title-view:first-child {
    margin-top: 0;
}

.section-divider-view {
    border: none;
    border-top: 1px solid var(--gray-lighter);
    margin: 20px 0;
}

/* ===================================
   TABELAS
   =================================== */
table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th {
    text-align: left;
    padding: 14px 16px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-lighter);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-lighter);
    color: var(--text-main);
    font-size: 13px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-hover);
}

td.actions {
    white-space: nowrap;
    text-align: right;
}

.action-link {
    color: var(--primary);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.action-link:hover {
    background: var(--primary-light);
}

.link-excluir {
    color: var(--danger) !important;
}

.link-excluir:hover {
    background: #FEE2E2 !important;
}

.action-form {
    display: inline;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px !important;
    font-style: italic;
}

/* ===================================
   BADGES / STATUS
   =================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-default {
    background: var(--gray-lighter);
    color: var(--gray-dark);
}

.badge-admin,
.badge-direção {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===================================
   FORMULÁRIOS
   =================================== */
.form-container {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-light);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-lighter);
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-lighter);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

/* ===================================
   ALERTAS / MENSAGENS FLASH
   =================================== */
.flash-messages-container {
    padding-top: 16px;
}

.alert {
    padding: 14px 20px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ===================================
   RODAPÉ
   =================================== */
.site-footer {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    margin-top: auto;
    border-top: 1px solid var(--gray-lighter);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-info p {
    margin: 4px 0;
}

.footer-info a {
    color: var(--primary);
    font-weight: 500;
}

/* ===================================
   PÁGINA DE LOGIN
   =================================== */
.login-page {
    background: linear-gradient(135deg, var(--black) 0%, var(--gray-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    height: 50px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form label i {
    color: var(--primary);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Botão "Entrar com Google" */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-lighter, #dadce0);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: #3c4043;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.btn-google:hover {
    background: #f7f8f8;
    box-shadow: 0 1px 3px rgba(60,64,67,0.24);
}

.btn-google img {
    display: block;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 18px 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gray-lighter, #e0e0e0);
}

.login-divider span {
    padding: 0 12px;
}

/* Solicitações de acesso pendentes (fluxo de aprovação) */
.pendentes-box {
    background: #fff9e6;
    border: 1px solid #ffe08a;
    border-radius: var(--radius, 8px);
    padding: 16px 20px;
    margin-bottom: 28px;
}

.pendentes-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin: 0 0 4px;
    color: #8a6d00;
}

.pendentes-ajuda {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-muted, #777);
}

.badge-warning {
    background: #f5a623;
    color: #fff;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.form-aprovar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-perfil {
    padding: 5px 8px;
    border: 1px solid var(--gray-lighter, #ddd);
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
}

.check-admin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted, #555);
}

.btn-aprovar,
.btn-recusar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-aprovar {
    background: #2e7d32;
    color: #fff;
}

.btn-aprovar:hover {
    background: #256628;
}

.btn-recusar {
    background: transparent;
    color: #c62828;
    border: 1px solid #e0a0a0;
}

.btn-recusar:hover {
    background: #fdecea;
}

/* ===================================
   PÁGINAS DE CONFIGURAÇÃO
   =================================== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.config-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-lighter);
    box-shadow: var(--shadow);
}

.config-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.config-card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.config-card-icon i {
    font-size: 1.4em;
    color: var(--primary);
}

.config-card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.config-card-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Grid de categorias */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.categoria-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-lighter);
}

.categoria-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.categoria-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.categoria-icon i {
    color: var(--primary);
}

.categoria-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.categoria-count {
    font-size: 12px;
    color: var(--text-muted);
}

.page-description {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 20px;
}

.back-link:hover {
    color: var(--primary);
}

/* ===================================
   PÁGINA INICIAL - QUICK CARDS
   =================================== */
.quick-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.quick-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-lighter);
    box-shadow: var(--shadow);
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.quick-card-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-card-icon i {
    font-size: 1.5em;
    color: var(--primary);
}

.quick-card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.quick-card-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ===================================
   EXPORTAÇÃO
   =================================== */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.export-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-lighter);
    box-shadow: var(--shadow);
}

.export-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-buttons a {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-pdf {
    background: #991B1B;
    color: #FFFFFF !important;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-pdf:hover {
    background: #7F1D1D;
    color: #FFFFFF !important;
}

.export-buttons {
    flex-wrap: wrap;
}

/* ===================================
   LINKS
   =================================== */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ===================================
   UTILITÁRIOS
   =================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ===================================
   FILTROS DE TABELA (MULTI-SELECAO POR COLUNA)
   =================================== */
tr.filter-row th {
    background: var(--bg-subtle);
    padding: 8px 10px;
    border-bottom: 2px solid var(--gray-lighter);
    text-transform: none;
    letter-spacing: normal;
}

.col-filter-multi {
    position: relative;
    width: 100%;
}

.col-filter-multi-btn {
    width: 100%;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--gray-lighter);
    border-radius: 6px;
    font-size: 12px;
    background-color: var(--bg-input);
    color: var(--text-main);
    font-weight: 400;
    text-transform: none;
    cursor: pointer;
    text-align: left;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.col-filter-multi-btn:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.col-filter-multi--partial {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.col-filter-search {
    width: 100%;
}

.col-filter-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-lighter);
    border-radius: 6px;
    font-size: 12px;
    background-color: var(--bg-input);
    color: var(--text-main);
    font-weight: 400;
}

.col-filter-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--gray-lighter);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
}

.filter-quick-actions {
    display: flex;
    gap: 6px;
    padding: 2px 8px 8px;
    border-bottom: 1px solid var(--gray-lighter);
    margin-bottom: 4px;
}

.filter-quick-btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--gray-lighter);
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-main);
    cursor: pointer;
    text-transform: none;
}

.filter-quick-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark, var(--primary));
}

.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    cursor: pointer;
    color: var(--text-main);
}

.filter-checkbox-item:hover {
    background: var(--bg-hover);
}

.filter-checkbox-item input {
    margin-top: 2px;
    flex-shrink: 0;
}

.filter-checkbox-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-clear-wrap {
    display: flex;
    justify-content: center;
}

.btn-clear-filter {
    background: var(--gray-lighter);
    color: var(--text-main);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-clear-filter:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===================================
   AJUSTES VISUAIS DE LISTAGENS
   =================================== */
table[data-filterable="true"] tbody tr:nth-child(even) td {
    background: var(--bg-subtle);
}

table[data-filterable="true"] tbody tr:hover td {
    background: var(--primary-light) !important;
}

table[data-filterable="true"] tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    line-height: 1.5;
}

table[data-filterable="true"] thead th {
    white-space: nowrap;
}

.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
}

table.table-renegociacoes {
    table-layout: fixed;
    width: 100%;
    min-width: 1050px;
    overflow: visible;
}

table.table-renegociacoes .col-cliente { width: 20%; }

table.table-renegociacoes .cliente-nome {
    font-weight: 500;
}

table.table-renegociacoes .cliente-data-solicitacao {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
}
table.table-renegociacoes .col-empreendimento { width: 11%; }
table.table-renegociacoes .col-lote { width: 7%; }
table.table-renegociacoes .col-aprovacao { width: 12%; }
table.table-renegociacoes .col-status { width: 22%; }
table.table-renegociacoes .col-acoes {
    width: 30%;
    min-width: 280px;
}

table.table-renegociacoes td:last-child,
table.table-renegociacoes th.col-acoes {
    overflow: visible;
}

table.table-renegociacoes .table-actions {
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
}

table.table-renegociacoes .table-actions .btn-sm {
    padding: 5px 10px !important;
    font-size: 11px !important;
}

table.table-renegociacoes .badge {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
}

/* Valores calculados — Leilão */
.leilao-valores-calculados {
    margin: 16px 0;
    padding: 16px 20px;
    background: var(--primary-light, #FFF7ED);
    border: 1px solid var(--primary, #F97316);
    border-radius: 8px;
}

.leilao-valores-calculados h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--primary-dark, #C2410C);
}

.leilao-valores-calculados p {
    margin: 8px 0;
}

.calculated-value {
    font-weight: 700;
    color: var(--primary-dark, #C2410C);
    font-size: 1.05em;
}

.direcao-aprovacao-box {
    padding: 12px 16px;
    background: var(--bg-subtle);
    border-radius: 8px;
    border: 1px dashed var(--gray-lighter, #E5E7EB);
    margin-top: 8px;
}

/* Botoes de acao — wrap quando necessario (coluna estreita) */
.table-actions {
    flex-wrap: wrap;
}

/* Botao Aprovar (verde) */
.btn-aprovar {
    background: var(--secondary) !important;
    color: #FFFFFF !important;
    border: none;
}

.btn-aprovar:hover {
    background: #059669 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-ciente {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border: none;
}

.btn-ciente:hover {
    background: #1D4ED8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Badges adicionais (grafia conforme planilha) */
.badge-em-andamento {
    background: #FEF3C7;
    color: #92400E;
}

.badge-concluido {
    background: #D1FAE5;
    color: #065F46;
}

.badge-cancelado {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-aguardando-direcao {
    background-color: #7c3aed;
    color: #fff;
}

.badge-pendente {
    background: var(--gray-lighter);
    color: var(--gray-dark);
}

/* Tabela em telas pequenas: filtros viram inputs empilhados */
@media (max-width: 768px) {
    tr.filter-row th {
        padding: 6px 8px;
    }

    .col-filter-multi-btn {
        font-size: 11px;
        padding: 4px 24px 4px 8px;
    }
}

/* ===================================
   RESPONSIVIDADE
   =================================== */
@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .header-top-content {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .page-context-title {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .header-top-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        gap: 12px;
    }
    
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        padding: 12px 16px;
    }
    
    .main-navigation ul li {
        width: 100%;
    }
    
    .main-navigation ul li a,
    .main-navigation ul li .dropbtn {
        display: block;
        text-align: left;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--gray-lighter);
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        background: var(--bg-body);
    }
    
    .dropdown-content a {
        padding-left: 32px;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    .config-grid,
    .categorias-grid,
    .quick-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .details-section {
        padding: 16px;
    }
    
    .form-container {
        padding: 16px;
    }
}

/* ===================================
   PÁGINAS DE AJUDA
   =================================== */
.help-page {
    padding-bottom: 40px;
}

.help-intro,
.help-doc-header {
    background: var(--bg-card);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.help-intro h1,
.help-doc-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.help-intro p,
.help-doc-header p {
    color: var(--text-muted);
    margin: 0;
}

.help-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
}

.help-back-link:hover {
    text-decoration: underline;
}

.help-alert {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
    font-size: 14px;
}

.help-toc {
    background: var(--bg-card);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.help-toc h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.help-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.help-toc a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.help-toc a:hover {
    text-decoration: underline;
}

.help-section {
    background: var(--bg-card);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.help-section h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-main);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.help-section h3 {
    font-size: 1rem;
    margin: 20px 0 10px;
    color: var(--text-main);
}

.help-section p,
.help-section li {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 14px;
}

.help-section ul,
.help-section ol {
    padding-left: 20px;
    margin: 12px 0;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.help-table th,
.help-table td {
    border: 1px solid var(--gray-lighter);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.help-table th {
    background: var(--primary-light);
    color: var(--text-main);
    font-weight: 600;
}

.help-table td {
    color: var(--text-muted);
}

.help-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0;
}

/* ===================================
   LOADING — Y minimalista (estilo Santander)
   =================================== */
body.is-page-loading {
    overflow: hidden;
}

.young-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.young-loader.young-loader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.young-loader__content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Marca Young (loading + cabeçalho) */
.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 100%;
}

.site-brand__logo {
    height: 36px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
    padding-left: 14px;
    border-left: 3px solid var(--primary);
}

.site-brand__name {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.site-brand__suffix {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-brand--loader {
    position: absolute;
    left: 28px;
    bottom: 28px;
    max-width: calc(100% - 56px);
}

.site-brand--loader .site-brand__name {
    color: var(--black);
}

.site-brand--loader .site-brand__suffix {
    color: var(--gray-medium);
}

.site-brand--header .site-brand__logo {
    height: 40px;
    filter: brightness(1.2);
}

.site-brand--header .site-brand__name {
    color: #ffffff;
}

.site-brand--header .site-brand__suffix {
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 900px) {
    .site-brand--header .site-brand__text {
        display: none;
    }

    .site-brand--header .site-brand__logo {
        height: 38px;
    }
}

@media (max-width: 480px) {
    .site-brand--loader {
        left: 20px;
        bottom: 20px;
        gap: 10px;
    }

    .site-brand--loader .site-brand__logo {
        height: 28px;
    }

    .site-brand--loader .site-brand__name {
        font-size: 1rem;
    }

    .site-brand--loader .site-brand__suffix {
        font-size: 0.625rem;
        letter-spacing: 0.08em;
    }
}

.young-loader__frame {
    position: relative;
    width: 72px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.young-loader__frame::before {
    content: '';
    position: absolute;
    inset: -10px -12px;
    border: 2px solid rgba(254, 80, 9, 0.12);
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    border-radius: 6px;
    animation: young-loader-frame 1.1s ease-in-out infinite;
}

.young-loader__logo {
    width: 56px;
    height: auto;
    display: block;
    overflow: visible;
}

.young-loader__y {
    fill: none;
    stroke: var(--primary);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
    animation: young-loader-draw 1.4s ease-in-out infinite;
}

@keyframes young-loader-draw {
    0% {
        stroke-dashoffset: 180;
        opacity: 0.35;
    }
    45% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: -180;
        opacity: 0.35;
    }
}

@keyframes young-loader-frame {
    0%,
    100% {
        opacity: 0.5;
        transform: rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: rotate(90deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .young-loader__y,
    .young-loader__frame::before {
        animation: none;
        stroke-dashoffset: 0;
        opacity: 1;
    }
}
