/* =====================================================
   ESL Cartas Contempladas – Estilos v2.1
   Mobile-first, tabela responsiva
   ===================================================== */

.cc-app {
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: #1A1A1A;
    max-width: 100%;
    box-sizing: border-box;
}
.cc-app *, .cc-app *::before, .cc-app *::after { box-sizing: border-box; }

.cc-titulo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1B4332;
    margin: 0 0 28px;
}

/* ── Toolbar ──────────────────────────────────────── */
.cc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.cc-search-wrap {
    position: relative;
    min-width: 180px;
    max-width: 300px;
    flex: 1;
}
.cc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: .45;
    pointer-events: none;
}
.cc-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1.5px solid #EDE8DF;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #FAF7F2;
    color: #1A1A1A;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.cc-search:focus {
    border-color: #2D6A4F;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}

/* Filtros */
.cc-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-filter-btn {
    padding: 6px 14px;
    border: 1.5px solid #EDE8DF;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #4A4A4A;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}
.cc-filter-btn:hover:not(.cc-filter-active) { border-color: #2D6A4F; color: #2D6A4F; }
.cc-filter-btn.cc-filter-active { background: #1B4332; border-color: #1B4332; color: #E9C46A; font-weight: 600; }
.cc-count { font-size: 12px; color: #4A4A4A; margin-left: auto; white-space: nowrap; }

/* ── Estados loading/erro ─────────────────────────── */
.cc-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border-radius: 12px;
    background: #FAF7F2;
    border: 1px solid #EDE8DF;
    text-align: center;
}
.cc-loading-state p { color: #4A4A4A; font-size: 14px; margin: 10px 0 0; }
.cc-error-state     { background: #fff5f5; border-color: #feb2b2; }
.cc-error-state p   { color: #c53030; font-size: 14px; margin: 6px 0 0; }
.cc-error-icon      { font-size: 1.8rem; }
.cc-spinner {
    width: 32px; height: 32px;
    border: 3px solid #EDE8DF;
    border-top-color: #1B4332;
    border-radius: 50%;
    animation: cc-spin .8s linear infinite;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ── TABELA DESKTOP ───────────────────────────────── */
.cc-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #EDE8DF;
    box-shadow: 0 2px 12px rgba(27,67,50,.07);
}
.cc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
    min-width: 700px;
}
.cc-table thead tr { background: #1B4332; }
.cc-table thead th {
    padding: 11px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #E9C46A;
    white-space: nowrap;
}
.cc-table thead th:last-child { text-align: center; }
.cc-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #F0EBE3;
    vertical-align: middle;
    line-height: 1.35;
}
.cc-table tbody tr:last-child td { border-bottom: none; }
.cc-table tbody tr:hover      { background: #F5FAF7; }
.cc-table tbody tr:nth-child(even) { background: #FAF7F2; }
.cc-table tbody tr:nth-child(even):hover { background: #F0F7F4; }

/* ── CARDS MOBILE ─────────────────────────────────── */
.cc-cards { display: none; gap: 10px; flex-direction: column; }

.cc-card {
    background: #fff;
    border: 1px solid #EDE8DF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(27,67,50,.06);
}
.cc-card-header {
    background: #1B4332;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cc-card-admin {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}
.cc-card-body {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}
.cc-card-field { display: flex; flex-direction: column; gap: 2px; }
.cc-card-field.full { grid-column: 1 / -1; }
.cc-card-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
}
.cc-card-value { font-size: 14px; color: #1A1A1A; font-weight: 500; }
.cc-card-value.highlight { color: #1B4332; font-weight: 700; font-size: 15px; }
.cc-card-footer {
    padding: 10px 14px;
    border-top: 1px solid #F0EBE3;
    background: #FAF7F2;
}

/* ── Badges tipo ──────────────────────────────────── */
.cc-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.cc-tipo-imovel  { background: #DCFCE7; color: #166534; }
.cc-tipo-veiculo { background: #DBEAFE; color: #1E40AF; }

/* ── Valores ──────────────────────────────────────── */
.cc-valor { font-weight: 700; color: #1B4332; }
.cc-parc  { font-size: 12px; color: #555; }
.cc-data  { font-size: 12px; font-weight: 500; white-space: nowrap; }

/* ── Botão Tenho interesse ────────────────────────── */
.cc-btn-interesse {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #25D366;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
    font-family: inherit;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.cc-btn-interesse:hover { background: #1ebe5d; transform: translateY(-1px); }
.cc-btn-interesse svg { flex-shrink: 0; }

/* ── Footer paginação ─────────────────────────────── */
.cc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.cc-info { font-size: 12px; color: #666; }
.cc-pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cc-page-btn {
    min-width: 32px; height: 32px;
    padding: 0 8px;
    border: 1.5px solid #EDE8DF;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1B4332;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
    line-height: 1;
}
.cc-page-btn:hover:not([disabled]):not(.cc-page-active) { border-color: #2D6A4F; background: #F0F7F4; }
.cc-page-btn.cc-page-active { background: #1B4332; border-color: #1B4332; color: #E9C46A; font-weight: 700; }
.cc-page-btn[disabled] { opacity: .35; cursor: not-allowed; }
.cc-page-ellipsis { font-size: 13px; color: #999; padding: 0 3px; user-select: none; }

/* ── RESPONSIVE ───────────────────────────────────── */

/* Desktop: mostra tabela, esconde cards */
.cc-cards { display: none !important; }
.cc-table-wrap { display: block; }

@media (max-width: 768px) {
    .cc-toolbar     { gap: 8px; }
    .cc-search-wrap { max-width: 100%; min-width: 0; flex: 1 1 100%; order: -1; }
    .cc-count       { margin-left: 0; }
    .cc-footer      { flex-direction: column; align-items: flex-start; }

    /* Esconde tabela, mostra cards */
    .cc-table-wrap  { display: none !important; }
    .cc-cards       { display: flex !important; }

    .cc-pagination  { justify-content: center; width: 100%; }
    .cc-info        { text-align: center; width: 100%; }
}
