
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #121212;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Container do Cartão */
.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    width: 100%;
}

.top-actions {
    width: 100%;
    max-width: 380px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-logout, .btn-admin-link {
    background: #d9534f;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn-admin-link {
    background: #0275d8;
}

/* ==========================================
CARTÃO FÍSICO ACDR ARENTIM (RESPONSIVO)
========================================== */
.acdr-card {
    width: 100%;
    max-width: 380px;
    height: auto;
    min-height: 230px;
    background-color: #d30a24;
    border-radius: 12px;
    display: flex;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    color: white;
    border: 1px solid #b0081d;
}

/* Barra Lateral Vertical */
.card-sidebar {
    width: 32px;
    background-color: #c0081f;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

    .card-sidebar span {
        transform: rotate(-90deg);
        white-space: nowrap;
        font-weight: 900;
        font-size: 13px;
        letter-spacing: 2px;
        font-family: 'Times New Roman', Times, serif;
    }

/* Área Conteúdo Principal */
.card-main {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

/* Cabeçalho do Cartão */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85px;
    flex-shrink: 0;
}

.logo-img {
    width: 100%;
    max-width: 75px;
    height: auto;
    object-fit: contain;
}

.foundation-date {
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
}

.club-title h2 {
    margin: 0;
    font-size: 13px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 600;
    line-height: 1.2;
}

/* Rodapé: Dados do Sócio + Selo */
.card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
}

.member-info-box {
    background-color: #eef4f8;
    color: #111;
    border-radius: 6px;
    padding: 6px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.info-row {
    display: flex;
    gap: 6px;
    font-size: 11px;
}

.info-label {
    color: #004488;
    font-weight: bold;
    white-space: nowrap;
}

.info-value {
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-uppercase {
    text-transform: uppercase;
}

/* Selo Amarelo da Quota */
.stamp-box {
    width: 80px;
    height: 70px;
    background-color: #ebd842;
    border: 1px solid #c9b724;
    color: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.stamp-header {
    font-size: 7.5px;
    font-weight: 800;
}

.stamp-year {
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: -0.5px;
}

.stamp-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 8.5px;
    font-weight: bold;
    border-top: 1px solid #111;
    padding-top: 1px;
}

.stamp-num {
    font-family: monospace;
    font-size: 10px;
}

.stamp-expired {
    filter: grayscale(1);
    opacity: 0.5;
}

/* Ajuste Fino para Telemóveis Muito Pequenos (<360px) */
@media (max-width: 360px) {
    .acdr-card {
        min-height: 210px;
    }

    .club-title h2 {
        font-size: 11px;
    }

    .logo-box {
        width: 70px;
    }

    .stamp-box {
        width: 72px;
        height: 65px;
    }

    .stamp-year {
        font-size: 16px;
    }
}

/* ==========================================
PAINEL ADMIN (MOBILE FIRST / SCROLL TABELA)
========================================== */
.admin-container {
    width: 100%;
    max-width: 1000px;
    margin: 16px auto;
    padding: 16px;
    background: #1e1e1e;
    color: #fff;
    border-radius: 8px;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

    .admin-header h2 {
        font-size: 20px;
    }

.search-bar input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
}

/* Permite scroll horizontal na tabela em telemóveis sem partir o layout */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Garante visibilidade dos dados em ecrãs pequenos */
}

    .admin-table th, .admin-table td {
        padding: 10px 8px;
        border-bottom: 1px solid #333;
        text-align: left;
        font-size: 13px;
    }

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.badge-success {
    background: #28a745;
    color: #fff;
}

.badge-danger {
    background: #dc3545;
    color: #fff;
}

.btn-primary {
    background: #d30a24;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-edit {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Modal Adaptada para Ecrãs Tácteis */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 1000;
}

.modal-card {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    color: #fff;
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

    .form-group label {
        margin-bottom: 4px;
        font-size: 13px;
    }

.form-control {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1e1e1e;
    color: #fff;
    font-size: 14px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}